tg-map-vue3 4.1.5 → 4.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tg-map.cjs +2 -0
- package/dist/tg-map.cjs.map +1 -0
- package/dist/tg-map.css +1 -0
- package/dist/tg-map.js +1440 -0
- package/dist/tg-map.js.map +1 -0
- package/package.json +4 -4
- package/dist/assets/404-D34FYbNB.js +0 -2
- package/dist/assets/404-D34FYbNB.js.map +0 -1
- package/dist/assets/ControlDemo-BvElkDpq.js +0 -2
- package/dist/assets/ControlDemo-BvElkDpq.js.map +0 -1
- package/dist/assets/CssPositionDemo-DbSCIYVw.js +0 -2
- package/dist/assets/CssPositionDemo-DbSCIYVw.js.map +0 -1
- package/dist/assets/HeatmapDemo-CKEH0W3g.js +0 -2
- package/dist/assets/HeatmapDemo-CKEH0W3g.js.map +0 -1
- package/dist/assets/InfoDemo-BSp_czCk.js +0 -2
- package/dist/assets/InfoDemo-BSp_czCk.js.map +0 -1
- package/dist/assets/LifecycleBugDemo-Bldh5GGg.js +0 -2
- package/dist/assets/LifecycleBugDemo-Bldh5GGg.js.map +0 -1
- package/dist/assets/Main-DGU58I8w.js +0 -2
- package/dist/assets/Main-DGU58I8w.js.map +0 -1
- package/dist/assets/MapDemo-Crw8VrAs.vue +0 -155
- package/dist/assets/MapDemo-Z4UTQNq5.js +0 -2
- package/dist/assets/MapDemo-Z4UTQNq5.js.map +0 -1
- package/dist/assets/MapTypeDemo-bv5WPraY.js +0 -2
- package/dist/assets/MapTypeDemo-bv5WPraY.js.map +0 -1
- package/dist/assets/MapUrlsDemo-D0075XSg.js +0 -2
- package/dist/assets/MapUrlsDemo-D0075XSg.js.map +0 -1
- package/dist/assets/MarkerDemo-D9YK-9Js.js +0 -2
- package/dist/assets/MarkerDemo-D9YK-9Js.js.map +0 -1
- package/dist/assets/MarkerDemo-D_C5RDUy.vue +0 -200
- package/dist/assets/MultiMapDemo-D-BWUDR1.js +0 -2
- package/dist/assets/MultiMapDemo-D-BWUDR1.js.map +0 -1
- package/dist/assets/OverlayDemo-BtSawKbN.js +0 -2
- package/dist/assets/OverlayDemo-BtSawKbN.js.map +0 -1
- package/dist/assets/PlaceDemo-DswQxAPt.js +0 -2
- package/dist/assets/PlaceDemo-DswQxAPt.js.map +0 -1
- package/dist/assets/ReactiveDemo-D5H5d9dh.js +0 -2
- package/dist/assets/ReactiveDemo-D5H5d9dh.js.map +0 -1
- package/dist/assets/ShapeDemo-CX9Jwa7y.js +0 -2
- package/dist/assets/ShapeDemo-CX9Jwa7y.js.map +0 -1
- package/dist/assets/ShapeDemo-t5GXEmrA.vue +0 -162
- package/dist/assets/TalksDemo-D0da45jA.js +0 -2
- package/dist/assets/TalksDemo-D0da45jA.js.map +0 -1
- package/dist/assets/V2Demo-vX7YCqCc.js +0 -2
- package/dist/assets/V2Demo-vX7YCqCc.js.map +0 -1
- package/dist/assets/index-C6IOkH7Y.css +0 -1
- package/dist/assets/index-DkG0ZlIx.js +0 -352
- package/dist/assets/index-DkG0ZlIx.js.map +0 -1
- package/dist/index.html +0 -14
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
var f1=Object.defineProperty;var d1=(n,r,t)=>r in n?f1(n,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[r]=t;var P=(n,r,t)=>d1(n,typeof r!="symbol"?r+"":r,t);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const o of e)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function t(e){const o={};return e.integrity&&(o.integrity=e.integrity),e.referrerPolicy&&(o.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?o.credentials="include":e.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(e){if(e.ep)return;e.ep=!0;const o=t(e);fetch(e.href,o)}})();/**
|
|
2
|
-
* @vue/shared v3.5.16
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**//*! #__NO_SIDE_EFFECTS__ */function yf(n){const r=Object.create(null);for(const t of n.split(","))r[t]=1;return t=>t in r}const st={},uo=[],si=()=>{},g1=()=>!1,hh=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),wf=n=>n.startsWith("onUpdate:"),kt=Object.assign,xf=(n,r)=>{const t=n.indexOf(r);t>-1&&n.splice(t,1)},p1=Object.prototype.hasOwnProperty,Ke=(n,r)=>p1.call(n,r),Pe=Array.isArray,co=n=>ma(n)==="[object Map]",Do=n=>ma(n)==="[object Set]",Og=n=>ma(n)==="[object Date]",ze=n=>typeof n=="function",xt=n=>typeof n=="string",Kr=n=>typeof n=="symbol",at=n=>n!==null&&typeof n=="object",Im=n=>(at(n)||ze(n))&&ze(n.then)&&ze(n.catch),Dm=Object.prototype.toString,ma=n=>Dm.call(n),v1=n=>ma(n).slice(8,-1),zm=n=>ma(n)==="[object Object]",Cf=n=>xt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,ws=yf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),uh=n=>{const r=Object.create(null);return t=>r[t]||(r[t]=n(t))},m1=/-(\w)/g,Ir=uh(n=>n.replace(m1,(r,t)=>t?t.toUpperCase():"")),_1=/\B([A-Z])/g,zn=uh(n=>n.replace(_1,"-$1").toLowerCase()),ch=uh(n=>n.charAt(0).toUpperCase()+n.slice(1)),nu=uh(n=>n?`on${ch(n)}`:""),Ki=(n,r)=>!Object.is(n,r),dl=(n,...r)=>{for(let t=0;t<n.length;t++)n[t](...r)},Bm=(n,r,t,i=!1)=>{Object.defineProperty(n,r,{configurable:!0,enumerable:!1,writable:i,value:t})},Cl=n=>{const r=parseFloat(n);return isNaN(r)?n:r},y1=n=>{const r=xt(n)?Number(n):NaN;return isNaN(r)?n:r};let kg;const fh=()=>kg||(kg=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function zo(n){if(Pe(n)){const r={};for(let t=0;t<n.length;t++){const i=n[t],e=xt(i)?T1(i):zo(i);if(e)for(const o in e)r[o]=e[o]}return r}else if(xt(n)||at(n))return n}const w1=/;(?![^(]*\))/g,x1=/:([^]+)/,C1=/\/\*[^]*?\*\//g;function T1(n){const r={};return n.replace(C1,"").split(w1).forEach(t=>{if(t){const i=t.split(x1);i.length>1&&(r[i[0].trim()]=i[1].trim())}}),r}function Bi(n){let r="";if(xt(n))r=n;else if(Pe(n))for(let t=0;t<n.length;t++){const i=Bi(n[t]);i&&(r+=i+" ")}else if(at(n))for(const t in n)n[t]&&(r+=t+" ");return r.trim()}function b1(n){if(!n)return null;let{class:r,style:t}=n;return r&&!xt(r)&&(n.class=Bi(r)),t&&(n.style=zo(t)),n}const M1="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",P1=yf(M1);function Gm(n){return!!n||n===""}function E1(n,r){if(n.length!==r.length)return!1;let t=!0;for(let i=0;t&&i<n.length;i++)t=kn(n[i],r[i]);return t}function kn(n,r){if(n===r)return!0;let t=Og(n),i=Og(r);if(t||i)return t&&i?n.getTime()===r.getTime():!1;if(t=Kr(n),i=Kr(r),t||i)return n===r;if(t=Pe(n),i=Pe(r),t||i)return t&&i?E1(n,r):!1;if(t=at(n),i=at(r),t||i){if(!t||!i)return!1;const e=Object.keys(n).length,o=Object.keys(r).length;if(e!==o)return!1;for(const s in n){const a=n.hasOwnProperty(s),l=r.hasOwnProperty(s);if(a&&!l||!a&&l||!kn(n[s],r[s]))return!1}}return String(n)===String(r)}function Tf(n,r){return n.findIndex(t=>kn(t,r))}const Fm=n=>!!(n&&n.__v_isRef===!0),Ae=n=>xt(n)?n:n==null?"":Pe(n)||at(n)&&(n.toString===Dm||!ze(n.toString))?Fm(n)?Ae(n.value):JSON.stringify(n,Nm,2):String(n),Nm=(n,r)=>Fm(r)?Nm(n,r.value):co(r)?{[`Map(${r.size})`]:[...r.entries()].reduce((t,[i,e],o)=>(t[ou(i,o)+" =>"]=e,t),{})}:Do(r)?{[`Set(${r.size})`]:[...r.values()].map(t=>ou(t))}:Kr(r)?ou(r):at(r)&&!Pe(r)&&!zm(r)?String(r):r,ou=(n,r="")=>{var t;return Kr(n)?`Symbol(${(t=n.description)!=null?t:r})`:n};/**
|
|
6
|
-
* @vue/reactivity v3.5.16
|
|
7
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
-
* @license MIT
|
|
9
|
-
**/let ar;class S1{constructor(r=!1){this.detached=r,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ar,!r&&ar&&(this.index=(ar.scopes||(ar.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let r,t;if(this.scopes)for(r=0,t=this.scopes.length;r<t;r++)this.scopes[r].pause();for(r=0,t=this.effects.length;r<t;r++)this.effects[r].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let r,t;if(this.scopes)for(r=0,t=this.scopes.length;r<t;r++)this.scopes[r].resume();for(r=0,t=this.effects.length;r<t;r++)this.effects[r].resume()}}run(r){if(this._active){const t=ar;try{return ar=this,r()}finally{ar=t}}}on(){++this._on===1&&(this.prevScope=ar,ar=this)}off(){this._on>0&&--this._on===0&&(ar=this.prevScope,this.prevScope=void 0)}stop(r){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t<i;t++)this.effects[t].stop();for(this.effects.length=0,t=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!r){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}function O1(){return ar}let ht;const su=new WeakSet;class Hm{constructor(r){this.fn=r,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ar&&ar.active&&ar.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,su.has(this)&&(su.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Zm(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Rg(this),Vm(this);const r=ht,t=Ur;ht=this,Ur=!0;try{return this.fn()}finally{Wm(this),ht=r,Ur=t,this.flags&=-3}}stop(){if(this.flags&1){for(let r=this.deps;r;r=r.nextDep)Pf(r);this.deps=this.depsTail=void 0,Rg(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?su.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Mc(this)&&this.run()}get dirty(){return Mc(this)}}let jm=0,xs,Cs;function Zm(n,r=!1){if(n.flags|=8,r){n.next=Cs,Cs=n;return}n.next=xs,xs=n}function bf(){jm++}function Mf(){if(--jm>0)return;if(Cs){let r=Cs;for(Cs=void 0;r;){const t=r.next;r.next=void 0,r.flags&=-9,r=t}}let n;for(;xs;){let r=xs;for(xs=void 0;r;){const t=r.next;if(r.next=void 0,r.flags&=-9,r.flags&1)try{r.trigger()}catch(i){n||(n=i)}r=t}}if(n)throw n}function Vm(n){for(let r=n.deps;r;r=r.nextDep)r.version=-1,r.prevActiveLink=r.dep.activeLink,r.dep.activeLink=r}function Wm(n){let r,t=n.depsTail,i=t;for(;i;){const e=i.prevDep;i.version===-1?(i===t&&(t=e),Pf(i),k1(i)):r=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=e}n.deps=r,n.depsTail=t}function Mc(n){for(let r=n.deps;r;r=r.nextDep)if(r.dep.version!==r.version||r.dep.computed&&($m(r.dep.computed)||r.dep.version!==r.version))return!0;return!!n._dirty}function $m(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Bs)||(n.globalVersion=Bs,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!Mc(n))))return;n.flags|=2;const r=n.dep,t=ht,i=Ur;ht=n,Ur=!0;try{Vm(n);const e=n.fn(n._value);(r.version===0||Ki(e,n._value))&&(n.flags|=128,n._value=e,r.version++)}catch(e){throw r.version++,e}finally{ht=t,Ur=i,Wm(n),n.flags&=-3}}function Pf(n,r=!1){const{dep:t,prevSub:i,nextSub:e}=n;if(i&&(i.nextSub=e,n.prevSub=void 0),e&&(e.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let o=t.computed.deps;o;o=o.nextDep)Pf(o,!0)}!r&&!--t.sc&&t.map&&t.map.delete(t.key)}function k1(n){const{prevDep:r,nextDep:t}=n;r&&(r.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=r,n.nextDep=void 0)}let Ur=!0;const Um=[];function Ri(){Um.push(Ur),Ur=!1}function Ai(){const n=Um.pop();Ur=n===void 0?!0:n}function Rg(n){const{cleanup:r}=n;if(n.cleanup=void 0,r){const t=ht;ht=void 0;try{r()}finally{ht=t}}}let Bs=0;class R1{constructor(r,t){this.sub=r,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class dh{constructor(r){this.computed=r,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(r){if(!ht||!Ur||ht===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==ht)t=this.activeLink=new R1(ht,this),ht.deps?(t.prevDep=ht.depsTail,ht.depsTail.nextDep=t,ht.depsTail=t):ht.deps=ht.depsTail=t,Jm(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=ht.depsTail,t.nextDep=void 0,ht.depsTail.nextDep=t,ht.depsTail=t,ht.deps===t&&(ht.deps=i)}return t}trigger(r){this.version++,Bs++,this.notify(r)}notify(r){bf();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Mf()}}}function Jm(n){if(n.dep.sc++,n.sub.flags&4){const r=n.dep.computed;if(r&&!n.dep.subs){r.flags|=20;for(let i=r.deps;i;i=i.nextDep)Jm(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const Tl=new WeakMap,bn=Symbol(""),Pc=Symbol(""),Gs=Symbol("");function Wt(n,r,t){if(Ur&&ht){let i=Tl.get(n);i||Tl.set(n,i=new Map);let e=i.get(t);e||(i.set(t,e=new dh),e.map=i,e.key=t),e.track()}}function Ti(n,r,t,i,e,o){const s=Tl.get(n);if(!s){Bs++;return}const a=l=>{l&&l.trigger()};if(bf(),r==="clear")s.forEach(a);else{const l=Pe(n),h=l&&Cf(t);if(l&&t==="length"){const u=Number(i);s.forEach((c,f)=>{(f==="length"||f===Gs||!Kr(f)&&f>=u)&&a(c)})}else switch((t!==void 0||s.has(void 0))&&a(s.get(t)),h&&a(s.get(Gs)),r){case"add":l?h&&a(s.get("length")):(a(s.get(bn)),co(n)&&a(s.get(Pc)));break;case"delete":l||(a(s.get(bn)),co(n)&&a(s.get(Pc)));break;case"set":co(n)&&a(s.get(bn));break}}Mf()}function A1(n,r){const t=Tl.get(n);return t&&t.get(r)}function Fn(n){const r=Ne(n);return r===n?r:(Wt(r,"iterate",Gs),kr(n)?r:r.map(Bt))}function gh(n){return Wt(n=Ne(n),"iterate",Gs),n}const L1={__proto__:null,[Symbol.iterator](){return au(this,Symbol.iterator,Bt)},concat(...n){return Fn(this).concat(...n.map(r=>Pe(r)?Fn(r):r))},entries(){return au(this,"entries",n=>(n[1]=Bt(n[1]),n))},every(n,r){return gi(this,"every",n,r,void 0,arguments)},filter(n,r){return gi(this,"filter",n,r,t=>t.map(Bt),arguments)},find(n,r){return gi(this,"find",n,r,Bt,arguments)},findIndex(n,r){return gi(this,"findIndex",n,r,void 0,arguments)},findLast(n,r){return gi(this,"findLast",n,r,Bt,arguments)},findLastIndex(n,r){return gi(this,"findLastIndex",n,r,void 0,arguments)},forEach(n,r){return gi(this,"forEach",n,r,void 0,arguments)},includes(...n){return lu(this,"includes",n)},indexOf(...n){return lu(this,"indexOf",n)},join(n){return Fn(this).join(n)},lastIndexOf(...n){return lu(this,"lastIndexOf",n)},map(n,r){return gi(this,"map",n,r,void 0,arguments)},pop(){return Zo(this,"pop")},push(...n){return Zo(this,"push",n)},reduce(n,...r){return Ag(this,"reduce",n,r)},reduceRight(n,...r){return Ag(this,"reduceRight",n,r)},shift(){return Zo(this,"shift")},some(n,r){return gi(this,"some",n,r,void 0,arguments)},splice(...n){return Zo(this,"splice",n)},toReversed(){return Fn(this).toReversed()},toSorted(n){return Fn(this).toSorted(n)},toSpliced(...n){return Fn(this).toSpliced(...n)},unshift(...n){return Zo(this,"unshift",n)},values(){return au(this,"values",Bt)}};function au(n,r,t){const i=gh(n),e=i[r]();return i!==n&&!kr(n)&&(e._next=e.next,e.next=()=>{const o=e._next();return o.value&&(o.value=t(o.value)),o}),e}const I1=Array.prototype;function gi(n,r,t,i,e,o){const s=gh(n),a=s!==n&&!kr(n),l=s[r];if(l!==I1[r]){const c=l.apply(n,o);return a?Bt(c):c}let h=t;s!==n&&(a?h=function(c,f){return t.call(this,Bt(c),f,n)}:t.length>2&&(h=function(c,f){return t.call(this,c,f,n)}));const u=l.call(s,h,i);return a&&e?e(u):u}function Ag(n,r,t,i){const e=gh(n);let o=t;return e!==n&&(kr(n)?t.length>3&&(o=function(s,a,l){return t.call(this,s,a,l,n)}):o=function(s,a,l){return t.call(this,s,Bt(a),l,n)}),e[r](o,...i)}function lu(n,r,t){const i=Ne(n);Wt(i,"iterate",Gs);const e=i[r](...t);return(e===-1||e===!1)&&Of(t[0])?(t[0]=Ne(t[0]),i[r](...t)):e}function Zo(n,r,t=[]){Ri(),bf();const i=Ne(n)[r].apply(n,t);return Mf(),Ai(),i}const D1=yf("__proto__,__v_isRef,__isVue"),Xm=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Kr));function z1(n){Kr(n)||(n=String(n));const r=Ne(this);return Wt(r,"has",n),r.hasOwnProperty(n)}class Ym{constructor(r=!1,t=!1){this._isReadonly=r,this._isShallow=t}get(r,t,i){if(t==="__v_skip")return r.__v_skip;const e=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!e;if(t==="__v_isReadonly")return e;if(t==="__v_isShallow")return o;if(t==="__v_raw")return i===(e?o?$1:e_:o?Qm:Km).get(r)||Object.getPrototypeOf(r)===Object.getPrototypeOf(i)?r:void 0;const s=Pe(r);if(!e){let l;if(s&&(l=L1[t]))return l;if(t==="hasOwnProperty")return z1}const a=Reflect.get(r,t,Ft(r)?r:i);return(Kr(t)?Xm.has(t):D1(t))||(e||Wt(r,"get",t),o)?a:Ft(a)?s&&Cf(t)?a:a.value:at(a)?e?t_(a):xr(a):a}}class qm extends Ym{constructor(r=!1){super(!1,r)}set(r,t,i,e){let o=r[t];if(!this._isShallow){const l=rn(o);if(!kr(i)&&!rn(i)&&(o=Ne(o),i=Ne(i)),!Pe(r)&&Ft(o)&&!Ft(i))return l?!1:(o.value=i,!0)}const s=Pe(r)&&Cf(t)?Number(t)<r.length:Ke(r,t),a=Reflect.set(r,t,i,Ft(r)?r:e);return r===Ne(e)&&(s?Ki(i,o)&&Ti(r,"set",t,i):Ti(r,"add",t,i)),a}deleteProperty(r,t){const i=Ke(r,t);r[t];const e=Reflect.deleteProperty(r,t);return e&&i&&Ti(r,"delete",t,void 0),e}has(r,t){const i=Reflect.has(r,t);return(!Kr(t)||!Xm.has(t))&&Wt(r,"has",t),i}ownKeys(r){return Wt(r,"iterate",Pe(r)?"length":bn),Reflect.ownKeys(r)}}class B1 extends Ym{constructor(r=!1){super(!0,r)}set(r,t){return!0}deleteProperty(r,t){return!0}}const G1=new qm,F1=new B1,N1=new qm(!0);const Ec=n=>n,za=n=>Reflect.getPrototypeOf(n);function H1(n,r,t){return function(...i){const e=this.__v_raw,o=Ne(e),s=co(o),a=n==="entries"||n===Symbol.iterator&&s,l=n==="keys"&&s,h=e[n](...i),u=t?Ec:r?bl:Bt;return!r&&Wt(o,"iterate",l?Pc:bn),{next(){const{value:c,done:f}=h.next();return f?{value:c,done:f}:{value:a?[u(c[0]),u(c[1])]:u(c),done:f}},[Symbol.iterator](){return this}}}}function Ba(n){return function(...r){return n==="delete"?!1:n==="clear"?void 0:this}}function j1(n,r){const t={get(e){const o=this.__v_raw,s=Ne(o),a=Ne(e);n||(Ki(e,a)&&Wt(s,"get",e),Wt(s,"get",a));const{has:l}=za(s),h=r?Ec:n?bl:Bt;if(l.call(s,e))return h(o.get(e));if(l.call(s,a))return h(o.get(a));o!==s&&o.get(e)},get size(){const e=this.__v_raw;return!n&&Wt(Ne(e),"iterate",bn),Reflect.get(e,"size",e)},has(e){const o=this.__v_raw,s=Ne(o),a=Ne(e);return n||(Ki(e,a)&&Wt(s,"has",e),Wt(s,"has",a)),e===a?o.has(e):o.has(e)||o.has(a)},forEach(e,o){const s=this,a=s.__v_raw,l=Ne(a),h=r?Ec:n?bl:Bt;return!n&&Wt(l,"iterate",bn),a.forEach((u,c)=>e.call(o,h(u),h(c),s))}};return kt(t,n?{add:Ba("add"),set:Ba("set"),delete:Ba("delete"),clear:Ba("clear")}:{add(e){!r&&!kr(e)&&!rn(e)&&(e=Ne(e));const o=Ne(this);return za(o).has.call(o,e)||(o.add(e),Ti(o,"add",e,e)),this},set(e,o){!r&&!kr(o)&&!rn(o)&&(o=Ne(o));const s=Ne(this),{has:a,get:l}=za(s);let h=a.call(s,e);h||(e=Ne(e),h=a.call(s,e));const u=l.call(s,e);return s.set(e,o),h?Ki(o,u)&&Ti(s,"set",e,o):Ti(s,"add",e,o),this},delete(e){const o=Ne(this),{has:s,get:a}=za(o);let l=s.call(o,e);l||(e=Ne(e),l=s.call(o,e)),a&&a.call(o,e);const h=o.delete(e);return l&&Ti(o,"delete",e,void 0),h},clear(){const e=Ne(this),o=e.size!==0,s=e.clear();return o&&Ti(e,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(e=>{t[e]=H1(e,n,r)}),t}function Ef(n,r){const t=j1(n,r);return(i,e,o)=>e==="__v_isReactive"?!n:e==="__v_isReadonly"?n:e==="__v_raw"?i:Reflect.get(Ke(t,e)&&e in i?t:i,e,o)}const Z1={get:Ef(!1,!1)},V1={get:Ef(!1,!0)},W1={get:Ef(!0,!1)};const Km=new WeakMap,Qm=new WeakMap,e_=new WeakMap,$1=new WeakMap;function U1(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function J1(n){return n.__v_skip||!Object.isExtensible(n)?0:U1(v1(n))}function xr(n){return rn(n)?n:Sf(n,!1,G1,Z1,Km)}function X1(n){return Sf(n,!1,N1,V1,Qm)}function t_(n){return Sf(n,!0,F1,W1,e_)}function Sf(n,r,t,i,e){if(!at(n)||n.__v_raw&&!(r&&n.__v_isReactive))return n;const o=J1(n);if(o===0)return n;const s=e.get(n);if(s)return s;const a=new Proxy(n,o===2?i:t);return e.set(n,a),a}function fo(n){return rn(n)?fo(n.__v_raw):!!(n&&n.__v_isReactive)}function rn(n){return!!(n&&n.__v_isReadonly)}function kr(n){return!!(n&&n.__v_isShallow)}function Of(n){return n?!!n.__v_raw:!1}function Ne(n){const r=n&&n.__v_raw;return r?Ne(r):n}function kf(n){return!Ke(n,"__v_skip")&&Object.isExtensible(n)&&Bm(n,"__v_skip",!0),n}const Bt=n=>at(n)?xr(n):n,bl=n=>at(n)?t_(n):n;function Ft(n){return n?n.__v_isRef===!0:!1}function qe(n){return Y1(n,!1)}function Y1(n,r){return Ft(n)?n:new q1(n,r)}class q1{constructor(r,t){this.dep=new dh,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?r:Ne(r),this._value=t?r:Bt(r),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(r){const t=this._rawValue,i=this.__v_isShallow||kr(r)||rn(r);r=i?r:Ne(r),Ki(r,t)&&(this._rawValue=r,this._value=i?r:Bt(r),this.dep.trigger())}}function j(n){return Ft(n)?n.value:n}function eo(n){return ze(n)?n():j(n)}const K1={get:(n,r,t)=>r==="__v_raw"?n:j(Reflect.get(n,r,t)),set:(n,r,t,i)=>{const e=n[r];return Ft(e)&&!Ft(t)?(e.value=t,!0):Reflect.set(n,r,t,i)}};function r_(n){return fo(n)?n:new Proxy(n,K1)}class Q1{constructor(r){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new dh,{get:i,set:e}=r(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=e}get value(){return this._value=this._get()}set value(r){this._set(r)}}function ex(n){return new Q1(n)}function tx(n){const r=Pe(n)?new Array(n.length):{};for(const t in n)r[t]=ix(n,t);return r}class rx{constructor(r,t,i){this._object=r,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const r=this._object[this._key];return this._value=r===void 0?this._defaultValue:r}set value(r){this._object[this._key]=r}get dep(){return A1(Ne(this._object),this._key)}}function ix(n,r,t){const i=n[r];return Ft(i)?i:new rx(n,r,t)}class nx{constructor(r,t,i){this.fn=r,this.setter=t,this._value=void 0,this.dep=new dh(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Bs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&ht!==this)return Zm(this,!0),!0}get value(){const r=this.dep.track();return $m(this),r&&(r.version=this.dep.version),this._value}set value(r){this.setter&&this.setter(r)}}function ox(n,r,t=!1){let i,e;return ze(n)?i=n:(i=n.get,e=n.set),new nx(i,e,t)}const Ga={},Ml=new WeakMap;let _n;function sx(n,r=!1,t=_n){if(t){let i=Ml.get(t);i||Ml.set(t,i=[]),i.push(n)}}function ax(n,r,t=st){const{immediate:i,deep:e,once:o,scheduler:s,augmentJob:a,call:l}=t,h=w=>e?w:kr(w)||e===!1||e===0?bi(w,1):bi(w);let u,c,f,d,g=!1,p=!1;if(Ft(n)?(c=()=>n.value,g=kr(n)):fo(n)?(c=()=>h(n),g=!0):Pe(n)?(p=!0,g=n.some(w=>fo(w)||kr(w)),c=()=>n.map(w=>{if(Ft(w))return w.value;if(fo(w))return h(w);if(ze(w))return l?l(w,2):w()})):ze(n)?r?c=l?()=>l(n,2):n:c=()=>{if(f){Ri();try{f()}finally{Ai()}}const w=_n;_n=u;try{return l?l(n,3,[d]):n(d)}finally{_n=w}}:c=si,r&&e){const w=c,x=e===!0?1/0:e;c=()=>bi(w(),x)}const m=O1(),v=()=>{u.stop(),m&&m.active&&xf(m.effects,u)};if(o&&r){const w=r;r=(...x)=>{w(...x),v()}}let _=p?new Array(n.length).fill(Ga):Ga;const y=w=>{if(!(!(u.flags&1)||!u.dirty&&!w))if(r){const x=u.run();if(e||g||(p?x.some((C,b)=>Ki(C,_[b])):Ki(x,_))){f&&f();const C=_n;_n=u;try{const b=[x,_===Ga?void 0:p&&_[0]===Ga?[]:_,d];_=x,l?l(r,3,b):r(...b)}finally{_n=C}}}else u.run()};return a&&a(y),u=new Hm(c),u.scheduler=s?()=>s(y,!1):y,d=w=>sx(w,!1,u),f=u.onStop=()=>{const w=Ml.get(u);if(w){if(l)l(w,4);else for(const x of w)x();Ml.delete(u)}},r?i?y(!0):_=u.run():s?s(y.bind(null,!0),!0):u.run(),v.pause=u.pause.bind(u),v.resume=u.resume.bind(u),v.stop=v,v}function bi(n,r=1/0,t){if(r<=0||!at(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),r--,Ft(n))bi(n.value,r,t);else if(Pe(n))for(let i=0;i<n.length;i++)bi(n[i],r,t);else if(Do(n)||co(n))n.forEach(i=>{bi(i,r,t)});else if(zm(n)){for(const i in n)bi(n[i],r,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&bi(n[i],r,t)}return n}/**
|
|
10
|
-
* @vue/runtime-core v3.5.16
|
|
11
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
-
* @license MIT
|
|
13
|
-
**/function _a(n,r,t,i){try{return i?n(...i):n()}catch(e){ph(e,r,t)}}function Qr(n,r,t,i){if(ze(n)){const e=_a(n,r,t,i);return e&&Im(e)&&e.catch(o=>{ph(o,r,t)}),e}if(Pe(n)){const e=[];for(let o=0;o<n.length;o++)e.push(Qr(n[o],r,t,i));return e}}function ph(n,r,t,i=!0){const e=r?r.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=r&&r.appContext.config||st;if(r){let a=r.parent;const l=r.proxy,h=`https://vuejs.org/error-reference/#runtime-${t}`;for(;a;){const u=a.ec;if(u){for(let c=0;c<u.length;c++)if(u[c](n,l,h)===!1)return}a=a.parent}if(o){Ri(),_a(o,null,10,[n,l,h]),Ai();return}}lx(n,t,e,i,s)}function lx(n,r,t,i=!0,e=!1){if(e)throw n;console.error(n)}const rr=[];let ii=-1;const go=[];let Vi=null,to=0;const i_=Promise.resolve();let Pl=null;function n_(n){const r=Pl||i_;return n?r.then(this?n.bind(this):n):r}function hx(n){let r=ii+1,t=rr.length;for(;r<t;){const i=r+t>>>1,e=rr[i],o=Fs(e);o<n||o===n&&e.flags&2?r=i+1:t=i}return r}function Rf(n){if(!(n.flags&1)){const r=Fs(n),t=rr[rr.length-1];!t||!(n.flags&2)&&r>=Fs(t)?rr.push(n):rr.splice(hx(r),0,n),n.flags|=1,o_()}}function o_(){Pl||(Pl=i_.then(a_))}function ux(n){Pe(n)?go.push(...n):Vi&&n.id===-1?Vi.splice(to+1,0,n):n.flags&1||(go.push(n),n.flags|=1),o_()}function Lg(n,r,t=ii+1){for(;t<rr.length;t++){const i=rr[t];if(i&&i.flags&2){if(n&&i.id!==n.uid)continue;rr.splice(t,1),t--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function s_(n){if(go.length){const r=[...new Set(go)].sort((t,i)=>Fs(t)-Fs(i));if(go.length=0,Vi){Vi.push(...r);return}for(Vi=r,to=0;to<Vi.length;to++){const t=Vi[to];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}Vi=null,to=0}}const Fs=n=>n.id==null?n.flags&2?-1:1/0:n.id;function a_(n){try{for(ii=0;ii<rr.length;ii++){const r=rr[ii];r&&!(r.flags&8)&&(r.flags&4&&(r.flags&=-2),_a(r,r.i,r.i?15:14),r.flags&4||(r.flags&=-2))}}finally{for(;ii<rr.length;ii++){const r=rr[ii];r&&(r.flags&=-2)}ii=-1,rr.length=0,s_(),Pl=null,(rr.length||go.length)&&a_()}}let Ot=null,l_=null;function El(n){const r=Ot;return Ot=n,l_=n&&n.type.__scopeId||null,r}function ue(n,r=Ot,t){if(!r||n._n)return n;const i=(...e)=>{i._d&&Vg(-1);const o=El(r);let s;try{s=n(...e)}finally{El(o),i._d&&Vg(1)}return s};return i._n=!0,i._c=!0,i._d=!0,i}function Ve(n,r){if(Ot===null)return n;const t=Ch(Ot),i=n.dirs||(n.dirs=[]);for(let e=0;e<r.length;e++){let[o,s,a,l=st]=r[e];o&&(ze(o)&&(o={mounted:o,updated:o}),o.deep&&bi(s),i.push({dir:o,instance:t,value:s,oldValue:void 0,arg:a,modifiers:l}))}return n}function un(n,r,t,i){const e=n.dirs,o=r&&r.dirs;for(let s=0;s<e.length;s++){const a=e[s];o&&(a.oldValue=o[s].value);let l=a.dir[i];l&&(Ri(),Qr(l,t,8,[n.el,a,n,r]),Ai())}}const cx=Symbol("_vte"),h_=n=>n.__isTeleport,Wi=Symbol("_leaveCb"),Fa=Symbol("_enterCb");function fx(){const n={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ya(()=>{n.isMounted=!0}),_h(()=>{n.isUnmounting=!0}),n}const Mr=[Function,Array],u_={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Mr,onEnter:Mr,onAfterEnter:Mr,onEnterCancelled:Mr,onBeforeLeave:Mr,onLeave:Mr,onAfterLeave:Mr,onLeaveCancelled:Mr,onBeforeAppear:Mr,onAppear:Mr,onAfterAppear:Mr,onAppearCancelled:Mr},c_=n=>{const r=n.subTree;return r.component?c_(r.component):r},dx={name:"BaseTransition",props:u_,setup(n,{slots:r}){const t=F_(),i=fx();return()=>{const e=r.default&&g_(r.default(),!0);if(!e||!e.length)return;const o=f_(e),s=Ne(n),{mode:a}=s;if(i.isLeaving)return hu(o);const l=Ig(o);if(!l)return hu(o);let h=Sc(l,s,i,t,c=>h=c);l.type!==$t&&Ns(l,h);let u=t.subTree&&Ig(t.subTree);if(u&&u.type!==$t&&!wn(l,u)&&c_(t).type!==$t){let c=Sc(u,s,i,t);if(Ns(u,c),a==="out-in"&&l.type!==$t)return i.isLeaving=!0,c.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete c.afterLeave,u=void 0},hu(o);a==="in-out"&&l.type!==$t?c.delayLeave=(f,d,g)=>{const p=d_(i,u);p[String(u.key)]=u,f[Wi]=()=>{d(),f[Wi]=void 0,delete h.delayedLeave,u=void 0},h.delayedLeave=()=>{g(),delete h.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function f_(n){let r=n[0];if(n.length>1){for(const t of n)if(t.type!==$t){r=t;break}}return r}const gx=dx;function d_(n,r){const{leavingVNodes:t}=n;let i=t.get(r.type);return i||(i=Object.create(null),t.set(r.type,i)),i}function Sc(n,r,t,i,e){const{appear:o,mode:s,persisted:a=!1,onBeforeEnter:l,onEnter:h,onAfterEnter:u,onEnterCancelled:c,onBeforeLeave:f,onLeave:d,onAfterLeave:g,onLeaveCancelled:p,onBeforeAppear:m,onAppear:v,onAfterAppear:_,onAppearCancelled:y}=r,w=String(n.key),x=d_(t,n),C=(T,S)=>{T&&Qr(T,i,9,S)},b=(T,S)=>{const B=S[1];C(T,S),Pe(T)?T.every(L=>L.length<=1)&&B():T.length<=1&&B()},E={mode:s,persisted:a,beforeEnter(T){let S=l;if(!t.isMounted)if(o)S=m||l;else return;T[Wi]&&T[Wi](!0);const B=x[w];B&&wn(n,B)&&B.el[Wi]&&B.el[Wi](),C(S,[T])},enter(T){let S=h,B=u,L=c;if(!t.isMounted)if(o)S=v||h,B=_||u,L=y||c;else return;let D=!1;const N=T[Fa]=G=>{D||(D=!0,G?C(L,[T]):C(B,[T]),E.delayedLeave&&E.delayedLeave(),T[Fa]=void 0)};S?b(S,[T,N]):N()},leave(T,S){const B=String(n.key);if(T[Fa]&&T[Fa](!0),t.isUnmounting)return S();C(f,[T]);let L=!1;const D=T[Wi]=N=>{L||(L=!0,S(),N?C(p,[T]):C(g,[T]),T[Wi]=void 0,x[B]===n&&delete x[B])};x[B]=n,d?b(d,[T,D]):D()},clone(T){const S=Sc(T,r,t,i,e);return e&&e(S),S}};return E}function hu(n){if(vh(n))return n=nn(n),n.children=null,n}function Ig(n){if(!vh(n))return h_(n.type)&&n.children?f_(n.children):n;if(n.component)return n.component.subTree;const{shapeFlag:r,children:t}=n;if(t){if(r&16)return t[0];if(r&32&&ze(t.default))return t.default()}}function Ns(n,r){n.shapeFlag&6&&n.component?(n.transition=r,Ns(n.component.subTree,r)):n.shapeFlag&128?(n.ssContent.transition=r.clone(n.ssContent),n.ssFallback.transition=r.clone(n.ssFallback)):n.transition=r}function g_(n,r=!1,t){let i=[],e=0;for(let o=0;o<n.length;o++){let s=n[o];const a=t==null?s.key:String(t)+String(s.key!=null?s.key:o);s.type===We?(s.patchFlag&128&&e++,i=i.concat(g_(s.children,r,a))):(r||s.type!==$t)&&i.push(a!=null?nn(s,{key:a}):s)}if(e>1)for(let o=0;o<i.length;o++)i[o].patchFlag=-2;return i}/*! #__NO_SIDE_EFFECTS__ */function ke(n,r){return ze(n)?kt({name:n.name},r,{setup:n}):n}function p_(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}function Sl(n,r,t,i,e=!1){if(Pe(n)){n.forEach((g,p)=>Sl(g,r&&(Pe(r)?r[p]:r),t,i,e));return}if(po(i)&&!e){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Sl(n,r,t,i.component.subTree);return}const o=i.shapeFlag&4?Ch(i.component):i.el,s=e?null:o,{i:a,r:l}=n,h=r&&r.r,u=a.refs===st?a.refs={}:a.refs,c=a.setupState,f=Ne(c),d=c===st?()=>!1:g=>Ke(f,g);if(h!=null&&h!==l&&(xt(h)?(u[h]=null,d(h)&&(c[h]=null)):Ft(h)&&(h.value=null)),ze(l))_a(l,a,12,[s,u]);else{const g=xt(l),p=Ft(l);if(g||p){const m=()=>{if(n.f){const v=g?d(l)?c[l]:u[l]:l.value;e?Pe(v)&&xf(v,o):Pe(v)?v.includes(o)||v.push(o):g?(u[l]=[o],d(l)&&(c[l]=u[l])):(l.value=[o],n.k&&(u[n.k]=l.value))}else g?(u[l]=s,d(l)&&(c[l]=s)):p&&(l.value=s,n.k&&(u[n.k]=s))};s?(m.id=-1,pr(m,t)):m()}}}fh().requestIdleCallback;fh().cancelIdleCallback;const po=n=>!!n.type.__asyncLoader,vh=n=>n.type.__isKeepAlive;function px(n,r){v_(n,"a",r)}function vx(n,r){v_(n,"da",r)}function v_(n,r,t=Gt){const i=n.__wdc||(n.__wdc=()=>{let e=t;for(;e;){if(e.isDeactivated)return;e=e.parent}return n()});if(mh(r,i,t),t){let e=t.parent;for(;e&&e.parent;)vh(e.parent.vnode)&&mx(i,r,t,e),e=e.parent}}function mx(n,r,t,i){const e=mh(r,n,i,!0);yh(()=>{xf(i[r],e)},t)}function mh(n,r,t=Gt,i=!1){if(t){const e=t[n]||(t[n]=[]),o=r.__weh||(r.__weh=(...s)=>{Ri();const a=wa(t),l=Qr(r,t,n,s);return a(),Ai(),l});return i?e.unshift(o):e.push(o),o}}const Gi=n=>(r,t=Gt)=>{(!Zs||n==="sp")&&mh(n,(...i)=>r(...i),t)},m_=Gi("bm"),ya=Gi("m"),_x=Gi("bu"),yx=Gi("u"),_h=Gi("bum"),yh=Gi("um"),wx=Gi("sp"),xx=Gi("rtg"),Cx=Gi("rtc");function Tx(n,r=Gt){mh("ec",n,r)}const bx="components";function _t(n,r){return Px(bx,n,!0,r)||n}const Mx=Symbol.for("v-ndc");function Px(n,r,t=!0,i=!1){const e=Ot||Gt;if(e){const o=e.type;{const a=uC(o,!1);if(a&&(a===r||a===Ir(r)||a===ch(Ir(r))))return o}const s=Dg(e[n]||o[n],r)||Dg(e.appContext[n],r);return!s&&i?o:s}}function Dg(n,r){return n&&(n[r]||n[Ir(r)]||n[ch(Ir(r))])}function St(n,r,t,i){let e;const o=t,s=Pe(n);if(s||xt(n)){const a=s&&fo(n);let l=!1,h=!1;a&&(l=!kr(n),h=rn(n),n=gh(n)),e=new Array(n.length);for(let u=0,c=n.length;u<c;u++)e[u]=r(l?h?bl(Bt(n[u])):Bt(n[u]):n[u],u,void 0,o)}else if(typeof n=="number"){e=new Array(n);for(let a=0;a<n;a++)e[a]=r(a+1,a,void 0,o)}else if(at(n))if(n[Symbol.iterator])e=Array.from(n,(a,l)=>r(a,l,void 0,o));else{const a=Object.keys(n);e=new Array(a.length);for(let l=0,h=a.length;l<h;l++){const u=a[l];e[l]=r(n[u],u,l,o)}}else e=[];return e}function Jt(n,r,t={},i,e){if(Ot.ce||Ot.parent&&po(Ot.parent)&&Ot.parent.ce)return r!=="default"&&(t.name=r),he(),Ue(We,null,[Y("slot",t,i)],64);let o=n[r];o&&o._c&&(o._d=!1),he();const s=o&&__(o(t)),a=t.key||s&&s.key,l=Ue(We,{key:(a&&!Kr(a)?a:`_${r}`)+""},s||[],s&&n._===1?64:-2);return!e&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function __(n){return n.some(r=>js(r)?!(r.type===$t||r.type===We&&!__(r.children)):!0)?n:null}const Oc=n=>n?N_(n)?Ch(n):Oc(n.parent):null,Ts=kt(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>Oc(n.parent),$root:n=>Oc(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>w_(n),$forceUpdate:n=>n.f||(n.f=()=>{Rf(n.update)}),$nextTick:n=>n.n||(n.n=n_.bind(n.proxy)),$watch:n=>Ux.bind(n)}),uu=(n,r)=>n!==st&&!n.__isScriptSetup&&Ke(n,r),Ex={get({_:n},r){if(r==="__v_skip")return!0;const{ctx:t,setupState:i,data:e,props:o,accessCache:s,type:a,appContext:l}=n;let h;if(r[0]!=="$"){const d=s[r];if(d!==void 0)switch(d){case 1:return i[r];case 2:return e[r];case 4:return t[r];case 3:return o[r]}else{if(uu(i,r))return s[r]=1,i[r];if(e!==st&&Ke(e,r))return s[r]=2,e[r];if((h=n.propsOptions[0])&&Ke(h,r))return s[r]=3,o[r];if(t!==st&&Ke(t,r))return s[r]=4,t[r];kc&&(s[r]=0)}}const u=Ts[r];let c,f;if(u)return r==="$attrs"&&Wt(n.attrs,"get",""),u(n);if((c=a.__cssModules)&&(c=c[r]))return c;if(t!==st&&Ke(t,r))return s[r]=4,t[r];if(f=l.config.globalProperties,Ke(f,r))return f[r]},set({_:n},r,t){const{data:i,setupState:e,ctx:o}=n;return uu(e,r)?(e[r]=t,!0):i!==st&&Ke(i,r)?(i[r]=t,!0):Ke(n.props,r)||r[0]==="$"&&r.slice(1)in n?!1:(o[r]=t,!0)},has({_:{data:n,setupState:r,accessCache:t,ctx:i,appContext:e,propsOptions:o}},s){let a;return!!t[s]||n!==st&&Ke(n,s)||uu(r,s)||(a=o[0])&&Ke(a,s)||Ke(i,s)||Ke(Ts,s)||Ke(e.config.globalProperties,s)},defineProperty(n,r,t){return t.get!=null?n._.accessCache[r]=0:Ke(t,"value")&&this.set(n,r,t.value,null),Reflect.defineProperty(n,r,t)}};function zg(n){return Pe(n)?n.reduce((r,t)=>(r[t]=null,r),{}):n}let kc=!0;function Sx(n){const r=w_(n),t=n.proxy,i=n.ctx;kc=!1,r.beforeCreate&&Bg(r.beforeCreate,n,"bc");const{data:e,computed:o,methods:s,watch:a,provide:l,inject:h,created:u,beforeMount:c,mounted:f,beforeUpdate:d,updated:g,activated:p,deactivated:m,beforeDestroy:v,beforeUnmount:_,destroyed:y,unmounted:w,render:x,renderTracked:C,renderTriggered:b,errorCaptured:E,serverPrefetch:T,expose:S,inheritAttrs:B,components:L,directives:D,filters:N}=r;if(h&&Ox(h,i,null),s)for(const A in s){const k=s[A];ze(k)&&(i[A]=k.bind(t))}if(e){const A=e.call(t,t);at(A)&&(n.data=xr(A))}if(kc=!0,o)for(const A in o){const k=o[A],Z=ze(k)?k.bind(t,t):ze(k.get)?k.get.bind(t,t):si,W=!ze(k)&&ze(k.set)?k.set.bind(t):si,re=wt({get:Z,set:W});Object.defineProperty(i,A,{enumerable:!0,configurable:!0,get:()=>re.value,set:se=>re.value=se})}if(a)for(const A in a)y_(a[A],i,t,A);if(l){const A=ze(l)?l.call(t):l;Reflect.ownKeys(A).forEach(k=>{C_(k,A[k])})}u&&Bg(u,n,"c");function I(A,k){Pe(k)?k.forEach(Z=>A(Z.bind(t))):k&&A(k.bind(t))}if(I(m_,c),I(ya,f),I(_x,d),I(yx,g),I(px,p),I(vx,m),I(Tx,E),I(Cx,C),I(xx,b),I(_h,_),I(yh,w),I(wx,T),Pe(S))if(S.length){const A=n.exposed||(n.exposed={});S.forEach(k=>{Object.defineProperty(A,k,{get:()=>t[k],set:Z=>t[k]=Z})})}else n.exposed||(n.exposed={});x&&n.render===si&&(n.render=x),B!=null&&(n.inheritAttrs=B),L&&(n.components=L),D&&(n.directives=D),T&&p_(n)}function Ox(n,r,t=si){Pe(n)&&(n=Rc(n));for(const i in n){const e=n[i];let o;at(e)?"default"in e?o=bs(e.from||i,e.default,!0):o=bs(e.from||i):o=bs(e),Ft(o)?Object.defineProperty(r,i,{enumerable:!0,configurable:!0,get:()=>o.value,set:s=>o.value=s}):r[i]=o}}function Bg(n,r,t){Qr(Pe(n)?n.map(i=>i.bind(r.proxy)):n.bind(r.proxy),r,t)}function y_(n,r,t,i){let e=i.includes(".")?L_(t,i):()=>t[i];if(xt(n)){const o=r[n];ze(o)&&tt(e,o)}else if(ze(n))tt(e,n.bind(t));else if(at(n))if(Pe(n))n.forEach(o=>y_(o,r,t,i));else{const o=ze(n.handler)?n.handler.bind(t):r[n.handler];ze(o)&&tt(e,o,n)}}function w_(n){const r=n.type,{mixins:t,extends:i}=r,{mixins:e,optionsCache:o,config:{optionMergeStrategies:s}}=n.appContext,a=o.get(r);let l;return a?l=a:!e.length&&!t&&!i?l=r:(l={},e.length&&e.forEach(h=>Ol(l,h,s,!0)),Ol(l,r,s)),at(r)&&o.set(r,l),l}function Ol(n,r,t,i=!1){const{mixins:e,extends:o}=r;o&&Ol(n,o,t,!0),e&&e.forEach(s=>Ol(n,s,t,!0));for(const s in r)if(!(i&&s==="expose")){const a=kx[s]||t&&t[s];n[s]=a?a(n[s],r[s]):r[s]}return n}const kx={data:Gg,props:Fg,emits:Fg,methods:ds,computed:ds,beforeCreate:Kt,created:Kt,beforeMount:Kt,mounted:Kt,beforeUpdate:Kt,updated:Kt,beforeDestroy:Kt,beforeUnmount:Kt,destroyed:Kt,unmounted:Kt,activated:Kt,deactivated:Kt,errorCaptured:Kt,serverPrefetch:Kt,components:ds,directives:ds,watch:Ax,provide:Gg,inject:Rx};function Gg(n,r){return r?n?function(){return kt(ze(n)?n.call(this,this):n,ze(r)?r.call(this,this):r)}:r:n}function Rx(n,r){return ds(Rc(n),Rc(r))}function Rc(n){if(Pe(n)){const r={};for(let t=0;t<n.length;t++)r[n[t]]=n[t];return r}return n}function Kt(n,r){return n?[...new Set([].concat(n,r))]:r}function ds(n,r){return n?kt(Object.create(null),n,r):r}function Fg(n,r){return n?Pe(n)&&Pe(r)?[...new Set([...n,...r])]:kt(Object.create(null),zg(n),zg(r??{})):r}function Ax(n,r){if(!n)return r;if(!r)return n;const t=kt(Object.create(null),n);for(const i in r)t[i]=Kt(n[i],r[i]);return t}function x_(){return{app:null,config:{isNativeTag:g1,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Lx=0;function Ix(n,r){return function(i,e=null){ze(i)||(i=kt({},i)),e!=null&&!at(e)&&(e=null);const o=x_(),s=new WeakSet,a=[];let l=!1;const h=o.app={_uid:Lx++,_component:i,_props:e,_container:null,_context:o,_instance:null,version:fC,get config(){return o.config},set config(u){},use(u,...c){return s.has(u)||(u&&ze(u.install)?(s.add(u),u.install(h,...c)):ze(u)&&(s.add(u),u(h,...c))),h},mixin(u){return o.mixins.includes(u)||o.mixins.push(u),h},component(u,c){return c?(o.components[u]=c,h):o.components[u]},directive(u,c){return c?(o.directives[u]=c,h):o.directives[u]},mount(u,c,f){if(!l){const d=h._ceVNode||Y(i,e);return d.appContext=o,f===!0?f="svg":f===!1&&(f=void 0),n(d,u,f),l=!0,h._container=u,u.__vue_app__=h,Ch(d.component)}},onUnmount(u){a.push(u)},unmount(){l&&(Qr(a,h._instance,16),n(null,h._container),delete h._container.__vue_app__)},provide(u,c){return o.provides[u]=c,h},runWithContext(u){const c=vo;vo=h;try{return u()}finally{vo=c}}};return h}}let vo=null;function C_(n,r){if(Gt){let t=Gt.provides;const i=Gt.parent&&Gt.parent.provides;i===t&&(t=Gt.provides=Object.create(i)),t[n]=r}}function bs(n,r,t=!1){const i=Gt||Ot;if(i||vo){let e=vo?vo._context.provides:i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(e&&n in e)return e[n];if(arguments.length>1)return t&&ze(r)?r.call(i&&i.proxy):r}}const T_={},b_=()=>Object.create(T_),M_=n=>Object.getPrototypeOf(n)===T_;function Dx(n,r,t,i=!1){const e={},o=b_();n.propsDefaults=Object.create(null),P_(n,r,e,o);for(const s in n.propsOptions[0])s in e||(e[s]=void 0);t?n.props=i?e:X1(e):n.type.props?n.props=e:n.props=o,n.attrs=o}function zx(n,r,t,i){const{props:e,attrs:o,vnode:{patchFlag:s}}=n,a=Ne(e),[l]=n.propsOptions;let h=!1;if((i||s>0)&&!(s&16)){if(s&8){const u=n.vnode.dynamicProps;for(let c=0;c<u.length;c++){let f=u[c];if(wh(n.emitsOptions,f))continue;const d=r[f];if(l)if(Ke(o,f))d!==o[f]&&(o[f]=d,h=!0);else{const g=Ir(f);e[g]=Ac(l,a,g,d,n,!1)}else d!==o[f]&&(o[f]=d,h=!0)}}}else{P_(n,r,e,o)&&(h=!0);let u;for(const c in a)(!r||!Ke(r,c)&&((u=zn(c))===c||!Ke(r,u)))&&(l?t&&(t[c]!==void 0||t[u]!==void 0)&&(e[c]=Ac(l,a,c,void 0,n,!0)):delete e[c]);if(o!==a)for(const c in o)(!r||!Ke(r,c))&&(delete o[c],h=!0)}h&&Ti(n.attrs,"set","")}function P_(n,r,t,i){const[e,o]=n.propsOptions;let s=!1,a;if(r)for(let l in r){if(ws(l))continue;const h=r[l];let u;e&&Ke(e,u=Ir(l))?!o||!o.includes(u)?t[u]=h:(a||(a={}))[u]=h:wh(n.emitsOptions,l)||(!(l in i)||h!==i[l])&&(i[l]=h,s=!0)}if(o){const l=Ne(t),h=a||st;for(let u=0;u<o.length;u++){const c=o[u];t[c]=Ac(e,l,c,h[c],n,!Ke(h,c))}}return s}function Ac(n,r,t,i,e,o){const s=n[t];if(s!=null){const a=Ke(s,"default");if(a&&i===void 0){const l=s.default;if(s.type!==Function&&!s.skipFactory&&ze(l)){const{propsDefaults:h}=e;if(t in h)i=h[t];else{const u=wa(e);i=h[t]=l.call(null,r),u()}}else i=l;e.ce&&e.ce._setProp(t,i)}s[0]&&(o&&!a?i=!1:s[1]&&(i===""||i===zn(t))&&(i=!0))}return i}const Bx=new WeakMap;function E_(n,r,t=!1){const i=t?Bx:r.propsCache,e=i.get(n);if(e)return e;const o=n.props,s={},a=[];let l=!1;if(!ze(n)){const u=c=>{l=!0;const[f,d]=E_(c,r,!0);kt(s,f),d&&a.push(...d)};!t&&r.mixins.length&&r.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!o&&!l)return at(n)&&i.set(n,uo),uo;if(Pe(o))for(let u=0;u<o.length;u++){const c=Ir(o[u]);Ng(c)&&(s[c]=st)}else if(o)for(const u in o){const c=Ir(u);if(Ng(c)){const f=o[u],d=s[c]=Pe(f)||ze(f)?{type:f}:kt({},f),g=d.type;let p=!1,m=!0;if(Pe(g))for(let v=0;v<g.length;++v){const _=g[v],y=ze(_)&&_.name;if(y==="Boolean"){p=!0;break}else y==="String"&&(m=!1)}else p=ze(g)&&g.name==="Boolean";d[0]=p,d[1]=m,(p||Ke(d,"default"))&&a.push(c)}}const h=[s,a];return at(n)&&i.set(n,h),h}function Ng(n){return n[0]!=="$"&&!ws(n)}const Af=n=>n[0]==="_"||n==="$stable",Lf=n=>Pe(n)?n.map(ni):[ni(n)],Gx=(n,r,t)=>{if(r._n)return r;const i=ue((...e)=>Lf(r(...e)),t);return i._c=!1,i},S_=(n,r,t)=>{const i=n._ctx;for(const e in n){if(Af(e))continue;const o=n[e];if(ze(o))r[e]=Gx(e,o,i);else if(o!=null){const s=Lf(o);r[e]=()=>s}}},O_=(n,r)=>{const t=Lf(r);n.slots.default=()=>t},k_=(n,r,t)=>{for(const i in r)(t||!Af(i))&&(n[i]=r[i])},Fx=(n,r,t)=>{const i=n.slots=b_();if(n.vnode.shapeFlag&32){const e=r._;e?(k_(i,r,t),t&&Bm(i,"_",e,!0)):S_(r,i)}else r&&O_(n,r)},Nx=(n,r,t)=>{const{vnode:i,slots:e}=n;let o=!0,s=st;if(i.shapeFlag&32){const a=r._;a?t&&a===1?o=!1:k_(e,r,t):(o=!r.$stable,S_(r,e)),s=r}else r&&(O_(n,r),s={default:1});if(o)for(const a in e)!Af(a)&&s[a]==null&&delete e[a]},pr=eC;function Hx(n){return jx(n)}function jx(n,r){const t=fh();t.__VUE__=!0;const{insert:i,remove:e,patchProp:o,createElement:s,createText:a,createComment:l,setText:h,setElementText:u,parentNode:c,nextSibling:f,setScopeId:d=si,insertStaticContent:g}=n,p=(M,R,V,q=null,U=null,K=null,ie=void 0,ne=null,le=!!R.dynamicChildren)=>{if(M===R)return;M&&!wn(M,R)&&(q=Te(M),se(M,U,K,!0),M=null),R.patchFlag===-2&&(le=!1,R.dynamicChildren=null);const{type:ee,ref:ye,shapeFlag:ce}=R;switch(ee){case xh:m(M,R,V,q);break;case $t:v(M,R,V,q);break;case fu:M==null&&_(R,V,q,ie);break;case We:L(M,R,V,q,U,K,ie,ne,le);break;default:ce&1?x(M,R,V,q,U,K,ie,ne,le):ce&6?D(M,R,V,q,U,K,ie,ne,le):(ce&64||ce&128)&&ee.process(M,R,V,q,U,K,ie,ne,le,Be)}ye!=null&&U&&Sl(ye,M&&M.ref,K,R||M,!R)},m=(M,R,V,q)=>{if(M==null)i(R.el=a(R.children),V,q);else{const U=R.el=M.el;R.children!==M.children&&h(U,R.children)}},v=(M,R,V,q)=>{M==null?i(R.el=l(R.children||""),V,q):R.el=M.el},_=(M,R,V,q)=>{[M.el,M.anchor]=g(M.children,R,V,q,M.el,M.anchor)},y=({el:M,anchor:R},V,q)=>{let U;for(;M&&M!==R;)U=f(M),i(M,V,q),M=U;i(R,V,q)},w=({el:M,anchor:R})=>{let V;for(;M&&M!==R;)V=f(M),e(M),M=V;e(R)},x=(M,R,V,q,U,K,ie,ne,le)=>{R.type==="svg"?ie="svg":R.type==="math"&&(ie="mathml"),M==null?C(R,V,q,U,K,ie,ne,le):T(M,R,U,K,ie,ne,le)},C=(M,R,V,q,U,K,ie,ne)=>{let le,ee;const{props:ye,shapeFlag:ce,transition:ve,dirs:be}=M;if(le=M.el=s(M.type,K,ye&&ye.is,ye),ce&8?u(le,M.children):ce&16&&E(M.children,le,null,q,U,cu(M,K),ie,ne),be&&un(M,null,q,"created"),b(le,M,M.scopeId,ie,q),ye){for(const Fe in ye)Fe!=="value"&&!ws(Fe)&&o(le,Fe,null,ye[Fe],K,q);"value"in ye&&o(le,"value",null,ye.value,K),(ee=ye.onVnodeBeforeMount)&&ri(ee,q,M)}be&&un(M,null,q,"beforeMount");const Ie=Zx(U,ve);Ie&&ve.beforeEnter(le),i(le,R,V),((ee=ye&&ye.onVnodeMounted)||Ie||be)&&pr(()=>{ee&&ri(ee,q,M),Ie&&ve.enter(le),be&&un(M,null,q,"mounted")},U)},b=(M,R,V,q,U)=>{if(V&&d(M,V),q)for(let K=0;K<q.length;K++)d(M,q[K]);if(U){let K=U.subTree;if(R===K||D_(K.type)&&(K.ssContent===R||K.ssFallback===R)){const ie=U.vnode;b(M,ie,ie.scopeId,ie.slotScopeIds,U.parent)}}},E=(M,R,V,q,U,K,ie,ne,le=0)=>{for(let ee=le;ee<M.length;ee++){const ye=M[ee]=ne?$i(M[ee]):ni(M[ee]);p(null,ye,R,V,q,U,K,ie,ne)}},T=(M,R,V,q,U,K,ie)=>{const ne=R.el=M.el;let{patchFlag:le,dynamicChildren:ee,dirs:ye}=R;le|=M.patchFlag&16;const ce=M.props||st,ve=R.props||st;let be;if(V&&cn(V,!1),(be=ve.onVnodeBeforeUpdate)&&ri(be,V,R,M),ye&&un(R,M,V,"beforeUpdate"),V&&cn(V,!0),(ce.innerHTML&&ve.innerHTML==null||ce.textContent&&ve.textContent==null)&&u(ne,""),ee?S(M.dynamicChildren,ee,ne,V,q,cu(R,U),K):ie||k(M,R,ne,null,V,q,cu(R,U),K,!1),le>0){if(le&16)B(ne,ce,ve,V,U);else if(le&2&&ce.class!==ve.class&&o(ne,"class",null,ve.class,U),le&4&&o(ne,"style",ce.style,ve.style,U),le&8){const Ie=R.dynamicProps;for(let Fe=0;Fe<Ie.length;Fe++){const Re=Ie[Fe],ct=ce[Re],Qe=ve[Re];(Qe!==ct||Re==="value")&&o(ne,Re,ct,Qe,U,V)}}le&1&&M.children!==R.children&&u(ne,R.children)}else!ie&&ee==null&&B(ne,ce,ve,V,U);((be=ve.onVnodeUpdated)||ye)&&pr(()=>{be&&ri(be,V,R,M),ye&&un(R,M,V,"updated")},q)},S=(M,R,V,q,U,K,ie)=>{for(let ne=0;ne<R.length;ne++){const le=M[ne],ee=R[ne],ye=le.el&&(le.type===We||!wn(le,ee)||le.shapeFlag&198)?c(le.el):V;p(le,ee,ye,null,q,U,K,ie,!0)}},B=(M,R,V,q,U)=>{if(R!==V){if(R!==st)for(const K in R)!ws(K)&&!(K in V)&&o(M,K,R[K],null,U,q);for(const K in V){if(ws(K))continue;const ie=V[K],ne=R[K];ie!==ne&&K!=="value"&&o(M,K,ne,ie,U,q)}"value"in V&&o(M,"value",R.value,V.value,U)}},L=(M,R,V,q,U,K,ie,ne,le)=>{const ee=R.el=M?M.el:a(""),ye=R.anchor=M?M.anchor:a("");let{patchFlag:ce,dynamicChildren:ve,slotScopeIds:be}=R;be&&(ne=ne?ne.concat(be):be),M==null?(i(ee,V,q),i(ye,V,q),E(R.children||[],V,ye,U,K,ie,ne,le)):ce>0&&ce&64&&ve&&M.dynamicChildren?(S(M.dynamicChildren,ve,V,U,K,ie,ne),(R.key!=null||U&&R===U.subTree)&&R_(M,R,!0)):k(M,R,V,ye,U,K,ie,ne,le)},D=(M,R,V,q,U,K,ie,ne,le)=>{R.slotScopeIds=ne,M==null?R.shapeFlag&512?U.ctx.activate(R,V,q,ie,le):N(R,V,q,U,K,ie,le):G(M,R,le)},N=(M,R,V,q,U,K,ie)=>{const ne=M.component=oC(M,q,U);if(vh(M)&&(ne.ctx.renderer=Be),sC(ne,!1,ie),ne.asyncDep){if(U&&U.registerDep(ne,I,ie),!M.el){const le=ne.subTree=Y($t);v(null,le,R,V)}}else I(ne,M,R,V,U,K,ie)},G=(M,R,V)=>{const q=R.component=M.component;if(Kx(M,R,V))if(q.asyncDep&&!q.asyncResolved){A(q,R,V);return}else q.next=R,q.update();else R.el=M.el,q.vnode=R},I=(M,R,V,q,U,K,ie)=>{const ne=()=>{if(M.isMounted){let{next:ce,bu:ve,u:be,parent:Ie,vnode:Fe}=M;{const Lt=A_(M);if(Lt){ce&&(ce.el=Fe.el,A(M,ce,ie)),Lt.asyncDep.then(()=>{M.isUnmounted||ne()});return}}let Re=ce,ct;cn(M,!1),ce?(ce.el=Fe.el,A(M,ce,ie)):ce=Fe,ve&&dl(ve),(ct=ce.props&&ce.props.onVnodeBeforeUpdate)&&ri(ct,Ie,ce,Fe),cn(M,!0);const Qe=jg(M),Tt=M.subTree;M.subTree=Qe,p(Tt,Qe,c(Tt.el),Te(Tt),M,U,K),ce.el=Qe.el,Re===null&&Qx(M,Qe.el),be&&pr(be,U),(ct=ce.props&&ce.props.onVnodeUpdated)&&pr(()=>ri(ct,Ie,ce,Fe),U)}else{let ce;const{el:ve,props:be}=R,{bm:Ie,m:Fe,parent:Re,root:ct,type:Qe}=M,Tt=po(R);cn(M,!1),Ie&&dl(Ie),!Tt&&(ce=be&&be.onVnodeBeforeMount)&&ri(ce,Re,R),cn(M,!0);{ct.ce&&ct.ce._injectChildStyle(Qe);const Lt=M.subTree=jg(M);p(null,Lt,V,q,M,U,K),R.el=Lt.el}if(Fe&&pr(Fe,U),!Tt&&(ce=be&&be.onVnodeMounted)){const Lt=R;pr(()=>ri(ce,Re,Lt),U)}(R.shapeFlag&256||Re&&po(Re.vnode)&&Re.vnode.shapeFlag&256)&&M.a&&pr(M.a,U),M.isMounted=!0,R=V=q=null}};M.scope.on();const le=M.effect=new Hm(ne);M.scope.off();const ee=M.update=le.run.bind(le),ye=M.job=le.runIfDirty.bind(le);ye.i=M,ye.id=M.uid,le.scheduler=()=>Rf(ye),cn(M,!0),ee()},A=(M,R,V)=>{R.component=M;const q=M.vnode.props;M.vnode=R,M.next=null,zx(M,R.props,q,V),Nx(M,R.children,V),Ri(),Lg(M),Ai()},k=(M,R,V,q,U,K,ie,ne,le=!1)=>{const ee=M&&M.children,ye=M?M.shapeFlag:0,ce=R.children,{patchFlag:ve,shapeFlag:be}=R;if(ve>0){if(ve&128){W(ee,ce,V,q,U,K,ie,ne,le);return}else if(ve&256){Z(ee,ce,V,q,U,K,ie,ne,le);return}}be&8?(ye&16&&_e(ee,U,K),ce!==ee&&u(V,ce)):ye&16?be&16?W(ee,ce,V,q,U,K,ie,ne,le):_e(ee,U,K,!0):(ye&8&&u(V,""),be&16&&E(ce,V,q,U,K,ie,ne,le))},Z=(M,R,V,q,U,K,ie,ne,le)=>{M=M||uo,R=R||uo;const ee=M.length,ye=R.length,ce=Math.min(ee,ye);let ve;for(ve=0;ve<ce;ve++){const be=R[ve]=le?$i(R[ve]):ni(R[ve]);p(M[ve],be,V,null,U,K,ie,ne,le)}ee>ye?_e(M,U,K,!0,!1,ce):E(R,V,q,U,K,ie,ne,le,ce)},W=(M,R,V,q,U,K,ie,ne,le)=>{let ee=0;const ye=R.length;let ce=M.length-1,ve=ye-1;for(;ee<=ce&&ee<=ve;){const be=M[ee],Ie=R[ee]=le?$i(R[ee]):ni(R[ee]);if(wn(be,Ie))p(be,Ie,V,null,U,K,ie,ne,le);else break;ee++}for(;ee<=ce&&ee<=ve;){const be=M[ce],Ie=R[ve]=le?$i(R[ve]):ni(R[ve]);if(wn(be,Ie))p(be,Ie,V,null,U,K,ie,ne,le);else break;ce--,ve--}if(ee>ce){if(ee<=ve){const be=ve+1,Ie=be<ye?R[be].el:q;for(;ee<=ve;)p(null,R[ee]=le?$i(R[ee]):ni(R[ee]),V,Ie,U,K,ie,ne,le),ee++}}else if(ee>ve)for(;ee<=ce;)se(M[ee],U,K,!0),ee++;else{const be=ee,Ie=ee,Fe=new Map;for(ee=Ie;ee<=ve;ee++){const Ht=R[ee]=le?$i(R[ee]):ni(R[ee]);Ht.key!=null&&Fe.set(Ht.key,ee)}let Re,ct=0;const Qe=ve-Ie+1;let Tt=!1,Lt=0;const ut=new Array(Qe);for(ee=0;ee<Qe;ee++)ut[ee]=0;for(ee=be;ee<=ce;ee++){const Ht=M[ee];if(ct>=Qe){se(Ht,U,K,!0);continue}let gr;if(Ht.key!=null)gr=Fe.get(Ht.key);else for(Re=Ie;Re<=ve;Re++)if(ut[Re-Ie]===0&&wn(Ht,R[Re])){gr=Re;break}gr===void 0?se(Ht,U,K,!0):(ut[gr-Ie]=ee+1,gr>=Lt?Lt=gr:Tt=!0,p(Ht,R[gr],V,null,U,K,ie,ne,le),ct++)}const sr=Tt?Vx(ut):uo;for(Re=sr.length-1,ee=Qe-1;ee>=0;ee--){const Ht=Ie+ee,gr=R[Ht],Gn=Ht+1<ye?R[Ht+1].el:q;ut[ee]===0?p(null,gr,V,Gn,U,K,ie,ne,le):Tt&&(Re<0||ee!==sr[Re]?re(gr,V,Gn,2):Re--)}}},re=(M,R,V,q,U=null)=>{const{el:K,type:ie,transition:ne,children:le,shapeFlag:ee}=M;if(ee&6){re(M.component.subTree,R,V,q);return}if(ee&128){M.suspense.move(R,V,q);return}if(ee&64){ie.move(M,R,V,Be);return}if(ie===We){i(K,R,V);for(let ce=0;ce<le.length;ce++)re(le[ce],R,V,q);i(M.anchor,R,V);return}if(ie===fu){y(M,R,V);return}if(q!==2&&ee&1&&ne)if(q===0)ne.beforeEnter(K),i(K,R,V),pr(()=>ne.enter(K),U);else{const{leave:ce,delayLeave:ve,afterLeave:be}=ne,Ie=()=>{M.ctx.isUnmounted?e(K):i(K,R,V)},Fe=()=>{ce(K,()=>{Ie(),be&&be()})};ve?ve(K,Ie,Fe):Fe()}else i(K,R,V)},se=(M,R,V,q=!1,U=!1)=>{const{type:K,props:ie,ref:ne,children:le,dynamicChildren:ee,shapeFlag:ye,patchFlag:ce,dirs:ve,cacheIndex:be}=M;if(ce===-2&&(U=!1),ne!=null&&(Ri(),Sl(ne,null,V,M,!0),Ai()),be!=null&&(R.renderCache[be]=void 0),ye&256){R.ctx.deactivate(M);return}const Ie=ye&1&&ve,Fe=!po(M);let Re;if(Fe&&(Re=ie&&ie.onVnodeBeforeUnmount)&&ri(Re,R,M),ye&6)de(M.component,V,q);else{if(ye&128){M.suspense.unmount(V,q);return}Ie&&un(M,null,R,"beforeUnmount"),ye&64?M.type.remove(M,R,V,Be,q):ee&&!ee.hasOnce&&(K!==We||ce>0&&ce&64)?_e(ee,R,V,!1,!0):(K===We&&ce&384||!U&&ye&16)&&_e(le,R,V),q&&me(M)}(Fe&&(Re=ie&&ie.onVnodeUnmounted)||Ie)&&pr(()=>{Re&&ri(Re,R,M),Ie&&un(M,null,R,"unmounted")},V)},me=M=>{const{type:R,el:V,anchor:q,transition:U}=M;if(R===We){ge(V,q);return}if(R===fu){w(M);return}const K=()=>{e(V),U&&!U.persisted&&U.afterLeave&&U.afterLeave()};if(M.shapeFlag&1&&U&&!U.persisted){const{leave:ie,delayLeave:ne}=U,le=()=>ie(V,K);ne?ne(M.el,K,le):le()}else K()},ge=(M,R)=>{let V;for(;M!==R;)V=f(M),e(M),M=V;e(R)},de=(M,R,V)=>{const{bum:q,scope:U,job:K,subTree:ie,um:ne,m:le,a:ee,parent:ye,slots:{__:ce}}=M;Hg(le),Hg(ee),q&&dl(q),ye&&Pe(ce)&&ce.forEach(ve=>{ye.renderCache[ve]=void 0}),U.stop(),K&&(K.flags|=8,se(ie,M,R,V)),ne&&pr(ne,R),pr(()=>{M.isUnmounted=!0},R),R&&R.pendingBranch&&!R.isUnmounted&&M.asyncDep&&!M.asyncResolved&&M.suspenseId===R.pendingId&&(R.deps--,R.deps===0&&R.resolve())},_e=(M,R,V,q=!1,U=!1,K=0)=>{for(let ie=K;ie<M.length;ie++)se(M[ie],R,V,q,U)},Te=M=>{if(M.shapeFlag&6)return Te(M.component.subTree);if(M.shapeFlag&128)return M.suspense.next();const R=f(M.anchor||M.el),V=R&&R[cx];return V?f(V):R};let Ge=!1;const Me=(M,R,V)=>{M==null?R._vnode&&se(R._vnode,null,null,!0):p(R._vnode||null,M,R,null,null,null,V),R._vnode=M,Ge||(Ge=!0,Lg(),s_(),Ge=!1)},Be={p,um:se,m:re,r:me,mt:N,mc:E,pc:k,pbc:S,n:Te,o:n};return{render:Me,hydrate:void 0,createApp:Ix(Me)}}function cu({type:n,props:r},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&r&&r.encoding&&r.encoding.includes("html")?void 0:t}function cn({effect:n,job:r},t){t?(n.flags|=32,r.flags|=4):(n.flags&=-33,r.flags&=-5)}function Zx(n,r){return(!n||n&&!n.pendingBranch)&&r&&!r.persisted}function R_(n,r,t=!1){const i=n.children,e=r.children;if(Pe(i)&&Pe(e))for(let o=0;o<i.length;o++){const s=i[o];let a=e[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=e[o]=$i(e[o]),a.el=s.el),!t&&a.patchFlag!==-2&&R_(s,a)),a.type===xh&&(a.el=s.el),a.type===$t&&!a.el&&(a.el=s.el)}}function Vx(n){const r=n.slice(),t=[0];let i,e,o,s,a;const l=n.length;for(i=0;i<l;i++){const h=n[i];if(h!==0){if(e=t[t.length-1],n[e]<h){r[i]=e,t.push(i);continue}for(o=0,s=t.length-1;o<s;)a=o+s>>1,n[t[a]]<h?o=a+1:s=a;h<n[t[o]]&&(o>0&&(r[i]=t[o-1]),t[o]=i)}}for(o=t.length,s=t[o-1];o-- >0;)t[o]=s,s=r[s];return t}function A_(n){const r=n.subTree.component;if(r)return r.asyncDep&&!r.asyncResolved?r:A_(r)}function Hg(n){if(n)for(let r=0;r<n.length;r++)n[r].flags|=8}const Wx=Symbol.for("v-scx"),$x=()=>bs(Wx);function kl(n,r){return If(n,null,r)}function tt(n,r,t){return If(n,r,t)}function If(n,r,t=st){const{immediate:i,deep:e,flush:o,once:s}=t,a=kt({},t),l=r&&i||!r&&o!=="post";let h;if(Zs){if(o==="sync"){const d=$x();h=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=si,d.resume=si,d.pause=si,d}}const u=Gt;a.call=(d,g,p)=>Qr(d,u,g,p);let c=!1;o==="post"?a.scheduler=d=>{pr(d,u&&u.suspense)}:o!=="sync"&&(c=!0,a.scheduler=(d,g)=>{g?d():Rf(d)}),a.augmentJob=d=>{r&&(d.flags|=4),c&&(d.flags|=2,u&&(d.id=u.uid,d.i=u))};const f=ax(n,r,a);return Zs&&(h?h.push(f):l&&f()),f}function Ux(n,r,t){const i=this.proxy,e=xt(n)?n.includes(".")?L_(i,n):()=>i[n]:n.bind(i,i);let o;ze(r)?o=r:(o=r.handler,t=r);const s=wa(this),a=If(e,o.bind(i),t);return s(),a}function L_(n,r){const t=r.split(".");return()=>{let i=n;for(let e=0;e<t.length&&i;e++)i=i[t[e]];return i}}const Jx=(n,r)=>r==="modelValue"||r==="model-value"?n.modelModifiers:n[`${r}Modifiers`]||n[`${Ir(r)}Modifiers`]||n[`${zn(r)}Modifiers`];function Xx(n,r,...t){if(n.isUnmounted)return;const i=n.vnode.props||st;let e=t;const o=r.startsWith("update:"),s=o&&Jx(i,r.slice(7));s&&(s.trim&&(e=t.map(u=>xt(u)?u.trim():u)),s.number&&(e=t.map(Cl)));let a,l=i[a=nu(r)]||i[a=nu(Ir(r))];!l&&o&&(l=i[a=nu(zn(r))]),l&&Qr(l,n,6,e);const h=i[a+"Once"];if(h){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,Qr(h,n,6,e)}}function I_(n,r,t=!1){const i=r.emitsCache,e=i.get(n);if(e!==void 0)return e;const o=n.emits;let s={},a=!1;if(!ze(n)){const l=h=>{const u=I_(h,r,!0);u&&(a=!0,kt(s,u))};!t&&r.mixins.length&&r.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!o&&!a?(at(n)&&i.set(n,null),null):(Pe(o)?o.forEach(l=>s[l]=null):kt(s,o),at(n)&&i.set(n,s),s)}function wh(n,r){return!n||!hh(r)?!1:(r=r.slice(2).replace(/Once$/,""),Ke(n,r[0].toLowerCase()+r.slice(1))||Ke(n,zn(r))||Ke(n,r))}function jg(n){const{type:r,vnode:t,proxy:i,withProxy:e,propsOptions:[o],slots:s,attrs:a,emit:l,render:h,renderCache:u,props:c,data:f,setupState:d,ctx:g,inheritAttrs:p}=n,m=El(n);let v,_;try{if(t.shapeFlag&4){const w=e||i,x=w;v=ni(h.call(x,w,u,c,d,f,g)),_=a}else{const w=r;v=ni(w.length>1?w(c,{attrs:a,slots:s,emit:l}):w(c,null)),_=r.props?a:Yx(a)}}catch(w){Ms.length=0,ph(w,n,1),v=Y($t)}let y=v;if(_&&p!==!1){const w=Object.keys(_),{shapeFlag:x}=y;w.length&&x&7&&(o&&w.some(wf)&&(_=qx(_,o)),y=nn(y,_,!1,!0))}return t.dirs&&(y=nn(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(t.dirs):t.dirs),t.transition&&Ns(y,t.transition),v=y,El(m),v}const Yx=n=>{let r;for(const t in n)(t==="class"||t==="style"||hh(t))&&((r||(r={}))[t]=n[t]);return r},qx=(n,r)=>{const t={};for(const i in n)(!wf(i)||!(i.slice(9)in r))&&(t[i]=n[i]);return t};function Kx(n,r,t){const{props:i,children:e,component:o}=n,{props:s,children:a,patchFlag:l}=r,h=o.emitsOptions;if(r.dirs||r.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?Zg(i,s,h):!!s;if(l&8){const u=r.dynamicProps;for(let c=0;c<u.length;c++){const f=u[c];if(s[f]!==i[f]&&!wh(h,f))return!0}}}else return(e||a)&&(!a||!a.$stable)?!0:i===s?!1:i?s?Zg(i,s,h):!0:!!s;return!1}function Zg(n,r,t){const i=Object.keys(r);if(i.length!==Object.keys(n).length)return!0;for(let e=0;e<i.length;e++){const o=i[e];if(r[o]!==n[o]&&!wh(t,o))return!0}return!1}function Qx({vnode:n,parent:r},t){for(;r;){const i=r.subTree;if(i.suspense&&i.suspense.activeBranch===n&&(i.el=n.el),i===n)(n=r.vnode).el=t,r=r.parent;else break}}const D_=n=>n.__isSuspense;function eC(n,r){r&&r.pendingBranch?Pe(n)?r.effects.push(...n):r.effects.push(n):ux(n)}const We=Symbol.for("v-fgt"),xh=Symbol.for("v-txt"),$t=Symbol.for("v-cmt"),fu=Symbol.for("v-stc"),Ms=[];let mr=null;function he(n=!1){Ms.push(mr=n?null:[])}function tC(){Ms.pop(),mr=Ms[Ms.length-1]||null}let Hs=1;function Vg(n,r=!1){Hs+=n,n<0&&mr&&r&&(mr.hasOnce=!0)}function z_(n){return n.dynamicChildren=Hs>0?mr||uo:null,tC(),Hs>0&&mr&&mr.push(n),n}function xe(n,r,t,i,e,o){return z_(F(n,r,t,i,e,o,!0))}function Ue(n,r,t,i,e){return z_(Y(n,r,t,i,e,!0))}function js(n){return n?n.__v_isVNode===!0:!1}function wn(n,r){return n.type===r.type&&n.key===r.key}const B_=({key:n})=>n??null,gl=({ref:n,ref_key:r,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?xt(n)||Ft(n)||ze(n)?{i:Ot,r:n,k:r,f:!!t}:n:null);function F(n,r=null,t=null,i=0,e=null,o=n===We?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:r,key:r&&B_(r),ref:r&&gl(r),scopeId:l_,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:i,dynamicProps:e,dynamicChildren:null,appContext:null,ctx:Ot};return a?(Df(l,t),o&128&&n.normalize(l)):t&&(l.shapeFlag|=xt(t)?8:16),Hs>0&&!s&&mr&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&mr.push(l),l}const Y=rC;function rC(n,r=null,t=null,i=0,e=null,o=!1){if((!n||n===Mx)&&(n=$t),js(n)){const a=nn(n,r,!0);return t&&Df(a,t),Hs>0&&!o&&mr&&(a.shapeFlag&6?mr[mr.indexOf(n)]=a:mr.push(a)),a.patchFlag=-2,a}if(cC(n)&&(n=n.__vccOpts),r){r=G_(r);let{class:a,style:l}=r;a&&!xt(a)&&(r.class=Bi(a)),at(l)&&(Of(l)&&!Pe(l)&&(l=kt({},l)),r.style=zo(l))}const s=xt(n)?1:D_(n)?128:h_(n)?64:at(n)?4:ze(n)?2:0;return F(n,r,t,i,e,s,o,!0)}function G_(n){return n?Of(n)||M_(n)?kt({},n):n:null}function nn(n,r,t=!1,i=!1){const{props:e,ref:o,patchFlag:s,children:a,transition:l}=n,h=r?_r(e||{},r):e,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&B_(h),ref:r&&r.ref?t&&o?Pe(o)?o.concat(gl(r)):[o,gl(r)]:gl(r):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:r&&n.type!==We?s===-1?16:s|16:s,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&nn(n.ssContent),ssFallback:n.ssFallback&&nn(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&Ns(u,l.clone(u)),u}function ae(n=" ",r=0){return Y(xh,null,n,r)}function on(n="",r=!1){return r?(he(),Ue($t,null,n)):Y($t,null,n)}function ni(n){return n==null||typeof n=="boolean"?Y($t):Pe(n)?Y(We,null,n.slice()):js(n)?$i(n):Y(xh,null,String(n))}function $i(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:nn(n)}function Df(n,r){let t=0;const{shapeFlag:i}=n;if(r==null)r=null;else if(Pe(r))t=16;else if(typeof r=="object")if(i&65){const e=r.default;e&&(e._c&&(e._d=!1),Df(n,e()),e._c&&(e._d=!0));return}else{t=32;const e=r._;!e&&!M_(r)?r._ctx=Ot:e===3&&Ot&&(Ot.slots._===1?r._=1:(r._=2,n.patchFlag|=1024))}else ze(r)?(r={default:r,_ctx:Ot},t=32):(r=String(r),i&64?(t=16,r=[ae(r)]):t=8);n.children=r,n.shapeFlag|=t}function _r(...n){const r={};for(let t=0;t<n.length;t++){const i=n[t];for(const e in i)if(e==="class")r.class!==i.class&&(r.class=Bi([r.class,i.class]));else if(e==="style")r.style=zo([r.style,i.style]);else if(hh(e)){const o=r[e],s=i[e];s&&o!==s&&!(Pe(o)&&o.includes(s))&&(r[e]=o?[].concat(o,s):s)}else e!==""&&(r[e]=i[e])}return r}function ri(n,r,t,i=null){Qr(n,r,7,[t,i])}const iC=x_();let nC=0;function oC(n,r,t){const i=n.type,e=(r?r.appContext:n.appContext)||iC,o={uid:nC++,vnode:n,type:i,parent:r,appContext:e,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new S1(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:r?r.provides:Object.create(e.provides),ids:r?r.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:E_(i,e),emitsOptions:I_(i,e),emit:null,emitted:null,propsDefaults:st,inheritAttrs:i.inheritAttrs,ctx:st,data:st,props:st,attrs:st,slots:st,refs:st,setupState:st,setupContext:null,suspense:t,suspenseId:t?t.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=r?r.root:o,o.emit=Xx.bind(null,o),n.ce&&n.ce(o),o}let Gt=null;const F_=()=>Gt||Ot;let Rl,Lc;{const n=fh(),r=(t,i)=>{let e;return(e=n[t])||(e=n[t]=[]),e.push(i),o=>{e.length>1?e.forEach(s=>s(o)):e[0](o)}};Rl=r("__VUE_INSTANCE_SETTERS__",t=>Gt=t),Lc=r("__VUE_SSR_SETTERS__",t=>Zs=t)}const wa=n=>{const r=Gt;return Rl(n),n.scope.on(),()=>{n.scope.off(),Rl(r)}},Wg=()=>{Gt&&Gt.scope.off(),Rl(null)};function N_(n){return n.vnode.shapeFlag&4}let Zs=!1;function sC(n,r=!1,t=!1){r&&Lc(r);const{props:i,children:e}=n.vnode,o=N_(n);Dx(n,i,o,r),Fx(n,e,t||r);const s=o?aC(n,r):void 0;return r&&Lc(!1),s}function aC(n,r){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,Ex);const{setup:i}=t;if(i){Ri();const e=n.setupContext=i.length>1?hC(n):null,o=wa(n),s=_a(i,n,0,[n.props,e]),a=Im(s);if(Ai(),o(),(a||n.sp)&&!po(n)&&p_(n),a){if(s.then(Wg,Wg),r)return s.then(l=>{$g(n,l)}).catch(l=>{ph(l,n,0)});n.asyncDep=s}else $g(n,s)}else H_(n)}function $g(n,r,t){ze(r)?n.type.__ssrInlineRender?n.ssrRender=r:n.render=r:at(r)&&(n.setupState=r_(r)),H_(n)}function H_(n,r,t){const i=n.type;n.render||(n.render=i.render||si);{const e=wa(n);Ri();try{Sx(n)}finally{Ai(),e()}}}const lC={get(n,r){return Wt(n,"get",""),n[r]}};function hC(n){const r=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,lC),slots:n.slots,emit:n.emit,expose:r}}function Ch(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(r_(kf(n.exposed)),{get(r,t){if(t in r)return r[t];if(t in Ts)return Ts[t](n)},has(r,t){return t in r||t in Ts}})):n.proxy}function uC(n,r=!0){return ze(n)?n.displayName||n.name:n.name||r&&n.__name}function cC(n){return ze(n)&&"__vccOpts"in n}const wt=(n,r)=>ox(n,r,Zs);function j_(n,r,t){const i=arguments.length;return i===2?at(r)&&!Pe(r)?js(r)?Y(n,null,[r]):Y(n,r):Y(n,null,r):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&js(t)&&(t=[t]),Y(n,r,t))}const fC="3.5.16";/**
|
|
14
|
-
* @vue/runtime-dom v3.5.16
|
|
15
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
-
* @license MIT
|
|
17
|
-
**/let Ic;const Ug=typeof window<"u"&&window.trustedTypes;if(Ug)try{Ic=Ug.createPolicy("vue",{createHTML:n=>n})}catch{}const Z_=Ic?n=>Ic.createHTML(n):n=>n,dC="http://www.w3.org/2000/svg",gC="http://www.w3.org/1998/Math/MathML",yi=typeof document<"u"?document:null,Jg=yi&&yi.createElement("template"),pC={insert:(n,r,t)=>{r.insertBefore(n,t||null)},remove:n=>{const r=n.parentNode;r&&r.removeChild(n)},createElement:(n,r,t,i)=>{const e=r==="svg"?yi.createElementNS(dC,n):r==="mathml"?yi.createElementNS(gC,n):t?yi.createElement(n,{is:t}):yi.createElement(n);return n==="select"&&i&&i.multiple!=null&&e.setAttribute("multiple",i.multiple),e},createText:n=>yi.createTextNode(n),createComment:n=>yi.createComment(n),setText:(n,r)=>{n.nodeValue=r},setElementText:(n,r)=>{n.textContent=r},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>yi.querySelector(n),setScopeId(n,r){n.setAttribute(r,"")},insertStaticContent(n,r,t,i,e,o){const s=t?t.previousSibling:r.lastChild;if(e&&(e===o||e.nextSibling))for(;r.insertBefore(e.cloneNode(!0),t),!(e===o||!(e=e.nextSibling)););else{Jg.innerHTML=Z_(i==="svg"?`<svg>${n}</svg>`:i==="mathml"?`<math>${n}</math>`:n);const a=Jg.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}r.insertBefore(a,t)}return[s?s.nextSibling:r.firstChild,t?t.previousSibling:r.lastChild]}},Fi="transition",Vo="animation",Vs=Symbol("_vtc"),V_={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},vC=kt({},u_,V_),mC=n=>(n.displayName="Transition",n.props=vC,n),_C=mC((n,{slots:r})=>j_(gx,yC(n),r)),fn=(n,r=[])=>{Pe(n)?n.forEach(t=>t(...r)):n&&n(...r)},Xg=n=>n?Pe(n)?n.some(r=>r.length>1):n.length>1:!1;function yC(n){const r={};for(const L in n)L in V_||(r[L]=n[L]);if(n.css===!1)return r;const{name:t="v",type:i,duration:e,enterFromClass:o=`${t}-enter-from`,enterActiveClass:s=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=o,appearActiveClass:h=s,appearToClass:u=a,leaveFromClass:c=`${t}-leave-from`,leaveActiveClass:f=`${t}-leave-active`,leaveToClass:d=`${t}-leave-to`}=n,g=wC(e),p=g&&g[0],m=g&&g[1],{onBeforeEnter:v,onEnter:_,onEnterCancelled:y,onLeave:w,onLeaveCancelled:x,onBeforeAppear:C=v,onAppear:b=_,onAppearCancelled:E=y}=r,T=(L,D,N,G)=>{L._enterCancelled=G,dn(L,D?u:a),dn(L,D?h:s),N&&N()},S=(L,D)=>{L._isLeaving=!1,dn(L,c),dn(L,d),dn(L,f),D&&D()},B=L=>(D,N)=>{const G=L?b:_,I=()=>T(D,L,N);fn(G,[D,I]),Yg(()=>{dn(D,L?l:o),pi(D,L?u:a),Xg(G)||qg(D,i,p,I)})};return kt(r,{onBeforeEnter(L){fn(v,[L]),pi(L,o),pi(L,s)},onBeforeAppear(L){fn(C,[L]),pi(L,l),pi(L,h)},onEnter:B(!1),onAppear:B(!0),onLeave(L,D){L._isLeaving=!0;const N=()=>S(L,D);pi(L,c),L._enterCancelled?(pi(L,f),ep()):(ep(),pi(L,f)),Yg(()=>{L._isLeaving&&(dn(L,c),pi(L,d),Xg(w)||qg(L,i,m,N))}),fn(w,[L,N])},onEnterCancelled(L){T(L,!1,void 0,!0),fn(y,[L])},onAppearCancelled(L){T(L,!0,void 0,!0),fn(E,[L])},onLeaveCancelled(L){S(L),fn(x,[L])}})}function wC(n){if(n==null)return null;if(at(n))return[du(n.enter),du(n.leave)];{const r=du(n);return[r,r]}}function du(n){return y1(n)}function pi(n,r){r.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[Vs]||(n[Vs]=new Set)).add(r)}function dn(n,r){r.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[Vs];t&&(t.delete(r),t.size||(n[Vs]=void 0))}function Yg(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let xC=0;function qg(n,r,t,i){const e=n._endId=++xC,o=()=>{e===n._endId&&i()};if(t!=null)return setTimeout(o,t);const{type:s,timeout:a,propCount:l}=CC(n,r);if(!s)return i();const h=s+"end";let u=0;const c=()=>{n.removeEventListener(h,f),o()},f=d=>{d.target===n&&++u>=l&&c()};setTimeout(()=>{u<l&&c()},a+1),n.addEventListener(h,f)}function CC(n,r){const t=window.getComputedStyle(n),i=g=>(t[g]||"").split(", "),e=i(`${Fi}Delay`),o=i(`${Fi}Duration`),s=Kg(e,o),a=i(`${Vo}Delay`),l=i(`${Vo}Duration`),h=Kg(a,l);let u=null,c=0,f=0;r===Fi?s>0&&(u=Fi,c=s,f=o.length):r===Vo?h>0&&(u=Vo,c=h,f=l.length):(c=Math.max(s,h),u=c>0?s>h?Fi:Vo:null,f=u?u===Fi?o.length:l.length:0);const d=u===Fi&&/\b(transform|all)(,|$)/.test(i(`${Fi}Property`).toString());return{type:u,timeout:c,propCount:f,hasTransform:d}}function Kg(n,r){for(;n.length<r.length;)n=n.concat(n);return Math.max(...r.map((t,i)=>Qg(t)+Qg(n[i])))}function Qg(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function ep(){return document.body.offsetHeight}function TC(n,r,t){const i=n[Vs];i&&(r=(r?[r,...i]:[...i]).join(" ")),r==null?n.removeAttribute("class"):t?n.setAttribute("class",r):n.className=r}const Al=Symbol("_vod"),W_=Symbol("_vsh"),bC={beforeMount(n,{value:r},{transition:t}){n[Al]=n.style.display==="none"?"":n.style.display,t&&r?t.beforeEnter(n):Wo(n,r)},mounted(n,{value:r},{transition:t}){t&&r&&t.enter(n)},updated(n,{value:r,oldValue:t},{transition:i}){!r!=!t&&(i?r?(i.beforeEnter(n),Wo(n,!0),i.enter(n)):i.leave(n,()=>{Wo(n,!1)}):Wo(n,r))},beforeUnmount(n,{value:r}){Wo(n,r)}};function Wo(n,r){n.style.display=r?n[Al]:"none",n[W_]=!r}const MC=Symbol(""),PC=/(^|;)\s*display\s*:/;function EC(n,r,t){const i=n.style,e=xt(t);let o=!1;if(t&&!e){if(r)if(xt(r))for(const s of r.split(";")){const a=s.slice(0,s.indexOf(":")).trim();t[a]==null&&pl(i,a,"")}else for(const s in r)t[s]==null&&pl(i,s,"");for(const s in t)s==="display"&&(o=!0),pl(i,s,t[s])}else if(e){if(r!==t){const s=i[MC];s&&(t+=";"+s),i.cssText=t,o=PC.test(t)}}else r&&n.removeAttribute("style");Al in n&&(n[Al]=o?i.display:"",n[W_]&&(i.display="none"))}const tp=/\s*!important$/;function pl(n,r,t){if(Pe(t))t.forEach(i=>pl(n,r,i));else if(t==null&&(t=""),r.startsWith("--"))n.setProperty(r,t);else{const i=SC(n,r);tp.test(t)?n.setProperty(zn(i),t.replace(tp,""),"important"):n[i]=t}}const rp=["Webkit","Moz","ms"],gu={};function SC(n,r){const t=gu[r];if(t)return t;let i=Ir(r);if(i!=="filter"&&i in n)return gu[r]=i;i=ch(i);for(let e=0;e<rp.length;e++){const o=rp[e]+i;if(o in n)return gu[r]=o}return r}const ip="http://www.w3.org/1999/xlink";function np(n,r,t,i,e,o=P1(r)){i&&r.startsWith("xlink:")?t==null?n.removeAttributeNS(ip,r.slice(6,r.length)):n.setAttributeNS(ip,r,t):t==null||o&&!Gm(t)?n.removeAttribute(r):n.setAttribute(r,o?"":Kr(t)?String(t):t)}function op(n,r,t,i,e){if(r==="innerHTML"||r==="textContent"){t!=null&&(n[r]=r==="innerHTML"?Z_(t):t);return}const o=n.tagName;if(r==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?n.getAttribute("value")||"":n.value,l=t==null?n.type==="checkbox"?"on":"":String(t);(a!==l||!("_value"in n))&&(n.value=l),t==null&&n.removeAttribute(r),n._value=t;return}let s=!1;if(t===""||t==null){const a=typeof n[r];a==="boolean"?t=Gm(t):t==null&&a==="string"?(t="",s=!0):a==="number"&&(t=0,s=!0)}try{n[r]=t}catch{}s&&n.removeAttribute(e||r)}function Mi(n,r,t,i){n.addEventListener(r,t,i)}function OC(n,r,t,i){n.removeEventListener(r,t,i)}const sp=Symbol("_vei");function kC(n,r,t,i,e=null){const o=n[sp]||(n[sp]={}),s=o[r];if(i&&s)s.value=i;else{const[a,l]=RC(r);if(i){const h=o[r]=IC(i,e);Mi(n,a,h,l)}else s&&(OC(n,a,s,l),o[r]=void 0)}}const ap=/(?:Once|Passive|Capture)$/;function RC(n){let r;if(ap.test(n)){r={};let i;for(;i=n.match(ap);)n=n.slice(0,n.length-i[0].length),r[i[0].toLowerCase()]=!0}return[n[2]===":"?n.slice(3):zn(n.slice(2)),r]}let pu=0;const AC=Promise.resolve(),LC=()=>pu||(AC.then(()=>pu=0),pu=Date.now());function IC(n,r){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;Qr(DC(i,t.value),r,5,[i])};return t.value=n,t.attached=LC(),t}function DC(n,r){if(Pe(r)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},r.map(i=>e=>!e._stopped&&i&&i(e))}else return r}const lp=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,zC=(n,r,t,i,e,o)=>{const s=e==="svg";r==="class"?TC(n,i,s):r==="style"?EC(n,t,i):hh(r)?wf(r)||kC(n,r,t,i,o):(r[0]==="."?(r=r.slice(1),!0):r[0]==="^"?(r=r.slice(1),!1):BC(n,r,i,s))?(op(n,r,i),!n.tagName.includes("-")&&(r==="value"||r==="checked"||r==="selected")&&np(n,r,i,s,o,r!=="value")):n._isVueCE&&(/[A-Z]/.test(r)||!xt(i))?op(n,Ir(r),i,o,r):(r==="true-value"?n._trueValue=i:r==="false-value"&&(n._falseValue=i),np(n,r,i,s))};function BC(n,r,t,i){if(i)return!!(r==="innerHTML"||r==="textContent"||r in n&&lp(r)&&ze(t));if(r==="spellcheck"||r==="draggable"||r==="translate"||r==="autocorrect"||r==="form"||r==="list"&&n.tagName==="INPUT"||r==="type"&&n.tagName==="TEXTAREA")return!1;if(r==="width"||r==="height"){const e=n.tagName;if(e==="IMG"||e==="VIDEO"||e==="CANVAS"||e==="SOURCE")return!1}return lp(r)&&xt(t)?!1:r in n}const sn=n=>{const r=n.props["onUpdate:modelValue"]||!1;return Pe(r)?t=>dl(r,t):r};function GC(n){n.target.composing=!0}function hp(n){const r=n.target;r.composing&&(r.composing=!1,r.dispatchEvent(new Event("input")))}const Rr=Symbol("_assign"),Mn={created(n,{modifiers:{lazy:r,trim:t,number:i}},e){n[Rr]=sn(e);const o=i||e.props&&e.props.type==="number";Mi(n,r?"change":"input",s=>{if(s.target.composing)return;let a=n.value;t&&(a=a.trim()),o&&(a=Cl(a)),n[Rr](a)}),t&&Mi(n,"change",()=>{n.value=n.value.trim()}),r||(Mi(n,"compositionstart",GC),Mi(n,"compositionend",hp),Mi(n,"change",hp))},mounted(n,{value:r}){n.value=r??""},beforeUpdate(n,{value:r,oldValue:t,modifiers:{lazy:i,trim:e,number:o}},s){if(n[Rr]=sn(s),n.composing)return;const a=(o||n.type==="number")&&!/^0\d/.test(n.value)?Cl(n.value):n.value,l=r??"";a!==l&&(document.activeElement===n&&n.type!=="range"&&(i&&r===t||e&&n.value.trim()===l)||(n.value=l))}},bt={deep:!0,created(n,r,t){n[Rr]=sn(t),Mi(n,"change",()=>{const i=n._modelValue,e=bo(n),o=n.checked,s=n[Rr];if(Pe(i)){const a=Tf(i,e),l=a!==-1;if(o&&!l)s(i.concat(e));else if(!o&&l){const h=[...i];h.splice(a,1),s(h)}}else if(Do(i)){const a=new Set(i);o?a.add(e):a.delete(e),s(a)}else s($_(n,o))})},mounted:up,beforeUpdate(n,r,t){n[Rr]=sn(t),up(n,r,t)}};function up(n,{value:r,oldValue:t},i){n._modelValue=r;let e;if(Pe(r))e=Tf(r,i.props.value)>-1;else if(Do(r))e=r.has(i.props.value);else{if(r===t)return;e=kn(r,$_(n,!0))}n.checked!==e&&(n.checked=e)}const Na={created(n,{value:r},t){n.checked=kn(r,t.props.value),n[Rr]=sn(t),Mi(n,"change",()=>{n[Rr](bo(n))})},beforeUpdate(n,{value:r,oldValue:t},i){n[Rr]=sn(i),r!==t&&(n.checked=kn(r,i.props.value))}},Dc={deep:!0,created(n,{value:r,modifiers:{number:t}},i){const e=Do(r);Mi(n,"change",()=>{const o=Array.prototype.filter.call(n.options,s=>s.selected).map(s=>t?Cl(bo(s)):bo(s));n[Rr](n.multiple?e?new Set(o):o:o[0]),n._assigning=!0,n_(()=>{n._assigning=!1})}),n[Rr]=sn(i)},mounted(n,{value:r}){cp(n,r)},beforeUpdate(n,r,t){n[Rr]=sn(t)},updated(n,{value:r}){n._assigning||cp(n,r)}};function cp(n,r){const t=n.multiple,i=Pe(r);if(!(t&&!i&&!Do(r))){for(let e=0,o=n.options.length;e<o;e++){const s=n.options[e],a=bo(s);if(t)if(i){const l=typeof a;l==="string"||l==="number"?s.selected=r.some(h=>String(h)===String(a)):s.selected=Tf(r,a)>-1}else s.selected=r.has(a);else if(kn(bo(s),r)){n.selectedIndex!==e&&(n.selectedIndex=e);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function bo(n){return"_value"in n?n._value:n.value}function $_(n,r){const t=r?"_trueValue":"_falseValue";return t in n?n[t]:r}const FC=kt({patchProp:zC},pC);let fp;function NC(){return fp||(fp=Hx(FC))}const HC=(...n)=>{const r=NC().createApp(...n),{mount:t}=r;return r.mount=i=>{const e=ZC(i);if(!e)return;const o=r._component;!ze(o)&&!o.render&&!o.template&&(o.template=e.innerHTML),e.nodeType===1&&(e.textContent="");const s=t(e,!1,jC(e));return e instanceof Element&&(e.removeAttribute("v-cloak"),e.setAttribute("data-v-app","")),s},r};function jC(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function ZC(n){return xt(n)?document.querySelector(n):n}const VC=ke({__name:"App",setup(n){return(r,t)=>{const i=_t("router-view");return he(),Ue(_C,{name:"fade",mode:"out-in"},{default:ue(()=>[Y(i)]),_:1})}}});function Pt(n){throw new Error(n)}function zf(n){throw new Error(`Unsupported: ${n}`)}function Ps(n,r){if(!n)throw new Error(`AssertionError: ${r}`)}function Ll(n){throw new Error(`Unexpected object: ${n}`)}const Dr=(...n)=>{};function Th(n,r){return n===r}function zc(n){return n}function U_(n){return new Promise((r,t)=>{setTimeout(r,n)})}function WC(n,r,t){const i=n.get(r);return i!==void 0?i:(n.set(r,t()),n.get(r))}function $C(n,r){return n.length==r.length&&n.every((t,i)=>t===r[i])}function UC(n,r){const t=new Map;for(const i of n)t.set(r(i),i);return t}function JC(n,r){const t={};for(const i of n)t[r(i)]=i;return t}function XC(n){return[...new Set(n)]}function YC(n,r){return[...new Map(n.map(t=>[r(t),t])).values()]}function qC(n,r,t=Th){const i=n.findIndex(e=>t(e,r));if(i!==-1)return n.splice(i,1,r)[0];n.push(r)}function KC(n,r,t=Th){if(!n.find(i=>t(i,r)))return n.push(r)}function QC(n,r){const t=n.indexOf(r);if(t!==-1)return n.splice(t,1)[0]}function J_(n,r,t=Th){return bh(n,i=>t(i,r))}function eT(n,r,t){const i=t(r);return bh(n,e=>t(e)===i)}function bh(n,r){const t=n.findIndex(r);if(t!==-1)return n.splice(t,1)[0]}const tT=bh,rT=J_;function iT(n,r,t){return r>t?(n.splice(t,0,n[r]),n.splice(r+1,1)):(n.splice(t+1,0,n[r]),n.splice(r,1)),n}function nT(n){return Array.isArray(n)?n[0]:n}function oT(n){return Array.isArray(n)?n[n.length-1]:n}function sT(n){return n==null||Array.isArray(n)?n:[n]}function aT(n,r,t){return Array.from({length:r-n+1},(i,e)=>t(e+n))}function lT(n,r){const t=new Map;for(const i of n)WC(t,r(i),()=>[]).push(i);return t}function hT(n){return n.length>0}async function uT(n,r){const t=[];for(let i=0;i<n.length;i++)t.push(await r(n[i],i));return t}var X_=Object.freeze({__proto__:null,asyncMap:uT,distinct:XC,distinctBy:YC,equals:$C,first:nT,fromRange:aT,groupBy:lT,isNotEmpty:hT,last:oT,move:iT,pushIfNotExists:KC,pushOrReplace:qC,remove:QC,removeBy:tT,removeByEquals:rT,removeIf:bh,removeItem:J_,removeItemBy:eT,toArray:sT,toMapByKey:UC,toRecordByKey:JC});function cT(n){const r=n.split(`
|
|
18
|
-
`).map(i=>i.trimEnd());for(;r.length&&!r[0];)r.shift();for(;r.length&&!r[r.length-1];)r.pop();const t=Math.min(...r.filter(i=>i).map(i=>{var e;return((e=i.match(/^\s*/))==null?void 0:e[0].length)??0}));return r.map(i=>i.slice(t)).join(`
|
|
19
|
-
`)}const fT=/^(\S+?)([a-z%]*)$/;function dT(n,r={}){var o,s;const t=fT.exec(n);if(!t)return;const i=+t[1];if(Number.isNaN(i))return;switch(t[2]){case"":case"px":return i;case"vh":return i*eo(((o=r.windowSize)==null?void 0:o.height)??0)/100;case"vw":return i*eo(((s=r.windowSize)==null?void 0:s.width)??0)/100;case"%":return i*eo(r.parentSize??0)/100;case"rem":return i*eo(r.rootFontSize??16);case"em":return i*eo(r.parentFontSize??16);default:return}}var gT=Object.freeze({__proto__:null,parseCssDimen:dT,trimIndent:cT});const pT={values(n){return Object.values(n)}},vT={basename(n,r){const t=n.endsWith("/")?n.slice(0,-1):n,i=t.lastIndexOf("/"),e=i>=0?t.substring(i+1):t;return r&&e.endsWith(r)?e.slice(0,-r.length):e},resolve(...n){let r="";for(let t of n.reverse())if(t.endsWith("/")&&(t=t.substring(0,t.length-1)),r=r?t+"/"+r:t,r.startsWith("/"))return r;return r}};var dp;(function(n){n[n.SECOND=1e3]="SECOND",n[n.MINUTE=6e4]="MINUTE",n[n.HOUR=36e5]="HOUR",n[n.DAY=864e5]="DAY"})(dp||(dp={}));function mT(n,r){return n===r?!0:JSON.stringify(n)===JSON.stringify(r)}var gp;(function(n){function r(a,l,h="children"){function u(c,f=!1){const d=[];for(const g of c){const p=g[h],m=f||l(g),v=p!=null?u(p,m):p;if(m||v!=null&&v.length){const _={...g};v!=null&&(_[h]=v),d.push(_)}}return d}return u(a)}n.searchFilter=r;function t(a,l,h="children",u=[]){return a.map(c=>({...c})).filter(c=>{const f=c[h],d=f&&t(f,l,h,[...u,c]);return d&&(c[h]=d),l(c,u)||(d==null?void 0:d.length)})}n.filter=t;function i(a,l,h="children",u=[]){return a.map((c,f)=>{const d=c[h],g=d&&i(d,l,h,[...u,c]);return l(c,g,u,f)})}n.map=i;function e(a,l,h="children",u=[]){for(const c of a){l(c,u);const f=c[h];f!=null&&f.length&&e(f,l,h,[...u,c])}}n.forEach=e;function o(a,l,h="children",u=[]){for(const c of a){const f=c[h];f!=null&&f.length&&o(f,l,h,[...u,c])}return a.sort((c,f)=>l(c,f,u)),a}n.sort=o;function s(a,l,h="children",u=[]){for(const c of a){if(l(c,u))return c;const f=c[h];if(f!=null&&f.length){const d=s(f,l,h,[...u,c]);if(d)return d}}}n.find=s})(gp||(gp={}));/*!
|
|
20
|
-
* maptalks v1.7.1
|
|
21
|
-
* LICENSE : BSD-3-Clause
|
|
22
|
-
* (c) 2016-2025 maptalks.org
|
|
23
|
-
*/var Y_="1.7.1",Ct=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"&&!process.versions.electron&&!process.versions.nw&&!process.versions["node-webkit"];function Il(){return typeof globalThis<"u"?globalThis:global||self}function q_(n){var r=Il().maptalksversion;if(r)throw new Error("Disallow duplicate imports of maptalks version "+n+" and "+r);Il().maptalksversion=n}var wr={isTest:!1,idleLog:!1,idleForceTimeThreshold:48,workerCount:Il().MAPTALKS_WORKER_COUNT||0,messagePostRatioPerWorker:.3,maxFPS:0,crsMaxNativeZoom:22};function He(){return Date.now()}function oe(n,...r){for(var t=0;t<r.length;t++){var i=r[t];for(var e in i)n[e]=i[e]}return n}function O(n){return n==null}function X(n){return typeof n=="number"&&!isNaN(n)}function Tn(n){return(n|0)===n}function Xt(n){return typeof n=="object"&&!!n}function Ee(n){return O(n)?!1:typeof n=="string"||n.constructor!==null&&n.constructor===String}function Oe(n){return O(n)?!1:typeof n=="function"||n.constructor!==null&&n.constructor===Function}var _T=Object.prototype.hasOwnProperty;function Bo(n,r){return _T.call(n,r)}function yT(n,r){return n.join?n.join(r||","):Array.prototype.join.call(n,r||",")}function wT(n){var r;for(r in n)return!1;return!r}var K_=Math.PI/180;function mt(n){return n*K_}function Bf(n){return n/K_}var ro={};function pp(){return window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI}if(!Ct){var Nr=navigator.userAgent.toLowerCase(),vu=document.documentElement||{style:{}},Nn="ActiveXObject"in window,mu=Nr.indexOf("webkit")!==-1,_u=Nr.indexOf("phantom")!==-1,vp=Nr.search("android [23]")!==-1,yu=Nr.indexOf("chrome")!==-1,mp=Nr.indexOf("gecko")!==-1&&!mu&&!window.opera&&!Nn,xT=/iphone/i.test(Nr)&&/micromessenger/i.test(Nr),$o=typeof orientation<"u"||Nr.indexOf("mobile")!==-1,_p=!window.PointerEvent&&window.MSPointerEvent,yp=window.PointerEvent&&navigator.pointerEnabled||_p,wp=Nn&&"transition"in vu.style,wu="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!vp,xp="MozPerspective"in vu.style,Cp="OTransition"in vu.style,CT=(wp||wu||xp)&&!Cp&&!_u,TT=typeof window<"u"&&Oe(window.createImageBitmap),bT=typeof window<"u"&&Oe(window.ResizeObserver),MT=typeof window<"u"&&Oe(window.btoa),PT=typeof window<"u"&&Oe(window.Proxy),ET=typeof window<"u"&&Oe(window.requestIdleCallback),ST=typeof globalThis.scheduler<"u"&&typeof globalThis.scheduler=="object",OT=typeof CanvasRenderingContext2D<"u"&&Oe(CanvasRenderingContext2D.prototype.roundRect),Tp=0;yu&&(Tp=Nr.match(/chrome\/([\d.]+)/)[1]);var kT=!_u&&(yp||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),RT=typeof window<"u"&&"WebGLRenderingContext"in window,bp=pp(),xu=!1;try{var AT=new OffscreenCanvas(2,2);AT.getContext("2d"),xu=!0}catch{xu=!1}var Mp=!1;try{var Pp=Object.defineProperty({},"passive",{get:function(){Mp=!0}});window.addEventListener("testPassive",null,Pp),window.removeEventListener("testPassive",null,Pp)}catch{}ro={IS_NODE:Ct,isTest:!1,ie:Nn,ielt9:Nn&&!document.addEventListener,edge:"msLaunchUri"in navigator&&!("documentMode"in document),webkit:mu,gecko:mp,android:Nr.indexOf("android")!==-1,android23:vp,chrome:yu,chromeVersion:Tp,safari:!yu&&Nr.indexOf("safari")!==-1,phantomjs:_u,ie3d:wp,webkit3d:wu,gecko3d:xp,opera12:Cp,any3d:CT,iosWeixin:xT,mobile:$o,mobileWebkit:$o&&mu,mobileWebkit3d:$o&&wu,mobileOpera:$o&&window.opera,mobileGecko:$o&&mp,touch:!!kT,msPointer:!!_p,pointer:!!yp,retina:bp>1,devicePixelRatio:bp,language:navigator.browserLanguage?navigator.browserLanguage:navigator.language,ie9:Nn&&document.documentMode===9,ie10:Nn&&document.documentMode===10,webgl:RT,imageBitMap:TT,roundRect:OT,resizeObserver:bT,btoa:MT,decodeImageInWorker:xu,monitorDPRChange:!0,supportsPassive:Mp,proxy:PT,requestIdleCallback:ET,scheduler:ST,checkDevicePixelRatio:function(){if(typeof window<"u"&&ro.monitorDPRChange){var r=pp(),t=r!==ro.devicePixelRatio;return t&&(ro.devicePixelRatio=r),t}return!1}},ro.roundRect||console.warn("current env the canvas not support roundRect")}var Ce=ro;function Ep(n,r){(r==null||r>n.length)&&(r=n.length);for(var t=0,i=Array(r);t<r;t++)i[t]=n[t];return i}function Gf(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function LT(n,r,t){if(Q_())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,r);var e=new(n.bind.apply(n,i));return t&&Ws(e,t.prototype),e}function IT(n,r){for(var t=0;t<r.length;t++){var i=r[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,GT(i.key),i)}}function DT(n,r,t){return r&&IT(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n}function Sp(n,r){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t)return(t=t.call(n)).next.bind(t);if(Array.isArray(n)||(t=FT(n))||r){t&&(n=t);var i=0;return function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
24
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bc(n){return Bc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bc(n)}function Q(n,r){n.prototype=Object.create(r.prototype),n.prototype.constructor=n,Ws(n,r)}function zT(n){try{return Function.toString.call(n).indexOf("[native code]")!==-1}catch{return typeof n=="function"}}function Q_(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q_=function(){return!!n})()}function Gc(){Gc=function(){return r};var n,r={},t=Object.prototype,i=t.hasOwnProperty,e=Object.defineProperty||function(I,A,k){I[A]=k.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function h(I,A,k){return Object.defineProperty(I,A,{value:k,enumerable:!0,configurable:!0,writable:!0}),I[A]}try{h({},"")}catch{h=function(A,k,Z){return A[k]=Z}}function u(I,A,k,Z){var W=A&&A.prototype instanceof v?A:v,re=Object.create(W.prototype),se=new N(Z||[]);return e(re,"_invoke",{value:S(I,k,se)}),re}function c(I,A,k){try{return{type:"normal",arg:I.call(A,k)}}catch(Z){return{type:"throw",arg:Z}}}r.wrap=u;var f="suspendedStart",d="suspendedYield",g="executing",p="completed",m={};function v(){}function _(){}function y(){}var w={};h(w,s,function(){return this});var x=Object.getPrototypeOf,C=x&&x(x(G([])));C&&C!==t&&i.call(C,s)&&(w=C);var b=y.prototype=v.prototype=Object.create(w);function E(I){["next","throw","return"].forEach(function(A){h(I,A,function(k){return this._invoke(A,k)})})}function T(I,A){function k(W,re,se,me){var ge=c(I[W],I,re);if(ge.type!=="throw"){var de=ge.arg,_e=de.value;return _e&&typeof _e=="object"&&i.call(_e,"__await")?A.resolve(_e.__await).then(function(Te){k("next",Te,se,me)},function(Te){k("throw",Te,se,me)}):A.resolve(_e).then(function(Te){de.value=Te,se(de)},function(Te){return k("throw",Te,se,me)})}me(ge.arg)}var Z;e(this,"_invoke",{value:function(W,re){function se(){return new A(function(me,ge){k(W,re,me,ge)})}return Z=Z?Z.then(se,se):se()}})}function S(I,A,k){var Z=f;return function(W,re){if(Z===g)throw Error("Generator is already running");if(Z===p){if(W==="throw")throw re;return{value:n,done:!0}}for(k.method=W,k.arg=re;;){var se=k.delegate;if(se){var me=B(se,k);if(me){if(me===m)continue;return me}}if(k.method==="next")k.sent=k._sent=k.arg;else if(k.method==="throw"){if(Z===f)throw Z=p,k.arg;k.dispatchException(k.arg)}else k.method==="return"&&k.abrupt("return",k.arg);Z=g;var ge=c(I,A,k);if(ge.type==="normal"){if(Z=k.done?p:d,ge.arg===m)continue;return{value:ge.arg,done:k.done}}ge.type==="throw"&&(Z=p,k.method="throw",k.arg=ge.arg)}}}function B(I,A){var k=A.method,Z=I.iterator[k];if(Z===n)return A.delegate=null,k==="throw"&&I.iterator.return&&(A.method="return",A.arg=n,B(I,A),A.method==="throw")||k!=="return"&&(A.method="throw",A.arg=new TypeError("The iterator does not provide a '"+k+"' method")),m;var W=c(Z,I.iterator,A.arg);if(W.type==="throw")return A.method="throw",A.arg=W.arg,A.delegate=null,m;var re=W.arg;return re?re.done?(A[I.resultName]=re.value,A.next=I.nextLoc,A.method!=="return"&&(A.method="next",A.arg=n),A.delegate=null,m):re:(A.method="throw",A.arg=new TypeError("iterator result is not an object"),A.delegate=null,m)}function L(I){var A={tryLoc:I[0]};1 in I&&(A.catchLoc=I[1]),2 in I&&(A.finallyLoc=I[2],A.afterLoc=I[3]),this.tryEntries.push(A)}function D(I){var A=I.completion||{};A.type="normal",delete A.arg,I.completion=A}function N(I){this.tryEntries=[{tryLoc:"root"}],I.forEach(L,this),this.reset(!0)}function G(I){if(I||I===""){var A=I[s];if(A)return A.call(I);if(typeof I.next=="function")return I;if(!isNaN(I.length)){var k=-1,Z=function W(){for(;++k<I.length;)if(i.call(I,k))return W.value=I[k],W.done=!1,W;return W.value=n,W.done=!0,W};return Z.next=Z}}throw new TypeError(typeof I+" is not iterable")}return _.prototype=y,e(b,"constructor",{value:y,configurable:!0}),e(y,"constructor",{value:_,configurable:!0}),_.displayName=h(y,l,"GeneratorFunction"),r.isGeneratorFunction=function(I){var A=typeof I=="function"&&I.constructor;return!!A&&(A===_||(A.displayName||A.name)==="GeneratorFunction")},r.mark=function(I){return Object.setPrototypeOf?Object.setPrototypeOf(I,y):(I.__proto__=y,h(I,l,"GeneratorFunction")),I.prototype=Object.create(b),I},r.awrap=function(I){return{__await:I}},E(T.prototype),h(T.prototype,a,function(){return this}),r.AsyncIterator=T,r.async=function(I,A,k,Z,W){W===void 0&&(W=Promise);var re=new T(u(I,A,k,Z),W);return r.isGeneratorFunction(A)?re:re.next().then(function(se){return se.done?se.value:re.next()})},E(b),h(b,l,"Generator"),h(b,s,function(){return this}),h(b,"toString",function(){return"[object Generator]"}),r.keys=function(I){var A=Object(I),k=[];for(var Z in A)k.push(Z);return k.reverse(),function W(){for(;k.length;){var re=k.pop();if(re in A)return W.value=re,W.done=!1,W}return W.done=!0,W}},r.values=G,N.prototype={constructor:N,reset:function(I){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(D),!I)for(var A in this)A.charAt(0)==="t"&&i.call(this,A)&&!isNaN(+A.slice(1))&&(this[A]=n)},stop:function(){this.done=!0;var I=this.tryEntries[0].completion;if(I.type==="throw")throw I.arg;return this.rval},dispatchException:function(I){if(this.done)throw I;var A=this;function k(ge,de){return re.type="throw",re.arg=I,A.next=ge,de&&(A.method="next",A.arg=n),!!de}for(var Z=this.tryEntries.length-1;Z>=0;--Z){var W=this.tryEntries[Z],re=W.completion;if(W.tryLoc==="root")return k("end");if(W.tryLoc<=this.prev){var se=i.call(W,"catchLoc"),me=i.call(W,"finallyLoc");if(se&&me){if(this.prev<W.catchLoc)return k(W.catchLoc,!0);if(this.prev<W.finallyLoc)return k(W.finallyLoc)}else if(se){if(this.prev<W.catchLoc)return k(W.catchLoc,!0)}else{if(!me)throw Error("try statement without catch or finally");if(this.prev<W.finallyLoc)return k(W.finallyLoc)}}}},abrupt:function(I,A){for(var k=this.tryEntries.length-1;k>=0;--k){var Z=this.tryEntries[k];if(Z.tryLoc<=this.prev&&i.call(Z,"finallyLoc")&&this.prev<Z.finallyLoc){var W=Z;break}}W&&(I==="break"||I==="continue")&&W.tryLoc<=A&&A<=W.finallyLoc&&(W=null);var re=W?W.completion:{};return re.type=I,re.arg=A,W?(this.method="next",this.next=W.finallyLoc,m):this.complete(re)},complete:function(I,A){if(I.type==="throw")throw I.arg;return I.type==="break"||I.type==="continue"?this.next=I.arg:I.type==="return"?(this.rval=this.arg=I.arg,this.method="return",this.next="end"):I.type==="normal"&&A&&(this.next=A),m},finish:function(I){for(var A=this.tryEntries.length-1;A>=0;--A){var k=this.tryEntries[A];if(k.finallyLoc===I)return this.complete(k.completion,k.afterLoc),D(k),m}},catch:function(I){for(var A=this.tryEntries.length-1;A>=0;--A){var k=this.tryEntries[A];if(k.tryLoc===I){var Z=k.completion;if(Z.type==="throw"){var W=Z.arg;D(k)}return W}}throw Error("illegal catch attempt")},delegateYield:function(I,A,k){return this.delegate={iterator:G(I),resultName:A,nextLoc:k},this.method==="next"&&(this.arg=n),m}},r}function Ws(n,r){return Ws=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},Ws(n,r)}function BT(n,r){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,r);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function GT(n){var r=BT(n,"string");return typeof r=="symbol"?r:r+""}function FT(n,r){if(n){if(typeof n=="string")return Ep(n,r);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ep(n,r):void 0}}function Fc(n){var r=typeof Map=="function"?new Map:void 0;return Fc=function(t){if(t===null||!zT(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(r!==void 0){if(r.has(t))return r.get(t);r.set(t,i)}function i(){return LT(t,arguments,Bc(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ws(i,t)},Fc(n)}var ey=function(){function n(t,i,e){if(!O(t)&&!O(i)?(this.x=+t,this.y=+i,this.z=e):!O(t.x)&&!O(t.y)?(this.x=+t.x,this.y=+t.y,this.z=t.z):Array.isArray(t)&&(this.x=+t[0],this.y=+t[1],this.z=t[2]),this._isNaN())throw new Error("Position is NaN")}var r=n.prototype;return r.set=function(i,e,o){return this.x=i,this.y=e,this.z=o||0,this},r._abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this},r._round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},r._ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},r.distanceTo=function(i){var e=i.x-this.x,o=i.y-this.y;return Math.sqrt(e*e+o*o)},r.mag=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r._floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},r._add=function(i,e){return O(i.x)?O(i[0])?(this.x+=i,this.y+=e):(this.x+=i[0],this.y+=i[1]):(this.x+=i.x,this.y+=i.y),this},r._sub=function(i,e){return O(i.x)?O(i[0])?(this.x-=i,this.y-=e):(this.x-=i[0],this.y-=i[1]):(this.x-=i.x,this.y-=i.y),this},r._substract=function(i,e){return X(e)?this._sub(i,e):this._sub(i)},r.substract=function(i,e){return this.sub(i,e)},r._multi=function(i){return this.x*=i,this.y*=i,this},r.div=function(i){return this.multi(1/i)},r._div=function(i){return this._multi(1/i)},r._isNaN=function(){return isNaN(this.x)||isNaN(this.y)||X(this.z)&&isNaN(this.z)},r.isZero=function(){return this.x===0&&this.y===0},r.toArray=function(){return X(this.z)?[this.x,this.y,this.z]:[this.x,this.y]},r.toJSON=function(){var i={x:this.x,y:this.y};return X(this.z)&&(i.z=this.z),i},n}(),z=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.closeTo=function(e,o){return o||(o=0),this.x>=e.x-o&&this.x<=e.x+o&&this.y>=e.y-o&&this.y<=e.y+o},t.unit=function(){return this.copy()._unit()},t._unit=function(){return this._div(this.mag()),this},t.perp=function(){return this.copy()._perp()},t._perp=function(){return[this.x,this.y]=[-this.y,this.x],this},t.angleWith=function(e){return this.angleWithSep(e.x,e.y)},t.angleWithSep=function(e,o){return Math.atan2(this.x*o-this.y*e,this.x*e+this.y*o)},t._rotate=function(e){var o=Math.cos(e),s=Math.sin(e),a=o*this.x-s*this.y,l=s*this.x+o*this.y;return this.x=a,this.y=l,this},t.rotate=function(e){return this.copy()._rotate(e)},t.abs=function(){return new r(Math.abs(this.x),Math.abs(this.y))},t.round=function(){return new r(Math.round(this.x),Math.round(this.y))},t.ceil=function(){return new r(Math.ceil(this.x),Math.ceil(this.y))},t.floor=function(){return new r(Math.floor(this.x),Math.floor(this.y))},t.copy=function(){return new r(this.x,this.y,this.z)},t.toFixed=function(e){return new r(this.x.toFixed(e),this.y.toFixed(e),X(this.z)?this.z.toFixed(e):void 0)},t.add=function(e,o){var s,a;return O(e.x)?O(e[0])?(s=this.x+e,a=this.y+o):(s=this.x+e[0],a=this.y+e[1]):(s=this.x+e.x,a=this.y+e.y),new r(s,a)},t.sub=function(e,o){var s,a;return O(e.x)?O(e[0])?(s=this.x-e,a=this.y-o):(s=this.x-e[0],a=this.y-e[1]):(s=this.x-e.x,a=this.y-e.y),new r(s,a)},t.multi=function(e){return new r(this.x*e,this.y*e)},t.equals=function(e){return e instanceof this.constructor?this.x===e.x&&this.y===e.y&&this.z===e.z:!1},r}(ey),ai,$s;(function(){if(Ct){ai=function(r){return setTimeout(r,16)},$s=clearTimeout;return}ai=function(r){return requestAnimationFrame(r)},$s=function(r){return cancelAnimationFrame(r)}})();function Si(n){var r="data:image/svg+xml";return n.length>4&&n.slice(-4)===".svg"?1:n.slice(0,r.length)===r?2:0}function Us(n,r){if(Ct&&Us.node){Us.node(n,r);return}n.src=r[0]}var NT=0;function ui(){return NT++}var ty=ui;function Js(n){return!n||!Ee(n)?n:JSON.parse(n)}function Yt(...n){for(var r=n[0],t=1;t<n.length;t++){var i=n[t];if(i&&i.length)for(var e=0,o=i.length;e<o;e++)r.push(i[e])}return r.length}function ry(...n){for(var r=[],t=-1,i=0;i<n.length;i++){var e=n[i];if(e&&e.length)for(var o=0,s=e.length;o<s;o++)r[++t]=e[o]}return r}function Dl(n,r){var t=r.indexOf(n);t>-1&&r.splice(t,1)}function Rn(n,r,t){if(!Array.isArray(n))return t?r.call(t,n):r(n);for(var i=[],e,o,s=0,a=n.length;s<a;s++){if(e=n[s],O(e)){i.push(null);continue}Array.isArray(e)?i.push(Rn(e,r,t)):(o=t?r.call(t,e):r(e),i.push(o))}return i}function pe(n,r){return n===void 0?r:n}function ir(n){return Math.sign?Math.sign(n):(n=+n,n===0||isNaN(n)?Number(n):n>0?1:-1)}function HT(n){if(Math.log2)return Math.log2(n);var r=Math.log(n)*Math.LOG2E,t=Math.round(r);return Math.abs(t-r)<1e-14?t:r}function zl(n,r,t){return n*(1-t)+r*t}function An(n,r,t){if(n===t||n===r)return n;var i=t-r,e=((n-r)%i+i)%i+r;return e}function Bl(n,r,t){return Math.min(t,Math.max(r,n))}function $e(n){return Array.isArray(n)&&n.length>0}var jT=/^([a-z][a-z\d+\-.]*:)?\/\//i;function iy(n){return jT.test(n)}var ny=/^url\((['"])(.+)\1\)$/i,oy=/^url\(([^'"].*[^'"])\)$/i;function sy(n){return Ee(n)?oy.test(n)?1:ny.test(n)?2:3:0}function Mh(n){var r=sy(n),t;return r===3?n:r===1?(t=oy.exec(n),t[1]):r===2?(t=ny.exec(n),t[2]):n}var ZT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function ay(n){if(Ce.btoa)return window.btoa(n);for(var r=String(n),t="",i,e,o=0,s=ZT;r.charAt(o|0)||(s="=",o%1);t+=s.charAt(63&i>>8-o%1*8)){if(e=r.charCodeAt(o+=3/4),e>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");i=i<<8|e}return t}function ly(n,r){for(var t=atob(n),i=new ArrayBuffer(t.length),e=new Uint8Array(i),o=0;o<t.length;o++)e[o]=t.charCodeAt(o)&255;var s=new Blob([i],{type:r});return s}function Gl(n,r,t,i){var e=t-n,o=i-r;return Math.atan2(o,e)}var Ff="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";function Fl(n,r){if(!n&&!r)return!0;if(!n||!r)return!1;for(var t in n)if(t==="center"){if(!r[t]||!Op(n[t][0],r[t][0])||!Op(n[t][1],r[t][1]))return!1}else if(n[t]!==r[t])return!1;return!0}function Op(n,r,t){return t==null&&(t=1e-6),n>=r-t&&n<=r+t}function Nf(n=100,r=4,t=null,i=null){n||(n=100),r||(r=4);var e=this,o=this.isVisible();r*=2,this._flashTimeout&&clearTimeout(this._flashTimeout);function s(){if(r===0){o?e.show():e.hide(),t&&(i?t.call(i):t());return}r%2===0?e.hide():e.show(),r--,e._flashTimeout=setTimeout(s,n)}return this._flashTimeout=setTimeout(s,n),this}function VT(n,r){for(var t=Object.getOwnPropertyNames(r),i=0;i<t.length;i++){var e=t[i],o=Object.getOwnPropertyDescriptor(r,e);o&&o.configurable&&n[e]===void 0&&Object.defineProperty(n,e,o)}return n}function Xs(n=[],r="_pt"){for(var t=[],i=0,e=n.length;i<e;i++){var o=n[i];if(!o){t.push(null);continue}o[r]||(o[r]=new z(0,0));var s=o[r];s.x=0,s.y=0,t.push(s)}return t}function Hf(n,r){r(n.data)}function Ph(n){if(n&&n.indexOf("http://")===0||n.indexOf("https://")===0)return n;var r=document.createElement("a");return r.href=n,n=r.href,r=null,n}var Uo={cssWidth:"1px",cssHeight:"1px",width:1,height:1};function Eh(n,r=1){var{width:t,height:i}=n;return Uo.cssWidth=t+"px",Uo.cssHeight=i+"px",Uo.width=Math.round(t*r),Uo.height=Math.round(i*r),Uo}function WT(n){return n===204||n>=400&&n<500||n===501}var xa="_maptalks__internal_layer_",hy=["MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"],jf=["FeatureCollection","Feature","Point","LineString","Polygon"].concat(hy),uy=["markerFile","polygonPatternFile","linePatternFile","markerFillPatternFile","markerLinePatternFile"],$T=[["markerWidth","markerHeight"],[],[null,"lineWidth"],[],[null,"markerLineWidth"]],UT={lineWidth:1,lineOpacity:1,lineDx:1,lineDy:1,polygonOpacity:1,markerWidth:1,markerHeight:1,markerDx:1,markerDy:1,markerOpacity:1,markerFillOpacity:1,markerLineWidth:1,markerLineOpacity:1,textSize:1,textOpacity:1,textHaloRadius:1,textWrapWidth:1,textLineSpacing:1,textDx:1,textDy:1},JT=["lineColor","polygonFill","markerFill","markerLineColor","textFill"],cy=14,ft=function(){function n(t,i){X(t)&&X(i)?(this.width=t,this.height=i):X(t.width)?(this.width=t.width,this.height=t.height):Array.isArray(t)&&(this.width=t[0],this.height=t[1])}var r=n.prototype;return r.copy=function(){return new n(this.width,this.height)},r.add=function(i,e){var o,s;return i instanceof n?(o=this.width+i.width,s=this.height+i.height):(o=this.width+i,s=this.height+e),new n(o,s)},r.equals=function(i){return this.width===i.width&&this.height===i.height},r.multi=function(i){return new n(this.width*i,this.height*i)},r._multi=function(i){return this.width*=i,this.height*=i,this},r._round=function(){return this.width=Math.round(this.width),this.height=Math.round(this.height),this},r.toPoint=function(){return new z(this.width,this.height)},r.toArray=function(){return[this.width,this.height]},r.toJSON=function(){return{width:this.width,height:this.height}},n}(),Pi="";function Sh(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function Zf(n,r,t){if(!n)return n;for(;n.indexOf(r)>-1;)n=n.replace(r,t);return n}var XT=/[\b\t\r\v\f]/igm;function Ca(n){return Ee(n)?n.replace(XT,Pi):n}function Vf(n){return Sh(n).split(/\s+/)}var kp=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;function Oi(n,r){return Oi.node?Oi.node(n,r):(kp.font=r,kp.measureText(n).width)}function Oh(n,r,t){var i=Oi(n,r);return new ft(i,t||cy)}function Nl(n,r,t,i){if(!n||n.length===0)return[{text:"",width:0}];var e=O(i)?Oi(n,r):i,o=e/n.length,s=Math.floor(t/o/2);if(o>=t||s<=0)return[{text:"",width:t}];if(e<=t)return[{text:n,width:e}];for(var a=[],l=n.substring(0,s),h=o*s,u=s,c=n.length;u<c;u++){var f=n[u],d=Oi(l+f);d>=t?(a.push({text:l,width:h}),l=n.substring(u,s+u),u+=s-1,h=o*s):(l+=f,h=d),u>=c-1&&(h=Oi(l),a.push({text:l,width:h}))}return a}var fy=["{","}"];function Ys(n,r){if(!Ee(n))return n;var[t,i]=fy;if(n.indexOf(t)===-1&&n.indexOf(i)===-1)return n;function e(u){if(!r)return Pi;var c=r[u];return O(c)?Pi:Array.isArray(c)?c.join():c}for(var o=YT(n),s=0,a=o.length;s<a;s++){var l=o[s],h=e(l);n=Zf(n,""+t+l+i,h)}return n}function YT(n){n+=Pi;for(var[r,t]=fy,i=[],e=!1,o=Pi,s=0,a=n.length;s<a;s++){var l=n[s];!e&&l===r&&(e=!0),l===r&&e&&(o=Pi),e&&l!==r&&l!==t&&(o+=l),l===t&&o&&(e=!1,i.push(o),o=Pi)}return i}function qs(n,r){X(n)&&(n+=""),n=n||"";var t=r.textMaxHeight||0,i=kh(n,r);return t&&t<i.size.height&&(i.size.height=t),i}function li(n,r,t){var i=n.width,e=n.height,o,s;return r==="left"?o=-i:r==="right"?o=0:o=-i/2,t==="top"?s=-e:t==="bottom"?s=0:s=-e/2,new z(o,s)}var Wf="sans-serif",$f=14;function Ta(n){if(n.textFont)return n.textFont;var r=n.textSize;return O(r)&&(r=$f),(n.textStyle&&n.textStyle!=="normal"?n.textStyle+" ":"")+(n.textWeight&&n.textWeight!=="normal"?n.textWeight+" ":"")+r+"px "+(n.textFaceName&&qT(n.textFaceName)||Wf)}function qT(n){for(var r=n.split(","),t=0;t<r.length;t++)r[t].trim&&(r[t]=r[t].trim()),r[t].indexOf(" ")>0&&r[t][0]!=='"'&&r[t][0]!=="'"&&(r[t]='"'+r[t]+'"');return r.join(",")}function kh(n,r){var t=Ta(r),i=r.textLineSpacing||0,e=Oh(n,t,r.textSize),o=e.width,s=e.height,a=r.textWrapCharacter||`
|
|
25
|
-
`,l=[],h=r.textWrapWidth;(!h||h>o)&&(h=o),Ee(n)||(n+="");var u=0;if(n.indexOf(a)>=0)for(var c=n.split(a),f=0,d=c.length;f<d;f++){var g=c[f],p=Oi(g,t);if(p>h)for(var m=Nl(g,t,h,p),v=0,_=m.length;v<_;v++){var y=m[v].width;y>u&&(u=y),l.push({text:m[v].text,size:new ft(y,s)})}else p>u&&(u=p),l.push({text:g,size:new ft(p,s)})}else if(o>h)for(var w=Nl(n,t,h,o),x=0;x<w.length;x++){var C=w[x].width;C>u&&(u=C),l.push({text:w[x].text,size:new ft(C,s)})}else o>u&&(u=o),l.push({text:n,size:e});var b=l.length,E=new ft(u,s*b+i*(b-1));return{total:b,size:E,rows:l,rawSize:e}}function Rh(n){var r=0,t=n&&n.length||0;if(!t)return r;for(var i,e=0;e<t;e++)i=n.charCodeAt(e),r=(r<<5)-r+i,r=r&r;return r}var Rp=Object.freeze({__proto__:null,DEFAULT_FONT:Wf,DEFAULT_TEXTSIZE:$f,EMPTY_STRING:Pi,describeText:qs,escapeSpecialChars:Ca,getAlignPoint:li,getFont:Ta,hashCode:Rh,replaceAll:Zf,replaceVariable:Ys,splitContent:Nl,splitTextToRow:kh,splitWords:Vf,stringLength:Oh,stringWidth:Oi,trim:Sh}),KT=function(r){return r[0]},Ah=Ct?KT:function(n){for(var r=document.documentElement&&document.documentElement.style||{},t=0;t<n.length;t++)if(n[t]in r)return n[t];return!1},io=Ah(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),QT=Ah(["transformOrigin","WebkitTransformOrigin","OTransformOrigin","MozTransformOrigin","msTransformOrigin"]),Ha=Ah(["transition","WebkitTransition","OTransition","MozTransition","msTransition"]);Ah(["filter","WebkitFilter","OFilter","MozFilter","msFilter"]);function we(n,r){var t=document.createElement(n);return r&&Uf(t,r),t}function Ap(n,r,t){var i=we(n);return r&&Ih(i,r),t&&t.appendChild(i),i}function Ln(n){if(!n)return this;if(Ce.ielt9||Ce.ie9){var r=we("div");r.appendChild(n),r.innerHTML="",r=null}else n.parentNode&&n.parentNode.removeChild(n);return this}function Jr(n,r,t,i){if(!n||!n.addEventListener||!r||!t)return this;for(var e=function(u){u||(u=window.event),t.call(i||n,u)},o=r.split(" "),s=o.length-1;s>=0;s--){var a=o[s];if(a){n["Z__"+a]||(n["Z__"+a]=[]);var l=dy(n,a,t);l>=0&&(console.warn(n,"find '"+a+"' handler:",t," The old listener function will be removed"),In(n,a,t)),n["Z__"+a].push({callback:e,src:t}),n.addEventListener(a,e,Ce.supportsPassive?{capture:!1,passive:!1}:!1)}}return this}function In(n,r,t){function i(f,d){f==="mousewheel"&&Ce.gecko&&(f="DOMMouseScroll"),n.removeEventListener(f,d,!1)}if(!n||!n.removeEventListener||!r)return this;for(var e=r.split(" "),o=e.length-1;o>=0;o--){var s=e[o];if(s){if(!t&&n["Z__"+s]){for(var a=n["Z__"+s],l=0,h=a.length;l<h;l++)i(a[l].callback);return delete n["Z__"+s],this}var u=dy(n,s,t);if(u<0)return this;var c=n["Z__"+s][u];i(s,c.callback),n["Z__"+s].splice(u,1)}}return this}function dy(n,r,t){if(!n||!n["Z__"+r]||!t)return-1;for(var i=n["Z__"+r],e=0,o=i.length;e<o;e++)if(i[e].src===t)return e;return-1}function hi(n){return n.preventDefault?n.preventDefault():n.returnValue=!1,this}function nr(n){return n._cancelBubble=!0,n.stopPropagation?n.stopPropagation():n.cancelBubble=!0,this}function eb(n){return n.onselectstart=function(){return!1},n.ondragstart=function(){return!1},n.setAttribute("unselectable","on"),this}function ja(n,r){return n?(Ce.any3d?rb(n,r):(n.style.left=r.x+"px",n.style.top=r.y+"px"),r):null}function Lh(n){var r=window.getComputedStyle(n),t=[parseInt(r["padding-left"]),parseInt(r["padding-top"])],i=n.getBoundingClientRect(),e=n.offsetWidth,o=n.offsetHeight,s=e?i.width/e:1,a=o?i.height/o:1;return n.__position=[i.left+t[0],i.top+t[1],s,a],n.__position}function yr(n,r){n||(n=window.event);var t=r.__position;t||(t=Lh(r));var i=n;return i.touches&&i.touches.length&&(n=i.touches[0]),i.changedTouches&&i.changedTouches.length&&(n=i.changedTouches[0]),n=n,new z((n.clientX-t[0]-r.clientLeft)/t[2],(n.clientY-t[1]-r.clientTop)/t[3])}function tb(n,r){var t=n.length-r.length;return t>=0&&n.indexOf(r,t)===t}function Ih(n,r){var t=n.style.cssText;return tb(t,";")||(t+=";"),n.style.cssText=t+r,this}function gy(n,r){if(n.classList!==void 0)return n.classList.contains(r);var t=py(n);return t.length>0&&new RegExp("(^|\\s)"+r+"(\\s|$)").test(t)}function mo(n,r){if(n.classList!==void 0&&!gy(n,r))for(var t=Vf(r),i=0,e=t.length;i<e;i++)n.classList.add(t[i]);else{var o=py(n);Uf(n,(o?o+" ":"")+r)}return this}function Uf(n,r){return O(n.className.baseVal)?n.className=r:n.className.baseVal=r,this}function py(n){return O(n.className.baseVal)?n.className:n.className.baseVal}function rb(n,r){var t=r||new z(0,0);return n.style[io]=Ce.any3d?"translate3d("+t.x+"px,"+t.y+"px,0px)":"translate("+t.x+"px,"+t.y+"px)",this}function ib(n){return/<[a-z\][\s\S]*>/i.test(n)}function nb(n,r){var t=ob(n);Ee(r)?t.innerHTML=r:t.appendChild(r);var i=new ft(t.clientWidth,t.clientHeight);return Ln(t),i}function ob(n){var r=document.createElement(n);return r.style.cssText="position:absolute;left:-10000px;top:-10000px;",document.body.appendChild(r),r}var vt=Jr,yt=In;function Hl(n){return n&&(n==="mousemove"||n==="touchmove")}var vy=48;function my(n,r){var t=He(),i=r||vy;return n._mousemoveTime&&t-n._mousemoveTime<i?!0:(n._mousemoveTime=t,!1)}var Zt={jsonp:function(r,t){var i="_maptalks_jsonp_"+ui();r.match(/\?/)?r+="&callback="+i:r+="?callback="+i;var e=document.createElement("script");return e.type="text/javascript",e.src=r,window[i]=function(o){t(null,o),document.getElementsByTagName("head")[0].removeChild(e),e=null,delete window[i]},document.getElementsByTagName("head")[0].appendChild(e),this},get:function(r,t,i){if(Oe(t)){var e=i;i=t,t=e}if(Ct&&Zt.get.node)return Zt.get.node(r,i,t);var o=Zt._getClient(i);if(o.open("GET",r,!0),t){for(var s in t.headers)o.setRequestHeader(s,t.headers[s]);o.withCredentials=t.credentials==="include",t.responseType&&(o.responseType=t.responseType)}return o.send(null),o},post:function(r,t,i){var e;if(Ee(r)){if(Oe(t)){var s=i;i=t,t=s}t=t||{},e=t.postData}else{var o=i;e=t,t=r,r=t.url,i=o}if(Ct&&Zt.post.node)return t.url=r,Zt.post.node(t,e,i);var a=Zt._getClient(i);if(a.open("POST",t.url,!0),t.headers||(t.headers={}),t.headers["Content-Type"]||(t.headers["Content-Type"]="application/x-www-form-urlencoded"),"setRequestHeader"in a)for(var l in t.headers)t.headers.hasOwnProperty(l)&&a.setRequestHeader(l,t.headers[l]);return Ee(e)||(e=JSON.stringify(e)),a.send(e),a},_wrapCallback:function(r,t){return function(){if(r.readyState===4)if(r.status===200)if(r.responseType==="arraybuffer"){var i=r.response;i.byteLength===0?t(new Error("http status 200 returned without content.")):t(null,{data:r.response,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires"),contentType:r.getResponseHeader("Content-Type")})}else t(null,r.responseText);else t(new Error(r.statusText+","+r.status))}},_getClient:function(r){var t;try{t=new XMLHttpRequest}catch{try{t=new ActiveXObject("Msxml2.XMLHTTP")}catch{try{t=new ActiveXObject("Microsoft.XMLHTTP")}catch{}}}return t.onreadystatechange=Zt._wrapCallback(t,r),t},getArrayBuffer:function(r,t,i){if(Oe(t)){var e=i;i=t,t=e}return t||(t={}),t.responseType="arraybuffer",Zt.get(r,t,i)},getImage:function(r,t,i){return Zt.getArrayBuffer(t,i,function(e,o){if(e)r.onerror&&r.onerror(e);else if(o){var s=window.URL||window.webkitURL,a=r.onload;r.onload=function(){a&&a(),s.revokeObjectURL(r.src)};var l=new Blob([new Uint8Array(o.data)],{type:o.contentType});r.cacheControl=o.cacheControl,r.expires=o.expires,r.src=o.data.byteLength?s.createObjectURL(l):Ff}})},getJSON:function(r,t,i){}};Zt.getJSON=function(n,r,t){if(Oe(r)){var i=t;t=r,r=i}var e=function(s,a){var l=a?Js(a):null;t(s,l)};return r&&r.jsonp?Zt.jsonp(n,e):Zt.get(n,r,e)};var Ks="",sb=/data:image\/.*;base64,/;function ab(){var n;return Ce.IS_NODE?console.error("Current environment does not support canvas dom"):n=we("canvas"),n}function lb(){var n;return Ce.decodeImageInWorker&&(n=new OffscreenCanvas(2,2)),n}function hb(n){return sb.test(n)}function ub(n){return n.indexOf("blob:")===0}function cb(n,r){return X(n)&&(n+=Ks),X(r)&&(r+=Ks),!n||!r?!1:n.includes?n.includes(r):n.indexOf(r)>-1}function Lp(n,r={}){for(var t in r){var i=r[t];if(!(!i||!i.target)&&cb(n,t)){var{target:e}=i;return n.replace(t,e)}}return Ks}function fb(n={imgUrl:"",jsonUrl:""}){return new Promise(function(r,t){var{imgUrl:i,jsonUrl:e}=n;if(!i||!e){t(new Error("not find imgUrl/jsonUrl from options")),console.error(n);return}function o(a,l,h){a.width=l,a.height=h;var u=a.getContext("2d");return u.clearRect(0,0,l,h),u}function s(a={},l){var h=ab();if(!h){t(new Error("can not create canvas"));return}var u=[];for(var c in a){var f=a[c];u.push({name:c,spriteItem:f})}var d=lb(),g=n.sourceName||"";u.forEach(function(p){var{name:m,spriteItem:v}=p,{x:_,y,width:w,height:x}=v,C;if(d){var b=o(d,w,x);b.drawImage(l,_,y,w,x,0,0,w,x),C=d.transferToImageBitmap()}else{var E=o(h,w,x);E.drawImage(l,_,y,w,x,0,0,w,x),C=h.toDataURL()}p.resource=C,Dt.addResource(g+m,C)}),r(u)}Zt.getJSON(e,{},function(a,l){if(a){t(a);return}var h=new Image;h.onload=function(){s(l,h)},h.onerror=function(u){t(u)},Zt.getImage(h,i,{})})})}function db(n){return new Promise(function(r,t){var i="",e=[],o="",s="",a="";if(Array.isArray(n)||n instanceof NodeList)e=n;else if(Xt(n)){var l=n;i=l.url,e=l.symbols,o=l.fill,s=l.stroke,a=l.sourceName||""}else Ee(n)&&(i=n);if(!i&&e&&e.length===0){t(new Error("not find svgs data"));return}var h=[],u=function(_,y){var w=pb(y);w&&(w.forEach(function(C){o&&(C.fill=o),s&&(C.stroke=s)}),Dt.addResource(a+_,w));var x={name:_,paths:w,body:y};h.push(x)};if(i&&Ee(i)){fetch(i).then(function(v){return v.json()}).then(function(v){v.forEach(function(_){var{name:y,body:w}=_;u(y,w)}),r(h)}).catch(function(v){console.log(v),t(v)});return}if(e){for(var c=0,f=e.length;c<f;c++){var d=e[c],g=d.id,p=d.innerHTML,m="<xml><svg>"+p+"</svg></xml>";g&&u(g,m)}r(h);return}t(new Error("not support svgs params type"))})}var Dt={host:Ks,resources:{},proxy:{},origin:{},fromJSON:function(r){try{Ee(r)&&(r=JSON.parse(r)),Xt(r)&&oe(Dt,r)}catch(t){console.error(t)}},toJSON:function(){return{host:Dt.host,proxy:oe({},Dt.proxy||{}),origin:oe({},Dt.origin||{})}},getResource:function(r){return Dt.resources[r]},removeResource:function(r){delete Dt.resources[r]},addResource:function(r,t){if(Dt.resources[r]){console.warn(r+" resource Already exists,the "+r+" Cannot be added,the resource name Cannot repeat ");return}Dt.resources[r]=t},updateResource:function(r,t){Dt.resources[r]=t},allResource:function(){return Dt.resources},loadSprite:fb,loadSvgs:db};function _y(n){if(X(n)&&(n+=Ks),!n)return console.error("resouce path is null,path:",n),n;if(!Ee(n)||hb(n)||ub(n))return n;if(n[0]==="$")return Dt.getResource(n.substring(1,1/0))||"";var r=Dt.origin||{},t=iy(n);if(t&&Xt(r)){var i=Lp(n,r);return i||n}var e=Dt.proxy||{};if(Xt(e)){var o=Lp(n,e);if(o)return o}var{host:s}=Dt;return!t&&s&&Ee(s)?""+s+n:Ph(n)}var Cu;function gb(){return Cu||(Cu=new DOMParser),Cu}function Hr(n,r){return n?n[r]&&n[r].value:null}function pb(n){var r=gb().parseFromString(n,"text/xml"),t=r.querySelector("svg");if(!t)return null;for(var i=t.childNodes,e=[],o=t.attributes,s=Hr(o,"fill"),a=Hr(o,"fill-opacity"),l=Hr(o,"stroke"),h=Hr(o,"stroke-opacity"),u=Hr(o,"stroke-width"),c=0,f=i.length;c<f;c++){var d=i[c],g=d.attributes;if(g){var p=void 0,m=d.tagName||"",v=m.toLowerCase()==="path";if(v?p=Hr(g,"d"):p=d,!!p){var _=Hr(g,"fill")||s,y=Hr(g,"stroke")||l,w={path:p};if(_&&(w.fill=_,w["fill-opacity"]=Hr(g,"fill-opacity")||a||1),y&&(w.stroke=y,w["stroke-opacity"]=Hr(g,"stroke-opacity")||h||1,w["stroke-width"]=Hr(g,"stroke-width")||u||1),e.push(w),!v)for(var x in w)x!=="path"&&w.hasOwnProperty(x)&&d.setAttribute(x,w[x])}}}return e}let Hn;const yy={width:100,height:10};let Nc=!1;try{new OffscreenCanvas(1,1).getContext("2d").fillText("hello",0,0),Nc=!0}catch{Nc=!1}function vb(){if(!Hn){const{width:n,height:r}=yy;Nc?Hn=new OffscreenCanvas(n,r):(Hn=document.createElement("canvas"),Hn.width=n,Hn.height=r)}return Hn}let Ip=class{constructor(r,t={}){if(!Array.isArray(r)){console.error("colors is not array");return}if(r.length<2){console.error("colors.length should >1");return}this.colors=r;let i=1/0,e=-1/0;for(let o=0,s=r.length;o<s;o++){const a=r[o][0];i=Math.min(a,i),e=Math.max(a,e)}this.min=i,this.max=e,this.valueOffset=this.max-this.min,this.options=Object.assign({},yy,t),this._initImgData()}getImageData(){return this.imgData}_initImgData(){const r=vb(),{width:t,height:i}=this.options;r.width=t,r.height=i;const e=r.getContext("2d");e.clearRect(0,0,r.width,r.height);const o=e.createLinearGradient(0,0,r.width,0),{colors:s,valueOffset:a}=this;for(let l=0,h=s.length;l<h;l++){const[u,c]=s[l],f=(u-this.min)/a;o.addColorStop(f,c)}e.fillStyle=o,e.fillRect(0,0,r.width,r.height),this.imgData=e.getImageData(0,0,r.width,r.height)}getColor(r){r=Math.max(this.min,r),r=Math.min(r,this.max);const t=(r-this.min)/this.valueOffset;let i=Math.round(t*this.imgData.width);i=Math.min(i,this.imgData.width-1);const e=i*4,o=this.imgData.data[e],s=this.imgData.data[e+1],a=this.imgData.data[e+2],l=this.imgData.data[e+3];return[o,s,a,l]}};var mb=typeof Map=="function",gs;mb&&(gs=new Map);function wy(n){return n==null}function _o(n){return!wy(n)}function Hc(n){return n===""}function xy(n,r){var t,i,e;if(!rt(n))t=function(){return n},i=!0,e=!0;else{var o=n.stops&&typeof n.stops[0][0]=="object",s=o||_o(n.property),a=o||!s,l=n.type||r||"exponential",h;if(l==="exponential")h=Dp;else if(l==="interval")h=wb;else if(l==="categorical")h=yb;else if(l==="identity")h=Cb;else if(l==="color-interpolate")h=xb;else if(l==="calculate-expression")h=Tb;else throw new Error('Unknown function type "'+l+'"');if(o){var u={},c=[];for(let d=0;d<n.stops.length;d++){var f=n.stops[d];u[f[0].zoom]===void 0&&(u[f[0].zoom]={zoom:f[0].zoom,type:n.type,property:n.property,default:n.default,stops:[]}),u[f[0].zoom].stops.push([f[0].value,f[1]])}for(let d in u)c.push([u[d].zoom,xy(u[d])]);t=function(d,g){const p=Dp({stops:c,base:n.base},d)(d,g);return typeof p=="function"?p(d,g):p},i=!1,e=!1}else a?(t=function(d){const g=h(n,d);return typeof g=="function"?g(d):g},i=!0,e=!1):(t=function(d,g){const p=h(n,g?g[n.property]:null);return typeof p=="function"?p(d,g):p},i=!1,e=!0)}return t.isZoomConstant=e,t.isFeatureConstant=i,t}function _b(n,r,t){return _o(n)?n:_o(r)?r:_o(t)?t:null}function yb(n,r){for(let t=0;t<n.stops.length;t++)if(r===n.stops[t][0])return n.stops[t][1];return n.default}function wb(n,r){for(var t=0;t<n.stops.length&&!(r<n.stops[t][0]);t++);return n.stops[Math.max(t-1,0)][1]}function Dp(n,r){for(var t=_o(n.base)&&!Hc(n.base)?n.base:1,i=0;!(i>=n.stops.length);){if(r<=n.stops[i][0])break;i++}return i===0?n.stops[i][1]:i===n.stops.length?n.stops[i-1][1]:Cy(r,t,n.stops[i-1][0],n.stops[i][0],n.stops[i-1][1],n.stops[i][1])}const zp={width:100,height:1};function xb(n,r){const t=n.stops;if(t&&t.length>1){let i;if(gs){const l=JSON.stringify(t);if(!gs.has(l)){const h=new Ip(t,zp);gs.set(l,h)}i=gs.get(l)}else i=new Ip(t,zp);const[e,o,s,a]=i.getColor(r);return[e/255,o/255,s/255,a/255]}else if(t&&t.length===1)return t[0][1];return null}function Cb(n,r){return _b(r,n.default)}function Tb(n,r){const t=String(n.property),i=n.expression,e=r;function o(l,h,u){const c=Number(u),f=String(h);return Array.isArray(l)?l.map(d=>o(d,f,c)):l===f?c:l}function s(l){if(Array.isArray(l)){const h=l[0];if(!["+","-","*","/"].includes(h))throw new Error(`Unknown operator: ${h}`);const u=l.slice(1).map(c=>s(c));switch(h){case"+":return u.reduce((c,f)=>c+f,0);case"-":return u.reduce((c,f)=>c-f);case"*":return u.reduce((c,f)=>c*f,1);case"/":return u.some(c=>c===0)?n.default:u.reduce((c,f)=>c/f);default:throw new Error(`Unsupported operator: ${h}`)}}else{if(typeof l=="number")return l;throw new Error("Invalid expression format")}}function a(l){return wy(l)||Hc(l)||isNaN(l)?n.default:l}if(_o(r)&&!Hc(r)&&!isNaN(r)&&!(r<0)){const l=o(i,t,e);return a(s(l))}else return a(n.default)}function Cy(n,r,t,i,e,o){return typeof e=="function"?function(){var s=e.apply(void 0,arguments),a=o.apply(void 0,arguments);return Cy(n,r,t,i,s,a)}:e.length?bb(n,r,t,i,e,o):Ty(n,r,t,i,e,o)}function Ty(n,r,t,i,e,o){var s=i-t,a=n-t,l;return r===1?l=a/s:l=(Math.pow(r,a)-1)/(Math.pow(r,s)-1),e*(1-l)+o*l}function bb(n,r,t,i,e,o){var s=[];for(let a=0;a<e.length;a++)s[a]=Ty(n,r,t,i,e[a],o[a]);return s}function rt(n){return n&&typeof n=="object"&&(n.stops||n.property&&n.type==="identity"||n.expression&&n.type==="calculate-expression")}function Jf(n){for(const r in n)if(rt(n[r]))return!0;return!1}function Qs(n){return by(n,"exponential")}function Dh(n,r){if(!n)return null;var t=!1;if(Array.isArray(n)){var i=[],e;for(let h=0;h<n.length;h++)e=Dh(n[h],r),e?(i.push(e),t=!0):i.push(n[h]);return t?i:n}var o={__fn_types_loaded:!0},s=[],a;for(a in n)n.hasOwnProperty(a)&&s.push(a);const l=function(h){Object.defineProperty(o,h,{get:function(){return this["__fn_"+h]||(this["__fn_"+h]=Qs(this["_"+h])),this["__fn_"+h].apply(this,r())},set:function(u){this["_"+h]=u},configurable:!0,enumerable:!0})};for(let h=0,u=s.length;h<u;h++)a=s[h],rt(n[a])?(t=!0,o["_"+a]=n[a],l(a)):o[a]=n[a];return t?o:n}function jc(n){if(!n||!n.stops)return[];const r=[];for(let t=0,i=n.stops.length;t<i;t++)r.push(n.stops[t][1]);return r}function by(n,r){if(!rt(n))return function(){return n};n=JSON.parse(JSON.stringify(n));let t=!0,i=!0;const e=n.stops;if(e){for(let s=0;s<e.length;s++)if(rt(e[s][1])){const a=by(e[s][1],r);t=t&&a.isZoomConstant,i=i&&a.isFeatureConstant,e[s]=[e[s][0],a]}}const o=xy(n,r);return o.isZoomConstant=t&&o.isZoomConstant,o.isFeatureConstant=i&&o.isFeatureConstant,o}/*!
|
|
26
|
-
Feature Filter by
|
|
27
|
-
|
|
28
|
-
(c) mapbox 2016 and maptalks 2018
|
|
29
|
-
www.mapbox.com | www.maptalks.org
|
|
30
|
-
License: MIT, header required.
|
|
31
|
-
*/const Xf=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function Mb(n){return typeof n=="object"&&!!n}function zh(n){return new Function("f",`var p = (f && f.properties || {}); return ${Py(n)}`)}function My(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":case"!has":return n.length===2&&(typeof n[1]=="string"||n[1].property&&n[1].op);case"in":case"!in":return n.length>=2&&(typeof n[1]=="string"||n[1].property&&n[1].op);case"==":case"!=":case">":case">=":case"<":case"<=":return n.length===3&&(typeof n[1]=="string"||n[1].property&&n[1].op);case"none":case"any":case"all":for(const r of n.slice(1))if(!My(r)&&typeof r!="boolean")return!1;return!0;case"contains":return!0;default:return!1}}function Py(n){if(!n)return"true";const r=n[0];return n.length<=1?r==="any"?"false":"true":`(${r==="=="?Tu(n[1],n[2],"===",!1):r==="!="?Tu(n[1],n[2],"!==",!1):r==="<"||r===">"||r==="<="||r===">="?Tu(n[1],n[2],r,!0):r==="any"?bu(n.slice(1),"||"):r==="all"?bu(n.slice(1),"&&"):r==="none"?Mu(bu(n.slice(1),"||")):r==="in"?Bp(n[1],n.slice(2)):r==="!in"?Mu(Bp(n[1],n.slice(2))):r==="has"?Gp(n[1]):r==="!has"?Mu(Gp(n[1])):r==="contains"?Eb(n[1],n[2],n[3]):"true"})`}function Pb(n,r,t,i){const e=n.property,o=n.op;let s=Bh(e);if(o==="length")s=`((${s}+='').length)`;else return console.error(`not support ${o} op`),"false";return Ey(s,e,r,t,i)}function Eb(n,r,t){const i=Bh(n);return t!==void 0?`(${i} + '').indexOf("${r}") === ${t}`:`(${i} + '').indexOf("${r}") >= 0`}function Bh(n){return n[0]==="$"?"f."+n.substring(1):"p["+JSON.stringify(n)+"]"}function Tu(n,r,t,i){if(Mb(n)&&n.op)return Pb(n,r,t,i);const e=Bh(n);return Ey(e,n,r,t,i)}function Ey(n,r,t,i,e){const o=r==="$type"?Xf.indexOf(t):JSON.stringify(t);return(e?`typeof ${n}=== typeof ${o}&&`:"")+n+i+o}function bu(n,r){return n.map(Py).join(r)}function Bp(n,r){n==="$type"&&(r=r.map(e=>Xf.indexOf(e)));const t=JSON.stringify(r.sort(Sb)),i=Bh(n);return r.length<=200?`${t}.indexOf(${i}) !== -1`:`function(v, a, i, j) {
|
|
32
|
-
while (i <= j) { var m = (i + j) >> 1;
|
|
33
|
-
if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;
|
|
34
|
-
}
|
|
35
|
-
return false; }(${i}, ${t},0,${r.length-1})`}function Gp(n){return n==="$id"?'"id" in f':`${JSON.stringify(n)} in p`}function Mu(n){return`!(${n})`}function Sb(n,r){return n<r?-1:n>r?1:0}function jl(n){const r=n._toJSON(),t=r.feature;return t.type=Xf.indexOf(t.geometry.type),t.subType=r.subType,t}function Yf(n){if(!Array.isArray(n))return Yf([n]);const r=[];for(let t=0;t<n.length;t++){let i;n[t].filter===!0?i=function(){return!0}:i=zh(n[t].filter),r.push(Ob({},n[t],{filter:i}))}return r}function Ob(n){for(let r=1;r<arguments.length;r++){const t=arguments[r];for(const i in t)n[i]=t[i]}return n}var dt={};function kb(n){if(n){var r=n.id;dt[r]={pitch:n.getPitch(),bearing:n.getBearing(),zoom:n.getZoom(),devicePixelRatio:n.getDevicePixelRatio(),resolution:n.getResolution(),center:n.getCenter()}}}var Rb=[],Ab={};function ea(n,r){return Dh(n,function(){var t=r.getMap(),i=0,e=0,o=10,s=!!t;if(t){var a=t.id,l=dt[a];l?(i=l.bearing,e=l.pitch,o=l.zoom):(i=t.getBearing(),e=t.getPitch(),o=t.getZoom())}var h=!1;if(r._funTypeProperties=r._funTypeProperties||{},r.propertiesDirty)r._funTypeProperties={},r.propertiesDirty=!1,h=!0;else{var u=r._funTypeProperties;h=u["{bearing}"]!==i||u["{pitch}"]!==e||u["{zoom}"]!==o}var c=r._funTypeProperties;return h&&(c=oe(c||{},r.getProperties(),Ib(Ab,i,e,o))),Lb(Rb,s?o:12,c)})}function Lb(n,r,t){return n[0]=r,n[1]=t,n}function Ib(n,r,t,i){return n["{bearing}"]=r,n["{pitch}"]=t,n["{zoom}"]=i,n}var Fp=Object.freeze({__proto__:null,compileStyle:Yf,createFilter:zh,getFilterFeature:jl,getFunctionTypeResources:jc,hasFunctionDefinition:Jf,interpolated:Qs,isFeatureFilter:My,isFunctionDefinition:rt,loadFunctionTypes:Dh,loadGeoSymbol:ea});function Sy(n){var r={stroke:{stroke:n.markerLineColor,"stroke-width":n.markerLineWidth,"stroke-opacity":n.markerLineOpacity,"stroke-dasharray":null,"stroke-linecap":"butt","stroke-linejoin":"round"},fill:{fill:n.markerFill,"fill-opacity":n.markerFillOpacity}};return r.stroke["stroke-width"]===0&&(r.stroke["stroke-opacity"]=0),r}function ta(n,r,t){if(!n.markerPath)return null;var i=1,e=Sy(n);X(n.markerOpacity)&&(i=n.markerOpacity),X(n.opacity)&&(i*=n.opacity);var o={};if(e){for(var s in e.stroke)e.stroke.hasOwnProperty(s)&&(O(e.stroke[s])||(o[s]=e.stroke[s]));for(var a in e.fill)e.fill.hasOwnProperty(a)&&(O(e.fill[a])||(o[a]=e.fill[a]))}var l,h=n.markerPath;Ee(h)&&h[0]==="$"?l=Dt.getResource(h.substring(1,1/0))||[]:l=Array.isArray(n.markerPath)?n.markerPath:[n.markerPath];for(var u,c=[],f=0;f<l.length;f++)u=Ee(l[f])?{path:l[f]}:l[f],u=oe({},o,u),u.d=u.path,delete u.path,c.push(u);var d=['<svg version="1.1"','xmlns="http://www.w3.org/2000/svg"'];i<1&&d.push('opacity="'+i+'"'),n.markerPathWidth&&n.markerPathHeight&&d.push('viewBox="0 0 '+n.markerPathWidth+" "+n.markerPathHeight+'"'),d.push('preserveAspectRatio="none"'),r&&d.push('width="'+r+'"'),t&&d.push('height="'+t+'"'),d.push("><defs></defs>");for(var g=0;g<c.length;g++){if(c[g].d instanceof Element){d.push(c[g].d.outerHTML);continue}var p="<path";for(var m in c[g])c[g].hasOwnProperty(m)&&(p+=" "+m+'="'+c[g][m]+'"');p+="></path>",d.push(p)}d.push("</svg>");var v="data:image/svg+xml;base64,"+ay(d.join(" "));return v}function ba(n,r){if(!n)return[];var t=n;Array.isArray(n)||(t=[n]);for(var i=[],e=uy,o,s,a,l,h=t.length-1;h>=0;h--)if(n=t[h],!!n){r&&(n=Zl(n));for(var u=0;u<e.length;u++)if(o=n[e[u]],rt(o)&&(o=jc(o)),!!o){Array.isArray(o)||(o=[o]);for(var c=0;c<o.length;c++)o[c].slice(0,4)==="url("&&(o[c]=Mh(o[c])),s=$T[u],i.push([o[c],n[s[0]],n[s[1]]])}if(n.markerType==="path"&&n.markerPath)if(a=rt(n.markerWidth)?200:n.markerWidth,l=rt(n.markerHeight)?200:n.markerHeight,rt(n.markerPath)){o=jc(n.markerPath);for(var f=n.markerPath,d=0;d<o.length;d++)n.markerPath=o[d],i.push([ta(n),a,l]);n.markerPath=f}else i.push([ta(n),a,l])}return i}function Zl(n){if(!n)return null;var r=n;if(Ct)return r;for(var t=uy,i,e=0,o=t.length;e<o;e++)i=r[t[e]],i&&(r[t[e]]=Oy(i));return r}function Oy(n){if(rt(n)&&n.stops){for(var r=n.stops,t=0;t<r.length;t++)r[t][1]=Oy(r[t][1]);return n}return n.slice(0,4)==="url("&&(n=Mh(n)),n}function Vl(n){return n&&Ce.decodeImageInWorker&&n instanceof ImageBitmap}function Li(n){return n&&n.colorStops}function Zc(n){var r=[n.type];if(n.places&&r.push(n.places.join()),n.colorStops){for(var t=[],i=n.colorStops.length-1;i>=0;i--)t.push(n.colorStops[i].join());r.push(t.join(","))}return r.join("_")}function Db(n,r){return Ma(n,r)}function Ma(n,r){if(!n)return 1;var t=[];if(Array.isArray(n)){for(var i=0;i<n.length;i++)t.push(Ma(n[i],r));return t.sort().join(",")}var e=Object.keys(n).sort(),o=e.reduce(function(a,l){return(!r||l.indexOf(r)===0)&&(a[l]=n[l]),a},{}),s=Rh(JSON.stringify(o));return s}function Wl(n,r){function t(s,a){var l=s.opacity;O(l)?s.opacity=a:s.opacity*=a}var i;if(Array.isArray(n)){i=[];for(var e=0;e<n.length;e++){var o=oe({},n[e]);t(o,r),i.push(o)}}else i=oe({},n),t(i,r);return i}function Zr(...n){var r=n[0],t=Array.prototype.slice.call(n,1);if((!t||!t.length)&&(t=[{}]),Array.isArray(r)){for(var i,e,o=[],s=0,a=r.length;s<a;s++){i=r[s],e={};for(var l=0,h=t.length;l<h;l++)Array.isArray(t[l])?O(t[l][s])?oe(e,i||{}):oe(e,i,t[l][s]):oe(e,i,t[l]?t[l]:{});o.push(e)}return o}else{var u=[{},r];return u.push.apply(u,t),oe.apply(this,u)}}function ky(n){if(n.symbol&&(n=[n]),Array.isArray(n))return n;var r=n.$root,t=n.$iconset;if(n=n.style,r||t){r&&r[r.length-1]==="/"&&(r=r.substring(0,r.length-1)),t&&t[t.length-1]==="/"&&(t=t.substring(0,t.length-1));var i=function(o){return o==="{$root}"?r:o==="{$iconset}"?t:null};Ry(n,i)}return n}function Ry(n,r){for(var t=0;t<n.length;t++){var{symbol:i}=n[t];i&&qf(i,r)}}var Vc=/(\{\$root\}|\{\$iconset\})/g;function qf(n,r){for(var t in n)n.hasOwnProperty(t)&&t!=="textName"&&(Ee(n[t])&&n[t].length>2?n[t]=n[t].replace(Vc,r):rt(n[t])?n[t]=Ay(n[t],r):Xt(n[t])&&qf(n[t],r))}function Ay(n,r){var t=n.default;Ee(t)&&(n.default=t.replace(Vc,r));var i=n.stops;if(!i)return n;for(var e=0;e<i.length;e++)Array.isArray(i[e])&&(Ee(i[e][1])?i[e][1]=i[e][1].replace(Vc,r):rt(i[e][1])&&(i[e][1]=Ay(i[e][1],r)));return n}function Ly(n=[]){Array.isArray(n)||(n=[n]);for(var r=n.length,t=0;t<r;t++){var i=n[t];if(i.style){var{lineDasharray:e,lineWidth:o}=i.style;if(o&&X(o)&&o>0&&e&&Array.isArray(e)&&e.length)return!0}}return!1}function Wc(n,r,t,i,e){var o=1/Math.tan(r/2),s=1/(i-e);return n[0]=o/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=o,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=(e+i)*s,n[11]=-1,n[12]=0,n[13]=0,n[14]=2*e*i*s,n[15]=0,n}function Iy(n,r,t,i,e){var o=1/Math.tan(r/2);if(n[0]=o/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=o,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,e!=null&&e!==1/0){var s=1/(i-e);n[10]=(e+i)*s,n[14]=2*e*i*s}else n[10]=-1,n[14]=-2*i;return n}function Kf(n,r,t){var i=t[0],e=t[1],o=t[2],s,a,l,h,u,c,f,d,g,p,m,v;return r===n?(n[12]=r[0]*i+r[4]*e+r[8]*o+r[12],n[13]=r[1]*i+r[5]*e+r[9]*o+r[13],n[14]=r[2]*i+r[6]*e+r[10]*o+r[14],n[15]=r[3]*i+r[7]*e+r[11]*o+r[15]):(s=r[0],a=r[1],l=r[2],h=r[3],u=r[4],c=r[5],f=r[6],d=r[7],g=r[8],p=r[9],m=r[10],v=r[11],n[0]=s,n[1]=a,n[2]=l,n[3]=h,n[4]=u,n[5]=c,n[6]=f,n[7]=d,n[8]=g,n[9]=p,n[10]=m,n[11]=v,n[12]=s*i+u*e+g*o+r[12],n[13]=a*i+c*e+p*o+r[13],n[14]=l*i+f*e+m*o+r[14],n[15]=h*i+d*e+v*o+r[15]),n}function $l(n,r,t){var i=t[0],e=t[1],o=t[2];return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=r[3]*i,n[4]=r[4]*e,n[5]=r[5]*e,n[6]=r[6]*e,n[7]=r[7]*e,n[8]=r[8]*o,n[9]=r[9]*o,n[10]=r[10]*o,n[11]=r[11]*o,n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],n}function Dy(n,r,t){var i=Math.sin(t),e=Math.cos(t),o=r[4],s=r[5],a=r[6],l=r[7],h=r[8],u=r[9],c=r[10],f=r[11];return r!==n&&(n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15]),n[4]=o*e+h*i,n[5]=s*e+u*i,n[6]=a*e+c*i,n[7]=l*e+f*i,n[8]=h*e-o*i,n[9]=u*e-s*i,n[10]=c*e-a*i,n[11]=f*e-l*i,n}function zy(n,r,t){var i=Math.sin(t),e=Math.cos(t),o=r[0],s=r[1],a=r[2],l=r[3],h=r[4],u=r[5],c=r[6],f=r[7];return r!==n&&(n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15]),n[0]=o*e+h*i,n[1]=s*e+u*i,n[2]=a*e+c*i,n[3]=l*e+f*i,n[4]=h*e-o*i,n[5]=u*e-s*i,n[6]=c*e-a*i,n[7]=f*e-l*i,n}function so(n,r,t){var i=r[0],e=r[1],o=r[2],s=r[3],a=r[4],l=r[5],h=r[6],u=r[7],c=r[8],f=r[9],d=r[10],g=r[11],p=r[12],m=r[13],v=r[14],_=r[15],y=t[0],w=t[1],x=t[2],C=t[3];return n[0]=y*i+w*a+x*c+C*p,n[1]=y*e+w*l+x*f+C*m,n[2]=y*o+w*h+x*d+C*v,n[3]=y*s+w*u+x*g+C*_,y=t[4],w=t[5],x=t[6],C=t[7],n[4]=y*i+w*a+x*c+C*p,n[5]=y*e+w*l+x*f+C*m,n[6]=y*o+w*h+x*d+C*v,n[7]=y*s+w*u+x*g+C*_,y=t[8],w=t[9],x=t[10],C=t[11],n[8]=y*i+w*a+x*c+C*p,n[9]=y*e+w*l+x*f+C*m,n[10]=y*o+w*h+x*d+C*v,n[11]=y*s+w*u+x*g+C*_,y=t[12],w=t[13],x=t[14],C=t[15],n[12]=y*i+w*a+x*c+C*p,n[13]=y*e+w*l+x*f+C*m,n[14]=y*o+w*h+x*d+C*v,n[15]=y*s+w*u+x*g+C*_,n}function $c(n,r){var t=r[0],i=r[1],e=r[2],o=r[3],s=r[4],a=r[5],l=r[6],h=r[7],u=r[8],c=r[9],f=r[10],d=r[11],g=r[12],p=r[13],m=r[14],v=r[15],_=t*a-i*s,y=t*l-e*s,w=t*h-o*s,x=i*l-e*a,C=i*h-o*a,b=e*h-o*l,E=u*p-c*g,T=u*m-f*g,S=u*v-d*g,B=c*m-f*p,L=c*v-d*p,D=f*v-d*m,N=_*D-y*L+w*B+x*S-C*T+b*E;return N?(N=1/N,n[0]=(a*D-l*L+h*B)*N,n[1]=(e*L-i*D-o*B)*N,n[2]=(p*b-m*C+v*x)*N,n[3]=(f*C-c*b-d*x)*N,n[4]=(l*S-s*D-h*T)*N,n[5]=(t*D-e*S+o*T)*N,n[6]=(m*w-g*b-v*y)*N,n[7]=(u*b-f*w+d*y)*N,n[8]=(s*L-a*S+h*E)*N,n[9]=(i*S-t*L-o*E)*N,n[10]=(g*C-p*w+v*_)*N,n[11]=(c*w-u*C-d*_)*N,n[12]=(a*T-s*B-l*E)*N,n[13]=(t*B-i*T+e*E)*N,n[14]=(p*y-g*x-m*_)*N,n[15]=(u*x-c*y+f*_)*N,n):null}function Gh(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Uc(n,r){return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],n}var Np=Object.freeze({__proto__:null,DEFAULT_FONT:Wf,DEFAULT_TEXTSIZE:$f,EMPTY_STRING:Pi,GUID:ty,IS_NODE:Ct,UID:ui,_defaults:VT,b64toBlob:ly,btoa:ay,calCanvasSize:Eh,get cancelAnimFrame(){return $s},checkMTKVersion:q_,clamp:Bl,computeDegree:Gl,convertResourceUrl:Zl,convertStylePath:Ry,copy:Uc,describeText:qs,emptyImageUrl:Ff,equalMapView:Fl,escapeSpecialChars:Ca,extend:oe,extendSymbol:Zr,extractCssUrl:Mh,flash:Nf,forEachCoord:Rn,getAbsoluteURL:Ph,getAlignPoint:li,getExternalResources:ba,getFont:Ta,getGlobalThis:Il,getGradientStamp:Zc,getImageBitMap:Hf,getMarkerPathBase64:ta,getPointsResultPts:Xs,getSymbolHash:Ma,getSymbolStamp:Db,getValueOrDefault:pe,hasOwn:Bo,hashCode:Rh,identity:Gh,interpolate:zl,invert:$c,isArrayHasData:$e,isCssUrl:sy,isDashLine:Ly,isEmpty:wT,isFunction:Oe,isGradient:Li,isImageBitMap:Vl,isInteger:Tn,isNil:O,isNoContentHttpCode:WT,isNumber:X,isObject:Xt,isSVG:Si,isString:Ee,isURL:iy,join:yT,loadImage:Us,log2:HT,lowerSymbolOpacity:Wl,mergeArray:ry,multiply:so,now:He,parseJSON:Js,parseStyleRootPath:ky,parseSymbolPath:qf,perspective:Wc,perspectiveNO:Iy,pushIn:Yt,removeFromArray:Dl,replaceAll:Zf,replaceVariable:Ys,get requestAnimFrame(){return ai},rotateX:Dy,rotateZ:zy,scale:$l,sign:ir,splitContent:Nl,splitTextToRow:kh,splitWords:Vf,stringLength:Oh,stringWidth:Oi,toDegree:Bf,toRadian:mt,translate:Kf,translateToSVGStyles:Sy,trim:Sh,wrap:An}),zb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qf(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bb=Ul;Ul.polyline=Ul;Ul.polygon=Gb;function Ul(n,r,t){var i=n.length,e=ao(n[0],r),o=[],s,a,l,h,u;for(t||(t=[]),s=1;s<i;s++){for(a=n[s-1],l=n[s],h=u=ao(l,r);;)if(e|h){if(e&h)break;e?(a=Jc(a,l,e,r),e=ao(a,r)):(l=Jc(a,l,h,r),h=ao(l,r))}else{o.push(a),h!==u?(o.push(l),s<i-1&&(t.push(o),o=[])):s===i-1&&o.push(l);break}e=u}return o.length&&t.push(o),t}function Gb(n,r){var t,i,e,o,s,a,l;for(i=1;i<=8;i*=2){for(t=[],e=n[n.length-1],o=!(ao(e,r)&i),s=0;s<n.length;s++)a=n[s],l=!(ao(a,r)&i),l!==o&&t.push(Jc(e,a,i,r)),l&&t.push(a),e=a,o=l;if(n=t,!n.length)break}return t}function Jc(n,r,t,i){return t&8?[n[0]+(r[0]-n[0])*(i[3]-n[1])/(r[1]-n[1]),i[3]]:t&4?[n[0]+(r[0]-n[0])*(i[1]-n[1])/(r[1]-n[1]),i[1]]:t&2?[i[2],n[1]+(r[1]-n[1])*(i[2]-n[0])/(r[0]-n[0])]:t&1?[i[0],n[1]+(r[1]-n[1])*(i[0]-n[0])/(r[0]-n[0])]:null}function ao(n,r){var t=0;return n[0]<r[0]?t|=1:n[0]>r[2]&&(t|=2),n[1]<r[1]?t|=4:n[1]>r[3]&&(t|=8),t}var Fb=Qf(Bb),By=1/0,Gy=1/0,Fy=-1/0,Ny=-1/0;function ur(){return[By,Gy,Fy,Ny]}var yo=ur();function Mo(n){n[0]=By,n[1]=Gy,n[2]=Fy,n[3]=Ny}function Ii(n,r){if(n)if(Array.isArray(n[0]))for(var t=0,i=n.length;t<i;t++)Ii(n[t],r);else if(Array.isArray(n))for(var e=0,o=n.length;e<o;e++){var{x:s,y:a}=n[e];r[0]=Math.min(s,r[0]),r[1]=Math.min(a,r[1]),r[2]=Math.max(s,r[2]),r[3]=Math.max(a,r[3])}else{var{x:l,y:h}=n;r[0]=Math.min(l,r[0]),r[1]=Math.min(h,r[1]),r[2]=Math.max(l,r[2]),r[3]=Math.max(h,r[3])}}function ra(n,r,t,i,e){r!==0&&!r||(Array.isArray(r)&&(t=r[1],i=r[2],e=r[3],r=r[0]),n[0]=Math.min(r,n[0]),n[1]=Math.min(t,n[1]),n[2]=Math.max(i,n[2]),n[3]=Math.max(e,n[3]))}function ia(n){return n&&n[0]!==1/0&&n[0]!==void 0}function Hy(n,r=0){n[0]-=r,n[1]-=r,n[2]+=r,n[3]+=r}function Nb(n,r){return!(n[2]<r[0]||n[1]>r[3]||n[0]>r[2]||n[3]<r[1])}function Hp(n,r){var[t,i,e,o]=n;return t>=r[0]&&e<=r[2]&&i>=r[1]&&o<=r[3]}function Hb(n,r){var t=r.bbox;if(!t)return console.error("maskGeoJSON bbox is null:",r),!1;if(Nb(t,n)){var i=r.geometry;if(!i)return console.error("maskGeoJSON is error,not find geometry.",r),!1;var{coordinates:e}=i,o=i.type;o==="Polygon"&&(e=[e]);for(var s=0,a=e.length;s<a;s++){var l=e[s],h=l[0],u=Fb.polygon(h,n);if(u.length>0){for(var c=1/0,f=-1/0,d=1/0,g=-1/0,p=0,m=u.length;p<m;p++){var[v,_]=u[p];c=Math.min(v,c),d=Math.min(_,d),f=Math.max(v,f),g=Math.max(_,g)}if(c!==f&&d!==g)return!0}}return!1}else return!1}var jb=function(){function n(){this.resources=new Map,this._errors=new Map}var r=n.prototype;return r.addResource=function(i,e){var o=this,s=this._getImgUrl(i);if(this.resources.set(s,{image:e,width:+i[1],height:+i[2],refCnt:0}),e&&e.width&&e.height&&!e.close&&Ce.imageBitMap&&!Ce.safari&&!Ce.iosWeixin){if(e.src&&Si(e.src))return;createImageBitmap(e).then(function(a){o.resources.has(s)&&(o.resources.get(s).image=a)})}},r.isResourceLoaded=function(i,e){if(!i)return!1;var o=this._getImgUrl(i);if(this._errors.has(o))return!0;var s=this.resources.get(o);return!(!s||e&&Si(i[0])&&(+i[1]>s.width||+i[2]>s.height))},r.login=function(i){var e=this.resources.get(i);e&&e.refCnt++},r.logout=function(i){var e=this.resources.get(i);e&&e.refCnt--<=0&&(e.image&&e.image.close&&e.image.close(),this.resources.delete(i))},r.getImage=function(i){var e=this._getImgUrl(i);return!this.isResourceLoaded(i)||this._errors.has(e)?null:this.resources.get(e).image},r.markErrorResource=function(i){var e=this._getImgUrl(i);this._errors.set(e,1)},r.merge=function(i){var e=this;if(!i)return this;var o=i.resources;return o&&o.forEach(function(s,a){var l=s;e.addResource([a,l.width,l.height],l.image)}),this},r.forEach=function(i){return this.resources?(this.resources.forEach(function(e,o){i(o,e)}),this):this},r._getImgUrl=function(i){return Vl(i)||!Array.isArray(i)?i:i[0]},r.remove=function(){return this.resources?(this.resources.forEach(function(i){i&&i.image&&i.image.close&&i.image.close()}),this.resources.clear(),this):this},n}(),ed=function(){function n(){this.resources={},this._errors={}}var r=n.prototype;return r.addResource=function(i,e){var o=this;if(this.resources[i[0]]={image:e,width:+i[1],height:+i[2],refCnt:0},e&&e.width&&e.height&&!e.close&&Ce.imageBitMap&&!Ce.safari&&!Ce.iosWeixin){if(e.src&&Si(e.src))return;createImageBitmap(e).then(function(s){o.resources[i[0]]&&(o.resources[i[0]].image=s)})}},r.isResourceLoaded=function(i,e){if(!i)return!1;var o=this._getImgUrl(i);if(this._errors[o])return!0;var s=this.resources[o];return!(!s||e&&Si(i[0])&&(+i[1]>s.width||+i[2]>s.height))},r.login=function(i){var e=this.resources[i];e&&e.refCnt++},r.logout=function(i){var e=this.resources[i];e&&e.refCnt--<=0&&(e.image&&e.image.close&&e.image.close(),delete this.resources[i])},r.getImage=function(i){var e=this._getImgUrl(i);return!this.isResourceLoaded(i)||this._errors[e]?null:this.resources[e].image},r.markErrorResource=function(i){this._errors[this._getImgUrl(i)]=1},r.merge=function(i){if(!i)return this;for(var e in i.resources){var o=i.resources[e];this.addResource([e,o.width,o.height],o.image)}return this},r.forEach=function(i){if(!this.resources)return this;for(var e in this.resources)Bo(this.resources,e)&&i(e,this.resources[e]);return this},r._getImgUrl=function(i){return Array.isArray(i)?i[0]:i},r.remove=function(){for(var i in this.resources){var e=this.resources[i];e&&e.image&&e.image.close&&e.image.close()}this.resources={}},n}();function na(){return Ce.decodeImageInWorker?new jb:new ed}function jt(n,r,t,i){return n[0]=r,n[1]=t,n[2]=i,n}function jy(n,r,t){return n[0]=r[0]+t[0],n[1]=r[1]+t[1],n[2]=r[2]+t[2],n}function xn(n,r,t){return n[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],n}function Za(n,r,t){return xn(n,r,t)}function Zb(n,r){return n[0]=r[0],n[1]=r[1],n[2]=r[2],n}function jp(n){var r=n[0],t=n[1],i=n[2];return Math.sqrt(r*r+t*t+i*i)}function Qi(n,r){var t=r[0],i=r[1],e=r[2],o=t*t+i*i+e*e;return o>0&&(o=1/Math.sqrt(o),n[0]=r[0]*o,n[1]=r[1]*o,n[2]=r[2]*o),n}function Ci(n,r){return n[0]*r[0]+n[1]*r[1]+n[2]*r[2]}function Zy(n,r,t){return n[0]=r[0]*t,n[1]=r[1]*t,n[2]=r[2]*t,n}function en(n,r,t){var i=r[0],e=r[1],o=r[2],s=t[0],a=t[1],l=t[2];return n[0]=e*l-o*a,n[1]=o*s-i*l,n[2]=i*a-e*s,n}function Xc(n,r){var t=r[0]-n[0],i=r[1]-n[1],e=r[2]-n[2];return Math.hypot?Math.hypot(t,i,e):Wb(t,i,e)}function Vb(n,r,t){var i=r[0],e=r[1],o=r[2],s=t[3]*i+t[7]*e+t[11]*o+t[15];return s=s||1,n[0]=(t[0]*i+t[4]*e+t[8]*o+t[12])/s,n[1]=(t[1]*i+t[5]*e+t[9]*o+t[13])/s,n[2]=(t[2]*i+t[6]*e+t[10]*o+t[14])/s,n}function Wb(...n){for(var r=0,t=n.length;t--;)r+=n[t]*n[t];return Math.sqrt(r)}function Zp(n,r){Qi(n,n),Qi(r,r);var t=Ci(n,r);return t>1?0:t<-1?Math.PI:Math.acos(t)}var $b=function(){function n(t,i){this.normal=t,this.constant=i}var r=n.prototype;return r.distanceToPoint=function(i){return Ci(this.normal,i)+this.constant},n}(),Ub=[0,0,0],Jo=[0,0,0],Xo=[0,0,0],Pu=[0,0,0],Va=[0,0,0],Vp=new $b([0,0,1],0),Jb=function(){function n(t,i){this.setFromTo(t,i)}var r=n.prototype;return r.setFromTo=function(i,e){this.origin=i;var o=this.direction||[0,0,0];this.direction=Qi(o,Za(o,e,i))},r.distanceToPlane=function(i){var e=Ci(i.normal,this.direction);if(e===0)return i.distanceToPoint(this.origin)===0?0:null;var o=-(Ci(this.origin,i.normal)+i.constant)/e;return o>=0?o:null},r.intersectGround=function(i){return this.intersectPlane(Vp,i)},r.distanceToGround=function(){return this.distanceToPlane(Vp)},r.intersectPlane=function(i,e){var o=this.distanceToPlane(i);return o===null?null:this.at(o,e)},r.intersectBox=function(i,e){var o,s,a,l,h,u,c=1/this.direction[0],f=1/this.direction[1],d=1/this.direction[2],g=this.origin;return c>=0?(o=(i[0][0]-g[0])*c,s=(i[1][0]-g[0])*c):(o=(i[1][0]-g[0])*c,s=(i[0][0]-g[0])*c),f>=0?(a=(i[0][1]-g[1])*f,l=(i[1][1]-g[1])*f):(a=(i[1][1]-g[1])*f,l=(i[0][1]-g[1])*f),o>l||a>s||((a>o||isNaN(o))&&(o=a),(l<s||isNaN(s))&&(s=l),d>=0?(h=(i[0][2]-g[2])*d,u=(i[1][2]-g[2])*d):(h=(i[1][2]-g[2])*d,u=(i[0][2]-g[2])*d),o>u||h>s)||((h>o||o!==o)&&(o=h),(u<s||s!==s)&&(s=u),s<0)?null:this.at(o>=0?o:s,e)},r.intersectTriangle=function(i,e,o,s,a){Za(Jo,e,i),Za(Xo,o,i),en(Pu,Jo,Xo);var l=Ci(this.direction,Pu),h;if(l>0){if(s)return null;h=1}else if(l<0)h=-1,l=-l;else return null;Za(Va,this.origin,i),en(Xo,Va,Xo);var u=h*Ci(this.direction,Xo);if(u<0)return null;en(Jo,Jo,Va);var c=h*Ci(this.direction,Jo);if(c<0||u+c>l)return null;var f=-h*Ci(Va,Pu);return f<0?null:this.at(f/l,a)},r.at=function(i,e){return Zb(e,this.origin),jy(e,e,Zy(Ub,this.direction,i))},n}(),td="core-fetch-image",Vy;function Xb(n){Vy=n}function Yb(){return Vy}var Wy=!1;function qb(){Wy=!0}function Kb(){return Wy}var $y=[];function Uy(n){return $y.indexOf(n)>-1}function Jy(n){Uy(n)||$y.push(n)}var Pn={};function rd(n,r){Pn[n]=r}var Qb=`
|
|
36
|
-
var adapters = {};
|
|
37
|
-
// Dynamic Create Adapter
|
|
38
|
-
function createAdapter(key,code){
|
|
39
|
-
if(adapters[key]||!code){
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
var func=new Function('exports',code+'(exports)');
|
|
43
|
-
var workerExports={};
|
|
44
|
-
func(workerExports,self);
|
|
45
|
-
adapters[key]=workerExports;
|
|
46
|
-
workerExports.initialize && workerExports.initialize(self);
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
onmessage = function (msg) {
|
|
50
|
-
msg = msg.data;
|
|
51
|
-
//createAdapter
|
|
52
|
-
if (msg.messageType === 'createAdapter') {
|
|
53
|
-
var key=msg.key;
|
|
54
|
-
var code=msg.code;
|
|
55
|
-
createAdapter(key,code);
|
|
56
|
-
postMessage({adapterName:key});
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
// postMessage when main thread idle
|
|
60
|
-
if(msg.messageType==='idle'){
|
|
61
|
-
var messageRatio = msg.messageRatio;
|
|
62
|
-
handleMessageQueue(messageRatio);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (msg.messageType === 'batch') {
|
|
66
|
-
const messages = msg.messages;
|
|
67
|
-
if (messages) {
|
|
68
|
-
for (let i = 0; i < messages.length; i++) {
|
|
69
|
-
dispatch(messages[i]);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
} else {
|
|
73
|
-
dispatch(msg);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
function dispatch(msg) {
|
|
78
|
-
var workerKey = msg.workerKey;
|
|
79
|
-
var adapter = adapters[workerKey];
|
|
80
|
-
if (!adapter) {
|
|
81
|
-
post(msg.callback, 'Unregistered worker adapters for ' + workerKey);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
try {
|
|
85
|
-
adapter.onmessage(msg, wrap(msg.callback));
|
|
86
|
-
} catch (err) {
|
|
87
|
-
post(msg.callback, workerKey + ':' + err.message);
|
|
88
|
-
console.error(err);
|
|
89
|
-
throw err;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
var messageResultQueue = [];
|
|
94
|
-
|
|
95
|
-
function handleMessageQueue(messageRatio){
|
|
96
|
-
if(messageResultQueue.length===0){
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
var count = Math.ceil((messageRatio || 1) * messageResultQueue.length);
|
|
100
|
-
var queues = messageResultQueue.slice(0, count);
|
|
101
|
-
queues.forEach(function(queue){
|
|
102
|
-
post(queue.callback,queue.err,queue.data,queue.buffers);
|
|
103
|
-
});
|
|
104
|
-
messageResultQueue=messageResultQueue.slice(count, Infinity);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function post(callback, err, data, buffers) {
|
|
108
|
-
var msg = {
|
|
109
|
-
callback : callback
|
|
110
|
-
};
|
|
111
|
-
if (err) {
|
|
112
|
-
msg.error = err;
|
|
113
|
-
} else {
|
|
114
|
-
msg.data = data;
|
|
115
|
-
}
|
|
116
|
-
if (buffers && buffers.length > 0) {
|
|
117
|
-
postMessage(msg, buffers);
|
|
118
|
-
} else {
|
|
119
|
-
postMessage(msg);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function joinQueue(callback,err,data,buffers){
|
|
124
|
-
messageResultQueue.push({
|
|
125
|
-
callback:callback,
|
|
126
|
-
err:err,
|
|
127
|
-
data:data,
|
|
128
|
-
buffers:buffers
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function wrap(callback) {
|
|
133
|
-
return function (err, data, buffers) {
|
|
134
|
-
joinQueue(callback, err, data, buffers);
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
var workerExports;
|
|
138
|
-
`,eM=`
|
|
139
|
-
workerExports = null;
|
|
140
|
-
`;function tM(){var n=Qb;for(var r in Pn){var t=Pn[r];Jy(r),Oe(t)&&t.length===0&&(t=t()),n+=`
|
|
141
|
-
workerExports = {};
|
|
142
|
-
(`+t+`)(workerExports, self);
|
|
143
|
-
adapters['`+r+"'] = workerExports",n+=`
|
|
144
|
-
workerExports.initialize && workerExports.initialize(self);
|
|
145
|
-
`}return n+=eM,n}var Eu;function rM(){if(typeof window>"u")return null;if(!Eu){var n=tM();Eu=window.URL.createObjectURL(new Blob([n],{type:"text/javascript"})),Pn={}}return Eu}function iM(n,r){if(!Pn[n]){console.error("not find "+n+" adapter");return}var t=Pn[n];Oe(t)&&t.length===0&&(t=t()),t="("+t+")";var i=Yb();if(i){var e=i.workers||[];e.length===0&&console.error("workerpool workers count is 0");var o=0,s=function(l){l=l.data||{},l.adapterName===n&&(o++,o===e.length&&(e.forEach(function(h){h.removeEventListener("message",s)}),delete Pn[n],r()))};e.forEach(function(a){a.addEventListener("message",s),a.postMessage({key:n,code:t,messageType:"createAdapter"})})}}var nM=typeof window<"u"?window.navigator.hardwareConcurrency||4:0,oM=Math.max(Math.floor(nM/2),1),Wp=function(){function n(t=50){this._limit=t,this._messages=[],this.buffers=[]}var r=n.prototype;return r.addMessage=function(i,e){if(this._messages.push(i),!!Array.isArray(e))for(var o=0;o<e.length;o++)this.buffers.indexOf(e[o])<0&&this.buffers.push(e[o])},r.isFull=function(){return this._messages.length>=this._limit},r.getMessage=function(){return{messageType:"batch",messages:this._messages}},n}(),sM=function(){function n(){this.active={},this.workerCount=typeof window<"u"?wr.workerCount||oM:0,this._messages=[],this._messageBuffers=[]}var r=n.prototype;return r.acquire=function(i){if(!this.workers){this.workers=[];for(var e=rM(),o=0;o<this.workerCount;o++){var s=new Worker(e);s.id=o,this.workers.push(s)}URL.revokeObjectURL(e),qb()}return this.active[i]=!0,this.workers.slice()},r.release=function(i){delete this.active[i],Object.keys(this.active).length===0&&(this.workers.forEach(function(e){e.terminate()}),this.workers=null)},r.addMessage=function(i,e,o){var s=this._messages[i];(!s||!s.length)&&(s=this._messages[i]=[new Wp]);var a=s[s.length-1];a.isFull()&&(a=new Wp,this._messages[i].push(a)),a.addMessage(e,o)},r.commit=function(){if(this.workers&&this._messages.length){for(var i=0;i<this._messages.length;i++)if(!(!this._messages[i]||!this._messages[i].length)){var e=this._messages[i].shift();this.workers[i].postMessage(e.getMessage(),e.buffers)}}},r.getWorkers=function(){return this.workers||[]},r.broadcastIdleMessage=function(i){var e=this.getWorkers();return e.forEach(function(o){o.postMessage({messageType:"idle",messageRatio:i})}),this},n}(),Wa;function Yc(){return Wa||(Wa=new sM,Xb(Wa)),Wa}var ps=[],qc=[];function aM(n){qy();var r=new Promise(function(t,i){if(!n){i(new Error("task is null"));return}if(Oe(n)&&(n={count:1,run:n}),!n.run){i(new Error("task.run is null"));return}if(O(n.count)&&(n.count=1),n.count=Math.ceil(n.count),!X(n.count)){i(new Error("task.count is not number"));return}var e=n;e.results=[],ps.push(e),e.resolve=t});return r}function lM(){if(ps.length!==0){for(var n=[],r=[],t=ps.length,i=0;i<t;i++){var e=ps[i];if(e.count--,e.count===-1)r.push(e);else{n.push(e);var o=e.run();e.results.push(o)}}ps=n,t=r.length;for(var s=0;s<t;s++){var a=r[s];a.resolve&&a.resolve(a.results)}}}function Kc(n){var r=wr.messagePostRatioPerWorker*(n?.5:1);Yc().commit(),Yc().broadcastIdleMessage(r),lM(),qc.forEach(function(t){t()})}var Qc=He();function Xy(){Kc(),Qc=He(),requestIdleCallback(Xy)}function Yy(){if(Ce.requestIdleCallback){var{idleForceTimeThreshold:n,idleLog:r}=wr,t=He();t-Qc>n&&(Kc(!0),Qc=He(),r&&console.warn("did not apply for availability, forced run idle"))}else Kc();ai(Yy)}var $p=!1;function qy(){$p||($p=!0,Ce.requestIdleCallback&&requestIdleCallback(Xy),ai(Yy))}function hM(n){qc.indexOf(n)>-1||Oe(n)&&qc.push(n)}var id=function(){function n(t,i){var e=function(){};this.max=t,this.onRemove=i||e,this.reset()}var r=n.prototype;return r.reset=function(){if(this.data)for(var i=this.data.values(),e=Sp(i),o;!(o=e()).done;){var s=o.value;this.onRemove(s)}return this.data=new Map,this},r.clear=function(){this.reset(),delete this.onRemove},r.add=function(i,e){return e?(this.has(i)?(this.data.delete(i),this.data.set(i,e)):this.data.set(i,e),this):this},r.keys=function(){for(var i=new Array(this.data.size),e=0,o=this.data.keys(),s=Sp(o),a;!(a=s()).done;){var l=a.value;i[e++]=l}return i},r.shrink=function(){for(var i=this.data.keys(),e=i.next();this.data.size>this.max;){var o=this.getAndRemove(e.value);o&&this.onRemove(o),e=i.next()}},r.has=function(i){return this.data.has(i)},r.getAndRemove=function(i){if(!this.has(i))return null;var e=this.data.get(i);return this.data.delete(i),e},r.get=function(i){if(!this.has(i))return null;var e=this.data.get(i);return e},r.remove=function(i){if(!this.has(i))return this;var e=this.data.get(i);return this.data.delete(i),this.onRemove(e),this},r.setMaxSize=function(i){return this.max=i,this.data.size>this.max&&this.shrink(),this},n}(),nd={exports:{}},Ky={exports:{}};(function(n,r){(function(t,i){n.exports=i()})(zb,function(){function t(s,a,l,h,u){i(s,a,l||0,h||s.length-1,u||o)}function i(s,a,l,h,u){for(;h>l;){if(h-l>600){var c=h-l+1,f=a-l+1,d=Math.log(c),g=.5*Math.exp(2*d/3),p=.5*Math.sqrt(d*g*(c-g)/c)*(f-c/2<0?-1:1),m=Math.max(l,Math.floor(a-f*g/c+p)),v=Math.min(h,Math.floor(a+(c-f)*g/c+p));i(s,a,m,v,u)}var _=s[a],y=l,w=h;for(e(s,l,a),u(s[h],_)>0&&e(s,l,h);y<w;){for(e(s,y,w),y++,w--;u(s[y],_)<0;)y++;for(;u(s[w],_)>0;)w--}u(s[l],_)===0?e(s,l,w):(w++,e(s,w,h)),w<=a&&(l=w+1),a<=w&&(h=w-1)}}function e(s,a,l){var h=s[a];s[a]=s[l],s[l]=h}function o(s,a){return s<a?-1:s>a?1:0}return t})})(Ky);var uM=Ky.exports;nd.exports=oa;nd.exports.default=oa;var cM=uM;function oa(n,r){if(!(this instanceof oa))return new oa(n,r);this._maxEntries=Math.max(4,n||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),r&&this._initFormat(r),this.clear()}oa.prototype={all:function(){return this._all(this.data,[])},search:function(n){var r=this.data,t=[],i=this.toBBox;if(!Ua(n,r))return t;for(var e=[],o,s,a,l;r;){for(o=0,s=r.children.length;o<s;o++)a=r.children[o],l=r.leaf?i(a):a,Ua(n,l)&&(r.leaf?t.push(a):Ou(n,l)?this._all(a,t):e.push(a));r=e.pop()}return t},collides:function(n){var r=this.data,t=this.toBBox;if(!Ua(n,r))return!1;for(var i=[],e,o,s,a;r;){for(e=0,o=r.children.length;e<o;e++)if(s=r.children[e],a=r.leaf?t(s):s,Ua(n,a)){if(r.leaf||Ou(n,a))return!0;i.push(s)}r=i.pop()}return!1},load:function(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(var r=0,t=n.length;r<t;r++)this.insert(n[r]);return this}var i=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=i;else if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var e=this.data;this.data=i,i=e}this._insert(i,this.data.height-i.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=no([]),this},remove:function(n,r){if(!n)return this;for(var t=this.data,i=this.toBBox(n),e=[],o=[],s,a,l,h;t||e.length;){if(t||(t=e.pop(),a=e[e.length-1],s=o.pop(),h=!0),t.leaf&&(l=fM(n,t.children,r),l!==-1))return t.children.splice(l,1),e.push(t),this._condense(e),this;!h&&!t.leaf&&Ou(t,i)?(e.push(t),o.push(s),s=0,a=t,t=t.children[0]):a?(s++,t=a.children[s],h=!1):t=null}return this},toBBox:function(n){return n},compareMinX:Up,compareMinY:Jp,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,r){for(var t=[];n;)n.leaf?r.push.apply(r,n.children):t.push.apply(t,n.children),n=t.pop();return r},_build:function(n,r,t,i){var e=t-r+1,o=this._maxEntries,s;if(e<=o)return s=no(n.slice(r,t+1)),jn(s,this.toBBox),s;i||(i=Math.ceil(Math.log(e)/Math.log(o)),o=Math.ceil(e/Math.pow(o,i-1))),s=no([]),s.leaf=!1,s.height=i;var a=Math.ceil(e/o),l=a*Math.ceil(Math.sqrt(o)),h,u,c,f;for(Xp(n,r,t,l,this.compareMinX),h=r;h<=t;h+=l)for(c=Math.min(h+l-1,t),Xp(n,h,c,a,this.compareMinY),u=h;u<=c;u+=a)f=Math.min(u+a-1,c),s.children.push(this._build(n,u,f,i-1));return jn(s,this.toBBox),s},_chooseSubtree:function(n,r,t,i){for(var e,o,s,a,l,h,u,c;i.push(r),!(r.leaf||i.length-1===t);){for(u=c=1/0,e=0,o=r.children.length;e<o;e++)s=r.children[e],l=Su(s),h=dM(n,s)-l,h<c?(c=h,u=l<u?l:u,a=s):h===c&&l<u&&(u=l,a=s);r=a||r.children[0]}return r},_insert:function(n,r,t){var i=this.toBBox,e=t?n:i(n),o=[],s=this._chooseSubtree(e,this.data,r,o);for(s.children.push(n),ms(s,e);r>=0&&o[r].children.length>this._maxEntries;)this._split(o,r),r--;this._adjustParentBBoxes(e,o,r)},_split:function(n,r){var t=n[r],i=t.children.length,e=this._minEntries;this._chooseSplitAxis(t,e,i);var o=this._chooseSplitIndex(t,e,i),s=no(t.children.splice(o,t.children.length-o));s.height=t.height,s.leaf=t.leaf,jn(t,this.toBBox),jn(s,this.toBBox),r?n[r-1].children.push(s):this._splitRoot(t,s)},_splitRoot:function(n,r){this.data=no([n,r]),this.data.height=n.height+1,this.data.leaf=!1,jn(this.data,this.toBBox)},_chooseSplitIndex:function(n,r,t){var i,e,o,s,a,l,h,u;for(l=h=1/0,i=r;i<=t-r;i++)e=vs(n,0,i,this.toBBox),o=vs(n,i,t,this.toBBox),s=gM(e,o),a=Su(e)+Su(o),s<l?(l=s,u=i,h=a<h?a:h):s===l&&a<h&&(h=a,u=i);return u},_chooseSplitAxis:function(n,r,t){var i=n.leaf?this.compareMinX:Up,e=n.leaf?this.compareMinY:Jp,o=this._allDistMargin(n,r,t,i),s=this._allDistMargin(n,r,t,e);o<s&&n.children.sort(i)},_allDistMargin:function(n,r,t,i){n.children.sort(i);var e=this.toBBox,o=vs(n,0,r,e),s=vs(n,t-r,t,e),a=$a(o)+$a(s),l,h;for(l=r;l<t-r;l++)h=n.children[l],ms(o,n.leaf?e(h):h),a+=$a(o);for(l=t-r-1;l>=r;l--)h=n.children[l],ms(s,n.leaf?e(h):h),a+=$a(s);return a},_adjustParentBBoxes:function(n,r,t){for(var i=t;i>=0;i--)ms(r[i],n)},_condense:function(n){for(var r=n.length-1,t;r>=0;r--)n[r].children.length===0?r>0?(t=n[r-1].children,t.splice(t.indexOf(n[r]),1)):this.clear():jn(n[r],this.toBBox)},_initFormat:function(n){var r=["return a"," - b",";"];this.compareMinX=new Function("a","b",r.join(n[0])),this.compareMinY=new Function("a","b",r.join(n[1])),this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};function fM(n,r,t){if(!t)return r.indexOf(n);for(var i=0;i<r.length;i++)if(t(n,r[i]))return i;return-1}function jn(n,r){vs(n,0,n.children.length,r,n)}function vs(n,r,t,i,e){e||(e=no(null)),e.minX=1/0,e.minY=1/0,e.maxX=-1/0,e.maxY=-1/0;for(var o=r,s;o<t;o++)s=n.children[o],ms(e,n.leaf?i(s):s);return e}function ms(n,r){return n.minX=Math.min(n.minX,r.minX),n.minY=Math.min(n.minY,r.minY),n.maxX=Math.max(n.maxX,r.maxX),n.maxY=Math.max(n.maxY,r.maxY),n}function Up(n,r){return n.minX-r.minX}function Jp(n,r){return n.minY-r.minY}function Su(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function $a(n){return n.maxX-n.minX+(n.maxY-n.minY)}function dM(n,r){return(Math.max(r.maxX,n.maxX)-Math.min(r.minX,n.minX))*(Math.max(r.maxY,n.maxY)-Math.min(r.minY,n.minY))}function gM(n,r){var t=Math.max(n.minX,r.minX),i=Math.max(n.minY,r.minY),e=Math.min(n.maxX,r.maxX),o=Math.min(n.maxY,r.maxY);return Math.max(0,e-t)*Math.max(0,o-i)}function Ou(n,r){return n.minX<=r.minX&&n.minY<=r.minY&&r.maxX<=n.maxX&&r.maxY<=n.maxY}function Ua(n,r){return r.minX<=n.maxX&&r.minY<=n.maxY&&r.maxX>=n.minX&&r.maxY>=n.minY}function no(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Xp(n,r,t,i,e){for(var o=[r,t],s;o.length;)t=o.pop(),r=o.pop(),!(t-r<=i)&&(s=r+Math.ceil((t-r)/i/2)*i,cM(n,s,r,t,e),o.push(r,s,s,t))}var pM=nd.exports,vM=Qf(pM),Yo={},Go=function(){function n(){this._tree=vM(9,["[0]","[1]","[2]","[3]"])}var r=n.prototype;return r.collides=function(i){return[Yo.minX,Yo.minY,Yo.maxX,Yo.maxY]=i,this._tree.collides(Yo)},r.insertBox=function(i){var e=this._tree;return e.insert(i),this},r.bulkInsertBox=function(i){return this._tree.load(i),this},r.clear=function(){return this._tree.clear(),this},n}(),Yp=new id(5e4);function mM(n,r,t){var i=n.font,e=n.fillStyle,o=n.strokeStyle,s=r.textHaloFill||vl,a=r.textHaloRadius||0,l=r.textHaloOpacity;X(l)||(l=1);var h=i+"_"+e+"_"+s+"_"+a+"_"+l+"_"+t,u=Yp.get(h);if(!u){var c=l!==0&&a!==0,f=((r.textSize||14)*1.2+a)*2,d=J.createCanvas(f,f);d.style.width=f/2+"px",d.style.height=f/2+"px";var g=f/4,p=f/4,m=J.getCanvas2DContext(d);m.scale(2,2),m.font=i,m.textAlign="center",m.textBaseline="middle",c&&(m.strokeStyle=o,m.lineWidth=a*2,m.globalAlpha=1,m.globalAlpha*=l,m.strokeText(t,g,p),m.globalAlpha=1),m.fillStyle=e,m.fillText(t,g,p),u=d,Yp.add(h,u)}return u}var vl="#000",_M="rgba(255,255,255,0)",yM="#000",qo=!1,Zn=null,Vn=Math.PI/180,qp=1,Kp="top",ku=new Go,Ru=new Go;function wM(){for(var n={},r=32;r<128;r++){var t=String.fromCharCode(r);n[t]=t}return n}var Qy=wM();function xM(n){for(var r=0,t=n.length;r<t;r++){var i=n[r];if(!Qy[i])return!1}return!0}function Qp(n){if(n.toReversed)return n.toReversed();for(var r=[],t=0,i=n.length-1;t<=i;t++)r[t]=n[i-t];return r}function CM(n,r,t,i,e){var o=n.x,s=n.y,a=r.x,l=r.y,h=a-o,u=l-s,c=Math.atan2(u,h),f=c/Math.PI*180;return i==="left"?(f+=180,c=f/180*Math.PI,c):i==="down"&&!e?(f-=90,c=f/180*Math.PI,c):(i==="up"&&!e&&(f+=90,c=f/180*Math.PI),c)}function e0(n,r){var t=r,i=r;Qy[n]&&(t=r/4,i=r);var e=Math.sqrt(t*t+i*i);return e}function TM(n,r){for(var t=0,i=0,e=n.length;i<e;i++){var o=n[i];t+=e0(o,r)}return t}function bM(n,r){var{distance:t,p1:i,p2:e}=n,o=e.x-i.x,s=e.y-i.y,a=(e.z||0)-(i.z||0),l=r/t,h=i.x+l*o,u=i.y+l*s,c=(i.z||0)+l*a;return new z(h,u,c)}function MM(n,r){r=Object.assign({segDistance:1,isGeo:!0},r);for(var t=Math.max(r.segDistance,1e-17),i=[],e=0,o=0,s=0,a=n.length;s<a-1;s++){var l=n[s],h=n[s+1],u=h.distanceTo(l);i[o]={p1:l,distance:u,p2:h},o++,e+=u}if(e<=t)return[{distance:e,points:n}];var c=i.length,f=i[0];o=0;for(var d,g=0,p=[],m=[f.p1];o<c;){var{distance:v,p2:_}=i[o];if(g+=v,g<t){m.push(_),o++;continue}if(g===t){m.push(_),g=0,p.push(m),m=[_],o++;continue}if(g>t){var y=t-(g-v);d=bM(i[o],y),m.push(d),p.push(m),g=0,i[o].p1=d,i[o].distance=v-y,m=[d]}}m.length&&p.push(m);for(var w=[],x=0,C=p.length;x<C;x++){var b=p[x];w[x]={points:b,distance:Jl(b)}}return w}function PM(n){for(var r=n.length,t=n[0].point,i=n[r-1].point,e=ur(),o=0,s=n.length;o<s;o++){var a=n[o].point;Ii(a,e)}var[l,h,u,c]=e,f=u-l,d=c-h,g=!0;return d>f&&(g=!1),g?t.x<i.x?"right":"left":t.y<i.y?"down":"up"}function Au(n,r,t,i){var e=Jl(n),o=[],s=0,a=!1;ku.clear();for(var l=1,h=0,u=r.length;h<u;h++){for(var c=r[h],f=e0(c,t),d=f+s,g=l,p=n.length;g<p;g++){var m=n[g-1],v=n[g];if(!(v.distance<d)){l=g;var _=d-m.distance,y=_/(v.distance-m.distance),w=v.x-m.x,x=v.y-m.y,C=new z(m.x+w*y,m.y+x*y),{x:b,y:E}=C,T=f/3,S=[b-T,E-T,b+T,E+T];if(i&&i.collides(S)){a=!0;break}if(ku.collides(S)){a=!0;break}else ku.insertBox(S);T=f/2,o.push({char:c,charSize:f,point:C,bbox:[b-T,E-T,b+T,E+T]}),s+=f;break}}if(a)break}return a?[]:e<s?[]:o}function EM(n,r,t,i,e,o,s,a,l,h){var u=1-n,c=1-r,f=t*u*u+e*2*n*u+s*n*n,d=t*c*c+e*2*r*c+s*r*r,g=e*u*u+s*2*n*u+l*n*n,p=e*c*c+s*2*r*c+l*r*r,m=i*u*u+o*2*n*u+a*n*n,v=i*c*c+o*2*r*c+a*r*r,_=o*u*u+a*2*n*u+h*n*n,y=o*c*c+a*2*r*c+h*r*r,w=f*c+g*r,x=d*u+p*n,C=d*c+p*r,b=m*c+_*r,E=v*u+y*n,T=v*c+y*r;return[w,b,x,E,C,T]}function ev(n,r,t,i,e,o,s,a,l,h){var u=(n+t)/2,c=(r+i)/2,f=(t+e)/2,d=(i+o)/2,g=(e+s)/2,p=(o+a)/2,m=Math.sqrt((t-n)*(t-n)+(i-r)*(i-r)),v=Math.sqrt((e-t)*(e-t)+(o-i)*(o-i)),_=Math.sqrt((s-e)*(s-e)+(a-o)*(a-o)),y=m/(m+v),w=v/(v+_),x=u+(f-u)*y,C=c+(d-c)*y,b=f+(g-f)*w,E=d+(p-d)*w,T=x+(f-x)*l+t-x,S=C+(d-C)*l+i-C,B=b+(f-b)*l+e-b,L=E+(d-E)*l+o-E,D=[T,S,B,L];return h<1?EM(0,h,t,i,T,S,B,L,e,o):D}function Jl(n){if(n.length<2)return 0;var r=0;n[0].distance=0;for(var t=1,i=n.length;t<i;t++){var e=n[t-1],o=n[t],s=e.distanceTo(o);o.distance=s+e.distance,r+=s}return r}function SM(n){if(X(n.minStep))return n.minStep;for(var r=n.colors||[],t=r.length,i=[],e=0;e<t;e++)i[e]=r[e][0];i.sort(function(u,c){return u-c});for(var o=1/0,s=1;s<t;s++){var a=i[s-1],l=i[s],h=l-a;o=Math.min(o,h)}return n.minStep=o,o}function OM(n,r,t){var i=n.x,e=n.y,o=r.x,s=r.y,a=o-i,l=s-e;return new z(i+a*t,e+l*t)}function Lu(n,r,t,i){return"rgba("+n+", "+r+", "+t+", "+i/255+")"}var Iu,J={getTempCanvas:function(){return Iu||(Iu=J.createCanvas(1,1)),Iu},getCanvas2DPerformanceContext:function(r){return r.getContext("2d",{})},getCanvas2DContext:function(r){return r.getContext("2d",{willReadFrequently:!0})},setHitTesting:function(r){qo=r},createCanvas:function(r,t,i){var e;return Ct?e=new i(r,t):(e=we("canvas"),e.width=r,e.height=t),e},prepareCanvasFont:function(r,t,i){r.textBaseline!==Kp&&(r.textBaseline=Kp),i=i||Ta(t),r.font!==i&&(r.font=i);var e=t.textFill;e||(e=yM);var o=J.getRgba(e,t.textOpacity);r.fillStyle!==o&&(r.fillStyle=o)},prepareCanvas:function(r,t,i,e){if(t){var o=t.lineWidth;!O(o)&&r.lineWidth!==o&&(r.lineWidth=o);var s=t.linePatternFile,a=t.lineColor||vl,l=t.lineStrokeColor,h=t.lineStrokeWidth;if(r.lineStrokeColor=null,r.lineStrokeWidth=null,l&&(Array.isArray(l)&&(l=J.normalizeColorToRGBA(l)),r.lineStrokeColor=l),h&&h>0&&(r.lineStrokeWidth=h),e)r.strokeStyle="#000";else if(s&&i){var u;(t.linePatternDx||t.linePatternDy)&&(u=[t.linePatternDx,t.linePatternDy]),J._setStrokePattern(r,s,o,u,i),t.lineDasharray=[]}else Li(a)?t.lineGradientExtent?r.strokeStyle=J._createGradient(r,a,t.lineGradientExtent):r.strokeStyle=vl:(Array.isArray(a)&&(a=J.normalizeColorToRGBA(a)),r.strokeStyle=a);t.lineJoin&&(r.lineJoin=t.lineJoin),t.lineCap&&(r.lineCap=t.lineCap),r.setLineDash&&$e(t.lineDasharray)&&r.setLineDash(t.lineDasharray);var c=t.polygonPatternFile,f=t.polygonFill||_M;if(e)r.fillStyle="#000";else if(c&&i){var d=rv(c),g=i.getImage([d,null,null]);if(g||(g=i.getImage([d+"-texture",null,o])),Si(d)&&g instanceof Image&&(Ce.edge||Ce.ie)){var p=g.width||20,m=g.height||20,v=J.createCanvas(p,m);J.image(v.getContext("2d"),g,0,0,p,m),g=v}g?(r.fillStyle=r.createPattern(g,"repeat"),(t.polygonPatternDx||t.polygonPatternDy)&&(r.fillStyle.polygonPatternOffset=[t.polygonPatternDx,t.polygonPatternDy])):typeof console<"u"&&console.warn("img not found for",d)}else Li(f)?t.polygonGradientExtent?r.fillStyle=J._createGradient(r,f,t.polygonGradientExtent):r.fillStyle="rgba(255,255,255,0)":(Array.isArray(f)&&(f=J.normalizeColorToRGBA(f)),r.fillStyle=f)}},_createGradient:function(r,t,i){var e=null,o=t.places,s=i.getMin(),a=i.getMax(),l=i.getWidth(),h=i.getHeight(),u=i.bearing||0;if(!t.type||t.type==="linear"){if(!o)o=[s.x,s.y,a.x,s.y];else{if(o.length!==4)throw new Error("A linear gradient's places should have 4 numbers.");o=[s.x+o[0]*l,s.y+o[1]*h,s.x+o[2]*l,s.y+o[3]*h]}if(u!==0&&!t.places){var c=180-u,f=c+180,{xmin:d,ymin:g,xmax:p,ymax:m}=i,v=(d+p)/2,_=(g+m)/2,y=Math.sqrt(l*l+h*h)/2,w=c/180*Math.PI,x=f/180*Math.PI,C=Math.cos(w)*y+v,b=Math.sin(w)*y+_,E=Math.cos(x)*y+v,T=Math.sin(x)*y+_;o=[C,b,E,T]}e=r.createLinearGradient.apply(r,o)}else if(t.type==="radial"){if(o){if(o.length!==6)throw new Error("A radial gradient's places should have 6 numbers.");o=[s.x+o[0]*l,s.y+o[1]*h,l*o[2],s.x+o[3]*l,s.y+o[4]*h,l*o[5]]}else{var S=i.getCenter()._round();o=[S.x,S.y,Math.abs(S.x-s.x),S.x,S.y,0]}e=r.createRadialGradient.apply(r,o)}return t.colorStops.forEach(function(B){e.addColorStop.apply(e,B)}),e},_setStrokePattern:function(r,t,i,e,o){var s=rv(t),a;if(Ct)a=o.getImage([s,null,i]);else{var l=s+"-texture-"+i;if(a=o.getImage(l),!a){var h=o.getImage([s,null,null]);if(h){var u;!h.width||!h.height?u=i:u=Math.round(h.width*i/h.height);var c=J.createCanvas(u,i,r.canvas.constructor);J.image(c.getContext("2d"),h,0,0,u,i),o.addResource([l,null,i],c),a=c}}}a?(r.strokeStyle=r.createPattern(a,"repeat"),r.strokeStyle.linePatternOffset=e):typeof console<"u"&&console.warn("img not found for",s)},clearRect:function(r,t,i,e,o){r.canvas._drawn=!1,r.clearRect(t,i,e,o)},fillCanvas:function(r,t,i,e){if(qo&&(t=1),r.canvas._drawn=!0,t!==0){var o=J._isPattern(r.fillStyle),s=r.fillStyle&&r.fillStyle.polygonPatternOffset,a=s?s[0]:0,l=s?s[1]:0;O(t)&&(t=1);var h;t<1&&(h=r.globalAlpha,r.globalAlpha*=t),o&&(i=i||0,e=e||0,r.translate(i+a,e+l)),r.fill(),o&&r.translate(-i-a,-e-l),t<1&&(r.globalAlpha=h)}},getRgba:function(r,t){if(O(t)&&(t=1),r[0]==="#"&&t===1)return r;if(r[0]!=="#")return Array.isArray(r)&&(r=J.normalizeColorToRGBA(r,t)),r;var i,e,o;return r.length===7?(i=parseInt(r.substring(1,3),16),e=parseInt(r.substring(3,5),16),o=parseInt(r.substring(5,7),16)):(i=parseInt(r.substring(1,2),16)*17,e=parseInt(r.substring(2,3),16)*17,o=parseInt(r.substring(3,4),16)*17),"rgba("+i+","+e+","+o+","+t+")"},normalizeColorToRGBA:function(r,t=1){return"rgba("+r[0]*255+", "+r[1]*255+", "+r[2]*255+", "+(r.length===4?r[3]:1)*t+")"},image:function(r,t,i,e,o,s){r.canvas._drawn=!0;try{X(o)&&X(s)?r.drawImage(t,i,e,o,s):r.drawImage(t,i,e)}catch(a){console&&(console.warn("error when drawing image on canvas:",a),console.warn(t))}},text:function(r,t,i,e,o){return J._textOnMultiRow(r,o.rows,e,i,o.size,o.rawSize)},_textOnMultiRow:function(r,t,i,e,o,s){var a=li(o,i.textHorizontalAlignment,i.textVerticalAlignment),l=s.height+i.textLineSpacing,h=e.add(0,a.y),u=i.textMaxHeight,c,f,d=0;Mo(yo);for(var g=0,p=t.length;g<p;g++){c=t[g].text,f=li(t[g].size,i.textHorizontalAlignment,i.textVerticalAlignment);var m=h.add(f.x,g*l);J._textOnLine(r,c,m,i.textHaloRadius,i.textHaloFill,i.textHaloOpacity);var v=t[g].size,_=m.x,y=m.y,w=_+v.width,x=y+v.height;if(ra(yo,_,y,w,x),u>0&&(d+=l,d+v.height>=u))break}return yo},_textOnLine:function(r,t,i,e,o,s){qo&&(s=1);var a=s!==0&&e!==0;r.textBaseline="top";var l,h,u=r.shadowBlur,c=r.shadowOffsetX,f=r.shadowOffsetY;if(a){var d=r.globalAlpha;r.globalAlpha*=s,r.miterLimit=2,r.lineJoin="round",r.lineCap="round",r.lineWidth=e*2,Array.isArray(o)&&(o=J.normalizeColorToRGBA(o)),r.strokeStyle=o,r.strokeText(t,i.x,i.y+qp),r.miterLimit=10,r.globalAlpha=d,l=r.globalCompositeOperation,r.globalCompositeOperation="destination-out",h=r.fillStyle,r.fillStyle="#000"}u&&a&&(r.shadowBlur=r.shadowOffsetX=r.shadowOffsetY=0),J.fillText(r,t,i),l&&(r.globalCompositeOperation=l,J.fillText(r,t,i,h),u&&(r.shadowBlur=u,r.shadowOffsetX=c,r.shadowOffsetY=f))},fillText:function(r,t,i,e){r.canvas._drawn=!0,e&&(r.fillStyle=e),r.fillText(t,i.x,i.y+qp)},textAlongLine:function(r,t,i,e,o,s){if(t){var a=e.textSize||14,l=e.textSpacing||0,h=TM(t,a);if(!(l<h)){Array.isArray(i[0])||(i=[i]);var u=r.textBaseline,c=r.textAlign,f=r.strokeStyle,d=r.globalAlpha,g=r.lineWidth,p=e.textAlongDebug,m=e.textHaloFill||vl,v=e.textHaloRadius||0,_=e.textHaloOpacity;X(_)||(_=1);var y=_!==0&&v!==0;r.textBaseline="middle",r.textAlign="center",y&&(Array.isArray(m)&&(m=J.normalizeColorToRGBA(m)),r.strokeStyle=m,r.lineWidth=v*2),Ru.clear();var w=ur(),x=t.split(""),C=xM(x);if(i.forEach(function(b){var E=Jl(b);if(!(E<h)){var T=MM(b,{segDistance:l});if(!(!T||!T.length))for(var S=0,B=T.length;S<B;S++){var L=T[S],D=L.distance;if(!(D<h)){var N=L.points;if(p){var G=r.fillStyle;r.fillStyle="red";var{x:I,y:A}=N[0];r.beginPath(),r.fillRect(I-2,A-2,4,4),r.fillStyle=G}var k=x,Z=Au(N,k,a,s);if(Z.length){var W=PM(Z);W==="left"&&(k=Qp(k),Z=Au(N,k,a,s)),W==="up"&&!C&&(k=Qp(k),Z=Au(N,k,a,s));for(var re=!1,se=0,me=Z.length;se<me;se++){var{bbox:ge}=Z[se];if(Ru.collides(ge)){re=!0;break}if(s&&s.collides(ge)){re=!0;break}}if(!re)for(var de=0,_e=Z.length;de<_e;de++){var Te=void 0,Ge=void 0;de===0?(Te=Z[de].point,Ge=Z[1].point):de===_e-1?(Te=Z[_e-2].point,Ge=Z[_e-1].point):(Te=Z[de-1].point,Ge=Z[de].point);var Me=k[de],{point:Be,bbox:lt}=Z[de];Ru.insertBox(lt),s&&s.insertBox(lt);var{x:M,y:R}=Be,V=CM(Te,Ge,Me,W,C);r.save(),r.translate(M,R),r.rotate(V);var q=mM(r,e,Me),{width:U,height:K}=q;if(r.drawImage(q,-U/4,-K/4,U/2,K/2),r.restore(),ra(w,lt),p){var ie=r.strokeStyle,ne=r.lineWidth;r.strokeStyle="red",r.lineWidth=.5;var[le,ee,ye,ce]=lt;r.beginPath(),r.rect(le,ee,ye-le,ce-ee),r.stroke(),r.lineWidth=ne,r.strokeStyle=ie}}}}}}}),r.textBaseline=u,r.textAlign=c,r.strokeStyle=f,r.globalAlpha=d,r.lineWidth=g,!!ia(w))return w}}},_stroke:function(r,t,i,e){if(qo&&(t=1),r.canvas._drawn=!0,t!==0){var o=function(){if(r.lineStrokeColor&&r.lineStrokeWidth&&r.lineStrokeWidth>0){var f=r.lineStrokeColor,d=r.lineStrokeWidth,g=r.globalAlpha,p=r.strokeStyle,m=r.lineWidth;X(t)&&t<1&&(r.globalAlpha=1,r.globalAlpha*=t),r.lineWidth=m+d*2,r.strokeStyle=f,r.stroke(),r.lineWidth=m,r.strokeStyle=p,r.globalAlpha=g}};o();var s=r.strokeStyle&&r.strokeStyle.linePatternOffset,a=s?s[0]:0,l=s?s[1]:0,h=J._isPattern(r.strokeStyle)&&(!O(i)&&!O(e)||!O(a)&&!O(l));O(t)&&(t=1);var u;t<1&&(u=r.globalAlpha,r.globalAlpha*=t),h&&(i=i||0,e=e||0,r.translate(i+a,e+l)),r.stroke(),h&&r.translate(-i-a,-e-l),t<1&&(r.globalAlpha=u)}},_gradientPath:function(r,t,i,e,o=!1){if(X(e)||(e=1),qo&&(e=1),!(e===0||r.lineWidth===0)){var s=r.globalAlpha;r.globalAlpha*=e;var a=r.lineColorIn,l=SM(a),h=Jl(t),u=0,c,f,d,g,p,m,v,[_,y,w,x]=a.getColor(0);c=Lu(_,y,w,x);var C=t[0];if(d=C.x,g=C.y,o){var b=t.length,E=t[b-1];C.equals(E)||t.push(C)}for(var T=i&&Array.isArray(i)&&i.length>1,S=function(){!T&&v&&(r.strokeStyle=f,r.beginPath(),r.moveTo(d,g),r.lineTo(p,m),r.lineTo(v.x,v.y),r.stroke());var M=r.createLinearGradient(d,g,p,m);M.addColorStop(0,c),M.addColorStop(1,f),r.strokeStyle=M,r.beginPath(),r.moveTo(d,g),r.lineTo(p,m),r.stroke(),c=f,d=p,g=m},B=1,L=t.length;B<L;B++){var D=t[B-1],N=t[B];v=t[B+1];var G=N.x,I=N.y,A=N.distanceTo(D),k=A/h;if(k<=l){var[Z,W,re,se]=a.getColor(u+k);f=Lu(Z,W,re,se),p=G,m=I,S()}else{var me=Math.ceil(k/l);v=N;for(var ge=1;ge<=me;ge++){var de=Math.min(ge*l,k),[_e,Te,Ge,Me]=a.getColor(u+de);if(f=Lu(_e,Te,Ge,Me),f!==c){var Be=OM(D,N,de/k);p=Be.x,m=Be.y,S()}}}u+=k}r.globalAlpha=s}},_path:function(r,t,i,e,o){if(!$e(t))return;function s(g,p){var m=Gl(g.x,g.y,p.x,p.y);r.save();var v=Math.cos(m);Math.abs(v)<1e-7?r.translate(g.x-r.lineWidth/2,g.y):r.translate(g.x,g.y-r.lineWidth/2/v),r.rotate(m),J._stroke(r,e),r.restore()}for(var a=$e(i),l=o===!0?!1:J._isPattern(r.strokeStyle),h,u,c,f=0,d=t.length;f<d;f++)if(h=t[f],!a||r.setLineDash)r.lineTo(h.x,h.y),l&&f>0&&(u=t[f-1],s(u,h),r.beginPath(),r.moveTo(h.x,h.y));else if(a){if(f===d-1)break;c=t[f+1],kM(r,h,c,i)}},path:function(r,t,i,e,o){$e(t)&&(r.lineColorIn?J._gradientPath(r,t,o,i):(r.beginPath(),r.moveTo(t[0].x,t[0].y),J._path(r,t,o,i)),J._stroke(r,i))},roundRect:function(r,t,i,e){if(Ce.roundRect){for(var o=1/0,s=1/0,a=-1/0,l=-1/0,h=0,u=t.length;h<u;h++){var c=t[h],{x:f,y:d}=c;o=Math.min(o,f),s=Math.min(s,d),a=Math.max(a,f),l=Math.max(l,d)}var g=Math.abs(a-o),p=Math.abs(l-s);if(!(g*p<=0)){var m=Math.min(g,p);r.roundRect(o,s,g,p,m/4);var v=r.globalAlpha;X(e)&&e<1&&(r.globalAlpha=1,r.globalAlpha*=e),r.fill(),r.globalAlpha=v,X(i)&&i<1&&(r.globalAlpha=1,r.globalAlpha*=i),r.stroke(),r.globalAlpha=v}}},_multiClip:function(r,t){!t||t.length===0||t.forEach(function(i){for(var e=0,o=i.length;e<o;e++){var s=i[e],a=s.x,l=s.y;e===0?r.moveTo(a,l):r.lineTo(a,l),e===o-1&&(a=i[0].x,l=i[0].y,r.lineTo(a,l))}})},polygon:function(r,t,i,e,o,s){if(r.isMultiClip){J._multiClip(r,t);return}if(r.isClip){J._multiClip(r,Array.isArray(t[0])?t:[t]);return}if($e(t)){var a=J._isPattern(r.strokeStyle),l=$e(o)&&!r.setLineDash||a&&!s;$e(t[0])||(t=[t]);var h=r,u=r.dpr||1,c=u!==1;t.length>1&&!Ct&&(Zn||(Zn=J.createCanvas(1,1)),r.canvas._drawn=!1,Zn.width=r.canvas.width,Zn.height=r.canvas.height,r=Zn.getContext("2d"),nv(r,[]),nv(r,o),iv(r,h),c&&r.scale(u,u));var f=r.lineColorIn,d=r.lineWidth,g,p,m;if(l){for(r.save(),p=0,m=t.length;p<m;p++)$e(t[p])&&(f&&(r.lineWidth=.1),J._ring(r,t[p],null,0,!0),g=e,p>0&&(r.globalCompositeOperation="destination-out",g=1),J.fillCanvas(r,g,t[p][0].x,t[p][0].y),p>0?r.globalCompositeOperation="source-over":m>1&&(r.fillStyle="#fff"),J._stroke(r,0),r.lineWidth=d,f&&J._gradientPath(r,t,null,0,!0));r.restore()}var v=r.fillStyle;for(p=0,m=t.length;p<m;p++)$e(t[p])&&(f&&(r.lineWidth=.1),s?(J.paintSmoothLine(r,t[p],i,s,!0),r.closePath()):J._ring(r,t[p],o,i),l||(g=e,p>0&&(r.globalCompositeOperation="destination-out",g=1),J.fillCanvas(r,g,t[p][0].x,t[p][0].y),p>0?r.globalCompositeOperation="source-over":m>1&&(r.fillStyle="#fff")),J._stroke(r,i),r.lineWidth=d,f&&J._gradientPath(r,t[p],o,i,!0));if(r.fillStyle!==v&&(r.fillStyle=v),t.length>1&&!Ct){if(c){var _=1/u;h.scale(_,_)}h.drawImage(Zn,0,0),c&&h.scale(u,u),h.canvas._drawn=r.canvas._drawn,iv(h,r)}}},_ring:function(r,t,i,e,o){var s=J._isPattern(r.strokeStyle);!o&&s&&!t[0].equals(t[t.length-1])&&(t=t.concat([t[0]])),r.beginPath(),r.moveTo(t[0].x,t[0].y),J._path(r,t,i,e,o),s||r.closePath()},paintSmoothLine_bak:function(r,t,i,e,o,s,a){if(t){if(t.length<=2||!e){J.path(r,t,i);return}var l=t.length,h=o?l:l-1;r.beginPath(),r.moveTo(t[0].x,t[0].y),a!==void 0&&(h-=Math.max(h-s-1,0));for(var u,c=0;c<h;c++){var f=t[c].x,d=t[c].y,g=void 0,p=void 0,m=void 0,v=void 0,_=void 0,y=void 0;c-1<0?o?(g=t[h-1].x,p=t[h-1].y):(g=t[c+1].x,p=t[c+1].y):(g=t[c-1].x,p=t[c-1].y),c+1<l?(m=t[c+1].x,v=t[c+1].y):(m=t[c+1-l].x,v=t[c+1-l].y),c+2<l?(_=t[c+2].x,y=t[c+2].y):o?(_=t[c+2-l].x,y=t[c+2-l].y):(_=t[c].x,y=t[c].y);var w=ev(g,p,f,d,m,v,_,y,e,c===h-1?a:1);if(c===h-1&&a>=0&&a<1){r.bezierCurveTo(w[0],w[1],w[2],w[3],w[4],w[5]),t.splice(h-1,l-(h-1)-1);var x=new z(w[4],w[5]);x.prevCtrlPoint=new z(w[2],w[3]),t.push(x),l=t.length}else r.bezierCurveTo(w[0],w[1],w[2],w[3],m,v);t[c].nextCtrlPoint=w.slice(0,2),t[c].prevCtrlPoint=u?u.slice(2):null,u=w}!o&&t[1].prevCtrlPoint&&(t[0].nextCtrlPoint=t[1].prevCtrlPoint,delete t[0].prevCtrlPoint),t[l-1].prevCtrlPoint||(t[l-1].prevCtrlPoint=t[l-2].nextCtrlPoint),J._stroke(r,i)}},paintSmoothLine:function(r,t,i,e,o,s,a){if(t){if(t.length<=2||!e){J.path(r,t,i);return}var l=t.length,h=o?l:l-1;r.beginPath(),r.moveTo(t[0].x,t[0].y),a!==void 0&&(h-=Math.max(h-s-1,0));for(var u,c,f=0;f<h;f++){var d=t[f].x,g=t[f].y,p=void 0,m=void 0,v=void 0,_=void 0,y=void 0,w=void 0;f-1<0?o?(p=t[h-1].x,m=t[h-1].y):(p=t[f+1].x,m=t[f+1].y):(p=t[f-1].x,m=t[f-1].y),f+1<l?(v=t[f+1].x,_=t[f+1].y):(v=t[f+1-l].x,_=t[f+1-l].y),f+2<l?(y=t[f+2].x,w=t[f+2].y):o?(y=t[f+2-l].x,w=t[f+2-l].y):(y=t[f].x,w=t[f].y);var x=t[f],C=ev(p,m,d,g,v,_,y,w,e,f===h-1?a:1);if(f===h-1&&a>=0&&a<1){r.bezierCurveTo(C[0],C[1],C[2],C[3],C[4],C[5]),t.splice(h-1,l-(h-1)-1);var b=new z(C[4],C[5]);t.push(b),l=t.length}else r.bezierCurveTo(C[0],C[1],C[2],C[3],v,_);f===0?(x.arrowNextPoint=x.arrowNextPoint||new z(0,0),u=C[2],c=C[3],x.arrowNextPoint.x=u,x.arrowNextPoint.y=c):(x.arrowPrePoint=x.arrowPrePoint||new z(0,0),x.arrowPrePoint.x=u,x.arrowPrePoint.y=c,u=C[2],c=C[3],f===h-1&&t[f+1]&&(t[f+1].arrowPrePoint=t[f+1].arrowPrePoint||new z(0,0),t[f+1].arrowPrePoint.x=C[0],t[f+1].arrowPrePoint.y=C[1]))}J._stroke(r,i)}},_arcBetween:function(r,t,i,e){var o=Math.abs(e),s=t.distanceTo(i),a=Math.abs(s/2/Math.sin(o/2)),l=Math.asin((i.y-t.y)/s);t.x>i.x&&(l=Math.PI-l);var h=90*Vn-o/2,u=l-h,c=Math.cos(u)*a,f=Math.sin(u)*a,d=t.x+c,g=t.y+f,p=Math.asin((i.y-g)/a);d>i.x&&(p=Math.PI-p);var m=p+o;if(e<0){p+=Math.PI,m+=Math.PI;var v=(t.x+i.x)/2,_=(t.y+i.y)/2,y=d-v,w=g-_;d=v-y,g=_-w}r.beginPath(),r.arc(d,g,a,p,m);var x=(m-p)/100,C=Math.cos(p+x)*a+d,b=Math.sin(p+x)*a+g,E=Math.cos(m-x)*a+d,T=Math.sin(m-x)*a+g;return t.arrowNextPoint=t.arrowNextPoint||new z(0,0),i.arrowPrePoint=i.arrowPrePoint||new z(0,0),e<0?(t.arrowNextPoint.x=C,t.arrowNextPoint.y=b,i.arrowPrePoint.x=E,i.arrowPrePoint.y=T):(t.arrowNextPoint.x=E,t.arrowNextPoint.y=T,i.arrowPrePoint.x=C,i.arrowPrePoint.y=b),[d,g]},_lineTo:function(r,t){r.lineTo(t.x,t.y)},bezierCurveAndFill:function(r,t,i,e){r.beginPath();var o=t[0];r.moveTo(o.x,o.y);var s=[r];s.push.apply(s,t.splice(1)),J._bezierCurveTo.apply(J,s),J.fillCanvas(r,e),J._stroke(r,i)},_bezierCurveTo:function(r,t,i,e){r.bezierCurveTo(t.x,t.y,i.x,i.y,e.x,e.y)},ellipse:function(r,t,i,e,o,s,a){function l(h,u,c,f,d){var g=.5522848,p=c*g,m=f*g,v=d*g;r.moveTo(h-c,u),r.bezierCurveTo(h-c,u-m,h-p,u-f,h,u-f),r.bezierCurveTo(h+p,u-f,h+c,u-m,h+c,u),r.bezierCurveTo(h+c,u+v,h+p,u+d,h,u+d),r.bezierCurveTo(h-p,u+d,h-c,u+v,h-c,u),r.closePath()}r.beginPath(),i===e&&i===o?r.arc(t.x,t.y,i,0,2*Math.PI):r.ellipse?e!==o?(r.ellipse(t.x,t.y,i,e,0,Vn*180,Vn*360,!1),r.ellipse(t.x,t.y,i,o,0,0,Vn*180,!1)):r.ellipse(t.x,t.y,i,e,0,0,Vn*360,!1):l(t.x,t.y,i,e,o),J.fillCanvas(r,a,t.x-i,t.y-e),J._stroke(r,s,t.x-i,t.y-e)},rectangle:function(r,t,i,e,o){var{x:s,y:a}=t;r.beginPath(),r.rect(s,a,i.width,i.height),J.fillCanvas(r,o,s,a),J._stroke(r,e,s,a)},sector:function(r,t,i,e,o,s){var a=Vn,l=e[0],h=e[1];function u(c,f,d,g,p,m){var v=a*-m,_=a*-p;c.beginPath(),c.moveTo(f,d),c.arc(f,d,g,v,_),c.lineTo(f,d),J.fillCanvas(c,s,f-g,d-g),J._stroke(c,o,f-g,d-g)}u(r,t.x,t.y,i,l,h)},_isPattern:function(r){return!Ee(r)&&!("addColorStop"in r)},drawCross:function(r,t,i,e,o){r.canvas._drawn=!0,r.strokeStyle=o,r.lineWidth=e,r.beginPath(),r.moveTo(t-5,i),r.lineTo(t+5,i),r.moveTo(t,i-5),r.lineTo(t,i+5),r.stroke()},copy:function(r,t){var i=t||we("canvas");return i.width=r.width,i.height=r.height,i.getContext("2d").drawImage(r,0,0),i},pixelRect:function(r,t,i,e){var o=r.lineWidth,s=r.globalAlpha,a=!1;if(o>0&&i>0)a=!0,i<1&&(r.globalAlpha*=i);else if(e>0)e<1&&(r.globalAlpha*=e);else return;r.canvas._drawn=!0,a?r.strokeRect(t[0],t[1],1,1):r.fillRect(t[0],t[1],1,1),r.globalAlpha!==s&&(r.globalAlpha=s)}};function kM(n,r,t,i){var e=r.x,o=r.y,s=t.x,a=t.y,l=i,h=function(C,b){return C<=b},u=function(C,b){return C>=b},c=function(C,b){return Math.min(C,b)},f=function(C,b){return Math.max(C,b)},d={thereYet:u,cap:c},g={thereYet:u,cap:c};o-a>0&&(g.thereYet=h,g.cap=f),e-s>0&&(d.thereYet=h,d.cap=f),n.moveTo(e,o);for(var p=e,m=o,v=0,_=!0,y,w;!(d.thereYet(p,s)&&g.thereYet(m,a));)y=Math.atan2(a-o,s-e),w=l[v],p=d.cap(s,p+Math.cos(y)*w),m=g.cap(a,m+Math.sin(y)*w),_?n.lineTo(p,m):n.moveTo(p,m),v=(v+1)%l.length,_=!_}var tv="data:image/";function rv(n){return n.substring(0,tv.length)===tv?n:Mh(n)}function iv(n,r){n.filter=r.filter,n.fillStyle=r.fillStyle,n.globalAlpha=r.globalAlpha,n.lineCap=r.lineCap,n.lineDashOffset=r.lineDashOffset,n.lineJoin=r.lineJoin,n.lineWidth=r.lineWidth,n.shadowBlur=r.shadowBlur,n.shadowColor=r.shadowColor,n.shadowOffsetX=r.shadowOffsetX,n.shadowOffsetY=r.shadowOffsetY,n.strokeStyle=r.strokeStyle,n.lineColorIn=r.lineColorIn,n.lineStrokeColor=r.lineStrokeColor,n.lineStrokeWidth=r.lineStrokeWidth}function nv(n,r){!r||!n.setLineDash||!Array.isArray(r)||n.setLineDash(r)}function Du(n){return"Z__"+n}function ci(n){return function(r){function t(){return r.apply(this,arguments)||this}Q(t,r);var i=t.prototype;return i.on=function(o,s,a){if(!o)return this;if(!Ee(o))return this._switch("on",o,s);if(!s)return this;this._eventMap||(this._eventMap={}),o=o;var l=o.toLowerCase().split(" "),h;a||(a=this);var u=X(s._id);s._id=ui();for(var c,f=0,d=l.length;f<d;f++){h=l[f];var g=Du(h);if(s[g]&&(s[g]._id=s._id),c=this._eventMap[h],c||(c=[],this._eventMap[h]=c),!u){c.push({handler:s,context:a});continue}var p=c.length;if(p>0){for(var m=0;m<p;m++)if(s===c[m].handler&&c[m].context===a)return wr.isTest||console.warn(this,"find '"+o+"' handler:",s," The old listener function will be removed"),this}c.push({handler:s,context:a})}return this},i.addEventListener=function(...o){return this.on.call(this,...o)},i.once=function(o,s,a){if(!Ee(o)){o=o;var l={};for(var h in o)o.hasOwnProperty(h)&&(l[h]=this._wrapOnceHandler(h,o[h],s));return this._switch("on",l)}o=o;for(var u=o.split(" "),c=0,f=u.length;c<f;c++)this.on(u[c],this._wrapOnceHandler(u[c],s,a));return this},i.off=function(o,s,a){if(!this._eventMap||!o)return this;if(!Ee(o))return this._switch("off",o,s);if(!s)return this;if(!X(s._id))return this;o=o;var l=o.split(" "),h,u,c;a||(a=this);for(var f=0,d=l.length;f<d;f++)if(h=l[f].toLowerCase(),c=Du(h),u=this._eventMap[h],!!u){for(var g=u.length-1;g>=0;g--){var p=u[g];(s===p.handler||s===p.handler[c])&&p.context===a&&(delete p.handler[c],u.splice(g,1))}u.length||delete this._eventMap[h]}return this},i.removeEventListener=function(...o){return this.off.call(this,...o)},i.listens=function(o,s,a){if(!this._eventMap||!Ee(o))return 0;var l=this._eventMap[o.toLowerCase()];if(!l||!l.length)return 0;if(!s)return l.length;for(var h=0,u=l.length;h<u;h++)if(s===l[h].handler&&(O(a)||l[h].context===a))return 1;return 0},i.getListeningEvents=function(){return this._eventMap?Object.keys(this._eventMap):[]},i.copyEventListeners=function(o){var s=o._eventMap;if(!s)return this;var a;for(var l in s){a=s[l];for(var h=0,u=a.length;h<u;h++)this.on(l,a[h].handler,a[h].context)}return this},i.fire=function(o,s){return this._eventParent?this._eventParent.fire.call(this._eventParent,o,s):this._fire.call(this,o,s)},i._wrapOnceHandler=function(o,s,a){var l=Du(o),h=!1,u=function c(...f){h||(delete u[l],h=!0,a?s.call(a,...f):s.call(this,...f),c._called=!0)};return u[l]=s,u},i._switch=function(o,s,a){for(var l in s)s.hasOwnProperty(l)&&this[o](l,s[l],a);return this},i._clearListeners=function(o){if(!(!this._eventMap||!Ee(o))){var s=this._eventMap[o.toLowerCase()];s&&(this._eventMap[o]=null)}},i._clearAllListeners=function(){this._eventMap=null},i._setEventParent=function(o){return this._eventParent=o,this},i._setEventTarget=function(o){return this._eventTarget=o,this},i._fire=function(o,s){if(!this._eventMap)return this;o=o.toLowerCase();var a=this._eventMap[o];if(!a)return this;s||(s={type:o,target:this._eventTarget||this}),s.type=o,s.target=this._eventTarget||this;for(var l=a.slice(0),h,u,c,f=0,d=l.length;f<d;f++)if(l[f]){var g=l[f].handler;g._called||(h=l[f].context,u=!0,c=oe({},s),h?u=l[f].handler.call(h,c):u=l[f].handler(c),u===!1&&s.domEvent&&nr(s.domEvent))}var p=this._eventMap[o];if(p){for(var m=[],v=0,_=p.length;v<_;v++){var y=p[v].handler;y._called||m.push(p[v])}this._eventMap[o]=m}return this},t}(n)}var RM=function(){},Pa=function(n){function r(i){var e;return e=n.call(this)||this,e._enabled=!1,e.target=i,e}Q(r,n);var t=r.prototype;return t.enable=function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},t.disable=function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},t.enabled=function(){return!!this._enabled},t.remove=function(){this.disable(),delete this.target,delete this.dom},r}(ci(RM)),br=function(){function n(t){if(!this||!this._setOptions)throw new Error('Class instance is being created without "new" operator.');this._setOptions(t),this.callInitHooks(),this._isUpdatingOptions=!1}var r=n.prototype;return r.proxyOptions=function(){var i=this;return Ce.proxy?(this.options=new Proxy(this.options,{set:function(o,s,a){if(s=s,o[s]===a||(o[s]=a,i._isUpdatingOptions))return!0;var l={};return l[s]=a,i.config(l),!0}}),this):this},r.callInitHooks=function(){var i=Object.getPrototypeOf(this);return this._visitInitHooks(i),this},r._setOptions=function(i){if((!this.hasOwnProperty("options")||O(this.options))&&(this.options=this.options?Object.create(this.options):{}),!i)return this;for(var e in i)this.options[e]=i[e];return this},r.setOptions=function(i){return console.warn("setOptions(options) It is a private method and deprecated, please use _setOptions(options) instead. If you want to update options, please use config(options) instead."),this._setOptions(i)},r.config=function(i,e){if(this._isUpdatingOptions=!0,i){if(arguments.length===2&&typeof i=="string"){var a={};a[i]=e,i=a}i=i;for(var l in i)this.options[l]=i[l],this[l]&&this[l]instanceof Pa&&(i[l]?this[l].enable():this[l].disable());this.onConfig(i),this._isUpdatingOptions=!1}else{var o={};for(var s in this.options)this.options.hasOwnProperty(s)&&(o[s]=this.options[s]);return this._isUpdatingOptions=!1,o}return this},r.onConfig=function(i){},r._visitInitHooks=function(i){if(!this._initHooksCalled){var e=Object.getPrototypeOf(i);e._visitInitHooks&&e._visitInitHooks.call(this,e),this._initHooksCalled=!0;var o=i._initHooks;if(o&&o!==e._initHooks)for(var s=0;s<o.length;s++)o[s].call(this)}},n.addInitHook=function(i,...e){var o=typeof i=="function"?i:function(){this[i].call(this,...e)},s=this.prototype,a=Object.getPrototypeOf(s);return(!s._initHooks||s._initHooks===a._initHooks)&&(s._initHooks=[]),s._initHooks.push(o),this},n.include=function(...i){for(var e=0;e<i.length;e++)oe(this.prototype,i[e]);return this},n.mergeOptions=function(i){var e=this.prototype,o=Object.getPrototypeOf(e);return(!e.options||e.options===o.options)&&(e.options=e.options?Object.create(e.options):{}),oe(e.options,i),this},n}(),AM=function(){},LM=function(n){function r(){return n.apply(this,arguments)||this}return Q(r,n),r}(ci(AM)),Sr=new LM,ef="dprchange",tf="docvisibilitychange",rf="dragstart",nf="dragend";if(typeof window<"u"&&window.matchMedia)for(var zu=1;zu<500;zu++){var IM=(zu*.01).toFixed(2),Ko=window.matchMedia("screen and (resolution: "+IM+"dppx)");Ko&&(Ko.addEventListener?Ko.addEventListener("change",Ce.checkDevicePixelRatio):Ko.addListener&&Ko.addListener(Ce.checkDevicePixelRatio))}if(Ce.devicePixelRatio){var Bu=Ce.devicePixelRatio;Object.defineProperty(Ce,"devicePixelRatio",{get:function(){return Bu},set:function(r){r!==Bu&&(Bu=r,Ce.monitorDPRChange&&Sr.fire(ef,{devicePixelRatio:r}))}})}Ce.webgl&&typeof document<"u"&&(Jr(document,"visibilitychange",function(){Sr.fire(tf,{visibilityState:document.visibilityState})}),Jr(document,"dragstart",function(){Sr.fire(rf)}),Jr(document,"dragend",function(){Sr.fire(nf)}));var Qo={};function t0(n){return function(r){function t(){return r.apply(this,arguments)||this}Q(t,r),t.registerJSONType=function(o){if(o){if(Qo[o]){console.error(o+" has register. please use Different name for:",this);return}Qo[o]=this}},t.getJSONClass=function(o){return o?Qo[o]:null};var i=t.prototype;return i.getJSONType=function(){if(this._jsonType===void 0){var o=Object.getPrototypeOf(this).constructor;for(var s in Qo)if(Qo[s]===o){this._jsonType=s;break}}if(!this._jsonType)throw new Error("Found an unregistered Layer/Geometry class!");return this._jsonType},t}(n)}function od(n){return function(r){function t(){return r.apply(this,arguments)||this}Q(t,r);var i=t.prototype;return i.addHandler=function(o,s){if(!s)return this;if(this._handlers||(this._handlers=[]),this[o])return this[o].enable(),this;var a=this[o]=new s(this);return this._handlers.push(a),this.options[o]&&a.enable(),this},i.removeHandler=function(o){if(!o)return this;var s=this[o];if(s){var a=this._handlers.indexOf(s);a>=0&&this._handlers.splice(a,1),this[o].remove(),delete this[o]}return this},i._clearHandlers=function(){for(var o=0,s=this._handlers.length;o<s;o++)this._handlers[o].remove();this._handlers=[]},t}(n)}var ov="touchstart mousedown",Ja={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},Gu={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},Ea=function(n){function r(i,e={}){var o;return o=n.call(this,null)||this,o.dom=i,o.options=e,o}Q(r,n);var t=r.prototype;return t.addHooks=function(){},t.removeHooks=function(){},t.enable=function(){return this.dom?(this._onMouseDown=function(e){return this.onMouseDown(e)},vt(this.dom,ov,this._onMouseDown,this),this):this},t.disable=function(){return this.dom?(this._offEvents(),yt(this.dom,ov,this._onMouseDown),delete this._onMouseDown,this):this},t.onMouseDown=function(e){if(!(!this.options.rightclick&&e.button===2)){var o=e;if(!(o.touches&&o.touches.length>1)&&!(this.options.cancelOn&&this.options.cancelOn(e)===!0)){var s=this.dom;s.setCapture?s.setCapture():window.captureEvents&&window.captureEvents(),s.ondragstart=function(){return!1},delete this.moved;var a=o.touches?o.touches[0]:e;this.startPos=new z(a.clientX,a.clientY),yt(document,Ja[e.type],this.onMouseMove),yt(document,Gu[e.type],this.onMouseUp),vt(document,Ja[e.type],this.onMouseMove,this),vt(document,Gu[e.type],this.onMouseUp,this),this.options.ignoreMouseleave||(yt(this.dom,"mouseleave",this.onMouseUp),vt(this.dom,"mouseleave",this.onMouseUp,this)),this.fire("mousedown",{domEvent:e,mousePos:new z(a.clientX,a.clientY)})}}},t.onMouseMove=function(e){var o=e;if(o.touches&&o.touches.length>1){this.moved&&(this.interupted=!0,this.onMouseUp(e));return}var s=o.touches?o.touches[0]:e,a=new z(s.clientX,s.clientY),l=a.sub(this.startPos);!l.x&&!l.y||(this.moved?this.fire("dragging",{domEvent:e,mousePos:new z(s.clientX,s.clientY)}):(this.fire("dragstart",{domEvent:e,mousePos:this.startPos.copy()}),this.moved=!0))},t.onMouseUp=function(e){var o=e,s=o.changedTouches?o.changedTouches[0]:e;this._offEvents();var a={domEvent:e};X(s.clientX)&&(a.mousePos=new z(parseInt(s.clientX+"",0),parseInt(s.clientY+"",0))),this.moved&&(a.interupted=this.interupted,this.fire("dragend",a),delete this.interupted,delete this.moved),this.fire("mouseup",a)},t._offEvents=function(){var e=this.dom;if(yt(e,"mouseleave",this.onMouseUp),!(typeof document>"u"||typeof window>"u")){for(var o in Ja)yt(document,Ja[o],this.onMouseMove),yt(document,Gu[o],this.onMouseUp);e.releaseCapture?e.releaseCapture():window.captureEvents&&window.captureEvents()}},r}(Pa),$=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n),r.toNumberArrays=function(e){return Array.isArray(e)?Rn(e,function(o){return o.toArray()}):e.toArray()},r.toCoordinates=function(e){if(X(e[0])&&X(e[1]))return new r(e);if(e instanceof r)return e;for(var o=[],s=0,a=e.length;s<a;s++){var l=e[s];Array.isArray(l)?X(l[0])?o.push(new r(l)):o.push(r.toCoordinates(l)):l instanceof r?o.push(l):o.push(new r(l))}return o};var t=r.prototype;return t.closeTo=function(e,o){return o||(o=0),this.x>=e.x-o&&this.x<=e.x+o&&this.y>=e.y-o&&this.y<=e.y+o},t.abs=function(){return new r(Math.abs(this.x),Math.abs(this.y))},t.round=function(){return new r(Math.round(this.x),Math.round(this.y))},t.ceil=function(){return new r(Math.ceil(this.x),Math.ceil(this.y))},t.floor=function(){return new r(Math.floor(this.x),Math.floor(this.y))},t.copy=function(){return new r(this.x,this.y,this.z)},t.toFixed=function(e){return new r(this.x.toFixed(e),this.y.toFixed(e),X(this.z)?this.z.toFixed(e):void 0)},t.add=function(e,o,s){var a,l,h=this.z;return O(e.x)?O(e[0])?(a=this.x+e,l=this.y+o,O(s)||(h=(this.z||0)+s)):(a=this.x+e[0],l=this.y+e[1],O(e[2])||(h=(this.z||0)+e[2])):(a=this.x+e.x,l=this.y+e.y,O(e.z)||(h=(this.z||0)+e.z)),new r(a,l,h)},t.sub=function(e,o,s){var a,l,h=this.z;return O(e.x)?O(e[0])?(a=this.x-e,l=this.y-o,O(s)||(h=(this.z||0)-s)):(a=this.x-e[0],l=this.y-e[1],O(e[2])||(h=(this.z||0)-e[2])):(a=this.x-e.x,l=this.y-e.y,O(e.z)||(h=(this.z||0)-e.z)),new r(a,l,h)},t.multi=function(e){return new r(this.x*e,this.y*e,O(this.z)?this.z:this.z*e)},t.equals=function(e){return e instanceof this.constructor?this.x===e.x&&this.y===e.y&&this.z===e.z:!1},r}(ey),cr=function(){function n(r,t){this.type=r,this.properties=t}return n.createProj4=function(t){return new n("proj4",{proj:t})},n.fromProjectionCode=function(t){return t?(t=t.toUpperCase().replace(":",""),n[t]||null):null},n}();cr.WGS84=cr.createProj4("+proj=longlat +datum=WGS84 +no_defs");cr.EPSG3857=cr.createProj4("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs");cr.IDENTITY=cr.createProj4("+proj=identity +no_defs");cr.CGCS2000=cr.createProj4("+proj=longlat +datum=CGCS2000");cr.EPSG4490=cr.CGCS2000;cr.BD09LL=cr.createProj4("+proj=longlat +datum=BD09");cr.GCJ02=cr.createProj4("+proj=longlat +datum=GCJ02");var DM=new z(0,0),zM=new $(0,0),Fu=new $(0,0),Nu=new $(0,0),Hu=new $(0,0),ju=new $(0,0),BM=new $(0,0),sv=new $(0,0),av=new $(0,0),Zu=[],yn,es=[],Je=function(){function n(...t){this._clazz=$;var i=t.length,e=i>0?t[i-1]:null;e&&e.unproject&&(this.projection=t[i-1]),this._dirty=!0,this.antiMeridian=!1,this._initialize(t[0],t[1],t[2],t[3])}var r=n.prototype;return r._initialize=function(i,e,o,s){if(this.xmin=null,this.xmax=null,this.ymin=null,this.ymax=null,!O(i)){var a=this.projection;if(X(i)&&X(e)&&X(o)&&X(s)){a?this.set(i,e,o,s):this.set(Math.min(i,o),Math.min(e,s),Math.max(i,o),Math.max(e,s));return}else if(Array.isArray(i))a?this.set(i[0],i[1],i[2],i[3]):this.set(Math.min(i[0],i[2]),Math.min(i[1],i[3]),Math.max(i[0],i[2]),Math.max(i[1],i[3]));else if(X(i.x)&&X(e.x)&&X(i.y)&&X(e.y)){var l=i,h=e;a?this.set(l.x,l.y,h.x,h.y):(l.x>h.x?(this.xmin=h.x,this.xmax=l.x):(this.xmin=l.x,this.xmax=h.x),l.y>h.y?(this.ymin=h.y,this.ymax=l.y):(this.ymin=l.y,this.ymax=h.y))}else X(i.xmin)&&X(i.xmax)&&X(i.ymin)&&X(i.ymax)&&this.set(i.xmin,i.ymin,i.xmax,i.ymax)}},r._add=function(i){return this._dirty=!0,O(i.x)?O(i.xmin)?O(i[0])||(this.xmin+=i[0],this.ymin+=i[1],this.xmax+=i[0],this.ymax+=i[1]):(this.xmin+=i.xmin,this.ymin+=i.ymin,this.xmax+=i.xmax,this.ymax+=i.ymax):(this.xmin+=i.x,this.ymin+=i.y,this.xmax+=i.x,this.ymax+=i.y),this},r.add=function(i){var e=new this.constructor(this.xmin,this.ymin,this.xmax,this.ymax,this.projection);return e._add(i)},r._scale=function(i){return this._dirty=!0,this.xmin*=i,this.ymin*=i,this.xmax*=i,this.ymax*=i,this},r._sub=function(i){return this._dirty=!0,O(i.x)?O(i.xmin)?O(i[0])||(this.xmin-=i[0],this.ymin-=i[1],this.xmax-=i[0],this.ymax-=i[1]):(this.xmin-=i.xmin,this.ymin-=i.ymin,this.xmax-=i.xmax,this.ymax-=i.ymax):(this.xmin-=i.x,this.ymin-=i.y,this.xmax-=i.x,this.ymax-=i.y),this},r._substract=function(i){return this._sub(i)},r.sub=function(i){var e=new this.constructor(this.xmin,this.ymin,this.xmax,this.ymax,this.projection);return e._sub(i)},r.substract=function(i){return this.sub(i)},r.round=function(){return new this.constructor(Math.round(this.xmin),Math.round(this.ymin),Math.round(this.xmax),Math.round(this.ymax),this.projection)},r._round=function(){return this._dirty=!0,this.xmin=Math.round(this.xmin),this.ymin=Math.round(this.ymin),this.xmax=Math.round(this.xmax),this.ymax=Math.round(this.ymax),this},r.getMin=function(i){return i?(i.set(this.xmin,this.ymin),i):new this._clazz(this.xmin,this.ymin)},r.getMax=function(i){return i?(i.set(this.xmax,this.ymax),i):new this._clazz(this.xmax,this.ymax)},r.getCenter=function(i){var e=(this.xmin+this.xmax)/2,o=(this.ymin+this.ymax)/2;return i?(i.set(e,o),i):new this._clazz(e,o)},r.isValid=function(){return!O(this.xmin)&&!O(this.ymin)&&!O(this.xmax)&&!O(this.ymax)},r.equals=function(i){return this.xmin===i.xmin&&this.xmax===i.xmax&&this.ymin===i.ymin&&this.ymax===i.ymax},r.intersects=function(i){this._project(this),this._project(i);var e=Math.max(this.pxmin,i.pxmin),o=Math.max(this.pymin,i.pymin),s=Math.min(this.pxmax,i.pxmax),a=Math.min(this.pymax,i.pymax);return!(e>s||o>a)},r.within=function(i){return this._project(this),this._project(i),this.pxmin>=i.pxmin&&this.pxmax<=i.pxmax&&this.pymin>=i.pymin&&this.pymax<=i.pymax},r.contains=function(i){if(!i)return!1;this._project(this);var e=this.projection;if(e){var o=zM;Array.isArray(i)?(o.x=i[0],o.y=i[1],i=e.project(o,o)):i.x!==void 0?(o.x=i.x,o.y=i.y,i=e.project(o,o)):i.xmin!==void 0&&this._project(i)}return(i.x||i.pxmin||0)>=this.pxmin&&(i.x||i.pxmax||0)<=this.pxmax&&(i.y||i.pymin||0)>=this.pymin&&(i.y||i.pymax||0)<=this.pymax},r.getWidth=function(){return Math.abs(this.xmax-this.xmin)},r.getHeight=function(){return Math.abs(this.ymax-this.ymin)},r.getSize=function(){return new ft(this.getWidth(),this.getHeight())},r.set=function(i,e,o,s){return this.xmin=i,this.ymin=e,this.xmax=o,this.ymax=s,this._dirty=!0,this},r.__combine=function(i){i.x!==void 0&&(yn.xmin=yn.xmax=i.x,yn.ymin=yn.ymax=i.y,yn._dirty=!0,i=yn),this._project(i),this._project(this);var e=X(this.pxmin),o,s,a,l;e?(o=Math.min(this.pxmin,i.pxmin),s=Math.min(this.pymin,i.pymin),a=Math.max(this.pxmax,i.pxmax),l=Math.max(this.pymax,i.pymax)):(o=i.pxmin,s=i.pymin,a=i.pxmax,l=i.pymax);var h=this.projection;if(h){Fu.set(o,s),Nu.set(a,l);var u=h.unproject(Fu,Fu),c=h.unproject(Nu,Nu);o=u.x,s=u.y,a=c.x,l=c.y}return es[0]=o,es[1]=s,es[2]=a,es[3]=l,es},r._combine=function(i){if(!i||i.isValid&&!i.isValid())return this;var e=this.__combine(i);return this.set(e[0],e[1],e[2],e[3]),this._dirty=!0,this},r.combine=function(i){if(!i||i.isValid&&!i.isValid())return this;var e=this.__combine(i);return new this.constructor(e[0],e[1],e[2],e[3],this.projection)},r.intersection=function(i){if(!this.intersects(i))return null;Hu.x=Math.max(this.pxmin,i.pxmin),Hu.y=Math.max(this.pymin,i.pymin),ju.x=Math.min(this.pxmax,i.pxmax),ju.y=Math.min(this.pymax,i.pymax);var e=Hu,o=ju,s=this.projection;return s&&(e=s.unproject(e,e),o=s.unproject(o,o)),new this.constructor(e,o,s)},r.expand=function(i){var e,o;return X(i)?e=o=i:(e=i.width||i.x||i[0]||0,o=i.height||i.y||i[1]||0),new this.constructor(this.xmin-e,this.ymin-o,this.xmax+e,this.ymax+o,this.projection)},r._expand=function(i){var e,o;return X(i)?e=o=i:(e=i.width||i.x||i[0]||0,o=i.height||i.y||i[1]||0),this.xmin-=e,this.ymin-=o,this.xmax+=e,this.ymax+=o,this._dirty=!0,this},r.toJSON=function(){return{xmin:this.xmin,ymin:this.ymin,xmax:this.xmax,ymax:this.ymax}},r.toArray=function(i){var e=this.xmin,o=this.ymin,s=this.xmax,a=this.ymax;return i?(i[0].x=e,i[0].y=a,i[1].x=s,i[1].y=a,i[2].x=s,i[2].y=o,i[3].x=e,i[3].y=o,i[4].x=e,i[4].y=a,i):[new this._clazz([e,a]),new this._clazz([s,a]),new this._clazz([s,o]),new this._clazz([e,o]),new this._clazz([e,a])]},r.toBBOX=function(){return[this.xmin,this.ymin,this.xmax,this.ymax]},r.toString=function(){return this.xmin+","+this.ymin+","+this.xmax+","+this.ymax},r.copy=function(){return new this.constructor(this.xmin,this.ymin,this.xmax,this.ymax,this.projection)},r.convertTo=function(i,e){if(!this.isValid())return null;var o=e||new this.constructor;e&&o.set(null,null,null,null);var s;return this._clazz===$?s=BM:this._clazz===z&&(s=DM),s.x=this.xmin,s.y=this.ymax,o._combine(i(s)),s.x=this.xmax,o._combine(i(s)),s.y=this.ymin,o._combine(i(s)),s.x=this.xmin,o._combine(i(s)),o},r._project=function(i){if(!i||!i.isValid()){i&&(i.pxmin=i.pxmax=i.pymin=i.pymax=null);return}var e=this.projection;if(e){if(i._dirty){sv.set(i.xmin,i.ymin),av.set(i.xmax,i.ymax),Zu[0]=sv,Zu[1]=av;var o=e.projectCoords(Zu,this.antiMeridian),s=o[0],a=o[1];i.pxmin=Math.min(s.x,a.x),i.pymin=Math.min(s.y,a.y),i.pxmax=Math.max(s.x,a.x),i.pymax=Math.max(s.y,a.y)}delete i._dirty}else i.pxmin=i.xmin,i.pxmax=i.xmax,i.pymin=i.ymin,i.pymax=i.ymax},n}();yn=new Je(0,0,0,0);var Le=function(n){function r(...t){var i;return i=n.call(this,...t)||this,i._clazz=z,i}return Q(r,n),r}(Je),r0=function(){function n(t){this.matrix=t}var r=n.prototype;return r.transform=function(i,e,o){var s=this.matrix[0]*(i.x-this.matrix[2])/e,a=-this.matrix[1]*(i.y-this.matrix[3])/e;return o?(o.x=s,o.y=a,o):new z(s,a)},r.untransform=function(i,e,o){var s=i.x*e/this.matrix[0]+this.matrix[2],a=i.y*e/-this.matrix[1]+this.matrix[3];return o?(o.x=s,o.y=a,o):new $(s,a)},n}(),hn={code:"",is:function(r){if(this.code===r)return!0;if(!this.aliases)return!1;for(var t=0;t<this.aliases.length;t++)if(this.aliases[t]===r)return!0;return!1},project:function(r){return r},unproject:function(r){return r},projectCoords:function(r,t){var i=this;if(!r)return[];if(!Array.isArray(r))return this.project(r);if(r.length===0)return[];if(!this.isSphere())return Rn(r,this.project,this);if(Array.isArray(r[0]))return r.map(function(_){return i.projectCoords(_,t)});for(var e=t,o=this.getCircum(),s=this.getSphereExtent(),a=s.sy,l,h=r[0],u,c,f,d,g=[this.project(h)],p=1,m=r.length;p<m;p++){u=r[p],c=u.x-h.x,f=u.y-h.y,d=this.project(u);var v=!1;Math.abs(c)>180&&e&&(c<0?u.x=360-Math.abs(u.x):u.x=-180-(180-Math.abs(u.x)),v=!0),Math.abs(f)>90&&e&&(l===void 0&&(l=u.y<h.y),l&&(d._add(0,-o.y*ir(f)*a),u._add(0,-180*ir(f)))),v&&(d=this.project(u)),h=u,g.push(d)}return g},unprojectCoords:function(r){return r?Array.isArray(r)?Rn(r,this.unproject,this):this.unproject(r):[]},isSphere:function(){return!!this.sphere},isOutSphere:function(r){if(!this.isSphere())return!1;var t=this.getSphereExtent();return!t.contains(r)},wrapCoord:function(r){if(!this.isSphere())return r;var t=this.getSphereExtent(),i=new $(r);return t.contains(i)||(i.x=An(r.x,t.xmin,t.xmax),i.y=An(r.y,t.ymin,t.ymax)),i},getCircum:function(){if(!this.circum&&this.isSphere()){var r=this.getSphereExtent();this.circum={x:r.getWidth(),y:r.getHeight()}}return this.circum},getSphereExtent:function(){if(!this.extent&&this.isSphere()){var r=this.project(new $(180,90)),t=this.project(new $(-180,-90));this.extent=new Je(t,r,this),this.extent.sx=r.x>t.x?1:-1,this.extent.sy=r.y>t.y?1:-1}return this.extent}},sd={measureLength:function(r,t){if(!Array.isArray(r))return this.measureLenBetween(r,t);for(var i=0,e=0,o=r.length;e<o-1;e++)i+=this.measureLenBetween(r[e],r[e+1]);return i}},GM={measure:"IDENTITY",measureLenBetween:function(r,t,i=!1){if(!r||!t)return 0;try{var e=Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));if(i)return e;var o=r.z||0,s=t.z||0,a=o-s;return a===0?e:Math.sqrt(e*e+a*a)}catch{return 0}},measureArea:function(r){if(!Array.isArray(r))return 0;for(var t=0,i=0,e=r.length;i<e;i++){var o=r[i],s=null;i===e-1?s=r[0]:s=r[i+1],t+=o.x*s.y-o.y*s.x}return Math.abs(t/2)},locate:function(r,t,i,e){return e=e||new $(0,0),e.set(r.x,r.y),this._locate(e,t,i)},_locate:function(r,t,i){return r?(t||(t=0),i||(i=0),!t&&!i||(r.x=r.x+t,r.y=r.y+i),r):null},rotate:function(r,t,i){return r=new $(r.x,r.y),this._rotate(r,t,i)},_rotate:function(){var n=new z(0,0);return function(r,t,i){return n.x=r.x-t.x,n.y=r.y-t.y,n._rotate(i*Math.PI/180),r.x=t.x+n.x,r.y=t.y+n.y,r}}()},i0=oe(GM,sd),n0=function(){function n(t){this.radius=t}var r=n.prototype;return r.measureLenBetween=function(i,e,o=!1){if(!i||!e)return 0;var s=mt(i.y),a=mt(e.y),l=s-a,h=mt(i.x)-mt(e.x);s=2*Math.asin(Math.sqrt(Math.pow(Math.sin(l/2),2)+Math.cos(s)*Math.cos(a)*Math.pow(Math.sin(h/2),2))),s*=this.radius;var u=s;if(o)return u;var c=i.z||0,f=e.z||0,d=c-f;return d===0?u:Math.sqrt(u*u+d*d)},r.measureArea=function(i){var e=mt(this.radius),o=0,s=i,a=s.length;if(a<3)return 0;var l;for(l=0;l<a-1;l++){var h=s[l],u=s[l+1];o+=h.x*e*Math.cos(mt(h.y))*u.y*e-u.x*e*Math.cos(mt(u.y))*h.y*e}var c=s[l],f=s[0];return o+=c.x*e*Math.cos(mt(c.y))*f.y*e-f.x*e*Math.cos(mt(f.y))*c.y*e,.5*Math.abs(o)},r.locate=function(i,e,o,s){return s=s||new $(0,0),s.set(i.x,i.y),this._locate(s,e,o)},r._locate=function(i,e,o){if(!i)return null;if(e||(e=0),o||(o=0),!e&&!o)return i;var s,a,l=mt(i.y);if(o!==0){var h=Math.abs(o),u=Math.sin(h/(2*this.radius))*2;l=l+u*(o>0?1:-1),a=An(l*180/Math.PI,-90,90)}else a=i.y;if(e!==0){var c=Math.abs(e),f=mt(i.x),d=2*Math.sqrt(Math.pow(Math.sin(c/(2*this.radius)),2)/Math.pow(Math.cos(l),2));f=f+d*(e>0?1:-1),s=An(f*180/Math.PI,-180,180)}else s=i.x;return i.x=s,i.y=a,i},r.rotate=function(i,e,o){var s=new $(i);return this._rotate(s,e,o)},r._rotate=function(i,e,o){var s=FM(e,i),a=s-o,l=this.measureLenBetween(e,i,!0);return i.x=e.x,i.y=e.y,NM(i,l,a,this.radius)},n}();function FM(n,r,t={}){var i;return t.final?i=lv(r,n):i=lv(n,r),i>180?-(360-i):i}function lv(n,r){var t=mt(n.y),i=mt(r.y),e=mt(r.x-n.x);e>Math.PI&&(e-=2*Math.PI),e<-Math.PI&&(e+=2*Math.PI);var o=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),s=Math.atan2(e,o);return(Bf(s)+360)%360}function NM(n,r,t,i){var e=r/i,o=n.x*Math.PI/180,s=mt(n.y),a=mt(t),l=e*Math.cos(a),h=s+l;Math.abs(h)>Math.PI/2&&(h=h>0?Math.PI-h:-Math.PI-h);var u=Math.log(Math.tan(h/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),c=Math.abs(u)>1e-11?l/u:Math.cos(s),f=e*Math.sin(a)/c,d=o+f;return n.x=(d*180/Math.PI+540)%360-180,n.y=h*180/Math.PI,n}var HM={measure:"EPSG:4326",sphere:new n0(6378137),measureLenBetween:function(r,t){return this.sphere.measureLenBetween(r,t)},measureArea:function(r){return this.sphere.measureArea.call(this.sphere,r)},_locate:function(r,t,i){return this.sphere._locate.call(this.sphere,r,t,i)},locate:function(r,t,i,e){return this.sphere.locate.call(this.sphere,r,t,i,e)},_rotate:function(r,t,i){return this.sphere._rotate.call(this.sphere,r,t,i)},rotate:function(r,t,i){return this.sphere.rotate.call(this.sphere,r,t,i)}},Sa=oe(HM,sd),jM={measure:"BAIDU",sphere:new n0(637099681e-2),measureLenBetween:function(r,t){return this.sphere.measureLenBetween.call(this.sphere,r,t)},measureArea:function(r){return this.sphere.measureArea.call(this.sphere,r)},_locate:function(r,t,i){return this.sphere._locate.call(this.sphere,r,t,i)},locate:function(r,t,i,e){return this.sphere.locate.call(this.sphere,r,t,i,e)},_rotate:function(r,t,i){return this.sphere._rotate.call(this.sphere,r,t,i)},rotate:function(r,t,i){return this.sphere.rotate.call(this.sphere,r,t,i)}},o0=oe(jM,sd),s0=Sa,_s={};function ad(n){_s[n.measure]=n}ad(i0);ad(Sa);ad(o0);var hv={getInstance:function(r){if(!r)return s0;for(var t in _s)if(Bo(_s,t)){var i=_s[t].measure;if(!i)continue;if(r.toLowerCase()===i.toLowerCase())return _s[t]}return null}},uv=1e-7,ZM={code:"EPSG:3857",rad:Math.PI/180,metersPerDegree:6378137*Math.PI/180,maxLatitude:85.0511287798,project:function(r,t){var i=this.rad,e=this.metersPerDegree,o=this.maxLatitude,s=r.x,a=Math.max(Math.min(o,r.y),-o),l;a===0?l=0:l=Math.log(Math.tan((90+a)*i/2))/i;var h=s*e,u=l*e,c=r.z;return t?(t.x=h,t.y=u,t.z=c,t):new $(h,u,c)},unproject:function(r,t){var i=this.rad,e=this.metersPerDegree,o=r.x/e,s=r.y,a;s===0?a=0:(a=s/e,a=(2*Math.atan(Math.exp(a*i))-Math.PI/2)/i),Math.abs(Math.abs(o)-180)<uv&&(o=ir(o)*180),Math.abs(Math.abs(a)-this.maxLatitude)<uv&&(a=ir(a)*this.maxLatitude);var l=o,h=a,u=r.z;return t?(t.x=l,t.y=h,t.z=u,t):new $(l,h,u)}},a0=oe({},hn,ZM,Sa),VM={code:"EPSG:4326",aliases:["EPSG:4490"],project:function(r,t){return t?(t.x=r.x,t.y=r.y,t.z=r.z,t):new $(r)},unproject:function(r,t){return t?(t.x=r.x,t.y=r.y,t.z=r.z,t):new $(r)}},WM=oe({},hn,VM,Sa),Vu=Math.abs,gn=Math.sin,pn=Math.cos,$M=Math.tan,UM=Math.atan,Xa=Math.atan2,JM=Math.sqrt,XM=Math.log,Wu=Math.hypot,cv=Math.sinh,YM=Math.cosh,fv=1/0;function qM(n){var r=[],t=[],i=[],e=[],o,s,a,l,h,u;n.es<=0,a=n.es/(1+JM(1-n.es)),h=l=a/(2-a),r[0]=l*(2+l*(-2/3+l*(-2+l*(116/45+l*(26/45+l*(-2854/675)))))),t[0]=l*(-2+l*(2/3+l*(4/3+l*(-82/45+l*(32/45+l*(4642/4725)))))),h*=l,r[1]=h*(7/3+l*(-8/5+l*(-227/45+l*(2704/315+l*(2323/945))))),t[1]=h*(5/3+l*(-16/15+l*(-13/9+l*(904/315+l*(-1522/945))))),h*=l,r[2]=h*(56/15+l*(-136/35+l*(-1262/105+l*(73814/2835)))),t[2]=h*(-26/15+l*(34/21+l*(8/5+l*(-12686/2835)))),h*=l,r[3]=h*(4279/630+l*(-332/35+l*(-399572/14175))),t[3]=h*(1237/630+l*(-12/5+l*(-24832/14175))),h*=l,r[4]=h*(4174/315+l*(-144838/6237)),t[4]=h*(-734/315+l*(109598/31185)),h*=l,r[5]=h*(601676/22275),t[5]=h*(444337/155925),h=l*l,o=n.k0/(1+l)*(1+h*(1/4+h*(1/64+h/256))),i[0]=l*(-.5+l*(2/3+l*(-37/96+l*(1/360+l*(81/512+l*(-96199/604800)))))),e[0]=l*(.5+l*(-2/3+l*(5/16+l*(41/180+l*(-127/288+l*(7891/37800)))))),i[1]=h*(-1/48+l*(-1/15+l*(437/1440+l*(-46/105+l*(1118711/3870720))))),e[1]=h*(13/48+l*(-3/5+l*(557/1440+l*(281/630+l*(-1983433/1935360))))),h*=l,i[2]=h*(-17/480+l*(37/840+l*(209/4480+l*(-5569/90720)))),e[2]=h*(61/240+l*(-103/140+l*(15061/26880+l*(167603/181440)))),h*=l,i[3]=h*(-4397/161280+l*(11/504+l*(830251/7257600))),e[3]=h*(49561/161280+l*(-179/168+l*(6601661/7257600))),h*=l,i[4]=h*(-4583/161280+l*(108847/3991680)),e[4]=h*(34729/80640+l*(-3418889/1995840)),h*=l,i[5]=h*(-20648693/638668800),e[5]=h*(212378941/319334400),u=p(t,n.phi0),s=-o*(u+m(e,2*u)),n.fwd=c,n.inv=f;function c(_,y){var w,x,C,b,E,T=_.phi,S=_.lam;T=p(t,T),w=gn(T),x=pn(T),b=gn(S),C=pn(S),T=Xa(w,C*x),S=Xa(b*x,Wu(w,x*C)),S=g($M(S)),E=v(e,2*T,2*S),T+=E[0],S+=E[1],Vu(S)<=2.623395162778?(y.y=o*T+s,y.x=o*S):y.x=y.y=fv}function f(_,y){var w,x,C,b,E,T=_.y,S=_.x;T=(T-s)/o,S=S/o,Vu(S)<=2.623395162778?(E=v(i,2*T,2*S),T+=E[0],S+=E[1],S=UM(cv(S)),w=gn(T),x=pn(T),b=gn(S),C=pn(S),S=Xa(b,C*x),T=Xa(w*C,Wu(b,C*x)),y.phi=p(r,T),y.lam=S):y.phi=y.lam=fv}function d(_){var y=1+_,w=y-1;return w===0?_:_*XM(y)/w}function g(_){var y=Vu(_);return y=d(y*(1+y/(Wu(1,y)+1))),_<0?-y:y}function p(_,y){for(var w=2*pn(2*y),x=_.length-1,C=_[x],b=0,E;--x>=0;)E=-b+w*C+_[x],b=C,C=E;return y+E*gn(2*y)}function m(_,y){for(var w=2*pn(y),x=_.length-1,C=_[x],b=0,E;--x>=0;)E=-b+w*C+_[x],b=C,C=E;return gn(y)*E}function v(_,y,w){for(var x=gn(y),C=pn(y),b=cv(w),E=YM(w),T=2*C*E,S=-2*x*b,B=_.length-1,L=_[B],D=0,N=0,G=0,I,A;--B>=0;)I=N,A=D,N=L,D=G,L=-I+T*N-S*D+_[B],G=-A+S*N+T*D;return T=x*E,S=C*b,[T*L-S*G,T*G+S*L]}}var dv=57.29577951308232,Wn=.017453292519943295,KM=6378137,QM=.0066943799901413165,gv=["Traverse_Mercator"],eP={code:"EPSG:9807",aliases:gv,centralMeridian:0,create:function(r){var t={a:KM,es:QM,x0:O(r.falseEasting)?5e5:r.falseEasting,y0:O(r.falseNorthing)?0:r.falseNorthing,k0:r.scaleFactor||.9996,lam0:(r.centralMeridian||0)*Wn,phi0:(r.latitudeOfOrigin||0)*Wn,originLam0:r.startLongtitude||0,originPhi0:r.startLatitude||0};qM(t);var i={lam:0,phi:0},e={},o=0,s=0;(t.originLam0||t.originPhi0)&&(i.lam=t.originLam0*Wn-t.lam0,i.phi=t.originPhi0*Wn,t.fwd(i,e),o=t.a*e.x+t.x0,s=t.a*e.y+t.y0);var a={code:"EPSG:9807",aliases:gv,centralMeridian:r.centralMeridian,project:function(h,u){i.lam=h.x*Wn-t.lam0,i.phi=h.y*Wn,t.fwd(i,e);var c=t.a*e.x+t.x0-o,f=t.a*e.y+t.y0-s,d=h.z;return u?(u.x=c,u.y=f,u.z=d,u):new $(c,f,d)},unproject:function(h,u){e.x=(h.x-t.x0+o)/t.a,e.y=(h.y-t.y0+s)/t.a,t.inv(e,i);var c=(i.lam+t.lam0)*dv,f=i.phi*dv,d=h.z;return u?(u.x=c,u.y=f,u.z=d,u):new $(c,f,d)}};return oe({},hn,a,Sa)}},Fh=oe({},hn,eP),tP={code:"utm",aliases:[],create:function(r){var t={},i=parseInt(r.zone);if(t.falseNorthing=r.south?1e7:0,t.falseEasting=5e5,i>0&&i<=60)i--;else throw new Error("zone must be > 0 and <= 60.");return t.centralMeridian=(i+.5)*6-180,t.scaleFactor=.9996,Fh.create(t)}},rP=oe({},Fh,tP),iP={EARTHRADIUS:637099681e-2,MCBAND:[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],LLBAND:[75,60,45,30,15,0],MC2LL:[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],LL2MC:[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],convertMC2LL:function(r,t){for(var i,e=0,o=this.MCBAND.length;e<o;e++)if(Math.abs(r.y)>=this.MCBAND[e]){i=this.MC2LL[e];break}var s=this.convertor(r,i,t);return s},convertLL2MC:function(r,t){var i,e,o;r.x=this.getLoop(r.x,-180,180),r.y=this.getRange(r.y,-74,74);var s=new $(r.x,r.y);for(e=0,o=this.LLBAND.length;e<o;e++)if(s.y>=this.LLBAND[e]){i=this.LL2MC[e];break}if(!i){for(e=this.LLBAND.length-1;e>=0;e--)if(s.y<=-this.LLBAND[e]){i=this.LL2MC[e];break}}var a=this.convertor(r,i,t);return a},convertor:function(r,t,i){if(!r||!t)return null;var e=t[0]+t[1]*Math.abs(r.x),o=Math.abs(r.y)/t[9],s=t[2]+t[3]*o+t[4]*o*o+t[5]*o*o*o+t[6]*o*o*o*o+t[7]*o*o*o*o*o+t[8]*o*o*o*o*o*o;e*=r.x<0?-1:1,s*=r.y<0?-1:1;var a=r.z;return i?(i.x=e,i.y=s,i.z=a,i):new $(e,s,a)},toRadians:function(r){return Math.PI*r/180},toDegrees:function(r){return 180*r/Math.PI},getRange:function(r,t,i){return t!=null&&(r=Math.max(r,t)),i!=null&&(r=Math.min(r,i)),r},getLoop:function(r,t,i){if(r===1/0)return i;if(r===-1/0)return t;for(;r>i;)r-=i-t;for(;r<t;)r+=i-t;return r}},nP={code:"BAIDU",project:function(r,t){return this.convertLL2MC(r,t)},unproject:function(r,t){return this.convertMC2LL(r,t)}},oP=oe({},hn,nP,o0,iP),sP={code:"IDENTITY",project:function(r,t){return t?(t.x=r.x,t.y=r.y,t.z=r.z,t):r.copy()},unproject:function(r,t){return t?(t.x=r.x,t.y=r.y,t.z=r.z,t):r.copy()}},aP=oe({},hn,sP,i0),l0=a0,vi=Object.freeze({__proto__:null,BAIDU:oP,Common:hn,DEFAULT:l0,EPSG3857:a0,EPSG4326:WM,EPSG9807:Fh,IDENTITY:aP,UTM:rP});function ld(n){return function(r){function t(){return r.apply(this,arguments)||this}return Q(t,r),t.registerRenderer=function(e,o){var s=this.prototype,a=Object.getPrototypeOf(s);return(!s._rendererClasses||s._rendererClasses===a._rendererClasses)&&(s._rendererClasses=s._rendererClasses?Object.create(s._rendererClasses):{}),s._rendererClasses[e.toLowerCase()]=o,this},t.getRendererClass=function(e){var o=this.prototype;return o._rendererClasses?o._rendererClasses[e.toLowerCase()]:null},t}(n)}var wo={markerWidth:10,markerHeight:10,markerLineWidth:1},$u=new z(0,0);function lP(n){if(!n)return 0;var{x:r,y:t}=n;if(r===0&&t===0)return 0;if(r===0||!r){if(t<0)return-Math.PI/2;if(t>0)return Math.PI/2}var i=t/r;return t<0&&r<0?Math.atan(i)-Math.PI:t>0&&r<0?Math.atan(i)+Math.PI:Math.atan(i)}function hP(n,r,t){var i=Math.PI/2+t,e=Math.PI/4+t,o=t,s=r,a=Math.sqrt(n*n+r*r),l=n,h=0,u=0,c=Math.cos(i)*s,f=Math.sin(i)*s,d=Math.cos(e)*a,g=Math.sin(e)*a,p=Math.cos(o)*l,m=Math.sin(o)*l,v=Math.min(c,d,p,h),_=Math.min(f,g,m,u),y=Math.max(c,d,p,h),w=Math.max(f,g,m,u);return[v,_,y-v,w-_]}function sa(n,r,t,i,e,o){var s=e.x+o.x,a=e.y+o.y;$u.x=s,$u.y=a;var l=lP($u),h=Math.sqrt(s*s+a*a),u=Math.cos(r+l)*h,c=Math.sin(r+l)*h,f=0,d=0;f+=u,d+=c;var[g,p,m,v]=hP(t,i,r);f+=g,d+=p;var _=f+Math.max(t,m),y=d+Math.max(i,v);return n.set(f,d,_,y),n}function h0(){return .5}var uP=new z(0,0);function hd(n,r,t,i,e,o,s){var a=uP.set(r,t);if(i)return sa(n,i,o,s,a,e);var l=n.set(a.x,a.y,a.x+o,a.y+s);return l._add(e),i&&fP(l,i),l}var cP=[];function u0(n,r,t){if(t=t||of(cP,r),t&&(t[0]===0||t[1]===0))return fd(n),n;var i=d0(r,t[0],t[1]);return hd(n,r.markerDx||0,r.markerDy||0,Nh(r),i,t[0],t[1])}function c0(n){return n==="rectangle"||n==="roundrectangle"?"right":"middle"}function f0(n){return n==="bar"||n==="pie"||n==="pin"?"top":n==="rectangle"||n==="roundrectangle"?"bottom":"middle"}var xo=new ft(0,0);function d0(n,r,t){var i=h0(),e=2*(n.shadowBlur||0),o=e+i;xo.width=r,xo.height=t;var s=n.markerType,a=li(xo,n.markerHorizontalAlignment||c0(s),n.markerVerticalAlignment||f0(s));return a.x!==-r/2&&(a.x-=ir(a.x+r/2)*o),a.y!==-t/2&&(a.y-=ir(a.y+t/2)*o),a}function of(n,r){var t=h0(),i=pe(r.markerWidth,wo.markerWidth),e=pe(r.markerHeight,wo.markerHeight);if(i===0||e===0)return n[0]=0,n[1]=0,n;var o=pe(r.markerLineWidth,wo.markerLineWidth),s=2*((r.shadowBlur||0)+Math.max(Math.abs(r.shadowOffsetX||0)+Math.abs(r.shadowOffsetY||0))),a=Math.round(i+o+s+t*2),l=Math.round(e+o+s+t*2);return n[0]=a,n[1]=l,n}var pv=new Le;function fP(n,r){var{xmin:t,ymin:i,xmax:e,ymax:o}=n;return pv.set(t,i,e,o),pv.convertTo(function(s){return s._rotate(r)},n)}function Nh(n,r="markerRotation"){var t=n[r];return X(t)?-t*Math.PI/180:0}function sf(n,r,t){var i=r.markerFile,e=t?t.getImage(i):null,o=r.markerWidth||(e?e.width:0),s=r.markerHeight||(e?e.height:0);if(xo.width=o,xo.height=s,r.markerWidth===0||r.markerHeight===0)return fd(n),n;var a=li(xo,r.markerHorizontalAlignment||"middle",r.markerVerticalAlignment||"top");return hd(n,r.markerDx||0,r.markerDy||0,Nh(r),a,o,s)}function g0(n,r,t){var i=t.size;if(i&&(i.width===0||i.height===0))return fd(n),n;var e=li(i,r.textHorizontalAlignment,r.textVerticalAlignment),o=r.textHaloRadius||0,s=hd(n,r.textDx||0,r.textDy||0,Nh(r,"textRotation"),e,i.width,i.height);return s.xmin-=o,s.xmax+=o,s.ymin-=o,s.ymax+=o,s}var Ya=new Le;function af(n,r,t,i){var e=n||new Le;if(Array.isArray(r)){for(var o=r,s=0;s<o.length;s++)af(e,o[s],t,i[s]);return e}return Xl(r)&&e._combine(g0(Ya,r,i)),ud(r)&&e._combine(sf(Ya,r,t)),Yl(r)&&e._combine(u0(Ya,r)),cd(r)&&e._combine(sf(Ya,r)),e}function Xl(n){return n?!O(n.textName):!1}function ud(n){return n?!O(n.markerFile):!1}function Yl(n){return n?!!(O(n.markerFile)&&!O(n.markerType)&&n.markerType!=="path"):!1}function cd(n){return n?!!(O(n.markerFile)&&n.markerType==="path"):!1}var Uu=["markerWidth","markerHeight","markerHorizontalAlignment","markerVerticalAlignment","markerDx","markerDy","markerRotation","textName","textSize","textDx","textDy","textVerticalAlignment","textHorizontalAlignment","textRotation","textWrapWidth"],Ju=["textName","markerType","markerFile","textHaloRadius","shadowBlur","shadowOffsetX","shadowOffsetY","textWrapWidth"];function fd(n){n&&(n.xmin=1/0,n.ymin=1/0,n.xmax=-1/0,n.ymax=-1/0)}function Es(n,r,t,i){for(var e=[],o=0,s,a=0,l=n.length;a<l-1;a++)s=dP(n[a],n[a+1],r,a,t,i),s&&(e[o]=e[o]||[],e[o].push({point:s[0],index:a}),(s[1]!==n[a+1]||a===l-2)&&(e[o].push({point:s[1],index:a+1}),o++));return e}var vv;function dP(n,r,t,i,e,o){var s=i?vv:Co(n,t),a=Co(r,t),l,h,u;for(vv=a;;){if(!(s|a))return[n,r];if(s&a)return!1;if(o)return[n,r];l=s||a,h=lf(n,r,l,t,e),u=Co(h,t),l===s?(n=h,s=u):(r=h,a=u)}}function ml(n,r,t){var i=[1,4,2,8],e,o,s,a,l,h,u,c,f;for(o=0,u=n.length;o<u;o++)n[o]._code=Co(n[o],r);for(a=0;a<4;a++){for(c=i[a],e=[],o=0,u=n.length,s=u-1;o<u;s=o++)l=n[o],h=n[s],l._code&c?h._code&c||(f=lf(h,l,c,r,t),f._code=Co(f,r),e.push(f)):(h._code&c&&(f=lf(h,l,c,r,t),f._code=Co(f,r),e.push(f)),e.push(l));n=e}return n}function lf(n,r,t,i,e){var o=r.x-n.x,s=r.y-n.y,a=i.getMin(),l=i.getMax(),h,u;t&8?(h=n.x+o*(l.y-n.y)/s,u=l.y):t&4?(h=n.x+o*(a.y-n.y)/s,u=a.y):t&2?(h=l.x,u=n.y+s*(l.x-n.x)/o):t&1&&(h=a.x,u=n.y+s*(a.x-n.x)/o);var c=new z(h,u);return e&&c._round(),c}function Co(n,r){var t=0;return n.x<r.getMin().x?t|=1:n.x>r.getMax().x&&(t|=2),n.y<r.getMin().y?t|=4:n.y>r.getMax().y&&(t|=8),t}function p0(n,r,t,i){n=new z(n);var e=Math.abs(t.x-r.x),o=Math.abs(t.y-r.y),s=Math.sqrt(Math.abs(e*e-o*o)),a=e>=o,l,h,u;return a?(l=new z(r.x-s,r.y),h=new z(r.x+s,r.y),u=e*2):(l=new z(r.x,r.y-s),h=new z(r.x,r.y+s),u=o*2),n.distanceTo(l)+n.distanceTo(h)<=u+2*i}function v0(n){if(!n)return[0,0];var r=1/0,t=-1/0;if(X(n))return r=t=n,[r,t];var i=function(l){for(var h=0,u=l.length;h<u;h++){var c=l[h];r=Math.min(r,c),t=Math.max(t,c)}};if(!Array.isArray(n[0]))return i(n),[r,t];for(var e=0,o=n.length;e<o;e++){var s=n[e];i(s)}return[r,t]}function _l(n,r,t){var i=r.x,e=r.y,o=t.x,s=t.y,a=n.x,l=n.y;return(e-s)*a+(o-i)*l+i*s-o*e>0}function qa(n,r,t){return!_l(n,r,t)}function gP(n,r,t,i,e){var o=qa(n,r,t),s=qa(n,t,i),a=qa(n,i,e),l=qa(n,e,r);return o&&s&&a&&l}function mv(n,r,t,i){var e=r.x-n.x,o=r.y-n.y,s=i.x-t.x,a=i.y-t.y;if(e===0&&s===0||o===0&&a===0)return null;var l=o/e,h=a/s;if(Math.abs(l)===Math.abs(h))return null;var u=n.y-l*n.x,c=t.y-h*t.x,f,d;return e===0?(f=n.x,d=h*f+c):s===0?(f=t.x,d=l*f+u):o===0?(d=n.y,f=(d-c)/h):a===0?(d=t.y,f=(d-u)/l):(f=(c-u)/(l-h),d=l*f+u),new z(f,d)}function hf(n){if(X(n))return n!==0;if(Array.isArray(n)&&n.length>0){for(var r=0,t=n.length;r<t;r++)if(X(n[r])&&n[r]!==0)return!0}return!1}var pP=function(){function n(){this.bbox=ur()}var r=n.prototype;return r._setBBOX=function(i,e,o,s,a){return i.isHitTesting||ra(this.bbox,e,o,s,a),this},r._bufferBBOX=function(i,e){return i.isHitTesting||Hy(this.bbox,e),this},r.getMap=function(){return this.geometry.getMap()},r.getPainter=function(){return this.painter},r.isDynamicSize=function(){return!1},r.isVisible=function(){if(!this.style)return!0;var i=this.style.visible;if(i===!1||i===0)return!1;var e=this.style.opacity;return!(e<=0)},n.testColor=function(i){return!i||!Ee(i)?!1:JT.indexOf(i)>=0},n}(),m0=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t._prepareContext=function(e){if(rt(this.symbol.opacity)?this._opacityFn||(this._opacityFn=Qs(this.symbol.opacity)):delete this._opacityFn,X(this.symbol.opacity))e.globalAlpha!==this.symbol.opacity&&(e.globalAlpha=this.symbol.opacity);else if(this._opacityFn){var o=this.getMap(),s=dt[o.id],a=s?s.zoom:o.getZoom();e.globalAlpha=this._opacityFn(a)}else e.globalAlpha!==1&&(e.globalAlpha=1)},t.prepareCanvas=function(e,o,s){e.setLineDash&&$e(o.lineDasharray)&&e.setLineDash(o.lineDasharray);var a=this.getPainter().isHitTesting();J.prepareCanvas(e,o,s,a)},t.remove=function(){},t.setZIndex=function(){},t.show=function(){},t.hide=function(){},t._defineStyle=function(e){return this.symbol&&(e.visible=this.symbol.visible,e.opacity=this.symbol.opacity),ea(e,this.geometry)},r}(pP);function vP(n,r){var t=n&&n.getImage(r);return t||null}function _0(n,r,t,i,e){var o=y0(t),s=t,a=s.markerType.toLowerCase(),l=w0(a,s.markerWidth,s.markerHeight),h=o.lineOpacity,u=o.polygonOpacity,c=Li(o.polygonFill);if(c){var f;Li(o.polygonFill)&&(f||(f=mP(r,s.markerWidth,s.markerHeight)),o.polygonGradientExtent=f)}J.prepareCanvas(n,o,i);var d=s.markerWidth,g=s.markerHeight,p=s.markerLineWidth||0,m=p/2;if(a==="ellipse")J.ellipse(n,r,d/2,g/2,g/2,h,u);else if(a==="cross"||a==="x"){for(var v=l.length-1;v>=0;v--)l[v]._add(r);J.path(n,l.slice(0,2),h),J.path(n,l.slice(2,4),h)}else if(a==="diamond"||a==="bar"||a==="square"||a==="rectangle"||a==="triangle"||a==="roundrectangle"){a==="bar"?r=r.add(0,-m):(a==="rectangle"||a==="roundrectangle")&&(r=r.add(m,m));for(var _=l.length-1;_>=0;_--)l[_]._add(r);a==="roundrectangle"?J.roundRect(n,l,h,u):J.polygon(n,l,h,u)}else if(a==="pin"){r=r.add(0,-m);for(var y=l.length-1;y>=0;y--)l[y]._add(r);var w=n.lineCap;n.lineCap="round",J.bezierCurveAndFill(n,l,h,u),n.lineCap=w}else if(a==="pie"){r=r.add(0,-m);var x=Math.atan(d/2/g)*180/Math.PI,C=n.lineCap;n.lineCap="round",J.sector(n,r,g,[90-x,90+x],h,u),n.lineCap=C}else throw new Error("unsupported markerType: "+a);if(e){var{x:b,y:E}=r;e[0]=b-d/2-p,e[1]=E-g/2-p,e[2]=b+d/2+p,e[3]=E+g/2+p}return n.canvas}function mP(n,r,t){var i=new Le;return i._combine(n),i.xmin+=-r/2,i.ymin+=-t/2,i.xmax+=r/2,i.ymax+=t/2,i}function y0(n){var r={lineColor:n.markerLineColor,linePatternFile:n.markerLinePatternFile,lineWidth:n.markerLineWidth,lineOpacity:n.markerLineOpacity,lineDasharray:n.markerLineDasharray,lineCap:"butt",lineJoin:"round",polygonFill:n.markerFill,polygonPatternFile:n.markerFillPatternFile,polygonOpacity:n.markerFillOpacity};return r.lineWidth===0&&(r.lineOpacity=0),r}function w0(n,r,t){var i=t/2,e=r/2,o=0,s=0,a,l,h,u;if(n==="triangle")return a=new z(o,s-i),l=new z(o-e,s+i),h=new z(o+e,s+i),[a,l,h];if(n==="cross")return a=new z(o-e,s),l=new z(o+e,s),h=new z(o,s-i),u=new z(o,s+i),[a,l,h,u];if(n==="diamond")return a=new z(o-e,s),l=new z(o,s-i),h=new z(o+e,s),u=new z(o,s+i),[a,l,h,u];if(n==="square")return a=new z(o-e,s+i),l=new z(o+e,s+i),h=new z(o+e,s-i),u=new z(o-e,s-i),[a,l,h,u];if(n==="rectangle"||n==="roundrectangle")return a=new z(o,s),l=a.add(r,0),h=a.add(r,t),u=a.add(0,t),[a,l,h,u];if(n==="x")return a=new z(o-e,s+i),l=new z(o+e,s-i),h=new z(o+e,s+i),u=new z(o-e,s-i),[a,l,h,u];if(n==="bar")return a=new z(o-e,s-t),l=new z(o+e,s-t),h=new z(o+e,s),u=new z(o-e,s),[a,l,h,u];if(n==="pin"||n==="pie"){var c=t*Math.atan(e/i);return a=new z(o,s),l=new z(o-c,s-t),h=new z(o+c,s-t),u=new z(o,s),[a,l,h,u]}return[]}var _P=new z(0,0),yP=new z(0,0),wP=new z(0,0),xP=new z(0,0),Fo=function(n){function r(i,e,o){var s;return s=n.call(this)||this,s.symbol=i,s.geometry=e,s.painter=o,s.rotations=[],s}Q(r,n);var t=r.prototype;return t.get2DExtent=function(){for(var e=this.getMap(),o=e.getGLRes(),s=new Le,a=this._getRenderPoints()[0],l=a.length-1;l>=0;l--)a[l]&&s._combine(e._pointAtResToPoint(a[l],o));return s},t.isDynamicSize=function(){var e=this.symbol;return rt(e.markerWidth)||rt(e.markerHeight)||rt(e.textSize)},t._rotateExtent=function(e,o){return e.convertTo(function(s){return s._rotate(o)})},t._getRenderPoints=function(){var e=this.getPainter(),o=e.isSpriting()?"center":this.getPlacement();return this.getPainter().getRenderPoints(o)},t._getRenderContainerPoints=function(e){var o=this.getPainter();if(o.isSpriting())return this._getRenderPoints()[0];var s=this.geometry,a=this.getDxDy(),l;if(s._cPoint&&!e){var h=e?wP:xP;h.set(s._cPoint.x,s._cPoint.y);var u=o.containerOffset;h._sub(u);var c=a.x,f=a.y;(c||f)&&h._add(c||0,f||0),l=[h]}else{var d=this._getRenderPoints()[0];l=this.painter._pointContainerPoints(d,a.x,a.y,e,!0,this.getPlacement())}if(!l||!Array.isArray(l[0]))return l;for(var g=[],p=0,m=l.length;p<m;p++)for(var v=0,_=l[p].length;v<_;v++)g.push(l[p][v]);return g},t.getPlacement=function(){return this.symbol.markerPlacement},t.getRotation=function(){return Nh(this.style)},t.getDxDy=function(){var e=this.style,o=e.markerDx,s=e.markerDy;return new z(o,s)},t._getRotationAt=function(e){var o=this.getRotation();o||(o=0);var s=this._getRenderPoints()[1];if(!s||!s[e])return o;var a=this.getMap(),l=s[e][0],h=s[e][1];if(!l||!h)return o;if(a.isTransforming()){var u=a.getGLRes();return l=a._pointAtResToContainerPoint(s[e][0],u,0,_P),h=a._pointAtResToContainerPoint(s[e][1],u,0,yP),o+Gl(l.x,l.y,h.x,h.y)}else return o+-Gl(l.x,l.y,h.x,h.y)},t._rotate=function(e,o,s){if(s){var a=this.getDxDy(),l=o.sub(a);return e.save(),e.translate(l.x,l.y),e.rotate(s),a}return null},r}(m0),_v=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.getPlacement=function(){return"point"},t.getDxDy=function(){return new z(0,0)},t.symbolize=function(e){var o=this.geometry,s=o.getLayer();if(!(!o.options.debug&&s&&!s.options.debug)){var a=this.getMap();if(!(!a||a.isZooming())){var l=s.options.debugOutline,h=1;e.strokeStyle=l,e.fillStyle=l,e.lineWidth=1,e.font="18px serif";var u=o.getContainerExtent().toArray();J.polygon(e,[u],h,0);for(var c=this._getRenderContainerPoints(),f=this.geometry.getId(),d=w0("cross",10,10),g=0;g<c.length;g++){var p=c[g];O(f)||J.fillText(e,f,p.add(8,-4),l);for(var m=[],v=0;v<d.length;v++)m.push(d[v].add(p));J.path(e,m.slice(0,2),h),J.path(e,m.slice(2,4),h)}}}},r}(Fo),Xu=new ft(1,1),CP=new Le,dd=function(n){function r(i,e,o){var s;return s=n.call(this,i,e,o)||this,s.style=s._defineStyle(s.translate()),s}Q(r,n),r.test=function(e){return ud(e)};var t=r.prototype;return t.symbolize=function(e,o){if(this.isVisible()){var s=this.style;if(!(!this.painter.isHitTesting()&&(s.markerWidth===0||s.markerHeight===0||s.markerOpacity===0))){var a=this._getRenderContainerPoints();if($e(a)){if(!s.markerFile&&!this._url){console.warn("not find icon url:",s);return}var l=this._getImage(o);if(!l){typeof console<"u"&&console.warn("no img found for "+(this.style.markerFile||this._url[0]));return}this._prepareContext(e);var h=s.markerWidth,u=s.markerHeight;if(!X(h)||!X(u)){h=l.width,u=l.height,s.markerWidth=h,s.markerHeight=u;var c=s.markerFile;o.isResourceLoaded(c)||o.addResource(c,l);var f=this.getPainter();f.isSpriting()||f.removeCache()}var d;this.symbol.markerType!=="path"&&X(s.markerOpacity)&&s.markerOpacity<1&&(d=e.globalAlpha,e.globalAlpha*=s.markerOpacity),Xu.width=h,Xu.height=u;var g=li(Xu,s.markerHorizontalAlignment,s.markerVerticalAlignment);this.rotations=[];for(var p=0,m=a.length;p<m;p++){var v=a[p],_=this._rotate(e,v,this._getRotationAt(p)),y=void 0;if(_){var w=v.sub(_);v=_;var x=this._getRotationAt(p);y=sa(CP,x,h,u,v,g),y._add(w),this.rotations.push(x)}var C=v.x+g.x,b=v.y+g.y;J.image(e,l,C,b,h,u),_&&e.restore(),_?this._setBBOX(e,y.xmin,y.ymin,y.xmax,y.ymax):this._setBBOX(e,C,b,C+h,b+u)}d!==void 0&&(e.globalAlpha=d)}}}},t._getImage=function(e){return vP(e,this.style.markerFile)},t.getFixedExtent=function(e){return this._fixedExtent=this._fixedExtent||new Le,sf(this._fixedExtent,this.style,e)},t.translate=function(){var e=this.symbol;return{markerFile:e.markerFile,markerOpacity:pe(e.markerOpacity,1),markerWidth:pe(e.markerWidth,null),markerHeight:pe(e.markerHeight,null),markerRotation:pe(e.markerRotation,0),markerDx:pe(e.markerDx,0),markerDy:pe(e.markerDy,0),markerHorizontalAlignment:pe(e.markerHorizontalAlignment,"middle"),markerVerticalAlignment:pe(e.markerVerticalAlignment,"top")}},r}(Fo);let $n;const x0={width:100,height:10};let uf=!1;try{new OffscreenCanvas(1,1).getContext("2d").fillText("hello",0,0),uf=!0}catch{uf=!1}function TP(){if(!$n){const{width:n,height:r}=x0;uf?$n=new OffscreenCanvas(n,r):($n=document.createElement("canvas"),$n.width=n,$n.height=r)}return $n}class bP{constructor(r,t={}){if(!Array.isArray(r)){console.error("colors is not array");return}if(r.length<2){console.error("colors.length should >1");return}this.colors=r;let i=1/0,e=-1/0;for(let o=0,s=r.length;o<s;o++){const a=r[o][0];i=Math.min(a,i),e=Math.max(a,e)}this.min=i,this.max=e,this.valueOffset=this.max-this.min,this.options=Object.assign({},x0,t),this._initImgData()}getImageData(){return this.imgData}_initImgData(){const r=TP(),{width:t,height:i}=this.options;r.width=t,r.height=i;const e=r.getContext("2d");e.clearRect(0,0,r.width,r.height);const o=e.createLinearGradient(0,0,r.width,0),{colors:s,valueOffset:a}=this;for(let l=0,h=s.length;l<h;l++){const[u,c]=s[l],f=(u-this.min)/a;o.addColorStop(f,c)}e.fillStyle=o,e.fillRect(0,0,r.width,r.height),this.imgData=e.getImageData(0,0,r.width,r.height)}getColor(r){r=Math.max(this.min,r),r=Math.min(r,this.max);const t=(r-this.min)/this.valueOffset;let i=Math.round(t*this.imgData.width);i=Math.min(i,this.imgData.width-1);const e=i*4,o=this.imgData.data[e],s=this.imgData.data[e+1],a=this.imgData.data[e+2],l=this.imgData.data[e+3];return[o,s,a,l]}}var MP=new $(0,0),PP=new $(0,0),gd=function(n){function r(i,e,o){var s;return s=n.call(this)||this,s.symbol=i,s.geometry=e,s.painter=o,e.isPoint?Gf(s):(s.style=s._defineStyle(s.translate()),s)}Q(r,n),r.test=function(e,o){if(!e||o&&o.isPoint)return!1;for(var s in e){var a=s.slice(0,4);if(a==="line"||a==="poly")return!0}return!1};var t=r.prototype;return t.symbolize=function(e,o){if(this.isVisible()){var s=this.style;if(!(s.polygonOpacity===0&&s.lineOpacity===0&&!this.painter.isHitTesting())){var a=this._getPaintParams();if(a){this._prepareContext(e);var l=Li(s.lineColor)||s.lineGradientProperty,h=this.geometry.getJSONType()==="Polygon"||this.geometry.type==="LineString";if(l&&(s.lineColor.places||!h)&&(s.lineGradientExtent=this.geometry.getContainerExtent()._expand(s.lineWidth)),Li(s.polygonFill)){s.polygonGradientExtent=this.geometry.getContainerExtent();var u=this.getMap();if(u){var c=dt[u.id],f=c?c.bearing:u.getBearing();s.polygonGradientExtent.bearing=f}}var d=this.geometry.getLayer().options.geometryEventTolerance||0,g=this.geometry._hitTestTolerance()+d,p=a[0],m=this.geometry.getJSONType()==="Polygon"&&p.length>0&&Array.isArray(p[0][0])||this.geometry.type==="LineString"&&p.length>0&&Array.isArray(p[0]);if(m)for(var v=0;v<p.length;v++){this.prepareCanvas(e,s,o),l&&h&&!s.lineColor.places&&this._createGradient(e,p[v],s.lineColor);var _=[e,p[v]];a.length>1&&_.push(...a.slice(1)),_.push(s.lineOpacity,s.polygonOpacity,s.lineDasharray),l&&_.push(this._lineColorIn);var y=this.geometry._paintOn(..._);this._setBBOX(e,y),this._bufferBBOX(e,g)}else{this.prepareCanvas(e,s,o),l&&h&&!s.lineColor.places&&this._createGradient(e,p,s.lineColor);var w=[e];w.push(...a),w.push(s.lineOpacity,s.polygonOpacity,s.lineDasharray),l&&w.push(this._lineColorIn);var x=this.geometry._paintOn(...w);this._setBBOX(e,x),this._bufferBBOX(e,g)}e.setLineDash&&Array.isArray(s.lineDasharray)&&e.setLineDash([]),this._tempRenderPoints=p}}}},t.get2DExtent=function(){var e=this.getMap(),o=this.geometry._getPrjExtent();if(!o)return null;(!this._extMin||!this._extMax)&&(this._extMin=new $(0,0),this._extMax=new $(0,0)),this._extMin.x=o.xmin,this._extMin.y=o.ymin,this._extMax.x=o.xmax,this._extMax.y=o.ymax;var s=e._prjToPoint(this._extMin,void 0,MP),a=e._prjToPoint(this._extMax,void 0,PP);return this._pxExtent?this._pxExtent.set(Math.min(s.x,a.x),Math.min(s.y,a.y),Math.max(s.x,a.x),Math.max(s.y,a.y)):this._pxExtent=new Le(s,a),this._pxExtent},t.getFixedExtent=function(){var e=this.style.lineWidth/2;return new Le(-e,-e,e,e)},t._getPaintParams=function(){return this.getPainter().getPaintParams(this.style.lineDx,this.style.lineDy)},t.translate=function(){var e=this.symbol,o={lineColor:pe(e.lineColor,"#000"),lineWidth:pe(e.lineWidth,2),lineOpacity:pe(e.lineOpacity,1),lineDasharray:pe(e.lineDasharray,[]),lineCap:pe(e.lineCap,"butt"),lineJoin:pe(e.lineJoin,"miter"),linePatternFile:pe(e.linePatternFile,null),lineDx:pe(e.lineDx,0),lineDy:pe(e.lineDy,0),polygonFill:pe(e.polygonFill,null),polygonOpacity:pe(e.polygonOpacity,1),polygonPatternFile:pe(e.polygonPatternFile,null),polygonPatternDx:pe(e.polygonPatternDx,0),polygonPatternDy:pe(e.polygonPatternDy,0),linePatternDx:pe(e.linePatternDx,0),linePatternDy:pe(e.linePatternDy,0),lineGradientProperty:pe(e.lineGradientProperty,null),lineStrokeColor:pe(e.lineStrokeColor,null),lineStrokeWidth:pe(e.lineStrokeWidth,null)};return o.lineWidth===0&&(o.lineOpacity=0),this.geometry.type==="LineString"&&!o.polygonFill&&(o.polygonFill=o.lineColor),o},t._createGradient=function(e,o,s){if(!(!Array.isArray(o)||!o.length)){var[a,l]=EP(o);if(!a||!l){console.error("unable create canvas LinearGradient,error data:",o);return}var h;if(s.colorStops&&(h=s.colorStops),!h){var u=this.geometry.properties||{},c=this.style||{};h=u[c.lineGradientProperty]}if(!(!h||!Array.isArray(h)||h.length<2)){if(!Array.isArray(h[0])){for(var f=[],d=[],g=0,p=0,m=h.length;p<m;p+=2)d[0]=h[p],d[1]=h[p+1],f[g]=d,g++,d=[];h=f}var v=e.createLinearGradient(a.x,a.y,l.x,l.y);h.forEach(function(w){v.addColorStop(...w)}),e.strokeStyle=v;var _=JSON.stringify(h);if(_!==this._lineColorStopsKey){this._lineColorStopsKey=_;var y=h.map(function(w){return[parseFloat(w[0]),w[1]]});this._lineColorIn=new bP(y,{height:1,width:100})}}}},r}(m0);function EP(n){var r,t=!0;Array.isArray(n[0])?(r=n[0],t=!1):r=n;var i=r.length;if(t)return[r[0],r[i-1]];for(var e=r[0],o=0,s,a=1;a<i;a++){var l=r[a],h=e.distanceTo(l);h>o&&(o=h,s=l)}return[e,s]}var oo=new Le;function SP(n,r){var{width:t,height:i}=r,e=0,o=-e,s=-e,a=t+e,l=i+e;oo.xmin=o,oo.ymin=s,oo.xmax=a,oo.ymax=l,Array.isArray(n[0])||(n=[n]);var h=[];return n.forEach(function(u){for(var c=!1,f=0,d=u.length;f<d;f++){var{x:g,y:p}=u[f];if(g<o||g>a||p<s||p>l){c=!0;break}}if(c){var m=Es(u,oo,!1,!1);m.forEach(function(v){for(var _=[],y=0,w=v.length;y<w;y++)_[y]=v[y].point;h.push(_)})}else h.push(u)}),h}var OP=function(n){function r(i,e,o){var s;s=n.call(this,i,e,o)||this;var a=s.translate();return s._dynamic=Jf(a),s.style=s._defineStyle(a),s.style.textWrapWidth===0?Gf(s):(s.strokeAndFill=s._defineStyle(s.translateLineAndFill(s.style)),s)}Q(r,n),r.test=function(e){return Xl(e)};var t=r.prototype;return t.isAlongLine=function(){var e=this.getPlacement(),o=this.style.textSpacing;return e==="line"&&X(o)&&o>0},t.symbolize=function(e,o){if(this.isVisible()){var s=this.style;if(!(!this.painter.isHitTesting()&&(s.textSize===0||!s.textOpacity&&(!s.textHaloRadius||!s.textHaloOpacity)||s.textWrapWidth===0))){var a=this.strokeAndFill,l=Ys(this.style.textName,this.geometry.getProperties());this._dynamic&&delete this._textDesc;var h=this._textDesc=this._textDesc||qs(l,this.style);this._prepareContext(e),this.prepareCanvas(e,a,o),this._textFont||(this._textFont=Ta(s)),J.prepareCanvasFont(e,s,this._dynamic?null:this._textFont);var u=s.textHaloRadius||0;if(this.rotations=[],this.isAlongLine()){var c=this.getPainter(),f=c.getPathTempRenderPoints();if(!f)return;var d=this.getMap();if(f=SP(f,d.getSize()),f){var g=this.geometry.getLayer(),p=J.textAlongLine(e,l,f,s,h,g.options.collision?g.getCollisionIndex():null);p&&(this._setBBOX(e,p),this._bufferBBOX(e,u))}}else{var m=this._getRenderContainerPoints();if(!$e(m))return;for(var v=0,_=m.length;v<_;v++){var y=m[v],w=this._rotate(e,y,this._getRotationAt(v)),x=void 0;if(w){var C=y.sub(w);y=w;var b=this._getRotationAt(v),{width:E,height:T}=h.size||{width:0,height:0},S=li(h.size,s.textHorizontalAlignment,s.textVerticalAlignment);x=sa(oo,b,E,T,y,S),x._add(C),this.rotations.push(b)}var B=J.text(e,l,y,s,h);w?(this._setBBOX(e,x.xmin,x.ymin,x.xmax,x.ymax),e.restore()):this._setBBOX(e,B),this._bufferBBOX(e,u)}}}}},t.getPlacement=function(){return this.symbol.textPlacement},t.getRotation=function(){var e=this.style.textRotation;return X(e)?-e*Math.PI/180:null},t.getDxDy=function(){var e=this.style;return new z(e.textDx,e.textDy)},t.getFixedExtent=function(){var e=this.geometry.getTextDesc();return Array.isArray(e)&&(e=e[this._index]),this._fixedExtent=this._fixedExtent||new Le,e?g0(this._fixedExtent,this.style,e):this._fixedExtent},t.translate=function(){var e=this.symbol,o={textName:e.textName,textFaceName:pe(e.textFaceName,"monospace"),textWeight:pe(e.textWeight,"normal"),textStyle:pe(e.textStyle,"normal"),textSize:pe(e.textSize,cy),textFont:pe(e.textFont,null),textFill:pe(e.textFill,"#000"),textOpacity:pe(e.textOpacity,1),textHaloFill:pe(e.textHaloFill,"#ffffff"),textHaloRadius:pe(e.textHaloRadius,0),textHaloOpacity:pe(e.textHaloOpacity,1),textWrapWidth:pe(e.textWrapWidth,null),textWrapCharacter:pe(e.textWrapCharacter,`
|
|
146
|
-
`),textLineSpacing:pe(e.textLineSpacing,0),textDx:pe(e.textDx,0),textDy:pe(e.textDy,0),textHorizontalAlignment:pe(e.textHorizontalAlignment,"middle"),textVerticalAlignment:pe(e.textVerticalAlignment,"middle"),textAlign:pe(e.textAlign,"center"),textRotation:pe(e.textRotation,0),textMaxWidth:pe(e.textMaxWidth,0),textMaxHeight:pe(e.textMaxHeight,0),textSpacing:pe(e.textSpacing,0),textAlongDebug:pe(e.textAlongDebug,!1)};return o.textMaxWidth>0&&(!o.textWrapWidth||o.textWrapWidth>o.textMaxWidth)&&(o.textWrapWidth||(o.textMaxHeight=1),o.textWrapWidth=o.textMaxWidth),o},t.translateLineAndFill=function(e){return{lineColor:e.textHaloRadius?e.textHaloFill:e.textFill,lineWidth:e.textHaloRadius,lineOpacity:e.textOpacity,lineDasharray:null,lineCap:"butt",lineJoin:"round",polygonFill:e.textFill,polygonOpacity:e.textOpacity}},r}(Fo),yv=[0,0],wv=new Le,kP=new z(0,0),Yu=ur(),C0=function(n){function r(i,e,o){var s;s=n.call(this,i,e,o)||this;var a=s.translate();return s._dynamic=Jf(a),s.style=s._defineStyle(a),s.strokeAndFill=s._defineStyle(y0(s.style)),s.padding=0,s}Q(r,n),r.test=function(e){return Yl(e)};var t=r.prototype;return t.symbolize=function(e,o){if(this.isVisible()){var s=this.style;if(!(!this.painter.isHitTesting()&&(s.markerWidth===0||s.markerHeight===0||s.polygonOpacity===0&&s.lineOpacity===0))){var a=this._getRenderContainerPoints();$e(a)&&(this._prepareContext(e),this.getPainter().isSpriting()||this.geometry.getLayer().getMask()===this.geometry||this._dynamic||this.geometry.getLayer().options.cacheVectorOnCanvas===!1?this._drawMarkersWithDynamic(e,a,o):this._drawMarkersWithCache(e,a,o))}}},t._drawMarkersWithDynamic=function(e,o,s){for(var a=o.length-1;a>=0;a--){var l=o[a],h=of(yv,this.style),[u,c]=h,f=this._rotate(e,l,this._getRotationAt(a));this.rotations=[];var d=void 0;if(f){var g=l.sub(f);l=f;var p=this._getRotationAt(a);d=sa(wv,p,u,c,l,kP),d._add(g),this.rotations.push(p)}var m=this._drawVectorMarker(e,l,s);if(f)e.restore(),this._setBBOX(e,d.xmin,d.ymin,d.xmax,d.ymax);else if(m)this._setBBOX(e,m[0],m[1],m[2],m[3]);else{var{x:v,y:_}=l;this._setBBOX(e,v,_,v+u,_+c)}}},t._drawMarkersWithCache=function(e,o,s){var a=this._stampSymbol(),l=s.getImage(a);l||(l=this._createMarkerImage(e,s),s.addResource([a,l.width,l.height],l));for(var h=d0(this.style,l.width,l.height),u=o.length-1;u>=0;u--){var c=o[u],f=this._rotate(e,c,this._getRotationAt(u));this.rotations=[];var d=void 0;if(f){var g=c.sub(f);c=f;var p=this._getRotationAt(u);d=sa(wv,p,l.width,l.height,c,h),d._add(g),this.rotations.push(p)}var m=c.x+h.x,v=c.y+h.y;J.image(e,l,m,v),f?(e.restore(),this._setBBOX(e,d.xmin,d.ymin,d.xmax,d.ymax)):this._setBBOX(e,m,v,m+l.width,v+l.height)}},t._createMarkerImage=function(e,o){var s=e.canvas.constructor,a=of(yv,this.style),l=J.createCanvas(a[0],a[1],s),h=this._getCacheImageAnchor(a[0],a[1]),u=l.getContext("2d");return this._drawVectorMarker(u,h,o),l},t._stampSymbol=function(){return this._stamp||(this._stamp=Rh([this.style.markerType,Li(this.style.markerFill)?Zc(this.style.markerFill):this.style.markerFill,this.style.markerFillOpacity,this.style.markerFillPatternFile,Li(this.style.markerLineColor)?Zc(this.style.markerLineColor):this.style.markerLineColor,this.style.markerLineWidth,this.style.markerLineOpacity,this.style.markerLineDasharray?this.style.markerLineDasharray.join(","):"",this.style.markerLinePatternFile,this.style.markerWidth,this.style.markerHeight,this.style.markerHorizontalAlignment,this.style.markerVerticalAlignment].join("_"))),this._stamp},t._getCacheImageAnchor=function(e,o){var s=2*(this.symbol.shadowBlur||0),a=s+this.padding,l=this.style.markerType;return l==="bar"||l==="pie"||l==="pin"?new z(e/2,o-a):l==="rectangle"||l==="roundrectangle"?new z(a,a):new z(e/2,o/2)},t._getGraidentExtent=function(e){var o=new Le,s=this.getDxDy(),a=this.getFixedExtent();if(Array.isArray(e))for(var l=e.length-1;l>=0;l--)o._combine(e[l]);else o._combine(e);return o.xmin+=a.xmin-s.x,o.ymin+=a.ymin-s.y,o.xmax+=a.xmax-s.x,o.ymax+=a.ymax-s.y,o},t._drawVectorMarker=function(e,o,s){return Mo(Yu),_0(e,o,this.style,s,Yu),Yu},t.getFixedExtent=function(){return this._fixedExtent=this._fixedExtent||new Le,u0(this._fixedExtent,this.style,null)},t.translate=function(){var e=this.symbol,o={markerType:pe(e.markerType,"ellipse"),markerFill:pe(e.markerFill,"#00f"),markerFillOpacity:pe(e.markerFillOpacity,1),markerFillPatternFile:pe(e.markerFillPatternFile,null),markerLineColor:pe(e.markerLineColor,"#000"),markerLineWidth:pe(e.markerLineWidth,wo.markerLineWidth),markerLineOpacity:pe(e.markerLineOpacity,1),markerLineDasharray:pe(e.markerLineDasharray,[]),markerLinePatternFile:pe(e.markerLinePatternFile,null),markerDx:pe(e.markerDx,0),markerDy:pe(e.markerDy,0),markerWidth:pe(e.markerWidth,wo.markerWidth),markerHeight:pe(e.markerHeight,wo.markerHeight),markerRotation:pe(e.markerRotation,0),shadowBlur:pe(e.shadowBlur,0),shadowOffsetX:pe(e.shadowOffsetX,0),shadowOffsetY:pe(e.shadowOffsetY,0)},s=o.markerType,a=c0(s),l=f0(s);return o.markerHorizontalAlignment=pe(e.markerHorizontalAlignment,a),o.markerVerticalAlignment=pe(e.markerVerticalAlignment,l),X(e.markerOpacity)&&(X(e.markerFillOpacity)&&(o.markerFillOpacity*=e.markerOpacity),X(e.markerLineOpacity)&&(o.markerLineOpacity*=e.markerOpacity)),o},r}(Fo),T0=function(n){function r(i,e,o){var s;O(i.markerWidth)&&(i.markerWidth=80),O(i.markerHeight)&&(i.markerHeight=80),s=n.call(this,i,e,o)||this,i=oe({},i,s.translate());var a=s.style=s._defineStyle(i);return Ce.gecko?s._url=[ta(a,a.markerWidth,a.markerHeight),a.markerWidth,a.markerHeight]:s._url=[ta(a),a.markerWidth,a.markerHeight],s}Q(r,n),r.test=function(e){return cd(e)};var t=r.prototype;return t._prepareContext=function(){},t._getImage=function(e){var o=this;if(e&&e.isResourceLoaded(this._url))return e.getImage(this._url);var s=this.painter,a=new Image;return a.onload=function(){var l=s.getLayer()&&s.getLayer().getRenderer();l&&l.setToRedraw()},a.onerror=function(l){l&&typeof console<"u"&&console.warn(l),e.markErrorResource(o._url)},a.src=this._url[0],e&&e.addResource(this._url,a),a},r}(dd),xv={lineWidth:1,polygonFill:"#fff",polygonOpacity:.5},b0=function(n){function r(i,e,o){var s;return s=n.call(this,i,e,o)||this,s.style=e.getLayer().options.drawAltitude,(!s.style||!Xt(s.style))&&(s.style={lineWidth:2}),s.style.lineWidth||(s.style.lineWidth=0),s.dxdy=s._defineStyle({dx:i.textDx||i.markerDx,dy:i.textDy||i.markerDy}),s}Q(r,n),r.test=function(e,o){var s=o.getLayer();if(!s)return!1;var a=o.getJSONType();return a==="Marker"||a==="LineString"};var t=r.prototype;return t.symbolize=function(e){var o=this.geometry.getLayer();if(o.options.drawAltitude&&this.geometry.hasAltitude()){var s=this._getStyle();if(this._prepareContext(e),this.geometry.type==="LineString"){var a=this._getPaintParams(s.lineDx,s.lineDy);if(!a)return;var l=this.getPainter().getPaintParams(s.lineDx,s.lineDy,!0,!0,"_groundpt")[0];this._drawLineAltitude(e,a[0],l)}else{var h=this._getRenderContainerPoints(),u=this._getRenderContainerPoints(!0);if(!h||h.length===0)return;this._drawMarkerAltitude(e,h[0],u[0])}}},t.getDxDy=function(){var e=this.dxdy;return new z(e.dx||0,e.dy||0)},t.get2DExtent=function(){return this.geometry.type==="LineString"?gd.prototype.get2DExtent.apply(this):n.prototype.get2DExtent.call(this)},t.getPlacement=function(){return"point"},t._getPaintParams=function(e,o){return this.getPainter().getPaintParams(e||0,o||0,null,!0,"_altpt")},t._drawMarkerAltitude=function(e,o,s){var a=this._getStyle();this.prepareCanvas(e,a),J.path(e,[o,s],a.lineOpacity,null,a.lineDasharray)},t._drawLineAltitude=function(e,o,s){var a=this._getStyle(),l=o.length>0&&Array.isArray(o[0]);if(l)for(var h=0;h<o.length;h++)this._drawLine(e,o[h],s[h]);else this._drawLine(e,o,s);e.setLineDash&&Array.isArray(a.lineDasharray)&&e.setLineDash([])},t._drawLine=function(e,o,s){var a=this._getStyle();this.prepareCanvas(e,a);for(var l=0,h=o.length-1;l<h;l++)J.polygon(e,[o[l],o[l+1],s[l+1],s[l]],a.lineOpacity,a.polygonOpacity,a.lineDasharray)},t._getStyle=function(){var e=this.geometry.getLayer(),o=e.options.drawAltitude;if(Array.isArray(o)){var s=e.getGeometries()||[],a=s.indexOf(this.geometry);a>=0&&(o=o[a]||xv)}return Xt(o)||(o=xv),o.lineWidth||(o.lineWidth=0,o.lineOpacity=0),o},r}(Fo),RP=[b0,gd,dd,T0,C0,OP],vn,Cv=new z(0,0),AP=new Le,Ka=new Le,Pr=new Le,LP=new Le,Ni=new Le,IP={code:void 0},ts={minx:1/0,miny:1/0,maxx:-1/0,maxy:-1/0},qu=[],pd=function(n){function r(i){var e;return e=n.call(this)||this,e.geometry=i,e.symbolizers=e._createSymbolizers(),e._altAtGL=e._getGeometryAltitude(),e.bbox=ur(),e._drawTime=0,e}Q(r,n);var t=r.prototype;return t._setDrawTime=function(e){return this._drawTime=e,this},t.getRenderBBOX=function(){var e=this.getLayer();if(e&&e._drawTime!==this._drawTime)return null;Mo(this.bbox);for(var o=!1,s=this.symbolizers.length-1;s>=0;s--){var a=this.symbolizers[s];if(!(a instanceof b0||a instanceof _v)){var l=a.bbox;if(!ia(l)){o=!0;break}ra(this.bbox,l)}}return o?null:ia(this.bbox)?this.bbox:null},t.getMap=function(){return this.geometry.getMap()},t.getLayer=function(){return this.geometry&&this.geometry.getLayer()},t._createSymbolizers=function(){var e=this.getSymbol(),o=[],s=RP,a=e;Array.isArray(e)||(a=[e]);for(var l=a.length-1;l>=0;l--)for(var h=a[l],u=s.length-1;u>=0;u--)if(s[u].test(h,this.geometry)){var c=new s[u](h,this.geometry,this);c._index=l,o.push(c),c instanceof Fo&&(this._hasPoint=!0)}if(!o.length&&console){var f=this.geometry.getId();console.warn("invalid symbol for geometry("+(this.geometry?this.geometry.getType()+(f?":"+f:""):"")+") to draw : "+JSON.stringify(e))}return this._debugSymbolizer=new _v(e,this.geometry,this),o},t.hasPoint=function(){return!!this._hasPoint},t.getRenderPoints=function(e){return this._verifyProjection(),this._renderPoints||(this._renderPoints={}),e||(e="center"),this._renderPoints[e]||(this._renderPoints[e]=this.geometry._getRenderPoints(e)),this._renderPoints[e]},t.getPaintParams=function(e,o,s,a,l="_pt"){var h=this.getLayer()._getRenderer(),u=h.mapStateCache,c,f,d,g,p,m=this.getMap();if(u&&!this._hitPoint)c=u.resolution,f=u.pitch,d=u.bearing,g=u.glScale,p=u.containerExtent;else{var v=dt[m.id];c=m.getResolution(),f=v?v.pitch:m.getPitch(),d=v?v.bearing:m.getBearing(),g=m.getGLScale(),p=m.getContainerExtent()}var _=this.geometry,y=c,w=f!==0,x=d!==0,C=this._cachedParams,b=_._paintAsPath&&_._paintAsPath();if(b&&this._unsimpledParams&&y<=this._unsimpledParams._res)C=this._unsimpledParams;else if(!C||C._res!==c||this._pitched!==w&&_._redrawWhenPitch()||this._rotated!==x&&_._redrawWhenRotate()){if(C=_._getPaintParams(),!C)return null;C._res=y,!_._simplified&&b&&(this._unsimpledParams||(this._unsimpledParams=C),y>this._unsimpledParams._res&&(this._unsimpledParams._res=y)),this._cachedParams=C}if(!C)return null;this._pitched=w,this._rotated=x;var E=g,T=[],S=C[0],B=p,L=!!_.getHoles,D=this._pointContainerPoints(S,e,o,s,a||this._hitPoint&&!B.contains(this._hitPoint),null,l,L);if(!D)return null;T.push(D);for(var N=1,G=C.length;N<G;N++)X(C[N])||C[N]instanceof ft?X(C[N])?T.push(C[N]/E):T.push(C[N].multi(1/E)):T.push(C[N]);return T},t._pointContainerPoints=function(e,o,s,a,l,h,u="_pt",c){if(this._aboveCamera())return null;var f=this.getLayer()._getRenderer(),d=f.mapStateCache,g=this.getMap(),p=this.geometry,m=this.containerOffset,v,_;d?(v=d.glRes,_=d.containerExtent):(v=g.getGLRes(),_=g.getContainerExtent());var y,w=this.getLayer().options.roundPoint,x=1/0,C=1/0,b=-1/0,E=-1/0,T=!l,S=f.layer.options.clipBBoxBufferSize||3,B=this.symbolizers,L=p.options.enableClip,D=p.options.strictClip;function N(Be=[],lt=[]){var M=Be;if(D&&g._currentViewGLInfo&&Be.length>1&&!hf(lt)){M=[];for(var{lt:R,rt:V,rb:q,lb:U,RB:K,LB:ie}=g._currentViewGLInfo,ne=0,le=Be.length;ne<le;ne++){var ee=Be[ne],ye=!gP(ee,R,V,q,U)&&_l(ee,K,ie);if(!ye){M.push(ee);continue}var ce=Be[ne-1]||(c?Be[le-1]:Be[1]),ve=Be[ne+1]||(c?Be[0]:Be[le-2]);if(!ce||!ve){M.push(ee);continue}var be=_l(ce,K,ie),Ie=_l(ve,K,ie);if(be&&Ie){M.push(ee);continue}var Fe=!1;if(!be){var Re=mv(ce,ee,K,ie);Re&&(M.push(Re),Fe=!0)}if(!Ie){var ct=mv(ve,ee,K,ie);ct&&(M.push(ct),Fe=!0)}Fe||M.push(ee)}}var Qe=Xs(M,u);Qe=g._pointsAtResToContainerPoints(M,v,lt,Qe);for(var Tt=0,Lt=Qe.length;Tt<Lt;Tt++){var ut=Qe[Tt];ut._sub(m),(o||s)&&ut._add(o||0,s||0),w&&(ut.x=Math.ceil(ut.x),ut.y=Math.ceil(ut.y)),x=Math.min(ut.x,x),C=Math.min(ut.y,C),b=Math.max(ut.x,b),E=Math.max(ut.y,E)}if(L&&T&&Ly(B)){if(Ni.ymin=_.ymin,Ni.ymin<S&&(Ni.ymin=_.ymin-S),Ni.xmin=_.xmin-S,Ni.xmax=_.xmax+S,Ni.ymax=_.ymax+S,p.getShell&&p.getHoles)return ml(Qe,Ni);var sr=Es(Qe,Ni,!1);if(sr.length){var Ht=[];return sr.forEach(function(gr){for(var Gn=0,c1=gr.length;Gn<c1;Gn++)Ht.push(gr[Gn].point)}),Ht}}return Qe}var G=this.getAltitude();if(Array.isArray(e)){var I=this.geometry,A;!l&&I.options.enableClip?(A=this._clip(e,G),A.inView&&(T=!1)):A={points:e,altitude:G};var k=A.points;G=A.altitude,a&&(G=0);var Z=G;y=[];for(var W=[],re=X(G),se=0,me=k.length;se<me;se++){var ge=k[se];if(Array.isArray(ge)){if(re){var de=N(ge,G);y.push(de);continue}for(var _e=[],Te=0,Ge=ge.length;Te<Ge;Te++)Array.isArray(G)&&(G[se]?Z=G[se][Te]:Z=0),_e.push(Z);var Me=N(ge,_e);y.push(Me)}else Array.isArray(G)&&(h==="vertex-last"?Z=G[G.length-1-se]:h==="line"?Z=(G[se]+G[se+1])/2:Z=G[se]),W.push(Z)}W.length&&(y=N(k,W))}else e instanceof z&&(a&&(G=0),y=g._pointAtResToContainerPoint(e,v,G)._sub(m),(o||s)&&y._add(o,s));return ts.minx=x,ts.miny=C,ts.maxx=b,ts.maxy=E,this._containerBbox=ts,y},t._clip=function(e,o){if(hf(o))return{points:e,altitude:o};var s=this.getMap(),a=this.geometry,l=this.getSymbol().lineWidth;X(l)||(l=4);var h=this.getLayer()._getRenderer(),u=h.mapStateCache,c,f,d;if(u)c=u._2DExtent,f=u.glExtent,d=u.pitch;else{c=s.get2DExtent(),f=s.get2DExtentAtRes(s.getGLRes());var g=dt[s.id];d=g?g.pitch:s.getPitch()}var p=c._expand(l);if(d>0&&o){var m=s.cameraLookAt,v=s.cameraPosition;Cv.set(v[0],v[1]),p=p._combine(Cv._add(ir(m[0]-v[0]),ir(m[1]-v[1])))}var _=this.get2DExtent(null,LP),y=e;if(_.within(p))return{points:y,altitude:o,inView:!0};var w=f._expand(l*s.getGLScale());Pr.xmin=w.xmin,Pr.xmax=w.xmax,Pr.ymin=w.ymin,Pr.ymax=w.ymax;var x=a.options.smoothness;if(a.getShell&&this.geometry.getHoles&&!x){var{xmin:C,ymin:b,xmax:E,ymax:T}=w,S=Math.abs(E-C),B=Math.abs(T-b),L=Math.sqrt(S*S+B*B),D=(L-S)/2,N=(L-B)/2;if(Pr.xmin=w.xmin-D,Pr.xmax=w.xmax+D,Pr.ymin=w.ymin-N,Pr.ymax=w.ymax+N,!Array.isArray(e[0]))y=ml(e,Pr);else{y=[];for(var G=0;G<e.length;G++){var I=ml(e[G],Pr);I.length&&y.push(I)}}}else if(a.getJSONType()==="LineString"&&!x){if(!Array.isArray(e[0]))y=Es(e,Pr,!1,!!x);else{y=[];for(var A=0;A<e.length;A++)Yt(y,Es(e[A],Pr,!1,!!x))}return this._interpolateSegAlt(y,e,o)}return{points:y,altitude:o}},t._interpolateSegAlt=function(e,o,s){if(!Array.isArray(s)){var a=function(c){return c.point};return{points:e.map(function(u){return Array.isArray(u)?u.map(a):u.point}),altitude:s}}var l=M0(e,o,s);s=[];var h=l.map(function(u){if(Array.isArray(u)){var c=[],f=u.map(function(d){return c.push(d.altitude),d.point});return s.push(c),f}return s.push(u.altitude),u.point});return{points:h,altitude:s}},t.getSymbol=function(){return this.geometry._getInternalSymbol()},t._resetSymbolizersBBOX=function(){for(var e=this.symbolizers.length-1;e>=0;e--){var o=this.symbolizers[e],s=o.bbox;Mo(s)}return this},t.paint=function(e,o,s){if(this.symbolizers){var a=this.getLayer(),l=a._getRenderer();if(!(!l||!l.context&&!o)){var h=l.mapStateCache||{offset:void 0};if(!(!this.geometry._isCheck&&e&&!e.intersects(this.get2DExtent(l.resources,AP)))&&!this._aboveCamera()){if(this.containerOffset=s||h.offset,!this.containerOffset){var u=this.getMap();this.containerOffset=u._pointToContainerPoint(l.middleWest)._add(0,-u.height/2)}this._beforePaint();var c=o||l.context;c.isHitTesting||this._resetSymbolizersBBOX(),qu[0]=c,qu[1]=l.resources;for(var f=this.symbolizers.length-1;f>=0;f--)(c.shadowBlur||this.symbolizers[f].symbol.shadowBlur)&&this._prepareShadow(c,this.symbolizers[f].symbol),this.symbolizers[f].symbolize(...qu);this._afterPaint(),this._painted=!0,(this.geometry.options.debug||a.options.debug)&&this._debugSymbolizer.symbolize(c)}}}},t.getSprite=function(e,o){if(!this.geometry.isPoint)return null;if(this._spriting=!0,!this._sprite&&this.symbolizers.length>0){var s=new Le;this.symbolizers.forEach(function(p){var m=p.getFixedExtent(e);s._combine(m)});var a=s.getMin().multi(-1),l=o||(this.getMap()?this.getMap().CanvasClass:null),h=J.createCanvas(s.getWidth(),s.getHeight(),l),u;this._renderPoints&&(u=this._renderPoints);for(var c=h.getContext("2d"),f=[c,e],d=this.symbolizers.length-1;d>=0;d--){var g=this.symbolizers[d].getDxDy();this._renderPoints={center:[[a.add(g)]]},this._prepareShadow(c,this.symbolizers[d].symbol),this.symbolizers[d].symbolize(...f)}u&&(this._renderPoints=u),this._sprite={canvas:h,offset:s.getCenter()}}return this._spriting=!1,this._sprite},t.isSpriting=function(){return!!this._spriting},t.hitTest=function(e,o){if((!o||o<.5)&&(o=.5),this._hitPoint=e.sub(o,o),!vn){var s=this.getMap()?this.getMap().CanvasClass:null;vn=J.createCanvas(1,1,s)}J.setHitTesting(!0),vn.width=vn.height=2*o;var a=J.getCanvas2DContext(vn);a.isHitTesting=!0;try{this.paint(null,a,this._hitPoint)}finally{J.setHitTesting(!1)}delete this._hitPoint;try{for(var l=a.getImageData(0,0,vn.width,vn.height).data,h=3,u=l.length;h<u;h+=4)if(l[h]>0)return!0}catch(c){console.error(c)}return!1},t.isHitTesting=function(){return!!this._hitPoint},t._prepareShadow=function(e,o){o.shadowBlur?(e.shadowBlur=this.isHitTesting()?0:o.shadowBlur,e.shadowColor=o.shadowColor||"#000",e.shadowOffsetX=o.shadowOffsetX||0,e.shadowOffsetY=o.shadowOffsetY||0):e.shadowBlur&&(e.shadowBlur=null,e.shadowColor=null,e.shadowOffsetX=null,e.shadowOffsetY=null)},t._eachSymbolizer=function(e,o){if(this.symbolizers){o||(o=this);for(var s=this.symbolizers.length-1;s>=0;s--)e.apply(o,[this.symbolizers[s]])}},t.get2DExtent=function(e,o){this._verifyProjection();var s=this.getMap();e=e||this.getLayer()._getRenderer().resources;var a=dt[s.id],l=a?a.zoom:s.getZoom(),h=this._isDynamicSize();if((!this._extent2D||this._extent2D._zoom!==l||!this._fixedExtent)&&(this._extent2D&&this._extent2D._zoom!==l&&delete this._extent2D,this.symbolizers&&(this._extent2D||(this._extent2D=this._computeExtent2D(new Le),this._extent2D._zoom=l),this._fixedExtent||(this._fixedExtent=this._computeFixedExtent(e,new Le)))),!this._extent2D)return h&&delete this._fixedExtent,null;var{xmin:u,ymin:c,xmax:f,ymax:d}=this._fixedExtent;return h&&delete this._fixedExtent,Ka.set(u,-d,f,-c),o?(o.set(this._extent2D.xmin,this._extent2D.ymin,this._extent2D.xmax,this._extent2D.ymax),o._add(Ka),o):this._extent2D.add(Ka)},t._computeExtent2D=function(e){for(var o=this.symbolizers.length-1;o>=0;o--){var s=this.symbolizers[o];e._combine(s.get2DExtent())}return e},t._computeFixedExtent=function(e,o){for(var s=this.symbolizers.length-1;s>=0;s--){var a=this.symbolizers[s];a.getFixedExtent&&o._combine(a.getFixedExtent(e))}return o},t._isDynamicSize=function(){for(var e=this.symbolizers.length-1;e>=0;e--){var o=this.symbolizers[e];if(o.isDynamicSize())return!0}return!1},t._aboveCamera=function(){var e=this.getMinAltitude(),o=this.getMap(),s=o.getGLRes();e=o.altitudeToPoint(e,s)*ir(e);var a=o.getFrustumAltitude();return e&&a&&a<e},t.getFixedExtent=function(){var e=this.getMap(),o=dt[e.id],s=o?o.zoom:e.getZoom();return this._isDynamicSize()?this._computeFixedExtent(null,new Le):((!this._extent2D||this._extent2D._zoom!==s)&&this.get2DExtent(null,Ka),this._fixedExtent)},t.setZIndex=function(e){this._eachSymbolizer(function(o){o.setZIndex(e)})},t.show=function(){if(this._painted)this.removeCache(),this._eachSymbolizer(function(o){o.show()});else{var e=this.getLayer();e.isCanvasRender()||this.paint()}},t.hide=function(){this._eachSymbolizer(function(e){e.hide()})},t.repaint=function(){this._altAtGL=this._getGeometryAltitude(),this.removeCache();var e=this.getLayer();if(e){var o=e.getRenderer();!o||!o.setToRedraw()||o.setToRedraw()}},t.refreshSymbol=function(){this.removeCache(),this._removeSymbolizers(),this.symbolizers=this._createSymbolizers()},t.remove=function(){this.removeCache(),this._removeSymbolizers()},t._removeSymbolizers=function(){this._eachSymbolizer(function(e){delete e.painter,e.remove()}),delete this.symbolizers},t.removeCache=function(){delete this._renderPoints,delete this._paintParams,delete this._sprite,delete this._extent2D,delete this._fixedExtent,delete this._cachedParams,delete this._unsimpledParams},t.getAltitude=function(){var e=this.geometry._getAltitude();return e!==this._propAlt&&(this._altAtGL=this._getGeometryAltitude()),this._altAtGL?this._altAtGL:0},t.getMinAltitude=function(){return this.minAltitude?this.minAltitude:0},t.getMaxAltitude=function(){return this.maxAltitude?this.maxAltitude:0},t._getGeometryAltitude=function(){var e=this.getMap();if(!e)return 0;var o=this.geometry._getAltitude();this._propAlt=o;var[s,a]=v0(o);if(this.minAltitude=s,this.maxAltitude=a,!o)return 0;var l=this.geometry.getCenter();return l?o:0},t._verifyProjection=function(){var e=this.geometry._getProjection()||IP;this._projCode&&this._projCode!==e.code&&this.removeCache(),this._projCode=e.code},t._beforePaint=function(){},t._afterPaint=function(){},t.getPathTempRenderPoints=function(){for(var e=this.symbolizers||[],o=0,s=e.length;o<s;o++){var a=this.symbolizers[o];if(a instanceof gd&&a._tempRenderPoints)return a._tempRenderPoints}},r}(br);function M0(n,r,t){if(!Array.isArray(t))return n;for(var i=[],e=0,o=n.length;e<o;e++)if(Array.isArray(n[e]))i.push(M0(n[e],r,t));else{var s=n[e];if(s.point.equals(r[s.index]))s.altitude=t[s.index],i.push(s);else{var a=void 0,l=void 0;s.index===0?(a=s.index,l=s.index+1):(a=s.index-1,l=s.index);var h=s.point.distanceTo(r[l]),u=h/(h+r[a].distanceTo(s.point)),c=zl(t[a],t[l],1-u);s.altitude=c,i.push(s)}}return i}var DP=new Le,P0=function(n){function r(i,e){var o;return o=n.call(this)||this,o.geometry=i,o.isMask=e,o.bbox=ur(),o._drawTime=0,o}Q(r,n);var t=r.prototype;return t._setDrawTime=function(e){return this._drawTime=e,this._eachPainter(function(o){o._setDrawTime(e)}),this},t.getRenderBBOX=function(){var e=this,o=this.getLayer();if(o&&o._drawTime!==this._drawTime)return null;Mo(this.bbox);var s=!1;return this._eachPainter(function(a){var l=a.getRenderBBOX();if(!ia(l)){s=!0;return}ra(e.bbox,l)}),s?null:ia(this.bbox)?this.bbox:null},t._eachPainter=function(e){for(var o=this.geometry.getGeometries(),s,a=0,l=o.length;a<l&&(s=this.isMask?o[a]._getMaskPainter():o[a]._getPainter(),!(!!s&&s&&e.call(this,s)===!1));a++);},t.getLayer=function(){return this.geometry&&this.geometry.getLayer()},t.paint=function(e){this.geometry&&this._eachPainter(function(o){o.paint(e)})},t.get2DExtent=function(e,o){o&&o.set(null,null,null,null);var s=o||new Le;return this._eachPainter(function(a){s=s._combine(a.get2DExtent(e,DP))}),s},t.remove=function(){this._eachPainter(function(e){e.remove()})},t.setZIndex=function(e){this._eachPainter(function(o){o.setZIndex(e)})},t.show=function(){this._eachPainter(function(e){e.show()})},t.hide=function(){this._eachPainter(function(e){e.hide()})},t.repaint=function(){this._eachPainter(function(e){e.repaint()})},t.refreshSymbol=function(){this._eachPainter(function(e){e.refreshSymbol()})},t.hasPoint=function(){var e=!1;return this._eachPainter(function(o){return o.hasPoint()?(e=!0,!1):!0}),e},t.getMinAltitude=function(){var e=!0,o=0;return this._eachPainter(function(s){var a=s.getMinAltitude();(e||a<o)&&(e=!1,o=a)}),o},t.getMaxAltitude=function(){var e=0;return this._eachPainter(function(o){var s=o.getMaxAltitude();s>e&&(e=s)}),e},r}(br);function zP(n){for(var r="",t=n.split(""),i=t.length,e=i-1;e>=0&&!isNaN(t[e]);e--)r=t[e]+r;return r}function BP(n){var r=n.indexOf("EPSG")>-1?n:"EPSG:"+n;return r=E0(r,[["4490","4326"],["102100","3857"],["900913","3857"]]),r}function E0(n,r=[]){return r.forEach(function(t){var[i,e]=t;n=n.replace(i,e)}),n}function GP(n){var{projection:r,isArcgis:t,isGeoServer:i,isSuperMap:e}=n,o=.0002645833333333333;return(t||i||e)&&(o=28e-5),r&&r.indexOf("4326")>-1&&(o=23767925226029154e-25,(t||e)&&(o=2518101729011901e-24),i&&(o=251528279553466e-23)),o}var FP="wmts";function Ji(n,r){var t=n.getElementsByTagName(r);if(t&&t.length)return t;var i=FP+":"+r;return n.getElementsByTagName(i)}function NP(n,r){for(var t=0;t<n.length;t++){var i=n[t];if(i=i.getElementsByTagName("ows:Identifier")[0],i&&i.textContent===r)return n[t]}return null}function HP(n,r,t){var i=["isArcgis","isSuperMap","isGeoServer"];i.every(function(I){return t[I]==null})&&console.warn("Please specify the server type, such as isArcgis, isSuperMap, isGeoServer, Otherwise, the system will determine by itself"),t.isArcgis==null&&(t.isArcgis=["arcgis","geoscene"].some(function(I){return n.indexOf(I)>-1})),t.isSuperMap==null&&(t.isSuperMap=n.indexOf("supermap")>-1);var e=new DOMParser,o=e.parseFromString(n,"text/xml"),s=o.querySelectorAll("Contents")[0];if(!s)return[];var a=Ji(s,"Layer");if(!a.length)return[];for(var l=[],h=0,u=s.childNodes.length;h<u;h++)s.childNodes[h].localName==="TileMatrixSet"&&l.push(s.childNodes[h]);if(!l.length)return[];for(var c=[],f=0,d=a.length;f<d;f++){var g=a[f],p=g.querySelectorAll("Style")[0];p&&(p=p.getElementsByTagName("ows:Identifier")[0],p&&(p=p.textContent));var m=g.getElementsByTagName("ows:Identifier")[0];m&&(m=m.textContent);var v=Ji(g,"TileMatrixSetLink");if(v.length!==0)for(var _=0,y=v.length;_<y;_++){var w=v[_];w=Ji(w,"TileMatrixSet")[0],w&&(w=w.textContent);var x=NP(l,w);if(x){var C=g.querySelectorAll("ResourceURL")[0],b="";C&&(b=C.attributes.template.value);var{resolutions:E,tileSize:T,tileSystem:S,projection:B,TileMatrixSet:L,isGeoServer:D,levelStr:N}=jP(x,t);b.length||(b=r.substr(0,r.lastIndexOf("?")),b+="?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER={LAYER}&STYLE={Style}&TILEMATRIXSET={TileMatrixSet}&FORMAT={tiles}&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}");var G=E0(b,[["{LAYER}",m],["{Layer}",m],["{layer}",m],["{STYLE}",p],["{Style}",p],["{style}",p],["{TileMatrixSet}",L],["{TileMatrix}",D?N+":{z}":"{z}"],["{TileRow}","{y}"],["{TileCol}","{x}"],["{tiles}",D?"image/png":"tiles"]]);c.push({tileSize:T,tileSystem:S,spatialReference:{resolutions:E,projection:B},urlTemplate:G,info:{layerName:m,TileMatrixSet:L,style:p,tileSize:T,tileSystem:S,resolutions:E,projection:B,urlTemplate:G}})}}}return c}function jP(n,r={}){var t=Ji(n,"TileMatrix"),i=[],e=[],o=[],s,a,l=!1,h;if(!s){var u=n.getElementsByTagName("ows:SupportedCRS")[0];u&&(s=u.textContent,s=s.split("EPSG")[1],s=zP(s),s=BP(s))}a||(a=n.getElementsByTagName("ows:Identifier")[0],a&&(a=a.textContent)),r.projection=s;for(var c=1/0,f=0;f<t.length;f++){var d=t[f],g=d.getElementsByTagName("ows:Identifier")[0].textContent;isNaN(parseInt(g))?(h=g.substr(0,g.lastIndexOf(":")),g=g.split(":"),g=g[g.length-1],g=parseInt(g),l=!0,r.isGeoServer=!0):g=parseInt(g),c=Math.min(c,g);var p=Ji(d,"ScaleDenominator")[0].textContent,m=Ji(d,"TopLeftCorner")[0].textContent,v=Ji(d,"TileWidth")[0].textContent,_=Ji(d,"TileHeight")[0].textContent;if(o.length===0&&o.push(parseInt(v),parseInt(_)),e.length===0){var[y,w]=m.split(" ").filter(function(T){return T!==""}).map(function(T){return parseFloat(T)});y>0?e.push(1,-1,w,y):e.push(1,-1,y,w)}var x=GP(r),C=parseFloat(p)*x;i.push(C)}if(c>0)for(var b=i[0],E=c-1;E>=0;E--)b=b*2,i.splice(0,0,b);return{resolutions:i,tileSize:o,tileSystem:e,projection:s,TileMatrixSet:a,isGeoServer:l,levelStr:h}}var ZP=function(r,t,i={jsonp:!0}){Ee(r)&&Zt.get(r,function(e,o){if(e){t(e);return}var s=HP(o,r,i);t(null,s)},i)};function Tv(n){for(var r=n.tileInfo,t=[r.cols,r.rows],i=[],e=r.lods,o=0,s=e.length;o<s;o++)i.push(e[o].resolution);var a=n.fullExtent,l=r.origin,h=[1,-1,l.x,l.y];return delete a.spatialReference,{spatialReference:{resolutions:i,fullExtent:a},tileSystem:h,tileSize:t}}var VP=function(r,t,i={jsonp:!0}){if(Ee(r)&&r.substring(0,1)!=="{")Zt.getJSON(r,function(o,s){if(o){t(o);return}var a=Tv(s);t(null,a)},i);else{Ee(r)&&(r=Js(r));var e=Tv(r);t(null,e)}},jr;function Qa(){if(!jr){var n=Math.round(wr.crsMaxNativeZoom||22);jr={"EPSG:3857":{projection:"EPSG:3857",resolutions:function(){for(var r=[],t=12756274*Math.PI,i=0;i<=n;i++)r[i]=t/(256*Math.pow(2,i));return r}(),fullExtent:{top:6378137*Math.PI,left:-6378137*Math.PI,bottom:-6378137*Math.PI,right:6378137*Math.PI}},"EPSG:4326":{projection:"EPSG:4326",fullExtent:{top:90,left:-180,bottom:-90,right:180},resolutions:function(){for(var r=[],t=0;t<=n;t++)r[t]=180/(Math.pow(2,t)*128);return r}()},BAIDU:{projection:"baidu",resolutions:function(){for(var r=Math.pow(2,18),t=[],i=0;i<=n;i++)t[i]=r,r*=.5;return t}(),fullExtent:{top:33554432,left:-33554432,bottom:-33554432,right:33554432}},IDENTITY:{projection:"identity",resolutions:function(){for(var r=Math.pow(2,8),t=[],i=0;i<=n;i++)t[i]=r,r*=.5;return t}(),fullExtent:{top:2e5,left:-2e5,bottom:-2e5,right:2e5}},"PRESET-VT-3857":{projection:"EPSG:3857",resolutions:function(){for(var r=[],t=6378137*Math.PI,i=0;i<=n;i++)r[i]=t/(256*Math.pow(2,i));return r}(),fullExtent:{top:6378137*Math.PI,left:-6378137*Math.PI,bottom:-6378137*Math.PI,right:6378137*Math.PI}},"PRESET-VT-4326":{projection:"EPSG:4326",fullExtent:{top:90,left:-180,bottom:-90,right:180},resolutions:function(){for(var r=[],t=0;t<=n;t++)r[t]=180/4/(Math.pow(2,t)*128);return r}()}},jr["EPSG:4490"]=jr["EPSG:4326"],jr["PRESET-3857-512"]=jr["PRESET-VT-3857"],jr["PRESET-4326-512"]=jr["PRESET-VT-4326"],jr["PRESET-4490-512"]=jr["PRESET-VT-4326"]}return jr}var Yi=function(){function n(t={}){this.options=t,this._initSpatialRef()}n.registerPreset=function(i,e){i=i&&i.toUpperCase();var o=Qa();o[i]&&console.warn("Spatial reference "+i+" already registered."),o[i]=e},n.getPreset=function(i){return Qa()[i.toUpperCase()]},n.getAllPresets=function(){return Object.keys(Qa())},n.loadArcgis=function(i,e,o){return VP(i,e,o),this},n.loadWMTS=function(i,e,o){return ZP(i,e,o),this},n.getProjectionInstance=function(i){var e;if(!i)return null;if(Ee(i)?e={code:i}:e=i,e.project)return e.locate||(e=oe({},e),e.measure==="identity"?oe(e,hv.getInstance("IDENTITY")):oe(e,hv.getInstance("EPSG:4326"))),e;var o=(e.code+"").toLowerCase();for(var s in vi)if(Bo(vi,s)){var a=vi[s].aliases||[],l=vi[s].code;l&&a.push(l);for(var h=0;h<a.length;h++)if(a[h].toLowerCase()===o)if(vi[s].create){var u=vi[s].create(i);return u.code=a[h],u}else{if(vi[s].code===a[h])return vi[s];var c=oe({},vi[s]);return c.code=a[h],c}}return null},n.equals=function(i,e){if(Ee(i)||Ee(e))return i===e;if(!i&&!e)return!0;if(!i||!e||i.projection!==e.projection)return!1;var o=i.fullExtent,s=e.fullExtent;if(o&&!s||!o&&s||o&&s&&(o.top!==s.top||o.bottom!==s.bottom||o.left!==s.left||o.right!==s.right))return!1;var a=i.resolutions,l=e.resolutions;if(a&&l){if(a.length!==l.length)return!1;for(var h=0;h<a.length;h++)if(a[h]!==l[h])return!1}else if(a||l)return!1;return!0};var r=n.prototype;return r._initSpatialRef=function(){var i;if(this.options.projection?i=n.getProjectionInstance(this.options.projection):i=l0,!i)throw new Error("must provide a valid projection in map's spatial reference.");i=oe({},hn,i),i.measureLength||oe(i,s0),this._projection=i;var e=Qa(),o,s=this.options.resolutions;if(!s&&(i.code&&(o=e[i.code.toUpperCase()],o&&(s=o.resolutions,this.isEPSG=i.code!=="IDENTITY")),!s))throw new Error("must provide valid resolutions in map's spatial reference.");if(this._resolutions=s,this._pyramid=!0,this._pyramid){for(var a=1e4,l=0;l<s.length;l++)if(s[l]&&s[l-1]&&Math.round(s[l-1]/s[l]*a)/a!==2){this._pyramid=!1;break}}var h=this.options.fullExtent;if(!h&&(i.code&&(o=e[i.code.toUpperCase()],o&&(h=o.fullExtent)),!h))throw new Error("must provide a valid fullExtent in map's spatial reference.");if(O(h.left)?(this._fullExtent=new Je(h),h.left=h.xmin,h.right=h.xmax,h.top=h.ymax,h.bottom=h.ymin):this._fullExtent=new Je(new $(h.left,h.top),new $(h.right,h.bottom)),O(h.top)||O(h.bottom)||O(h.left)||O(h.right))throw new Error("must provide valid top/bottom/left/right in fullExtent.");oe(this._fullExtent,h),this._projection.fullExtent=h;var u=h.right>=h.left?1:-1,c=h.top>=h.bottom?-1:1;this._transformation=new r0([u,c,0,0])},r.getResolutions=function(){return this._resolutions||[]},r.getResolution=function(i){var e=i|0;e<0?e=0:e>this._resolutions.length-1&&(e=this._resolutions.length-1);var o=this._resolutions[e];if(e!==i&&i>0&&e<this._resolutions.length-1){var s=this._resolutions[e+1];return o+(s-o)*(i-e)}return o},r.getProjection=function(){return this._projection},r.getFullExtent=function(){return this._fullExtent},r.getTransformation=function(){return this._transformation},r.getMinZoom=function(){for(var i=0;i<this._resolutions.length;i++)if(!O(this._resolutions[i]))return i;return 0},r.getMaxZoom=function(){for(var i=this._resolutions.length-1;i>=0;i--)if(!O(this._resolutions[i]))return i;return this._resolutions.length-1},r.getZoomDirection=function(){return ir(this._resolutions[this.getMinZoom()]-this._resolutions[this.getMaxZoom()])},r.toJSON=function(){return this.json||(this.json={resolutions:this._resolutions,fullExtent:{top:this._fullExtent.top,left:this._fullExtent.left,bottom:this._fullExtent.bottom,right:this._fullExtent.right},projection:this._projection.code}),this.json},r.isPyramid=function(){return this._pyramid},n}(),Ku=new z(0,0),bv=new Le,Qu={};function WP(n){if(!n)return!1;var{xmin:r,ymin:t,xmax:i,ymax:e}=n;return i-r>0&&e-t>0}var $P={id:null,visible:!0,interactive:!0,editable:!0,cursor:null,antiMeridian:!1,defaultProjection:"EPSG:4326"},je=function(n){function r(i){var e,o=oe({},i),s=o.symbol,a=o.properties,l=o.id;return delete o.symbol,delete o.id,delete o.properties,e=n.call(this,o)||this,e.propertiesDirty=!1,s?e.setSymbol(s):e._genSizeSymbol(),a&&e.setProperties(a),O(l)||e.setId(l),i&&X(i.rotateAngle)&&(e._dirtyRotate=!0),e}Q(r,n),r.fromJSON=function(e){return e};var t=r.prototype;return t.getFirstCoordinate=function(){if(this.type==="GeometryCollection"){var e=this.getGeometries();return e.length?e[0].getFirstCoordinate():null}var o=this.getCoordinates();if(!Array.isArray(o))return o;do o=o[0];while(Array.isArray(o)&&o.length>0);return o},t.getLastCoordinate=function(){if(this.type==="GeometryCollection"){var e=this.getGeometries();return e.length?e[e.length-1].getLastCoordinate():null}var o=this.getCoordinates();if(!Array.isArray(o))return o;do o=o[o.length-1];while(Array.isArray(o)&&o.length>0);return o},t.addTo=function(e,o){return e.addGeometry(this,o),this},t.getLayer=function(){return this._layer?this._layer:null},t.getMap=function(){return this._layer?this._layer.getMap():null},t.getId=function(){return this._id},t.setId=function(e){var o=this.getId();return this._id=e,this._fireEvent("idchange",{old:o,new:e}),this},t.getProperties=function(){return this.properties?this.properties:this._getParent()?this._getParent().getProperties():null},t.setProperties=function(e){this.propertiesDirty=!0;var o=this.properties;this.properties=Xt(e)?oe({},e):e;var s=this.getGeometries?this.getGeometries():[];return s.forEach(function(a){var l=a.getProperties?a.getProperties()||{}:{},h=oe(l,e||{});a.setProperties&&a.setProperties(h)}),this._clearAltitudeCache(),this._repaint(),this._fireEvent("propertieschange",{old:o,new:e}),this},t.getType=function(){return this.type},t.getSymbol=function(){var e=this._symbol;return e?Array.isArray(e)?Zr(e):oe({},e):null},t.setSymbol=function(e){return this._symbolUpdated=e,this._symbol=this._prepareSymbol(e),this.onSymbolChanged(),delete this._compiledSymbol,delete this._symbolHash,this},t.getSymbolHash=function(){return this._symbolHash||(this._symbolHash=Ma(this._symbolUpdated)),this._symbolHash},t.updateSymbol=function(e){if(!e)return this;var o=this._getSymbol(),s=Array.isArray(e);if(o||(o=this._getInternalSymbol()||{}),!Array.isArray(o)&&s&&(e=e[0]||{}),Array.isArray(o)){if(!s)for(e=[e];e.length<o.length;)e.push({});for(var a=0;a<e.length;a++)Xl(e[a])&&delete this._textDesc,o[a]&&e[a]&&(o[a]=Zr(o[a],e[a]))}else{if(Array.isArray(e))return console.error("Geometry's symbol is object but the update symbol is array."),console.error("Geometry's symbol and update symbol:",o,e),this;Xl(o)&&delete this._textDesc,o?o=Zr(o,e):o=Zr(this._getInternalSymbol(),e)}return this._eventSymbolProperties=e,delete this._compiledSymbol,this.setSymbol(o)},t.getTextContent=function(){var e=this._getInternalSymbol();if(Array.isArray(e)){for(var o=[],s=!1,a=0;a<e.length;a++)o[a]=Ys(e[a]&&e[a].textName,this.getProperties()),O(o[a])||(s=!0);return s?o:null}return Ys(e&&e.textName,this.getProperties())},t.getTextDesc=function(){if(!this._textDesc){var e=this.getTextContent(),o=this._sizeSymbol,s=Array.isArray(e);Array.isArray(o)?this._textDesc=o.map(function(a,l){return qs(s?e[l]:"",a)}):this._textDesc=qs(e,o)}return this._textDesc},t.getCenter=function(){return this._computeCenter(this._getMeasurer())},t.getExtent=function(){var e=this._getPrjExtent(),o=this._getProjection();if(e&&o){var s=o.unproject(new $(e.xmin,e.ymin)),a=o.unproject(new $(e.xmax,e.ymax));return new Je(s,a,o)}else return this._computeExtent(this._getMeasurer())},t.getContainerExtent=function(e){var o=this.get2DExtent();if(!o||!o.isValid())return null;var s=this.getMap(),a=s.getGLRes(),l=this.getMinAltitude(),h=o.convertTo(function(m){return s._pointAtResToContainerPoint(m,a,l,Ku)},e),u=this.getMaxAltitude();if(u!==l){var c=o.convertTo(function(m){return s._pointAtResToContainerPoint(m,a,u,Ku)},bv);h._combine(c)}var f=this.getLayer();if(f&&this.type==="LineString"&&u&&f.options.drawAltitude){var d=o.convertTo(function(m){return s._pointAtResToContainerPoint(m,a,0,Ku)},bv);h._combine(d)}if(h){var g=this._getFixedExtent();WP(g)&&h._add(g)}var p=this.options.smoothness;return p&&h._expand(h.getWidth()*.15),h},t._getFixedExtent=function(){this._fixedExtent||(this._fixedExtent=new Le);var e=this._sizeSymbol,o=(e&&e.lineWidth||1)/2,s=e&&e.lineStrokeWidth||0;o+=s,this._fixedExtent.set(-o,-o,o,o);var a=e&&e.lineDx||0;this._fixedExtent._add([a,0]);var l=e&&e.lineDy||0;return this._fixedExtent._add([0,l]),this._fixedExtent},t.get2DExtent=function(){var e=this.getMap();if(!e)return null;if(this._extent2d)return this._extent2d;var o=this._getPrjExtent();if(!o||!o.isValid())return null;var s=o.getMin(),a=o.getMax(),l=e.getGLRes();e._prjToPointAtRes(s,l,s),e._prjToPointAtRes(a,l,a),this._extent2d=new Le(s,a);var h=dt[e.id],u=h?h.zoom:e.getZoom();return this._extent2d.z=u,this._extent2d},t.getSize=function(){var e=this.getContainerExtent();return e?e.getSize():null},t.containsPoint=function(e,o){if(!this.getMap())throw new Error('The geometry is required to be added on a map to perform "containsPoint".');return e instanceof $&&(e=this.getMap().coordToContainerPoint(e)),this._containsPoint(e,o)},t._containsPoint=function(e,o){var s=this._getPainter();return s?(o=o||0,this._hitTestTolerance&&(o+=this._hitTestTolerance()),s.hitTest(e,o)):!1},t.show=function(){if(this.options.visible=!0,this.getMap()){var e=this._getPainter();e&&e.show(),this._fireEvent("show")}return this},t.hide=function(){if(this.options.visible=!1,this.getMap()){this.onHide();var e=this._getPainter();e&&e.hide(),this._fireEvent("hide")}return this},t.isVisible=function(){if(!this.options.visible)return!1;var e=this._getInternalSymbol();if(!e)return!0;if(!this.symbolIsVisible())return!1;if(Array.isArray(e)){if(!e.length)return!0;for(var o=0,s=e.length;o<s;o++)if(O(e[o].opacity)||e[o].opacity>0)return!0;return!1}else return O(e.opacity)||Xt(e.opacity)||X(e.opacity)&&e.opacity>0},t.symbolIsVisible=function(){var e=this._getCompiledSymbol();if(!e)return!0;Array.isArray(e)||(e=[e]);for(var o=0,s=e.length;o<s;o++){var a=e[o];if(a){var l=a.visible;if(l!==!1&&l!==0)return!0}}return!1},t.getZIndex=function(){return this.options.zIndex||0},t.setZIndex=function(e){var o=this.options.zIndex;return this.options.zIndex=e,this._fireEvent("zindexchange",{old:o,new:e}),this},t.setZIndexSilently=function(e){return this.options.zIndex=e,this},t.bringToFront=function(){var e=this.getLayer();if(!e||!e.getGeoMaxZIndex)return this;var o=e.getGeoMaxZIndex();return this.setZIndex(o+1),this},t.bringToBack=function(){var e=this.getLayer();if(!e||!e.getGeoMinZIndex)return this;var o=e.getGeoMinZIndex();return this.setZIndex(o-1),this},t.translate=function(e,o,s){if(O(e))return this;var a=new $(e,o,s);if(a.x===0&&a.y===0&&(O(a.z)||a.z===0))return this;var l=this.getCoordinates();if(this._silence=!0,l)if(Array.isArray(l)){var h=Rn(l,function(u){return u.add(a)});this.setCoordinates(h)}else this.setCoordinates(l.add(a));return this._silence=!1,this._fireEvent("positionchange"),this},t._translateRotatePivot=function(e){if(!this._pivot||!e)return this;if(this.options.rotatePivot){var o=this.getCoordinates();if(!o)return this;e instanceof $||(e=new $(e));var s=e.sub(o);if(s.x===0&&s.y===0)return this;this._pivot._add(s),this.options.rotatePivot=this._pivot.toArray()}return this},t.flash=function(e,o,s,a){return Nf.call(this,e,o,s,a)},t.copy=function(){var e=this.toJSON(),o=r.fromJSON(e);return o.options.visible=!0,o},t.remove=function(){var e=this.getLayer();return e?(this._fireEvent("removestart"),this._unbind(),this._fireEvent("removeend"),this._fireEvent("remove"),this):this},t.toGeoJSONGeometry=function(){var e=this._exportGeoJSONGeometry();return e},t.toGeoJSON=function(e){e||(e={});var o={type:"Feature",geometry:null};if(O(e.geometry)||e.geometry){var s=this._exportGeoJSONGeometry();o.geometry=s}var a=this.getId();O(a)||(o.id=a);var l;return(O(e.properties)||e.properties)&&(l=this._exportProperties()),o.properties=l,o},t.toJSON=function(e){e||(e={});var o=this._toJSON(e),s=this._exportGraphicOptions(e);return oe(o,s),o},t.getLength=function(){return this._computeGeodesicLength(this._getMeasurer())},t.getArea=function(){return this._computeGeodesicArea(this._getMeasurer())},t.rotate=function(e,o){if(!X(e))return console.error("angle:"+e+" is not number"),this;if(this._painter||(this._dirtyRotate=!0),this.type==="GeometryCollection"){var s=this.getGeometries();return s.forEach(function(u){return u.rotate(e,o)}),this}o?o=new $(o):o=this.getCenter(),this._angle=e,this._pivot=o;var a=this._getMeasurer(),l=this.getCoordinates();if(!Array.isArray(l)){if((o.x!==l.x||o.y!==l.y)&&!this.getShell){var h=a._rotate(l,o,e);this.setCoordinates(h)}else this.onPositionChanged();return this.getShell&&(this.options.rotateAngle=e,this.options.rotatePivot=o.toArray()),this}return Rn(l,function(u){return a._rotate(u,o,e)}),this.setCoordinates(l),this},t._rotatePrjCoordinates=function(e){if(!e||this._angle===0||!this._pivot)return e;var o=this._getProjection();if(!o)return e;var s=0,a=Array.isArray(e),l=a?e:[e],h=[],u,c;if(this.getRotateOffsetAngle){s=this.getRotateOffsetAngle();var f=l[l.length-1];u=f.x,c=f.y}else{var d=ur();Ii(l,d);var[g,p,m,v]=d;u=(g+m)/2,c=(p+v)/2}for(var _=0,y=l.length;_<y;_++){var w=l[_],{x,y:C}=w,b=x-u,E=C-c,T=Math.sqrt(b*b+E*E),S=UP(u,c,x,C),B=(S-this._angle+s)/180*Math.PI,L=Math.cos(B)*T,D=Math.sin(B)*T,N=new $(u+L,c+D);h.push(N)}for(var G=o.project(this._pivot),I=G.x,A=G.y,k=u-I,Z=c-A,W=0,re=h.length;W<re;W++){var se=h[W];se.x-=k,se.y-=Z}return a?h:h[0]},t.isRotated=function(){return!!(X(this._angle)&&this._pivot)},t._getConnectPoints=function(){return[this.getCenter()]},t._initOptions=function(e){var o=oe({},e),s=o.symbol,a=o.properties,l=o.id;delete o.symbol,delete o.id,delete o.properties,this._setOptions(o),s&&this.setSymbol(s),a&&this.setProperties(a),O(l)||this.setId(l)},t._bindLayer=function(e){if(e!==this.getLayer()){if(this.getLayer())throw new Error("Geometry cannot be added to two or more layers at the same time.");this._layer=e,this._clearCache(),this._bindInfoWindow(),this._bindMenu()}},t._prepareSymbol=function(e){if(Array.isArray(e)){for(var o=[],s=0;s<e.length;s++)o.push(Zl(this._checkAndCopySymbol(e[s])));return o}else if(e)return e=this._checkAndCopySymbol(e),Zl(e);return null},t._checkAndCopySymbol=function(e){var o={};for(var s in e)UT[s]&&Ee(e[s])?o[s]=+e[s]:o[s]=e[s];return o},t._getSymbol=function(){return this._symbol},t._setExternSymbol=function(e){return this._eventSymbolProperties=e,this._symbol||delete this._textDesc,this._externSymbol=this._prepareSymbol(e),this.onSymbolChanged(),this},t._getInternalSymbol=function(){return this._symbol?this._symbol:this._externSymbol?this._externSymbol:this.options.symbol?this.options.symbol:null},t._getPrjExtent=function(){var e=this._getProjection();return this._verifyProjection(),!this._extent&&e&&(this._extent=this._computePrjExtent(e)),this._extent},t._unbind=function(){var e=this.getLayer();e&&(this._animPlayer&&this._animPlayer.finish(),this._unbindMenu(),this._unbindInfoWindow(),this.isEditing()&&this.endEdit(),this._removePainter(),this.onRemove&&this.onRemove(),e.onRemoveGeometry&&e.onRemoveGeometry(this),delete this._layer,delete this._internalId,delete this._extent)},t._getInternalId=function(){return this._internalId},t._setInternalId=function(e){this._internalId=e},t._getMeasurer=function(){return this._getProjection()?this._getProjection():Yi.getProjectionInstance(this.options.defaultProjection)},t._getProjection=function(){var e=this.getMap();return e?e.getProjection():null},t._verifyProjection=function(){var e=this._getProjection();this._projCode&&e&&this._projCode!==e.code&&this._clearProjection(),this._projCode=e?e.code:this._projCode},t._getExternalResources=function(){var e=this._getInternalSymbol();return ba(e)},t._getPainter=function(){if(this._painter)return this._painter;var e=this.getLayer();if(e){if(hy.indexOf(this.type)!==-1){if(e.constructor.getCollectionPainterClass){var o=e.constructor.getCollectionPainterClass();o&&(this._painter=new o(this))}}else if(e.constructor.getPainterClass){var s=e.constructor.getPainterClass();s&&(this._painter=new s(this))}}return this._painter},t._getMaskPainter=function(){return this._maskPainter?this._maskPainter:(this._maskPainter=this.getGeometries&&this.getGeometries()?new P0(this,!0):new pd(this),this._maskPainter)},t._removePainter=function(){this._painter&&this._painter.remove(),delete this._painter},t._paint=function(e){if(this.symbolIsVisible()&&this._painter){if(this._dirtyCoords){delete this._dirtyCoords;var o=this._getProjection();o&&(this._pcenter=o.project(this._coordinates),this._clearCache())}this._dirtyRotate&&X(this.options.rotateAngle)&&this.rotate(this.options.rotateAngle,this.options.rotatePivot),this._dirtyRotate=!1,this._painter.paint(e)}},t._clearCache=function(){delete this._extent,delete this._extent2d,this._clearAltitudeCache(),this._parent&&(delete this._parent._extent,delete this._parent._extent2d,this._parent._clearAltitudeCache())},t._clearProjection=function(){delete this._extent,delete this._extent2d,this._parent&&(delete this._parent._extent,delete this._parent._extent2d)},t._repaint=function(){this._painter&&this._painter.repaint()},t.onHide=function(){this.closeMenu(),this.closeInfoWindow()},t.onShapeChanged=function(){this._clearCache(),this._repaint(),this._fireEvent("shapechange")},t.onPositionChanged=function(){this._clearCache(),this._repaint(),this._fireEvent("positionchange")},t.onSymbolChanged=function(){this._painter&&this._painter.refreshSymbol();var e={};this._eventSymbolProperties?(e.properties=JSON.parse(JSON.stringify(this._eventSymbolProperties)),delete this._eventSymbolProperties):delete this._textDesc,this._genSizeSymbol(),this._fireEvent("symbolchange",e)},t._genSizeSymbol=function(){var e=this._getInternalSymbol();if(!e){delete this._sizeSymbol;return}if(Array.isArray(e)){this._sizeSymbol=[];for(var o=!1,s=0;s<e.length;s++){var a=this._sizeSymbol[s]=this._getSizeSymbol(e[s]);!o&&a&&a._dynamic&&(o=!0)}this._sizeSymbol._dynamic=o}else this._sizeSymbol=this._getSizeSymbol(e)},t._getSizeSymbol=function(e){var o=ea({lineWidth:e.lineWidth,lineDx:e.lineDx,lineDy:e.lineDy},this);return(rt(e.lineWidth)||rt(e.lineDx)||rt(e.lineDy))&&(o._dynamic=!0),o},t._getCompiledSymbol=function(){return this._compiledSymbol?this._compiledSymbol:(this._compiledSymbol=ea(this._getInternalSymbol(),this),this._compiledSymbol)},t.onConfig=function(e){var o;e.properties&&(o=e.properties,delete e.properties);var s=!1;for(var a in e)if(e.hasOwnProperty(a)){var l=a.slice(0,5);if(l==="arrow"||l==="smoot"){s=!0;break}}o?(this.setProperties(o),this._repaint()):s&&this._repaint()},t._setParent=function(e){e&&(this._parent=e)},t._getParent=function(){return this._parent},t._fireEvent=function(e,o){this._silence||(this.getLayer()&&this.getLayer()._onGeometryEvent&&(o||(o={}),o.type=e,o.target=this,this.getLayer()._onGeometryEvent(o)),this.fire(e,o))},t._toJSON=function(e){return{feature:this.toGeoJSON(e)}},t._recordVisible=function(){var e=this.options.visible;O(e)&&(e=!0),this._savedVisible=e},t._recoveryVisible=function(){delete this._savedVisible},t._exportGraphicOptions=function(e){var o={};return(O(e.options)||e.options)&&(o.options=this.config()),o.options&&this.isEditing&&this.isEditing()&&(o.options.visible=this._savedVisible),(O(e.symbol)||e.symbol)&&(o.symbol=this.getSymbol()),(O(e.infoWindow)||e.infoWindow)&&this._infoWinOptions&&(o.infoWindow=this._infoWinOptions),o},t._exportGeoJSONGeometry=function(){var e=this.getCoordinates(),o=$.toNumberArrays(e);return{type:this.getType(),coordinates:o}},t._exportProperties=function(){var e=null,o=this.getProperties();return O(o)||(Xt(o)?e=oe({},o):e=o),e},t._hitTestTolerance=function(){return 0},t._getAltitude=function(){var e=this.getLayer();if(!e)return 0;var o=e.options,s=e.getAltitude?e.getAltitude():0,a=o.enableAltitude;if(!a&&e.isVectorLayer)return s;var l=ec(e),h=this.properties||Qu,u=h[l];if(O(u)){var c=Mv(this,s,a);return O(c)?s:c}return Array.isArray(u)?u.map(function(f){return f+s}):u+s},t.getAltitude=function(){var e=this.getLayer(),o=ec(e),s=this.properties||Qu,a=s[o];if(!O(a))return a;var l=Mv(this,0,!1);return O(l)?0:l},t.hasAltitude=function(){return this._genMinMaxAlt(),!!this._minAlt||!!this._maxAlt},t.setAltitude=function(e){if(!X(e))return this;var o=this.getLayer(),s=ec(o),a=this.properties||Qu,l=a[s];if(!O(l))if(Array.isArray(l))for(var h=0,u=l.length;h<u;h++)l[h]=e;else a[s]=e;var c=this.getCoordinates?this.getCoordinates():null;if(!c)return this;if(S0(c,e),o){var f=o.getRenderer();f&&(f.gl||f.device)?this.setCoordinates(c):f&&this._repaint()}return this._clearAltitudeCache(),this.onPositionChanged(),this},t._genMinMaxAlt=function(){if(this._minAlt===void 0||this._maxAlt===void 0){var e=this._getAltitude(),[o,s]=v0(e);this._minAlt=o,this._maxAlt=s}},t.getMinAltitude=function(){return this._genMinMaxAlt(),this._minAlt},t.getMaxAltitude=function(){return this._genMinMaxAlt(),this._maxAlt},t._clearAltitudeCache=function(){return this._minAlt=void 0,this._maxAlt=void 0,this},t._getEditCenter=function(){var e=this.getCenter().copy();e.z=0;var o=this.getAltitude();if(X(o))return e.z=o,e;var s=0,a=0,l=function(u){for(var c=0,f=u.length;c<f;c++)Array.isArray(u[c])?l(u[c]):(a++,s+=u[c])};return Array.isArray(o)&&(l(o),e.z=s/a),e},r}(t0(ci(od(br))));je.mergeOptions($P);function ec(n){var r="altitude";if(n){if(!n.isVectorLayer)return null;var t=n.options;r=t.altitudeProperty}return r}function Mv(n,r,t){var i=n.getCoordinates?n.getCoordinates():null;if(i){var e=[];if(O0(i,e),e.length){var o=k0(i,r,t);return o}}return null}function S0(n,r){if(Array.isArray(n))for(var t=0,i=n.length;t<i;t++)S0(n[t],r);else n.z=r}function O0(n,r){if(!r.length)if(Array.isArray(n))for(var t=0,i=n.length;t<i;t++)O0(n[t],r);else X(n.z)&&r.push(n.z)}function k0(n,r,t){if(Array.isArray(n)){for(var i=[],e=0,o=n.length;e<o;e++)i.push(k0(n[e],r,t));return i}return X(n.z)?t?r+n.z:n.z:t?r:0}function UP(n,r,t,i){if(n===t)return i>r?-90:90;t-=n,i-=r,i=-i;var e=Math.atan2(i,t);return e/Math.PI*180}var R0="check_browser_max_fps",JP=`function (exports) {
|
|
147
|
-
exports.initialize = function () {};
|
|
148
|
-
function now(){
|
|
149
|
-
return new Date().getTime();
|
|
150
|
-
}
|
|
151
|
-
function checkFPS(cb) {
|
|
152
|
-
if (typeof(requestAnimationFrame) === 'undefined') {
|
|
153
|
-
cb(-1);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
const count = 100;
|
|
157
|
-
let idx = 0;
|
|
158
|
-
let id;
|
|
159
|
-
let startTime;
|
|
160
|
-
function loop() {
|
|
161
|
-
idx++;
|
|
162
|
-
if (idx === count) {
|
|
163
|
-
cancelAnimationFrame(id);
|
|
164
|
-
const endTime = now();
|
|
165
|
-
const timePerFPS = (endTime - startTime) / count;
|
|
166
|
-
const fps = Math.floor(1000 / timePerFPS);
|
|
167
|
-
cb(fps);
|
|
168
|
-
} else {
|
|
169
|
-
id = requestAnimationFrame(loop);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
startTime = now();
|
|
173
|
-
id = requestAnimationFrame(loop);
|
|
174
|
-
}
|
|
175
|
-
//recive message
|
|
176
|
-
exports.onmessage = function (msg, postResponse) {
|
|
177
|
-
checkFPS((fps) => {
|
|
178
|
-
if (fps <= -1) {
|
|
179
|
-
postResponse('check fps fail');
|
|
180
|
-
} else {
|
|
181
|
-
postResponse(null, { fps });
|
|
182
|
-
}
|
|
183
|
-
})
|
|
184
|
-
}
|
|
185
|
-
}`;rd(R0,function(){return JP});var tc=0,Pv=[],Hh=function(){function n(t){var i=this;qy(),this._delayMessages=[],this.initializing=!1;var e=Uy(t);Kb()&&!e&&(this.initializing=!0,console.log("Injecting codes in worker with worker key: :"+t),iM(t,function(){i.initializing=!1,i.created()})),this.workerKey=t,this.workerPool=Yc(),this.currentActor=0,this.actorId=ui(),this.workers=this.workerPool.acquire(this.actorId),this.callbacks={},this.callbackID=0,this.receiveFn=this.receive.bind(this),this.workers.forEach(function(o){o.addEventListener("message",i.receiveFn,!1)}),Jy(t)}var r=n.prototype;return r.created=function(){var i=this;this._delayMessages.forEach(function(e){var{command:o,data:s,buffers:a,cb:l,workerId:h}=e;i[o](s,a,l,h)}),this._delayMessages=[]},r.isActive=function(){return!!this.workers},r.broadcast=function(i,e,o){var s=this;return this.initializing?(this._delayMessages.push({command:"broadcast",data:i,buffers:e,cb:o}),this):(o=o||function(){},XP(this.workers,function(a,l){s.send(i,e,l,a.id)},o),this)},r.send=function(i,e,o,s){if(this.initializing)return this._delayMessages.push({command:"send",data:i,buffers:e,cb:o,workerId:s}),this;var a=o?this.actorId+":"+this.callbackID++:null;return o&&(this.callbacks[a]=o),this.post({data:i,callback:String(a)},e,s),this},r.receive=function(i){var e=this,o=i.data,s=o.callback,a=this.callbacks[s];delete this.callbacks[s],o.type==="<request>"?this.actorId===o.actorId&&this[o.command](o.params,function(l,h,u){var c={type:"<response>",callback:o.callback};l?c.error=l.message:c.data=h,e.post(c,u||Pv,o.workerId)}):a&&o.error?a(o.error):a&&a(null,o.data)},r.remove=function(){var i=this;this.workers.forEach(function(e){e.removeEventListener("message",i.receiveFn,!1)}),delete this.receiveFn,delete this.workers,delete this.callbacks,delete this.workerPool},r.post=function(i,e,o){return(typeof o!="number"||isNaN(o))&&(o=this.currentActor=(this.currentActor+1)%this.workerPool.workerCount),i.workerId=o,i.workerKey=this.workerKey,i.actorId=this.actorId,this.workerPool.addMessage(o,i,e||Pv),o},r.getDedicatedWorker=function(){return tc=(tc+1)%this.workerPool.workerCount,tc},n}();function XP(n,r,t){n.length||t(null,[]);var i=n.length,e=new Array(n.length),o=null;n.forEach(function(s,a){r(s,function(l,h){l&&(o=l),e[a]=h,--i===0&&t(o,e)})})}var rc,YP=function(n){function r(){return n.call(this,R0)||this}return Q(r,n),r}(Hh),Ev=!1;function qP(n){rc||(rc=new YP),rc.send({},[],function(r,t){r?(Ev||(console.error(r),Ev=!0),n()):n(t.fps)})}var ic=!1;function KP(){ic||wr.maxFPS<=0&&(ic=!0,qP(function(n){X(n)&&n>0&&wr.maxFPS<=0&&(wr.maxFPS=n),ic=!1}))}hM(KP);var QP=[],eE=function(n){function r(){return n.call(this,td)||this}Q(r,n);var t=r.prototype;return t.fetchImage=function(e,o){var s={url:e};this.send(s,QP,o)},r}(Hh),tE={depth:1,stencil:0},rE={color:[0,0,0,0],depth:1,stencil:0},jh=function(n){function r(i){var e;return e=n.call(this)||this,e.layer=i,e._painted=!1,e._drawTime=0,Ce.decodeImageInWorker&&!Ce.safari&&!Ce.iosWeixin&&(e._resWorkerConn=new eE),e.setToRedraw(),e}Q(r,n);var t=r.prototype;return t.render=function(e){this.prepareRender(),!(!this.getMap()||!this.layer.isVisible())&&(this.resources||(this.resources=na()),this.checkAndDraw(this._tryToDraw,e),this._frameTime=e)},t.getFrameTimestamp=function(){return this._frameTime||0},t.checkAndDraw=function(e,...o){var s=this;if(this._toRedraw=!1,this.checkResources){var a=this.checkResources();a.length>0?(this._loadingResource=!0,this.loadResources(a).then(function(){if(s._loadingResource=!1,s.layer){s.layer.fire("resourceload");var l=s.layer.getMap();s.setToRedraw(),l.getRenderer().callInNextFrame(function(){s.setToRedraw()})}})):e.call(this,...o)}else e.call(this,...o)},t.testIfNeedRedraw=function(){var e=this.getMap();return this._loadingResource?!1:this._toRedraw?!0:e.isInteracting()&&!this.drawOnInteracting?!1:!!this.needToRedraw()},t.needToRedraw=function(){var e=this.getMap();return!!(e.isInteracting()||e.getRenderer().isViewChanged())},t.onSkipDrawOnInteracting=function(){},t.isLoadingResource=function(){return this._loadingResource},t.isRenderComplete=function(){return!!this._renderComplete},t.mustRenderOnInteracting=function(){return!this._painted},t.setToRedraw=function(){return this._toRedraw=!0,this},t.remove=function(){this.onRemove(),delete this._loadingResource,delete this.middleWest,delete this.canvas,delete this.context,delete this.canvasExtent2D,delete this._extent2D,this.resources&&this.resources.remove(),delete this.resources,this._resWorkerConn&&(this._resWorkerConn.remove(),delete this._resWorkerConn),delete this.layer},t.onRemove=function(){},t.onAdd=function(){},t.getMap=function(){return this.layer?this.layer.getMap():null},t.clear=function(){this.clearContext(),this.setToRedraw()},t.isBlank=function(){return!this._painted},t.show=function(){this.setToRedraw()},t.hide=function(){this.clear(),this.setToRedraw()},t.setZIndex=function(e){this.setToRedraw()},t.screenshotRenderResult=function(e,o,s,a){if(this.canvas){var l=J.getTempCanvas();l.width=s,l.height=a;var h=J.getCanvas2DContext(l);return h.clearRect(0,0,s,a),h.drawImage(this.canvas,e,o,s,a,0,0,s,a),h}else console.warn("not find layer canvas for screenshotRenderResult,the layerId:",this.layer.getId())},t.hitDetect=function(e){if(!this.context||this.layer.isEmpty&&this.layer.isEmpty()||this.isBlank()||this._errorThrown||this.layer.isVisible&&!this.layer.isVisible())return!1;var o=this.getMap(),s=this.mapDPR||o.getDevicePixelRatio(),a=o.getSize();if(e.x<0||e.x>a.width*s||e.y<0||e.y>a.height*s)return!1;var l=Math.round(s*e.x),h=Math.round(s*e.y),u=this.getImageData&&this.getImageData();if(u){var c=h*u.width*4+l*4;return u.data[c+3]>0}try{var f=this.screenshotRenderResult(l,h,2,2);if(f){var d=f.getImageData(l,h,1,1).data;if(d[3]>0)return!0}}catch(g){return this._errorThrown||(console&&console.warn(`hit detect failed with tainted canvas, some geometries have external resources in another domain:
|
|
186
|
-
`,g),this._errorThrown=!0),!1}return!1},t.loadResources=function(e){this.resources||(this.resources=new ed);var o=this.resources,s=[];if($e(e))for(var a={},l=e.length-1;l>=0;l--){var h=e[l];if(!(!h||!h.length)){var u=h.join("-");if(!Vl(h[0])){if(a[u])continue;a[u]=1}o.isResourceLoaded(h,!0)||s.push(new Promise(this._promiseResource(h)))}}return Promise.all(s)},t.prepareRender=function(){delete this._renderComplete;var e=this.getMap();this._renderZoom=e.getZoom(),this.canvasExtent2D=this._extent2D=e.get2DExtent(),this.middleWest=e._containerPointToPoint(new z(0,e.height/2))},t.prepareCanvas=function(){var e=this.layer.parent,{canvas:o,context:s}=e.getRenderer(),a=s instanceof CanvasRenderingContext2D;if(this.context)a&&(this.clearContext(),this.resizeCanvas());else{if(a)this.createContext();else{this.canvas=o,this.context=s;var{gl:l,regl:h,reglGL:u,device:c}=s;this.gl=l,this.regl=h,this.reglGL=u,this.device=c}this.initContext(),this.layer.fire("contextinit",{context:this.context})}this.prepareContext(),delete this._maskExtent;var f=this.layer.getMask();if(!f)return this.layer.fire("renderstart",{context:this.context}),null;var d=this._maskExtent=f._getMaskPainter().get2DExtent();return d&&this._extent2D&&!d.intersects(this._extent2D)?(this.layer.fire("renderstart",{context:this.context}),d):(this.layer.fire("renderstart",{context:this.context}),d)},t.initContext=function(){},t.prepareContext=function(){},t.clearContext=function(){if(this.device){var e=this.getMap().getRenderer();e.isWebGL()||e.isWebGPU()?this.device.clear(tE):this.device.clear(rE)}},t.createContext=function(){throw new Error("createContext not implemented")},t.getViewExtent=function(){return{extent:this._extent2D,maskExtent:this._maskExtent,zoom:this._renderZoom,middleWest:this.middleWest}},t.completeRender=function(){this.getMap()&&(this._renderComplete=!0,this.layer.fire("renderend",{context:this.context}),this.setCanvasUpdated())},t.getEvents=function(){return{_zoomstart:this.onZoomStart,_zooming:this.onZooming,_zoomend:this.onZoomEnd,_resize:this.onResize,_movestart:this.onMoveStart,_moving:this.onMoving,_moveend:this.onMoveEnd,_dragrotatestart:this.onDragRotateStart,_dragrotating:this.onDragRotating,_dragrotateend:this.onDragRotateEnd,_spatialreferencechange:this.onSpatialReferenceChange}},t.onZoomStart=function(e){},t.onZoomEnd=function(e){this.setToRedraw()},t.onZooming=function(e){},t.onMoveStart=function(e){},t.onMoving=function(e){},t.onMoveEnd=function(e){this.setToRedraw()},t.onResize=function(e){delete this._extent2D,this.setToRedraw()},t.onDragRotateStart=function(e){},t.onDragRotating=function(e){},t.onDragRotateEnd=function(e){this.setToRedraw()},t.onSpatialReferenceChange=function(e){},t.getDrawTime=function(){return this._drawTime},t._tryToDraw=function(e){if(this._toRedraw=!1,!this.canvas&&this.layer.isEmpty&&this.layer.isEmpty()){this._renderComplete=!0;return}this._drawAndRecord(e)},t._drawAndRecord=function(e){var o=this.getMap();if(o){var s=this._painted;this._painted=!0;var a=He();this.mapDPR=o.getDevicePixelRatio(),this.draw(e),a=He()-a,this._drawTime=s?a:a/2,s&&this.layer&&this.layer.options.logDrawTime&&console.log(this.layer.getId(),"frameTimeStamp:",e,"drawTime:",this._drawTime)}},t._promiseResource=function(e){var o=this,s=this.layer,a=this.resources,l=s.options.crossOrigin,h=s.options.renderer||"";return function(u){if(a.isResourceLoaded(e,!0)){u(e);return}var c=_y(e[0]);if(Vl(c)){createImageBitmap(c).then(function(g){o._cacheResource(e,g),u(e)}).catch(function(g){console.error(g),u(e)});return}var f=!Si(e[0])&&o._resWorkerConn&&(s.options.renderer!=="canvas"||s.options.decodeImageInWorker);if(f)o._resWorkerConn.fetchImage(c,function(g,p){if(g){g&&typeof console<"u"&&console.warn(g),u(e);return}Hf(p,function(m){o._cacheResource(e,m),u(e)})});else{var d=new Image;O(l)?h!=="canvas"&&(d.crossOrigin=""):d.crossOrigin=l,Si(e[0])&&!Ct&&(e[1]&&(e[1]*=2),e[2]&&(e[2]*=2)),d.onload=function(){o._cacheResource(e,d),u(e)},d.onabort=function(g){console&&console.warn("image loading aborted: "+e[0]),g&&console&&console.warn(g),u(e)},d.onerror=function(g){g&&typeof console<"u"&&console.warn(g),a.markErrorResource(e),u(e)},Us(d,[c])}}},t._cacheResource=function(e,o){if(!(!this.layer||!this.resources)){var s=e[1],a=e[2];if(this.layer.options.cacheSvgOnCanvas&&Si(e[0])===1&&(Ce.edge||Ce.ie)){O(s)&&(s=o.width||this.layer.options.defaultIconSize[0]),O(a)&&(a=o.height||this.layer.options.defaultIconSize[1]);var l=J.createCanvas(s,a);J.image(l.getContext("2d"),o,0,0,s,a),o=l}this.resources.addResource(e,o)}},t.setCanvasUpdated=function(){return this._canvasUpdated=!0,this},t.isCanvasUpdated=function(){return!!this._canvasUpdated},t.getCanvasImage=function(){var e=this.getMap();if(this._canvasUpdated=!1,this._renderZoom!==e.getZoom()||!this.canvas||!this._extent2D||this.isBlank()||this.layer.isEmpty&&this.layer.isEmpty())return null;var o=e._pointToContainerPoint(this.middleWest)._add(0,-e.height/2);return{image:this.canvas,layer:this.layer,point:o}},t.clearCanvas=function(){this.clearContext()},t.createCanvas=function(){if(!this.canvas){var e=this.getMap(),o=e.getSize(),s=e.getDevicePixelRatio(),a=Math.round(s*o.width),l=Math.round(s*o.height);if(this.layer._canvas){var h=this.layer._canvas;h.width=a,h.height=l,h.style&&(h.style.width=o.width+"px",h.style.height=o.height+"px"),this.canvas=this.layer._canvas}else this.canvas=J.createCanvas(a,l,e.CanvasClass);this.onCanvasCreate()}},t.onCanvasCreate=function(){},t.resizeCanvas=function(e){var o=this.canvas,s=this.getMap();if(!(!o||o===s.canvas)){var a=e||s.getSize(),l=s.getDevicePixelRatio(),{width:h,height:u,cssWidth:c,cssHeight:f}=Eh(a,l);this.layer._canvas&&(o.style.width!==c||o.style.height!==f)&&(o.style.width=c,o.style.height=f),!(o.width===h&&o.height===u)&&(o.height=u,o.width=h,this.context&&(this.context.dpr=1),l!==1&&this.context&&this._canvasContextScale(this.context,l))}},t.clipCanvas=function(e){var o=this.layer.getMask();if(!o||!this.layer.options.maskClip)return!1;var s=this.middleWest,a=this.getMap();this.middleWest=a._containerPointToPoint(new z(0,a.height/2));var l=e.globalAlpha;e.save();var h=this.mapDPR||a.getDevicePixelRatio();if(h!==1&&(e.save(),this._canvasContextScale(e,h)),o.getGeometries){e.isMultiClip=!0;var u=o.getGeometries()||[];e.beginPath(),u.forEach(function(f){var d=f._getMaskPainter();d.paint(null,e)}),e.stroke(),e.isMultiClip=!1}else{e.isClip=!0,e.beginPath();var c=o._getMaskPainter();c.paint(null,e),e.isClip=!1}h!==1&&e.restore();try{e.clip("evenodd")}catch(f){console.error(f)}return this.middleWest=s,e.globalAlpha=l,!0},t._canvasContextScale=function(e,o){return e.scale?(e.scale(o,o),e.dpr=o,this):this},r}(br),iE=`
|
|
187
|
-
function (exports) {
|
|
188
|
-
exports.onmessage = function (msg, postResponse) {
|
|
189
|
-
var url = msg.data.url;
|
|
190
|
-
var fetchOptions = msg.data.fetchOptions;
|
|
191
|
-
requestImageOffscreen(url, function (err, data) {
|
|
192
|
-
var buffers = [];
|
|
193
|
-
if (data && data.data) {
|
|
194
|
-
buffers.push(data.data);
|
|
195
|
-
}
|
|
196
|
-
postResponse(err, data, buffers);
|
|
197
|
-
}, fetchOptions);
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
function requestImageOffscreen(url, cb, fetchOptions) {
|
|
201
|
-
fetch(url, fetchOptions ? fetchOptions : {})
|
|
202
|
-
.then(response => response.arrayBuffer())
|
|
203
|
-
.then(arrayBuffer => {
|
|
204
|
-
const blob=new Blob([arrayBuffer]);
|
|
205
|
-
return createImageBitmap(blob);
|
|
206
|
-
})
|
|
207
|
-
.then(bitmap => {
|
|
208
|
-
cb(null, {data:bitmap});
|
|
209
|
-
}).catch(err => {
|
|
210
|
-
console.error('error when loading tile:', url);
|
|
211
|
-
console.error(err);
|
|
212
|
-
cb(err);
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
}`;function nE(){Ce.decodeImageInWorker&&rd(td,function(){return iE})}nE();var oE={attribution:null,minZoom:null,maxZoom:null,visible:!0,opacity:1,globalCompositeOperation:null,renderer:"canvas",debugOutline:"#0f0",cssFilter:null,forceRenderOnMoving:!1,forceRenderOnZooming:!1,forceRenderOnRotating:!1,collision:!1,collisionScope:"layer",hitDetect:function(){return!Ce.mobile}(),maskClip:!0},hr=function(n){function r(i,e){var o,s;return e&&(s=e.canvas,delete e.canvas),o=n.call(this,e)||this,o._canvas=s,o.setId(i),e&&(o.setZIndex(e.zIndex),e.mask&&o.setMask(je.fromJSON(e.mask))),o.proxyOptions(),o}Q(r,n);var t=r.prototype;return t.load=function(){if(!this.getMap())return this;if(this.onLoad()){this._initRenderer();var e=this.getZIndex();O(e)||this._renderer&&(this._renderer.setZIndex(e),this.isCanvasRender()||this._renderer.render()),this.onLoadEnd()}return this},t.getId=function(){return this._id},t.setId=function(e){var o=this._id;return O(e)||(e=e+""),this._id=e,this.fire("idchange",{type:"idchange",target:this,old:o,new:e}),this},t.addTo=function(e){return e.addLayer(this),this},t.setZIndex=function(e){return this._zIndex=e,O(e)?delete this.options.zIndex:this.options.zIndex=e,this.map&&this.map._sortLayersByZIndex(),this._renderer&&this._renderer.setZIndex(e),this.fire("setzindex",{type:"setzindex",target:this,zIndex:e}),this},t.getZIndex=function(){return this._zIndex||0},t.getMinZoom=function(){var e=this.getMap(),o=this.options.minZoom;return e?Math.max(e.getMinZoom(),o||0):o},t.getMaxZoom=function(){var e=this.getMap(),o=this.options.maxZoom;return e?Math.min(e.getMaxZoom(),O(o)?1/0:o):o},t.getOpacity=function(){return this.options.opacity},t.setOpacity=function(e){return this.config("opacity",e),this.fire("setopacity",{type:"setopacity",target:this,opacity:e}),this},t.isCanvasRender=function(){var e=this._getRenderer();return e&&e instanceof jh},t.getMap=function(){return this.map?this.map:null},t.getProjection=function(){var e=this.getMap();return e?e.getProjection():null},t.bringToFront=function(){var e=this._getLayerList();if(!e.length)return this;var o=e[e.length-1];if(e.length===1||o===this)return this;var s=o.getZIndex();return this.setZIndex(s+1),this},t.bringToBack=function(){var e=this._getLayerList();if(!e.length)return this;var o=e[0];if(e.length===1||o===this)return this;var s=o.getZIndex();return this.setZIndex(s-1),this},t.show=function(){var e=this;if(!this.options.visible){this.options.visible=!0;var o=this.getRenderer();o&&o.show();var s=this.getMap();o&&s&&s.getRenderer()?s.getRenderer().callInNextFrame(function(){s.getRenderer().callInNextFrame(function(){e.fire("show")})}):this.fire("show")}return this},t.hide=function(){var e=this;if(this.options.visible){this.options.visible=!1;var o=this.getRenderer();o&&o.hide();var s=this.getMap();o&&s&&s.getRenderer()?s.getRenderer().callInNextFrame(function(){s.getRenderer().callInNextFrame(function(){e.fire("hide")})}):this.fire("hide")}return this},t.isVisible=function(){var e=this.options.opacity;if(X(e)&&e<=0)return!1;var{minZoom:o,maxZoom:s}=this.options;if(X(o)||X(s)){var a=this.map;if(a){var l=dt[a.id],h=l?l.zoom:a.getZoom();if(!O(s)&&s<h||!O(o)&&o>h)return!1}}return O(this.options.visible)&&(this.options.visible=!0),this.options.visible},t.remove=function(){if(this.map){var e=this.map.getRenderer();this.map.removeLayer(this),e&&e.setToRedraw()}else this.fire("remove");return this},t.getMask=function(){return this._mask},t.setMask=function(e){if(!(e.type==="Point"&&e._isVectorMarker()||e.type==="Polygon"||e.type==="MultiPolygon"))throw new Error("Mask for a layer must be a marker with vector marker symbol or a Polygon(MultiPolygon).");if(e._bindLayer(this),e.type==="Point"?e.updateSymbol({markerLineColor:"rgba(0, 0, 0, 0)",markerFillOpacity:0}):e.setSymbol({lineColor:"rgba(0, 0, 0, 0)",polygonOpacity:0}),this._mask=e,e&&e.toGeoJSON)try{this._maskGeoJSON=e.toGeoJSON()}catch(s){delete this._maskGeoJSON,console.error(s)}if(this.options.mask=e.toJSON(),!this.getMap()||this.getMap().isZooming())return this;var o=this._getRenderer();return o&&o.setToRedraw&&this._getRenderer().setToRedraw(),this},t.removeMask=function(){if(delete this._mask,delete this._maskGeoJSON,delete this.options.mask,!this.getMap()||this.getMap().isZooming())return this;var e=this._getRenderer();return e&&e.setToRedraw&&this._getRenderer().setToRedraw(),this},t.onLoad=function(){return!0},t.onLoadEnd=function(){},t.isLoaded=function(){return!!this._loaded},t.getCollisionIndex=function(){if(this.options.collisionScope==="layer")return this._collisionIndex||(this._collisionIndex=new Go),this._collisionIndex;var e=this.getMap();return e?e.getCollisionIndex():null},t.clearCollisionIndex=function(){return this.options.collisionScope==="layer"&&this._collisionIndex&&this._collisionIndex.clear(),this},t.getRenderer=function(){return this._getRenderer()},t.onConfig=function(e){var o=e&&Object.keys&&Object.keys(e).length>0;if(o&&O(e.animation)){if(this._optionsHook&&Oe(this._optionsHook)&&this._optionsHook(e),this._silentConfig)return;var s=this.getRenderer();if(s&&s.setToRedraw&&s.setToRedraw(),"attribution"in e){var a=this.getMap();a&&a.attributionControl&&a.attributionControl._update&&a.attributionControl._update()}}},t.onAdd=function(){},t.onRendererCreate=function(){},t.onCanvasCreate=function(){},t.onRemove=function(){},t._bindMap=function(e,o){e&&(this.parent=e,e.isMap?this.map=e:this.map=e.getMap(),O(o)||this.setZIndex(o),this._switchEvents("on",this),this.onAdd(),this.fire("add"))},t._initRenderer=function(){var e=this.options.renderer;if(!(!this.constructor.getRendererClass||!e)){e=this.getRendererOption();var o=this.constructor.getRendererClass(e);if(!o)throw new Error("Invalid renderer for Layer("+this.getId()+"):"+e);this._renderer=new o(this),this._renderer.layer=this,this._renderer.setZIndex(this.getZIndex()),this._switchEvents("on",this._renderer),this._renderer.onAdd&&this._renderer.onAdd(),this.onRendererCreate(),this.fire("renderercreate",{type:"renderercreate",target:this,renderer:this._renderer})}},t.getRendererOption=function(){var e=this.options.renderer,o=this.getMap().getRenderer();return e!=="dom"&&(o.isWebGL()?e="gl":o.isWebGPU()&&(e="gpu")),e},t._doRemove=function(){this._loaded=!1,this._switchEvents("off",this),this.onRemove(),this._renderer&&(this._switchEvents("off",this._renderer),this._renderer.remove(),delete this._renderer),delete this.map,delete this._collisionIndex},t._switchEvents=function(e,o){o&&o.getEvents&&this.getMap()&&this.getMap()[e](o.getEvents(),o)},t._getRenderer=function(){return this._renderer},t._getLayerList=function(){if(!this.map)return[];var e=+!!this.map.getBaseLayer();return this.map.getLayers().slice(e)},t._getMask2DExtent=function(){if(!this._mask||!this.getMap())return null;var e=this._mask._getMaskPainter();return e?e.get2DExtent():null},t.toJSON=function(e){return{type:"Layer",id:this.getId(),options:e||this.config()}},r.fromJSON=function(e){if(!e)return null;var o=e.type,s=r.getJSONClass(o);if(!s||!s.fromJSON)throw new Error("unsupported layer type:"+o);return s.fromJSON(e)},t.identify=function(e,o){},t.identifyAtPoint=function(e,o){},r}(t0(ci(ld(br))));hr.mergeOptions(oE);var sE=hr.prototype.fire;hr.prototype.fire=function(n,r){return n==="layerload"&&(this._loaded=!0),this.map&&(r||(r={type:null,target:null}),r.type=n,r.target=this,this.map._onLayerEvent(r)),sE.apply(this,arguments),["show","hide"].indexOf(n)>-1&&this.fire("visiblechange",Object.assign({},r,{visible:this.options.visible})),this};var aE=new $(0,0),Sv=new z(0,0),Ov=["centerCross","fog","fogColor","debugSky"],lE={maxVisualPitch:70,maxPitch:80,centerCross:!1,zoomable:!0,zoomInCenter:!1,zoomOrigin:null,zoomAnimation:function(){return!Ct}(),zoomAnimationDuration:330,tileBackgroundLimitPerFrame:3,panAnimation:function(){return!Ct}(),panAnimationDuration:600,rotateAnimation:function(){return!Ct}(),enableInfoWindow:!0,hitDetect:function(){return!Ce.mobile}(),hitDetectLimit:5,fpsOnInteracting:25,layerCanvasLimitOnInteracting:-1,maxZoom:null,minZoom:null,maxExtent:null,limitExtentOnMaxExtent:!1,fixCenterOnResize:!0,checkSize:!0,checkSizeInterval:1e3,renderer:["canvas","gl","gpu"],cascadePitches:[10,60],renderable:!0,clickTimeThreshold:280,stopRenderOnOffscreen:!0,preventWheelScroll:!0,preventTouch:!0,supportPluginEvent:!0,switchDragButton:!1,mousemoveThrottleTime:vy,mousemoveThrottleEnable:!0,maxFPS:0,debug:!1,cameraFarUndergroundInMeter:2e3,onlyWebGL1:!1,forceRedrawPerFrame:!1,preserveDrawingBuffer:!0,extensions:[],optionalExtensions:["ANGLE_instanced_arrays","OES_element_index_uint","OES_standard_derivatives","OES_vertex_array_object","OES_texture_half_float","OES_texture_half_float_linear","OES_texture_float","OES_texture_float_linear","WEBGL_depth_texture","EXT_shader_texture_lod","EXT_frag_depth","EXT_texture_filter_anisotropic","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb"]},Se=function(n){function r(i,e){var o;if(!e)throw new Error("Invalid options when creating map.");if(!e.center)throw new Error("Invalid center when creating map.");var s=oe({},e),a=s.zoom;delete s.zoom;var l=new $(s.center);delete s.center;var h=s.baseLayer;delete s.baseLayer;var u=s.layers;return delete s.layers,o=n.call(this,s)||this,o.isMap=!0,o.VERSION=r.VERSION,Object.defineProperty(o,"id",{value:ui(),writable:!1}),o._loaded=!1,o._initContainer(i),o._panels={},o._baseLayer=null,o._layers=[],o._zoomLevel=a,o._center=l,o.setSpatialReference(s.spatialReference||s.view),o._mapViewPoint=new z(0,0),o._initRenderer(),o._updateMapSize(o._getContainerDomSize()),h&&o.setBaseLayer(h),u&&o.addLayer(u),o.setMaxExtent(s.maxExtent),o._Load(),o.proxyOptions(),o}Q(r,n),r.addOnLoadHook=function(e,...o){var s=typeof e=="function"?e:function(){this[e].call(this,...o)};return this.prototype._onLoadHooks=this.prototype._onLoadHooks||[],this.prototype._onLoadHooks.push(s),this};var t=r.prototype;return t.isLoaded=function(){return!!this._loaded},t.getContainer=function(){return this._containerDOM},t.getSpatialReference=function(){return this._spatialReference},t.setSpatialReference=function(e){var o=this.options.spatialReference;return this._loaded&&Yi.equals(o,e)?this:(this._updateSpatialReference(e,o),this)},t._updateSpatialReference=function(e,o){Ee(e)&&(e=Yi.getPreset(e)),e=oe({},e),this._center=this.getCenter(),this.options.spatialReference=e,this._spatialReference=new Yi(e);var s=this._spatialReference.getProjection();return this.options.spatialReference&&Oe(this.options.spatialReference.projection)&&(this.options.spatialReference.projection=s.code),this._resetMapStatus(),Fh.is(s.code)&&(this._originLng=s.centralMeridian,this._altitudeOriginDirty=!0),this._fireEvent("spatialreferencechange",{old:o,new:oe({},this.options.spatialReference)}),this},t.onConfig=function(e){var o=e.spatialReference||e.view;if(O(o)||this._updateSpatialReference(o,null),this.options.renderer==="canvas"){for(var s=!1,a=0,l=Ov.length;a<l;a++){var h=Ov[a];if(!O(e[h])){s=!0;break}}if(!s)return this}var u=this.getRenderer();return u&&u.setToRedraw(),this},t.getProjection=function(){return this._spatialReference?this._spatialReference.getProjection():null},t.getFullExtent=function(){return this._spatialReference?this._spatialReference.getFullExtent():null},t.setCursor=function(e){return delete this._cursor,this._trySetCursor(e),this._cursor=e,this},t.resetCursor=function(){return this.setCursor(null)},t.getCenter=function(){if(!this._loaded||!this._prjCenter)return this._center;var e=this.getProjection(),o=e.unproject(this._prjCenter);return o.x=Math.round(o.x*1e8)/1e8,o.y=Math.round(o.y*1e8)/1e8,this.centerAltitude&&(o.z=this.centerAltitude),o},t.setCenter=function(e,o){if(!e)return this;e=new $(e),o&&(e=this._getCenterByPadding(e,this.getZoom(),o));var s=this.getProjection(),a=s.project(e);return!this._verifyExtent(a)&&!this.options.limitExtentOnMaxExtent?this:this._loaded?(this.onMoveStart(),this._setPrjCenter(a),this.onMoveEnd(this._parseEventFromCoord(this.getCenter())),this):(this._center=e,this)},t.getSize=function(){return O(this.width)||O(this.height)?this._getContainerDomSize():new ft(this.width,this.height)},t.getContainerExtent=function(){var e=this.height,o=this.getPitch(),s=this.options.maxVisualPitch;return s&&o>s&&(e=this._getVisualHeight(s)),new Le(0,this.height-e,this.width,this.height)},t._getVisualHeight=function(e){e=e||.01;var o=(90-this.getPitch())*Math.PI/180,s=this.getFov()*Math.PI/180;e*=Math.PI/180;var a=this.cameraCenterDistance/this.getGLScale(),l=Math.tan(s/2),h=Math.tan(e),u=a*l/(1/h-l)/Math.sin(e),c=a*(Math.sin(o)*u/(a+Math.cos(o)*u));return this.height/2+c},t.getExtent=function(){return this.pointToExtent(this.get2DExtent())},t.getProjExtent=function(){var e=this.get2DExtent();return new Je(this._pointToPrj(e.getMin()),this._pointToPrj(e.getMax()))},t.getPrjExtent=function(){return this.getProjExtent()},t.getMaxExtent=function(){return this.options.maxExtent?new Je(this.options.maxExtent,this.getProjection()):null},t.setMaxExtent=function(e){if(e){var o=new Je(e,this.getProjection());this.options.maxExtent=o;var s=this.getProjection();this._prjMaxExtent=o.convertTo(function(a){return s.project(a)}),this._verifyExtent(this._getPrjCenter())||(this._loaded?this._panTo(this._prjMaxExtent.getCenter()):this._center=s.unproject(this._prjMaxExtent.getCenter()))}else delete this.options.maxExtent,delete this._prjMaxExtent;return this},t.getZoom=function(){return this._zoomLevel},t.getZoomForScale=function(e,o,s){var a=this.getZoom();if(O(o)&&(o=a),e===1&&o===a)return a;var l=this._getResolution(o),h=l/e,u=this.getZoomFromRes(h);if(s)return u;var c=1e-6;return this.getSpatialReference().getZoomDirection()<0?Math.ceil(u-c):Math.floor(u+c)},t.getZoomFromRes=function(e){var o=this._getResolutions(),s=this._getResolution(this.getMinZoom()),a=this._getResolution(this.getMaxZoom());if(s<=a){if(e<=s)return this.getMinZoom();if(e>=a)return this.getMaxZoom()}else{if(e>=s)return this.getMinZoom();if(e<=a)return this.getMaxZoom()}for(var l=o.length,h=0;h<l-1;h++)if(o[h]){var u=o[h+1]-o[h],c=e-o[h];if(ir(u)===ir(c)&&Math.abs(u)>=Math.abs(c))return h+c/u}return l-1},t.setZoom=function(e,o={animation:!0}){return isNaN(e)||O(e)?this:(e=+e,this._loaded&&this.options.zoomAnimation&&o.animation?this._zoomAnimation(e):this._zoom(e),this)},t.getMaxZoom=function(){return O(this.options.maxZoom)?this.getMaxNativeZoom():this.options.maxZoom},t.setMaxZoom=function(e){var o=this.getMaxNativeZoom();return e>o&&(e=o),e!==null&&e<this._zoomLevel&&(this.setZoom(e),e=+e),this.options.maxZoom=e,this},t.getMinZoom=function(){return O(this.options.minZoom)?this._spatialReference.getMinZoom():this.options.minZoom},t.setMinZoom=function(e){if(e!==null){e=+e;var o=this._spatialReference.getMinZoom();e<o&&(e=o),e>this._zoomLevel&&this.setZoom(e)}return this.options.minZoom=e,this},t.getMaxNativeZoom=function(){var e=this.getSpatialReference();return e?e.getMaxZoom():null},t.getGLRes=function(){if(this._glRes)return this._glRes;var e=this.getSpatialReference().getFullExtent();return this._glRes=(e.right-e.left)/Math.pow(2,19),this._glRes},t.getGLScale=function(e){return O(e)&&(e=this.getZoom()),this._getResolution(e)/this.getGLRes()},t.zoomIn=function(){return this.setZoom(this.getZoom()+1)},t.zoomOut=function(){return this.setZoom(this.getZoom()-1)},t.isZooming=function(){return!!this._zooming},t.isInteracting=function(){return this.isZooming()||this.isMoving()||this.isRotating()},t.setCenterAndZoom=function(e,o){return!O(o)&&this._zoomLevel!==o?(this.setCenter(e),this.setZoom(o,{animation:!1})):this.setCenter(e),this},t._getPaddingSize=function(e={}){return e.paddingLeft||e.paddingTop||e.paddingRight||e.paddingBottom?{width:(e.paddingLeft||0)+(e.paddingRight||0),height:(e.paddingTop||0)+(e.paddingBottom||0)}:null},t.getFitZoom=function(e,o,s){var a=this;if(!e||!(e instanceof Je))return this._zoomLevel;if(e.xmin===e.xmax&&e.ymin===e.ymax)return this.getMaxZoom();var l=this.getSize(),h=this._getPaddingSize(s);if(h){var u={width:l.width-(h.width||0),height:l.height-(h.height||0)};l=new ft(u.width,u.height)}var c=e.convertTo(function(_){return a.coordToPoint(_)}),f=c.getWidth(),d=c.getHeight(),g=l.width/f,p=l.height/d,m=this.getSpatialReference().getZoomDirection()<0?Math.max(g,p):Math.min(g,p),v=this.getZoomForScale(m,null,o);return v},t.getView=function(){return{center:this.getCenter().toArray(),zoom:this.getZoom(),pitch:this.getPitch(),bearing:this.getBearing()}},t.stringifyView=function(){return JSON.stringify(this.getView())},t._validateView=function(e){if(!(!e||!Xt(e))){if(X(e.bearing)){var o=e.bearing;o=o%360,o>180&&(o=-180+Math.abs(o-180)),o<-180&&(o=180-Math.abs(o+180)),e.bearing=o}X(e.pitch)&&(e.pitch=Math.max(0,e.pitch),e.pitch=Math.min(this.options.maxPitch,e.pitch));var s=this.getMaxZoom();X(e.zoom)&&(e.zoom=Math.max(0,e.zoom),e.zoom=Math.min(s,e.zoom))}},t.setView=function(e){return e?(this._validateView(e),e.center&&this.setCenter(e.center),e.zoom!==null&&!isNaN(+e.zoom)&&this.setZoom(+e.zoom,{animation:!1}),e.pitch!==null&&!isNaN(+e.pitch)&&this.setPitch(+e.pitch),e.bearing!==null&&!isNaN(+e.bearing)&&this.setBearing(+e.bearing),this):this},t.getResolution=function(e){return this._getResolution(e)},t.getScale=function(e){var o=O(e)?this.getZoom():e,s=this._getResolution(this.getMaxNativeZoom()),a=this._getResolution(o);return a/s},t._getCenterByPadding=function(e,o,s){var a=this.coordinateToPoint(e,o),{paddingLeft:l=0,paddingRight:h=0,paddingTop:u=0,paddingBottom:c=0}=s||{},f=0,d=0;(l||h)&&(f=(h-l)/2),(u||c)&&(d=(u-c)/2);var g=new z({x:a.x+f,y:a.y+d});return this.pointToCoordinate(g,o)},t.fitExtent=function(e,o,s,a){var l=this;if(s=s||{},!e)return this;var h=new Je(e),u=this.getFitZoom(h,s.isFraction||!1,s)+(o||0),c=h.convertTo(function(d){return l.coordToPoint(d)}),f=this.pointToCoord(c.getCenter());return this._getPaddingSize(s)&&(f=this._getCenterByPadding(f,u,s)),typeof s.animation>"u"||s.animation?this._animateTo({center:f,zoom:u},{duration:s.duration||this.options.zoomAnimationDuration,easing:s.easing||"out"},a):this.setCenterAndZoom(f,u)},t.getBaseLayer=function(){return this._baseLayer},t.setBaseLayer=function(e){var o=!1;if(this._baseLayer&&(o=!0,this._fireEvent("baselayerchangestart"),this._baseLayer.remove()),!e)return delete this._baseLayer,this._fireEvent("baselayerchangeend"),this._fireEvent("setbaselayer"),this;this._baseLayer=e,e._bindMap(this,-1);function s(){this._fireEvent("baselayerload"),o&&(o=!1,this._fireEvent("baselayerchangeend"))}return this._baseLayer.on("layerload",s,this),this._loaded&&this._baseLayer.load(),this._fireEvent("setbaselayer"),this},t.removeBaseLayer=function(){return this._baseLayer&&(this._baseLayer.remove(),delete this._baseLayer,this._fireEvent("baselayerremove")),this},t.getLayers=function(e){return this._getLayers(function(o){return o===this._baseLayer||o.getId().indexOf(xa)>=0?!1:e?e(o):!0})},t.getLayer=function(e){if(!e)return null;var o=this._layerCache?this._layerCache[e]:null;if(o)return o;var s=this.getBaseLayer();return s&&s.getId()===e?s:null},t.addLayer=function(e,...o){if(!e)return this;Array.isArray(e)||(e=[e]),o&&o.length&&(e=e.concat(o)),this._layerCache||(this._layerCache={});for(var s=this._layers,a=0,l=e.length;a<l;a++){var h=e[a],u=h.getId();if(O(u))throw new Error("Invalid id for the layer: "+u);if(h.getMap()!==this){if(this._layerCache[u])throw new Error("Duplicate layer id in the map: "+u);this._layerCache[u]=h,h._bindMap(this),s.push(h),this._loaded&&h.load()}}return this._sortLayersByZIndex(),this._fireEvent("addlayer",{layers:e}),this},t.removeLayer=function(e){if(!e)return this;if(!Array.isArray(e))return this.removeLayer([e]);for(var o=[],s=0,a=e.length;s<a;s++){var l=e[s];if(l instanceof hr||(l=this.getLayer(l)),!!l){var h=l.getMap();if(!(!h||h!==this)){o.push(l),this._removeLayer(l,this._layers),this._loaded&&l._doRemove();var u=l.getId();this._layerCache&&delete this._layerCache[u]}}}if(o.length>0){var c=this.getRenderer();c&&(this.options.renderer==="canvas"?c.setLayerCanvasUpdated():c.setToRedraw()),this.once("frameend",function(){o.forEach(function(f){f.fire("remove")})})}return this._fireEvent("removelayer",{layers:e}),this},t._findTerrainLayer=function(){if(kv(this._baseLayer))return this._baseLayer;for(var e=this._getLayers()||[],o=0;o<e.length;o++){var s=e[o];if(kv(s))return s}return null},t.sortLayers=function(e){if(!e||!Array.isArray(e))return this;for(var o=[],s=Number.MAX_VALUE,a=0,l=e.length;a<l;a++){var h=e[a];if(Ee(e[a])&&(h=this.getLayer(h)),!(h instanceof hr)||!h.getMap()||h.getMap()!==this)throw new Error("It must be a layer added to this map to order.");h.getZIndex()<s&&(s=h.getZIndex()),o.push(h)}for(var u=0,c=o.length;u<c;u++)o[u].setZIndex(s+u);return this},t.toDataURL=function(e){e||(e={});var o=e.mimeType;o||(o="image/png");var s=e.save,a=this._getRenderer();if(a&&a.toDataURL){var l=e.fileName;l||(l="export");var h=a.toDataURL(o,e.quality||.92);if(s&&h){var u;if(typeof Blob<"u"&&typeof atob<"u"){var c=ly(h.replace(/^data:image\/(png|jpeg|jpg|webp);base64,/,""),o);u=URL.createObjectURL(c)}else u=h;var f=document.createElement("a");f.download=l,f.href=u,document.body.appendChild(f),f.click(),document.body.removeChild(f)}return h}return null},t.coordToPoint=function(e,o,s){return this.coordinateToPoint(e,o,s)},t.coordToPointAtRes=function(e,o,s){return this.coordinateToPointAtRes(e,o,s)},t.pointToCoord=function(e,o,s){return this.pointToCoordinate(e,o,s)},t.pointAtResToCoord=function(e,o,s){return this.pointAtResToCoordinate(e,o,s)},t.coordToViewPoint=function(e,o,s){return this.coordinateToViewPoint(e,o,s)},t.viewPointToCoord=function(e,o){return this.viewPointToCoordinate(e,o)},t.coordToContainerPoint=function(e,o,s){return this.coordinateToContainerPoint(e,o,s)},t.containerPointToCoord=function(e,o){return this.containerPointToCoordinate(e,o)},t.containerPointToViewPoint=function(e,o){return o?o.set(e.x,e.y):o=e.copy(),o._sub(this.getViewPoint())},t.viewPointToContainerPoint=function(e,o){return o?o.set(e.x,e.y):o=e.copy(),o._add(this.getViewPoint())},t.checkSize=function(e){var o=He()-this._initTime<1500&&this.width===0||this.height===0,s=this._getContainerDomSize(),a=this.height,l=this.width;if(!e&&s.width===l&&s.height===a)return this;Lh(this._containerDOM);var h=this.getCenter();if(this.options.fixCenterOnResize)this._updateMapSize(s);else{var u=this._getVisualHeight(this.getPitch()),c=new z(0,this.height-u),f=this._containerPointToPrj(c);this._updateMapSize(s);var d=this._getVisualHeight(this.getPitch()),g=new z(0,this.height-d);this._setPrjCoordAtContainerPoint(f,g),this._mapViewCoord=this._getPrjCenter()}var p=s.width===0||s.height===0||l===0||a===0;return(o||p)&&(this._eventSilence=!0,this.setCenter(h),delete this._eventSilence),this._fireEvent("resize"),this},t.locate=function(e,o,s){return this.getProjection()._locate(new $(e),o,s)},t.getMainPanel=function(){var e=this._getRenderer();return e?e.getMainPanel():null},t.getPanels=function(){return this._panels},t.remove=function(){var e=this;if(this.isRemoved())return this;this._fireEvent("removestart");var o=[this._animPlayer,this._mapAnimPlayer];o.forEach(function(l){l&&l.finish&&e._stopAnim(l)}),this._removeDomEvents(),this._clearHandlers(),this.removeBaseLayer();for(var s=this.getLayers(),a=0;a<s.length;a++)s[a].remove();return this._getRenderer()&&this._getRenderer().remove(),this._containerDOM.childNodes&&this._containerDOM.childNodes.length>0&&Array.prototype.slice.call(this._containerDOM.childNodes,0).filter(function(l){return l.className==="maptalks-wrapper"}).forEach(function(l){return e._containerDOM.removeChild(l)}),delete this._panels,delete this._containerDOM,delete this._renderer,this._fireEvent("removeend"),this._clearAllListeners(),this},t.isRemoved=function(){return!this._containerDOM},t.isMoving=function(){return!!this._moving},t.onMoveStart=function(e){this._mapAnimPlayer&&this._stopAnim(this._mapAnimPlayer);var o=this._getPrjCenter();(!this._originCenter||this._verifyExtent(o))&&(this._originCenter=o),this._moving=!0,this._trySetCursor("move"),this._fireEvent("movestart",this._parseEvent(e?e.domEvent:null,"movestart"))},t.onMoving=function(e){this._fireEvent("moving",this._parseEvent(e?e.domEvent:null,"moving")),this._limitMaxExtent()},t.onMoveEnd=function(e){if(this._moving=!1,this._suppressRecenter||this._recenterOnTerrain(),this._trySetCursor("default"),this._fireEvent("moveend",e&&e.domEvent?this._parseEvent(e.domEvent,"moveend"):e),!this._verifyExtent(this._getPrjCenter())&&this._originCenter&&!this.options.limitExtentOnMaxExtent){var o=this._originCenter;this._panTo(o)}this._limitMaxExtent()},t.onDragRotateStart=function(e){this._dragRotating=!0,this._fireEvent("dragrotatestart",this._parseEvent(e?e.domEvent:null,"dragrotatestart"))},t.onDragRotating=function(e){this._fireEvent("dragrotating",this._parseEvent(e?e.domEvent:null,"dragrotating"))},t.onDragRotateEnd=function(e){this._dragRotating=!1,this._fireEvent("dragrotateend",this._parseEvent(e?e.domEvent:null,"dragrotateend"))},t.isDragRotating=function(){return!!this._dragRotating},t.isOffscreen=function(e,o=0){var{width:s,height:a}=this,l=s+o,h=a+o,{xmin:u,ymin:c,xmax:f,ymax:d}=e;return Array.isArray(e)&&([u,c,f,d]=e),f<o||u>=l||d<o||c>h},t.getRenderer=function(){return this._getRenderer()},t.getDevicePixelRatio=function(){return this.options.devicePixelRatio||Ce.devicePixelRatio||1},t.setDevicePixelRatio=function(e){return X(e)&&e>0&&e!==this.options.devicePixelRatio&&(this.options.devicePixelRatio=e,this.checkSize(!0)),this},t._initContainer=function(e){var o,s;if(Ee(e)){if(this._containerDOM=document.getElementById(e),!this._containerDOM)throw new Error("Invalid container when creating map: '"+e+"'")}else this._containerDOM=e,Ct&&(this.CanvasClass=this._containerDOM.constructor);if(((s=(o=this._containerDOM)===null||o===void 0?void 0:o.childNodes)===null||s===void 0?void 0:s.length)>0){var a=this._containerDOM.childNodes[0];if(a instanceof HTMLElement&&a.classList.contains("maptalks-wrapper"))throw new Error("Container is already loaded with another map instance, use map.remove() to clear it.")}},t._trySetCursor=function(e){return!this._cursor&&!this._priorityCursor&&(e||(e="default"),this._setCursorToPanel(e)),this},t._setPriorityCursor=function(e){if(e)this._priorityCursor=e,this._setCursorToPanel(e);else{var o=!1;this._priorityCursor&&(o=!0),delete this._priorityCursor,o&&this.setCursor(this._cursor)}return this},t._setCursorToPanel=function(e){var o=this.getMainPanel();o&&o.style&&o.style.cursor!==e&&(o.style.cursor=e)},t._removeLayer=function(e,o){if(!(!e||!o)){var s=o.indexOf(e);s>-1&&o.splice(s,1)}},t._sortLayersByZIndex=function(){if(this._layers){for(var e=0,o=this._layers.length;e<o;e++){var s=this._layers[e];s._order=e,s.sortLayersByZIndex&&s.sortLayersByZIndex()}this._layers.sort(function(a,l){var h=a.getZIndex()-l.getZIndex();return h===0?a._order-l._order:h})}},t._fireEvent=function(e,o){if(!this._eventSilence){var s="_";e[0]!==s&&this.fire(s+e,o),this.fire(e,o)}},t._Load=function(){this._resetMapStatus(),this.options.pitch&&(this.setPitch(this.options.pitch),delete this.options.pitch),this.options.bearing&&(this.setBearing(this.options.bearing),delete this.options.bearing),delete this._glRes,this._loadAllLayers(),this._getRenderer().onLoad(),this._loaded=!0,this._callOnLoadHooks(),this._initTime=He()},t._initRenderer=function(){var e=this.options.renderer;Array.isArray(e)||(e=[e]);for(var o=0;o<e.length;o++){var s=r.getRendererClass(e[o]);if(s){this._renderer=new s(this),this._renderer.load();break}}if(!this._renderer)throw new Error("Invalid map.options.renderer: "+this.options.renderer)},t._getRenderer=function(){return this._renderer},t._loadAllLayers=function(){function e(o){o&&o.load()}this._baseLayer&&this._baseLayer.load(),this._eachLayer(e,this.getLayers())},t._getLayers=function(e){for(var o=this._baseLayer?[this._baseLayer].concat(this._layers):this._layers,s=[],a=0;a<o.length;a++)(!e||e.call(this,o[a]))&&s.push(o[a]);return s},t._eachLayer=function(e,...o){if(!(arguments.length<2)){o&&!Array.isArray(o)&&(o=[o]);for(var s=[],a=0,l=o.length;a<l;a++)s=s.concat(o[a]);for(var h=0,u=s.length;h<u;h++)e.call(e,s[h])}},t._onLayerEvent=function(e){e&&e.type==="idchange"&&(delete this._layerCache[e.old],this._layerCache[e.new]=e.target)},t._resetMapStatus=function(){var e=this.getMaxZoom(),o=this.getMinZoom(),s=this._spatialReference.getMaxZoom(),a=this._spatialReference.getMinZoom();(O(e)||e===-1||e>s)&&this.setMaxZoom(s),(O(o)||o===-1||o<a)&&this.setMinZoom(a),e=this.getMaxZoom(),o=this.getMinZoom(),e<o&&this.setMaxZoom(o),(O(this._zoomLevel)||this._zoomLevel>e)&&(this._zoomLevel=e),this._zoomLevel<o&&(this._zoomLevel=o),delete this._prjCenter,delete this._glRes;var l=this.getProjection();this._prjCenter=l.project(this._center),this._prjCenter.z=this._center.z,this._calcMatrices();var h=this._getRenderer();h&&h.resetContainer()},t.setContainerDomRect=function(e){this._containerDomContentRect=e},t._getContainerDomSize=function(){if(!this._containerDOM)return null;var e=this._containerDOM,o,s;if(this._containerDomContentRect)return o=this._containerDomContentRect.width,s=this._containerDomContentRect.height,new ft(o,s);var a=e;if(!O(a.width)&&!O(a.height)){o=a.width,s=a.height;var l=this.getDevicePixelRatio();l!==1&&e.layer&&(o/=l,s/=l)}else if(!O(e.clientWidth)&&!O(e.clientHeight))o=parseInt(e.clientWidth+"",0),s=parseInt(e.clientHeight+"",0);else throw new Error("can not get size of container");return new ft(o,s)},t._updateMapSize=function(e){this.width=e.width,this.height=e.height;var o=this._getRenderer();return o&&o.updateMapSize(e),this._calcMatrices(),this},t._getPrjCenter=function(){return this._prjCenter},t._setPrjCenter=function(e){this._prjCenter=e,this.isInteracting()&&!this.isMoving()&&(this._mapViewCoord=e),this._calcMatrices()},t._setPrjCoordAtContainerPoint=function(e,o){if(!this.centerAltitude&&o.x===this.width/2&&o.y===this.height/2)return this;var s=this._containerPointToPoint(o),a=s._sub(this._prjToPoint(this._getPrjCenter())),l=this._pointToPrj(this._prjToPoint(e)._sub(a));return this._setPrjCenter(l),this},t._setPrjCoordAtOffsetToCenter=function(e,o){var s=this._pointToPrj(this._prjToPoint(e)._sub(o));return this._setPrjCenter(s),this},t._verifyExtent=function(e){if(!e)return!1;var o=this._prjMaxExtent;return o?o.contains(e):!0},t._limitMaxExtent=function(){var e=this;if(this._limitMaxExtenting||!this.options.limitExtentOnMaxExtent)return this;var o=this._prjMaxExtent,s=this.getMaxExtent();if(!o||!s)return this;var a=o.toArray(),l=a.map(function(S){return e.prjToContainerPoint(S)}),h=ur();Ii(l,h);var{width:u,height:c}=this.getSize(),f=[0,0,u,c];if(Hp(f,h))return this;if(Hp(h,f))return this;var d=0,g=0,p=0,m=0,v=0,_=0,y=Math.abs,[w,x,C,b]=h;if(w>0&&C>u&&(d=p=y(w)),w<0&&C<u&&(d=p=-y(w)),w<0&&C<u&&(d=m=-y(u-C)),w>0&&C>u&&(d=m=y(u-C)),x>0&&b>c&&(g=v=y(x)),x<0&&b<c&&(g=v=-y(x)),x<0&&b<c&&(g=_=-y(c-b)),x>0&&b>c&&(g=_=y(c-b)),p!==0&&m!==0&&(d=p,y(m)<y(p)&&(d=m)),v!==0&&_!==0&&(g=v,y(_)<y(v)&&(g=_)),d!==0||g!==0){var E=new z(u/2+d,c/2+g),T=this.containerPointToCoord(E);this._limitMaxExtenting=!0,this.setCenter(T),this._limitMaxExtenting=!1}return this},t._offsetCenterByPixel=function(e){var o=Sv.set(this.width/2-e.x,this.height/2-e.y),s=this._containerPointToPrj(o,aE),a=Sv.set(this.width/2,this.height/2);this._setPrjCoordAtContainerPoint(s,a)},t.offsetPlatform=function(e){return e?(this._getRenderer().offsetPlatform(e),this._mapViewCoord=this._getPrjCenter(),this._mapViewPoint=this._mapViewPoint.add(e),this._mapViewPoint):this._mapViewPoint},t.getViewPoint=function(){var e=this.getViewPointFrameOffset(),o=this.offsetPlatform();return e&&(o=o.add(e)),o},t._resetMapViewPoint=function(){this._mapViewPoint=new z(0,0),this._mapViewCoord=this._getPrjCenter()},t._getResolution=function(e){return(e===void 0||e===this._zoomLevel)&&this._mapRes!==void 0?this._mapRes:(O(e)&&(e=this._zoomLevel),this._spatialReference.getResolution(e))},t._getResolutions=function(){return this._spatialReference.getResolutions()},t._prjToPoint=function(e,o,s){o=O(o)?this.getZoom():o;var a=this._getResolution(o);return this._prjToPointAtRes(e,a,s)},t._prjToPointAtRes=function(e,o,s){return this._spatialReference.getTransformation().transform(e,o,s)},t._prjsToPointsAtRes=function(e,o,s=[]){for(var a=this._spatialReference.getTransformation(),l=[],h=0,u=e.length;h<u;h++){var c=a.transform(e[h],o,s[h]);l.push(c)}return l},t._pointToPrj=function(e,o,s){o=O(o)?this.getZoom():o;var a=this._getResolution(o);return this._pointToPrjAtRes(e,a,s)},t._pointToPrjAtRes=function(e,o,s){return this._spatialReference.getTransformation().untransform(e,o,s)},t._pointToPoint=function(e,o,s){return O(o)?(s?(s.x=e.x,s.y=e.y):s=e.copy(),s):this._pointAtResToPoint(e,this._getResolution(o),s)},t._pointAtResToPoint=function(e,o,s){return s?(s.x=e.x,s.y=e.y):s=e.copy(),s._multi(o/this._getResolution())},t._pointToPointAtRes=function(e,o,s){return s?(s.x=e.x,s.y=e.y):s=e.copy(),s._multi(this._getResolution()/o)},t._containerPointToPrj=function(e,o){return this._pointToPrj(this._containerPointToPoint(e,void 0,o),void 0,o)},t._callOnLoadHooks=function(){var e=r.prototype;if(e._onLoadHooks)for(var o=0,s=e._onLoadHooks.length;o<s;o++)e._onLoadHooks[o].call(this)},t._fixPrjOnWorldWide=function(e){var o=this.getProjection();if(o&&o.fullExtent&&e){var{left:s,bottom:a,top:l,right:h}=o.fullExtent||{};X(s)&&(e.x=Math.max(s,e.x)),X(h)&&(e.x=Math.min(h,e.x)),X(a)&&(e.y=Math.max(a,e.y)),X(l)&&(e.y=Math.min(l,e.y))}return this},t.toJSON=function(e){e||(e={});var o={jsonVersion:this.JSON_VERSION,version:this.VERSION,extent:this.getExtent().toJSON()};o.options=this.config(),o.options.center=this.getCenter(),o.options.zoom=this.getZoom(),o.options.bearing=this.getBearing(),o.options.pitch=this.getPitch();var s=this.getBaseLayer();(O(e.baseLayer)||e.baseLayer)&&s&&(o.baseLayer=s.toJSON(e.baseLayer));var a={};e.clipExtent&&(e.clipExtent===!0?a.clipExtent=this.getExtent():a.clipExtent=e.clipExtent);var l=[];if(O(e.layers)||e.layers&&!Array.isArray(e.layers)){for(var h=this.getLayers(),u=0,c=h.length;u<c;u++)if(h[u].toJSON){var f=oe({},Xt(e.layers)?e.layers:{},a);l.push(h[u].toJSON(f))}o.layers=l}else if($e(e.layers)){for(var d=e.layers,g=0;g<d.length;g++){var p=d[g],m=this.getLayer(p.id);if(m.toJSON){var v=oe({},p.options,a);l.push(m.toJSON(v))}}o.layers=l}else o.layers=[];return o},r.fromJSON=function(e,o,s){if(!e||!o)return null;s||(s={});var a=new r(e,o.options);if(O(s.baseLayer)||s.baseLayer){var l=hr.fromJSON(o.baseLayer);l&&a.setBaseLayer(l)}if(O(s.layers)||s.layers){for(var h=[],u=o.layers,c=0;c<u.length;c++){var f=hr.fromJSON(u[c]);h.push(f)}a.addLayer(h)}return a},r}(od(ci(ld(br))));Se.mergeOptions(lE);function kv(n){return n&&n.queryTerrainAtPoint&&n.getTerrainLayer&&n.getTerrainLayer()}var Bn=function(n){function r(){return n.apply(this,arguments)||this}return Q(r,n),r}(Pa),hE=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.addHooks=function(){this.target&&this.target.on("_dblclick",this._onDoubleClick,this)},t.removeHooks=function(){this.target&&this.target.off("_dblclick",this._onDoubleClick,this)},t._onDoubleClick=function(e){var o=this.target;if(o.options.doubleClickZoom){var s=o.getZoom(),a=e.domEvent.shiftKey?Math.ceil(s)-1:Math.floor(s)+1;o._zoomAnimation(a,e.containerPoint)}},r}(Bn);Se.mergeOptions({doubleClickZoom:!0});Se.addOnLoadHook("addHandler","doubleClickZoom",hE);var uE=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.addHooks=function(){var e=this.target;if(e){var o=e.getPanels().mapWrapper||e.getContainer();this._dragHandler=new Ea(o,{cancelOn:this._cancelOn.bind(this),rightclick:!0}),this._dragHandler.on("mousedown",this._onMouseDown,this).on("dragstart",this._onDragStart,this).on("dragging",this._onDragging,this).on("dragend",this._onDragEnd,this).enable()}},t.removeHooks=function(){this._dragHandler.off("mousedown",this._onMouseDown,this).off("dragstart",this._onDragStart,this).off("dragging",this._onDragging,this).off("dragend",this._onDragEnd,this),this._dragHandler.remove(),delete this._dragHandler},t._cancelOn=function(e){return!!(this.target.isZooming()||this._ignore(e))},t._ignore=function(e){return e?(e.domEvent&&(e=e.domEvent),this.target._ignoreEvent(e)):!1},t._onMouseDown=function(e){delete this.startDragTime,delete this._mode;var o=this.target.options.switchDragButton,s=o?0:2,a=e.domEvent.type==="touchstart",l=o&&a||e.domEvent.button===s||e.domEvent.ctrlKey;l?(this.target.options.dragRotate||this.target.options.dragPitch)&&(this._mode="rotatePitch"):this.target.options.dragPan&&(this._mode="move"),this.target._stopAnim(this.target._mapAnimPlayer),hi(e.domEvent)},t._onDragStart=function(e){this.startDragTime=He(),this._mode==="move"?this._moveStart(e):this._mode==="rotatePitch"&&this._rotateStart(e)},t._onDragging=function(e){this._mode==="move"?this._moving(e):this._mode==="rotatePitch"&&this._rotating(e)},t._onDragEnd=function(e){this._mode==="move"?this._moveEnd(e):this._mode==="rotatePitch"&&this._rotateEnd(e),delete this.startDragTime,delete this.startBearing},t._start=function(e){this.preX=e.mousePos.x,this.preY=e.mousePos.y,this.startX=this.preX,this.startY=this.preY,this._startPrjCenter=this.target._getPrjCenter().copy()},t._moveStart=function(e){delete this.startContainerPoint,this._start(e);var o=this.target;o.onMoveStart(e);var s=yr(o._getActualEvent(e.domEvent),o.getContainer());this.startPrjCoord=o.queryPrjCoordAtContainerPoint(s),o._isContainerPointOutOfMap(s)&&this.startPrjCoord.z===void 0&&(this.startContainerPoint=s)},t._moving=function(e){if(this.startDragTime){var o=this.target,s=yr(o._getActualEvent(e.domEvent),o.getContainer());if(this.startContainerPoint){var a=s._sub(this.startContainerPoint);s.set(o.width/2+a.x,o.height/2+a.y)}var l=o._containerPointToPoint(s,void 0,void 0,this.startPrjCoord.z),h=l._sub(o._prjToPoint(o._getPrjCenter()));o._setPrjCoordAtOffsetToCenter(this.startPrjCoord,h),o.onMoving(e)}},t._moveEnd=function(e){if(this.startDragTime){var o=e.domEvent.type==="touchend",s=this.target,a=He()-this.startDragTime,l=e.mousePos.x,h=e.mousePos.y,u=l-this.startX,c=h-this.startY,f=s._getPrjCenter(),d=f.sub(this._startPrjCenter);if(this._clear(),s.options.panAnimation&&!e.interupted&&s._verifyExtent(s._getPrjCenter())&&a<280&&Math.abs(c)+Math.abs(u)>5){a=5*a;var g=o?5:2.8,p=f.add(d._multi(g));s._panTo(p,{duration:o?a*3:a*2,easing:s.options.dragPanEasing||"outExpo"})}else s.onMoveEnd(e)}},t._rotateStart=function(e){this._start(e),delete this._rotateMode,this.startBearing=this.target.getBearing(),this.target.onDragRotateStart(e),this._db=0},t._rotating=function(e){var o=this.target,s=e.mousePos.x,a=e.mousePos.y,l=o.getPitch(),h=o.getBearing(),u=Math.abs(s-this.preX),c=Math.abs(a-this.preY);if(this._rotateMode||(o.options.dragRotatePitch?this._rotateMode="rotate_pitch":u>c?this._rotateMode="rotate":u<c?this._rotateMode="pitch":this._rotateMode="rotate"),!(this._rotateMode==="pitch"&&l===0&&c<10)){if(this._rotateMode.indexOf("rotate")>=0&&o.options.dragRotate){var f=.15,d=0;o.options.dragPitch||u>c?d=-f*(this.preX-s):s>o.width/2?d=f*(this.preY-a):d=-f*(this.preY-a);var g=o.getBearing()+d;this._db=this._db||0,this._db+=d,o._setBearing(g)}this._rotateMode.indexOf("pitch")>=0&&o.options.dragPitch&&o._setPitch(o.getPitch()+(this.preY-a)*.15),this.preX=s,this.preY=a,(o.getBearing()!==h||o.getPitch()!==l)&&o.onDragRotating(e)}},t._rotateEnd=function(e){var o=this.target,s=o.getBearing();this._clear();var a=He()-this.startDragTime;if(o.onDragRotateEnd(e),o.options.rotateAnimation&&Math.abs(s-this.startBearing)>20&&(this._rotateMode==="rotate"||this._rotateMode==="rotate_pitch")&&!e.interupted&&a<400){var l=o.getBearing();o._animateTo({bearing:l+this._db/1.5},{easing:"outQuint",duration:1600})}},t._clear=function(){delete this.startPrjCoord,delete this.preX,delete this.preY,delete this.startX,delete this.startY},r}(Bn);Se.mergeOptions({draggable:!0,dragPan:!0,dragRotatePitch:!0,dragRotate:!0,dragPitch:!0});Se.addOnLoadHook("addHandler","draggable",uE);var Rv="mousedown mouseup mousemove click dblclick contextmenu touchstart touchmove touchend mouseout",cE={mousemove:["mousemove","mouseover","mouseout","mouseenter"],touchend:["touchend","click"]},el=function(r){return r&&r.getLayer&&r.on&&r.fire},fE=function(r){return r._getInternalId?r._getInternalId():r.getId?r.getId():null},Un=function(r,t,i){if(r._onEvent)return r._onEvent(t,i);var e=r.getLayer();return e&&e.fireGeoEvent?e.fireGeoEvent(r,t,i):null},dE=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.addHooks=function(){var e=this.target,o=e.getPanels().allLayers||e.getContainer();vt(o,Rv,this._identifyGeometryEvents,this)},t.removeHooks=function(){var e=this.target,o=e.getPanels().allLayers||e.getContainer();yt(o,Rv,this._identifyGeometryEvents)},t._identifyGeometryEvents=function(e,o){var s=this.target;if(s.isInteracting()||s._ignoreEvent(e))return;var a=null,l=o||e.type;if(Hl(l)&&!wr.isTest&&s.options.mousemoveThrottleEnable&&my(this,s.options.mousemoveThrottleTime)){nr(e);return}var h=l==="mousedown"||l==="touchstart"&&e.touches&&e.touches.length===1;if(h)this._mouseDownTime=He();else if((l==="click"||l==="touchend")&&this._mouseDownTime){var u=this._mouseDownTime;delete this._mouseDownTime;var c=He();if(c-u>300){if(l==="click")return}else l==="touchend"&&(a="click")}var f=e.touches&&e.touches.length>0?e.touches[0]:e.changedTouches&&e.changedTouches.length>0?e.changedTouches[0]:e;if(!f)return;var d=yr(f,s.getContainer());l==="touchstart"&&s.options.preventTouch&&hi(e);for(var g=null,p=this.target.getRenderer().getTopElements(),m=h&&e.button!==2,v=0;v<p.length;v++)if(p[v].hitTest(d)){var _=p[v].options.cursor;if(_&&(g=_),m||p[v].events&&p[v].events.indexOf(l)>=0){var y={target:s,type:l,domEvent:e,containerPoint:d};if(m){s._setPriorityCursor(g),p[v].mousedown(y);return}else p[v].onEvent(y)}}var w=s._getLayers(function(T){return!!(T.identify&&T.options.geometryEvents)});if(!w.length)return;var x=cE[l]||[l],C={includeInternals:!0,filter:function(S){if(S instanceof je){var B=S._getEventTypeToFire(e);return l==="mousemove"?(!g&&S.options.cursor&&(g=S.options.cursor),!0):!(!S.listens(B)&&!S.listens(a))}else if(el(S))return!0;return!1},count:1,onlyVisible:s.options.onlyVisibleGeometryEvents,containerPoint:d,layers:w,eventTypes:x,domEvent:e},b=E.bind(this);Hl(l)?this._queryIdentifyTimeout=s.getRenderer().callInNextFrame(function(){s.isInteracting()||s.identifyAtPoint(C,b)}):s.identifyAtPoint(C,b);function E(T){var S=this,B=!0,L=function(){var se=S._prevOverGeos&&S._prevOverGeos.geos;return se||[]},D=function(se=[],me=[]){if(se&&se.length>0)for(var ge=se.length-1;ge>=0;ge--){var de=se[ge];el(de)&&me.indexOf(de)===-1&&(B=Un(de,e,"mouseout"))}};if(l==="mouseout"){var N=L();this._prevOverGeos={geos:[],geomap:{}},D(N,[])}else if(l==="mousemove"){var G={};if(T.length>0)for(var I=T.length-1;I>=0;I--){var A=T[I];if(el(A)){var k=fE(A);G[k]=A,Un(A,e),(!this._prevOverGeos||!this._prevOverGeos.geomap[k])&&Un(A,e,"mouseenter"),B=Un(A,e,"mouseover")}}s._setPriorityCursor(g);var Z=L();this._prevOverGeos={geos:T,geomap:G},D(Z,T)}else{if(!T||!T.length)return;for(var W=T.length-1;W>=0;W--)if(el(T[W])){B=Un(T[W],e),a&&Un(T[W],e,a);break}}B===!1&&nr(e)}},r}(Bn);Se.mergeOptions({geometryEvents:!0,onlyVisibleGeometryEvents:!0});Se.addOnLoadHook("addHandler","geometryEvents",dE);var Av=4.000244140625,gE=1/100,pE=1/450,vE=2,mE=function(n){function r(i){var e;return e=n.call(this,i)||this,e._thisScrollZoom=e._scrollZoom.bind(e),e._thisCheckIfEndZoom=e._checkIfEndZoom.bind(e),e._wheelZoomRate=pE,e._defaultZoomRate=gE,e._delta=0,e}Q(r,n);var t=r.prototype;return t.addHooks=function(){Jr(this.target._containerDOM,"wheel",this._onWheelScroll,this)},t.removeHooks=function(){In(this.target._containerDOM,"wheel",this._onWheelScroll)},t._currentZoomCanScroll=function(e){if(X(e)){var o=this.target,s=o.getZoom(),a=o.getMinZoom(),l=o.getMaxZoom();if(s===a&&e>0||s===l&&e<0)return!1}return!0},t._onWheelScroll=function(e){var o=this.target;if(o.options.preventWheelScroll&&(hi(e),nr(e)),o._ignoreEvent(e)||!o.options.zoomable)return!1;var s=o.getContainer(),a=o._checkZoomOrigin(yr(e,s));return o.options.seamlessZoom?(this._zooming||(this._trackPadSuspect=0,this._ensureTrackpad=!1),this._seamless(e,a)):this._interval(e,a)},t._seamless=function(e,o){var s=e.deltaMode===window.WheelEvent.DOM_DELTA_LINE?e.deltaY*60:e.deltaY;if(s%Av!==0&&(this._ensureTrackpad||(Math.abs(s)<60?this._trackPadSuspect++:this._trackPadSuspect=0,this._trackPadSuspect>=2&&(this._ensureTrackpad=!0)),this._ensureTrackpad&&(s*=14)),e.shiftKey&&s&&(s=s/4),this._lastWheelEvent=e,O(this._delta)&&(this._delta=0),this._delta-=s,!!this._currentZoomCanScroll(s)){if(!this._zooming&&this._delta){var a=this.target;this._zoomOrigin=o,a.onZoomStart(null,o)}this._start()}},t._start=function(){if(this._delta){this._zooming=!0;var e=this.target;this._active||(e.getRenderer().callInNextFrame(this._thisScrollZoom),this._active=!0)}},t._scrollZoom=function(){if(this._active=!1,!!this._delta){var e=Math.abs(this._delta)>Av?this._wheelZoomRate:this._defaultZoomRate,o=vE/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&o!==0&&(o=1/o);var s=this.target,a=s.getZoom(),l=s.getZoomForScale(o,a,!0);this._delta=0,s.onZooming(l,this._zoomOrigin),this._scrollTime=performance.now(),s.getRenderer().callInNextFrame(this._thisCheckIfEndZoom)}},t._checkIfEndZoom=function(){if(this._zooming){var e=this.target,o=performance.now();o-this._scrollTime>210?(this._zooming=!1,e.onZoomEnd(e.getZoom(),this._zoomOrigin)):e.getRenderer().callInNextFrame(this._thisCheckIfEndZoom)}},t._interval=function(e,o){var s=this,a=this.target;if(this._zooming)return this._requesting++,!1;this._requesting=0;var l=(e.deltaY?e.deltaY*-1:e.wheelDelta?e.wheelDelta:e.detail)>0?1:-1;e.detail&&(l*=-1);var h=a.getZoom(),u=h+l;if(u=a._checkZoom(l>0?Math.ceil(u):Math.floor(u)),u===h)return!1;this._zooming=!0,this._delta||(a.onZoomStart(null,o),this._origin=o,this._delta=l,this._startZoom=a.getZoom());var c=90;return a._animateTo({zoom:u-this._delta*1/2,around:this._origin},{continueOnViewChanged:!0,easing:"linear",duration:c,wheelZoom:!0},function(f){if(f.state.playState!=="finished"){f.state.playState!=="running"&&(delete s._zooming,delete s._requesting);return}s._requesting<1||Math.abs(u-s._startZoom)>2||u===a.getMaxZoom()||u===a.getMinZoom()?(a._animateTo({zoom:u,around:s._origin},{continueOnViewChanged:!0,duration:100},function(d){d.state.playState!=="running"&&(delete s._zooming,delete s._requesting)}),delete s._startZoom,delete s._origin,delete s._delta,s._requesting=0):O(s._requesting)||(delete s._zooming,s._onWheelScroll(e))}),!1},r}(Bn);Se.mergeOptions({scrollWheelZoom:!0,seamlessZoom:!0});Se.addOnLoadHook("addHandler","scrollWheelZoom",mE);var _E=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.addHooks=function(){Jr(this.target.getContainer(),"touchstart",this._onTouchStart,this)},t.removeHooks=function(){In(this.target.getContainer(),"touchstart",this._onTouchStart)},t._onTouchStart=function(e){var o=this.target;if(!(!e.touches||e.touches.length<2)){var s=o.getContainer(),a=yr(e.touches[0],s),l=yr(e.touches[1],s);this.preY=a.y,this._startP1=a,this._startP2=l,this._startDist=a.distanceTo(l),this._startVector=a.sub(l),this._startZoom=o.getZoom(),this._startBearing=o.getBearing(),yt(document,"touchmove",this._onTouchMove),yt(document,"touchend",this._onTouchEnd),Jr(document,"touchmove",this._onTouchMove,this),Jr(document,"touchend",this._onTouchEnd,this),o.options.preventTouch&&hi(e),o._fireEvent("touchactstart")}},t._onTouchMove=function(e){var o=this.target;if(!(!e.touches||e.touches.length<2)){var s=o.getContainer(),a=yr(e.touches[0],s),l=yr(e.touches[1],s),h=a.sub(this._startP1),u=l.sub(this._startP2),c=a.sub(l),f=a.distanceTo(l)/this._startDist,d=c.angleWith(this._startVector)*180/Math.PI,g=this.preY||a.y,p=(g-a.y)*.4;this.preY=a.y;var m={domEvent:e,mousePos:[a,l]};if(this.mode||(o.options.touchRotate&&Math.abs(d)>8?this.mode=o.options.touchZoomRotate?"rotate_zoom":"rotate":o.options.touchPitch&&h.y*u.y>0&&Math.abs(h.y)>10&&Math.abs(u.y)>10?this.mode="pitch":o.options.zoomable&&o.options.touchZoom&&Math.abs(1-f)>.15&&(this.mode=o.options.touchZoomRotate&&o.options.touchRotate?"rotate_zoom":"zoom"),this._startTouching(m)),this.mode==="zoom"||this.mode==="rotate_zoom"){this._scale=f;var v=o._getResolution(this._startZoom)/f,_=o.getZoomFromRes(v);o.onZooming(_,this._Origin)}this.mode==="rotate"||this.mode==="rotate_zoom"?(o._setBearing(this._startBearing+d),o.onDragRotating(m)):this.mode==="pitch"&&(o._setPitch(o.getPitch()+p),o.onDragRotating(m)),o._fireEvent("touchactinging")}},t._startTouching=function(e){var o=this.target;if(this.mode==="zoom"||this.mode==="rotate_zoom"){var s=o.getSize();this._Origin=new z(s.width/2,s.height/2),o.onZoomStart(null,this._Origin)}(this.mode==="rotate"||this.mode==="pitch"||this.mode==="rotate_zoom")&&o.onDragRotateStart(e)},t._onTouchEnd=function(e){delete this.preY;var o=this.target;if(yt(document,"touchmove",this._onTouchMove),yt(document,"touchend",this._onTouchEnd),this.mode==="zoom"||this.mode==="rotate_zoom"){var s=this._scale,a=o._getResolution(this._startZoom)/s,l=o.getZoomFromRes(a);o.onZoomEnd(l,this._Origin)}(this.mode==="pitch"||this.mode==="rotate"||this.mode==="rotate_zoom")&&o.onDragRotateEnd({domEvent:e}),delete this.mode,o._fireEvent("touchactend")},r}(Bn);Se.mergeOptions({touchGesture:!0,touchZoom:!0,touchPitch:!0,touchRotate:!0,touchZoomRotate:!1});Se.addOnLoadHook("addHandler","touchGesture",_E);var tl="__anim_player",En={outExpo:function(r){return r===1?1:1-Math.pow(2,-10*r)},outQuint:function(r){return 1-Math.pow(1-r,5)},in:function(r){return Math.pow(r,2)},out:function(r){return 1-En.in(1-r)},inAndOut:function(r){return 3*r*r-2*r*r*r},linear:function(r){return r},upAndDown:function(r){return r<.5?En.inAndOut(2*r):1-En.inAndOut(2*(r-.5))}},A0=function(){function n(r,t){this.state=r,this.styles=t}return DT(n,[{key:"playState",get:function(){return this.state.playState}},{key:"symbol",get:function(){return this.styles.symbol}}])}(),L0=function(){function n(t,i,e,o){this._animation=t,this.options=i,this._onFrame=e,this.playState="idle",this.ready=!0,this.finished=!1,this.target=o}var r=n.prototype;return r._prepare=function(){var i=this.options,e=i.speed||i.duration;Ee(e)&&(e=Mt.speed[e],e||(e=+e)),e||(e=Mt.speed.normal),this.duration=e,this._framer=i.framer||Mt._requestAnimFrame.bind(Mt)},r.play=function(){if(this.playState!=="idle"&&this.playState!=="paused"||this.target&&this.target[tl])return this;this.target&&(this.target[tl]=1),this.playState==="idle"&&(this.currentTime=0,this._prepare());var i=He();if(!this.startTime){var e=this.options;this.startTime=e.startTime?e.startTime:i}return this._playStartTime=Math.max(i,this.startTime),this.playState==="paused"&&(this._playStartTime-=this.currentTime),this.playState="running",this._run(),this},r.pause=function(){return this.playState==="paused"?this:(this.playState="paused",this._run(),this)},r.cancel=function(){return this.playState==="idle"?this:(this.playState="idle",this.finished=!1,this._run(),this)},r.finish=function(){return this.playState==="finished"?this:(this.playState="finished",this.finished=!0,this._run(),this)},r.reverse=function(){},r._run=function(){var i=this,e=this._onFrame,o=He(),s=o-this._playStartTime;if(this.options.repeat&&s>=this.duration&&(this._playStartTime=o,s=0),this.playState!=="running"){if(this.target&&delete this.target[tl],e){this.playState==="finished"?s=this.duration:this.playState==="idle"&&(s=0);var a=this._animation(s,this.duration);a.state.playState=this.playState,e(a)}return}var l=this._animation(s,this.duration);this.playState=l.state.playState,this.playState!=="running"&&this.target&&delete this.target[tl],this.playState==="idle"?this.startTime>o&&setTimeout(this._run.bind(this),this.startTime-o):this.playState==="running"?(this.currentTime=s,e&&e(l),this._framer(function(){i.playState==="running"&&i._run()})):this.playState==="finished"&&(this.finished=!0,e&&e(l))},n}(),Mt={speed:{slow:2e3,normal:1e3,fast:500},_resolveStyles:function(r){if(!r)return null;function t(c){if(!Array.isArray(c))return Mt._resolveStyles(c);for(var f=[],d=[],g=[],p=0;p<c.length;p++){var m=Mt._resolveStyles(c[p]);m&&(f.push(m[0]),d.push(m[1]),g.push(m[2]))}return f.length?[f,d,g]:null}function i(c){var f=c,d;Array.isArray(c)||(X(c)?f=[0,c]:c instanceof z||c instanceof $?(d=c.constructor,f=[new d(0,0),c]):f=[c,c]);var g=f[0],p=f[1];return X(g)&&X(p)?g===p?null:[g,p-g,p]:Array.isArray(g)&&X(g[0])||g instanceof $||g instanceof z?(Array.isArray(g)?(g=new $(g),p=new $(p)):(d=g.constructor,g=new d(g),p=new d(p)),g.equals(p)?null:[g,p.sub(g),p]):[g,p,p]}function e(c){return!Array.isArray(c)&&c.constructor===Object?!0:!!(Array.isArray(c)&&c[0].constructor===Object)}var o={},s={},a={};for(var l in r)if(r.hasOwnProperty(l)){var h=r[l];if(h){if(Array.isArray(h)&&(O(h[0])||O(h[1])))continue}else continue;var u=void 0;e(h)?u=t(h):u=i(h),u&&(s[l]=u[0],o[l]=u[1],a[l]=u[2])}return[s,o,a]},framing:function(r,t){t||(t={});var i;Oe(t.easing)?i=t.easing:i=t.easing?En[t.easing]:En.linear,(!i||!Oe(i))&&(i=En.linear);var e,o,s;r=Mt._resolveStyles(r),r&&(o=r[0],e=r[1],s=r[2]);var a=function(h,u,c){if(!u||!c)return null;var f={};for(var d in c)if(c.hasOwnProperty(d)){if(u[d]===s[d]){f[d]=u[d];continue}var g=u[d],p=c[d];if(X(p))f[d]=g+h*p;else if(Array.isArray(p)){for(var m=[],v=0;v<p.length;v++)m.push(a(h,g[v],p[v]));f[d]=m}else{var _=p.constructor;_===Object?f[d]=a(h,g,p):g instanceof z||g instanceof $?f[d]=g.add(p.multi(h)):f[d]=p}}return f};return function(l,h){var u,c;if(l<0)u={playState:"idle",delta:0},c=o;else if(l<h){var f=i(l/h);u={playState:"running",delta:f},c=a(f,o,e)}else u={playState:"finished",delta:1},c=s;return u.startStyles=o,u.destStyles=s,u.progress=l,u.remainingMs=h-l,new A0(u,c)}},_requestAnimFrame:function(r){this._frameQueue||(this._frameQueue=[]),this._frameQueue.push(r),this._a()},_a:function(){this._animationFrameId||(this._animationFrameId=ai(Mt._frameFn))},_run:function(){if(this._frameQueue.length){var r=this._frameQueue;this._frameQueue=[];for(var t=0,i=r.length;t<i;t++)r[t]();this._frameQueue.length?this._animationFrameId=ai(Mt._frameFn):delete this._animationFrameId}},animate:function(r,t,i,e){t||(t={});var o=Mt.framing(r,t),s=new L0(o,t,i,e);return s},_frameFn:function(){}};Mt._frameFn=Mt._run.bind(Mt);var yE=Mt.animate,wE=Object.freeze({__proto__:null,Animation:Mt,Easing:En,Frame:A0,Player:L0,animate:yE}),I0={exports:{}};(function(n){(function(){function r(a,l){var h=a.x-l.x,u=a.y-l.y;return h*h+u*u}function t(a,l,h){var u=l.x,c=l.y,f=h.x-u,d=h.y-c;if(f!==0||d!==0){var g=((a.x-u)*f+(a.y-c)*d)/(f*f+d*d);g>1?(u=h.x,c=h.y):g>0&&(u+=f*g,c+=d*g)}return f=a.x-u,d=a.y-c,f*f+d*d}function i(a,l){for(var h=a[0],u=[h],c,f=1,d=a.length;f<d;f++)c=a[f],r(c,h)>l&&(u.push(c),h=c);return h!==c&&u.push(c),u}function e(a,l,h,u,c){for(var f=u,d,g=l+1;g<h;g++){var p=t(a[g],a[l],a[h]);p>f&&(d=g,f=p)}f>u&&(d-l>1&&e(a,l,d,u,c),c.push(a[d]),h-d>1&&e(a,d,h,u,c))}function o(a,l){var h=a.length-1,u=[a[0]];return e(a,0,h,l,u),u.push(a[h]),u}function s(a,l,h){if(a.length<=2)return a;var u=l!==void 0?l*l:1;return a=h?a:i(a,u),a=o(a,u),a}n.exports=s,n.exports.default=s})()})(I0);var xE=I0.exports,CE=Qf(xE),D0="not find Geometry' Projection. please add Geometry to Layer and add Layer to Map",TE={smoothness:!1,enableClip:!0,enableSimplify:!0,simplifyTolerance:2,symbol:{lineColor:"#000",lineWidth:2,lineOpacity:1,polygonFill:"#fff",polygonOpacity:1,opacity:1}},Zh=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.animateShow=function(e={},o){var s=this;this._showPlayer&&this._showPlayer.finish(),Oe(e)&&(e={},o=e);var a=this.getCoordinates();if(a.length!==0){this._animIdx=0,this._animLenSoFar=0,this.show();var l=!!this.getShell,h=l?this.getShell().concat(this.getShell()[0]):a,u=this._getProjection();if(!u){console.error(D0);return}var c=u.projectCoords(h,this.options.antiMeridian);this._prjAniShowCenter=this._getPrjExtent().getCenter(),this._aniShowCenter=u.unproject(this._prjAniShowCenter);var f=e.duration||1e3,d=e.easing||"out";this.setCoordinates([]);var g=0;c.length&&(c[0]._distance=0);for(var p=1;p<c.length;p++){var m=c[p].distanceTo(c[p-1]);c[p]._distance=m,g+=m}this._tempCoord=new $(0,0),this._tempPrjCoord=new z(0,0);var v=this._showPlayer=Mt.animate({t:f},{duration:f,easing:d},function(_){if(!s.getMap()){if(v.playState!=="finished"&&(v.finish(),o)){var y=s.getCoordinates();o(_,y[y.length-1])}return}var w=s._drawAnimShowFrame(_.styles.t,f,g,h,c);_.state.playState==="finished"&&(delete s._showPlayer,delete s._aniShowCenter,delete s._prjAniShowCenter,delete s._animIdx,delete s._animLenSoFar,delete s._animTailRatio,delete s._tempCoord,delete s._tempPrjCoord,s.setCoordinates(a)),o&&o(_,w)},this);return setTimeout(function(){v.play()},1),v}},t._drawAnimShowFrame=function(e,o,s,a,l){if(e===0)return a[0];var h=e/o*s,u=0,c,f;for(c=this._animIdx+1,f=l.length;c<f&&(u=l[c]._distance,!(this._animLenSoFar+u>h));c++)this._animLenSoFar+=u;if(this._animIdx=c-1,this._animIdx>=f-1)return this.setCoordinates(a),a[a.length-1];var d=this._animIdx,g=l[d],p=l[d+1],m=h-this._animLenSoFar,v=m/u;this._animTailRatio=v;var _=g.x+(p.x-g.x)*v,y=g.y+(p.y-g.y)*v;this._tempPrjCoord.x=_,this._tempPrjCoord.y=y;var w=this._tempPrjCoord,x=a[d],C=a[d+1],b=x.x+(C.x-x.x)*v,E=x.y+(C.y-x.y)*v,T=(x.z||0)+((C.z||0)-(x.z||0))*v;this._tempCoord.x=b,this._tempCoord.y=E,this._tempCoord.z=T;var S=this._tempCoord,B=!!this.getShell;if(!B&&this.options.smoothness>0){for(var L=[],D=[],N=0;N<=this._animIdx;N++)L.push(a[N]),D.push(l[N]);L.push(S,S),D.push(w,w),this.setCoordinates(L),this._setPrjCoordinates(D)}else{var G=a.slice(0,this._animIdx+1);G.push(S);var I=l.slice(0,this._animIdx+1);I.push(w),B?(this.setCoordinates([this._aniShowCenter].concat(G)),this._setPrjCoordinates([this._prjAniShowCenter].concat(I))):(this.setCoordinates(G),this._setPrjCoordinates(I))}return S},t._getCenterInExtent=function(e,o,s){var a=this.getExtent();if(!e.intersects(a))return null;var l=s(o,e);if(l.length===0)return null;var[h,u,c]=[0,0,0];l.forEach(function(d){Array.isArray(d)?d.forEach(function(g){g.point&&(g=g.point),h+=g.x,u+=g.y,c++}):(d.point&&(d=d.point),h+=d.x,u+=d.y,c++)});var f=new $(h,u)._multi(1/c);return f.count=c,f},t._getPath2DPoints=function(e,o,s){if(!$e(e))return[];var a=this.getMap(),l=!o&&this._shouldSimplify(),h=this.options.simplifyTolerance*a._getResolution(),u=Array.isArray(e[0]);if(delete this._simplified,l&&!u){var c=e.length;e=CE(e,h,!1),this._simplified=e.length<c}if(s||(s=a._getResolution()),Array.isArray(e)){var f=[],d="_glPt";if(!Array.isArray(e[0]))return f=Xs(e,d),a._prjsToPointsAtRes(e,s,f);for(var g=[],p=0,m=e.length;p<m;p++){var v=e[p];f=Xs(v,d);var _=a._prjsToPointsAtRes(v,s,f);g.push(_)}return g}else return a._prjToPointAtRes(e,s)},t._shouldSimplify=function(){var e=this.getLayer(),o=e.options.enableAltitude;return e&&e.options.enableSimplify&&!o&&this.options.enableSimplify&&!this._showPlayer},t._setPrjCoordinates=function(e){this._prjCoords=e,this.onShapeChanged()},t._getPrjCoordinates=function(){return this._verifyProjection(),!this._prjCoords&&this._getProjection()&&(this._prjCoords=this._projectCoords(this._coordinates)),this._prjCoords},t._updateCache=function(){this._clearCache();var e=this._getProjection();e&&this._prjCoords&&(this._coordinates=this._unprojectCoords(this._getPrjCoordinates()))},t._clearProjection=function(){this._prjCoords=null,n.prototype._clearProjection.call(this)},t._projectCoords=function(e){var o=this._getProjection();return o?o.projectCoords(e,this.options.antiMeridian):[]},t._unprojectCoords=function(e){var o=this._getProjection();return o?o.unprojectCoords(e):[]},t._computeCenter=function(){var e=this._coordinates;if(!$e(e))return null;for(var o=0,s=0,a=0,l=e.length,h=0;h<l;h++)e[h]&&X(e[h].x)&&X(e[h].y)&&(o+=e[h].x,s+=e[h].y,a++);return new $(o/a,s/a)},t._computeExtent=function(e){var o=this._coordinates;if(!$e(o))return null;var s=[o];return this.hasHoles&&this.hasHoles()&&s.push.call(s,...this.getHoles()),this._coords2Extent(s,this._getProjection())},t._computePrjExtent=function(e){var o=[this._getPrjCoordinates()];return this.hasHoles&&this.hasHoles()&&o.push.call(o,...this._getPrjHoles()),this._coords2Extent(o)},t._get2DLength=function(){for(var e=this._getPath2DPoints(this._getPrjCoordinates(),!0),o=0,s=1,a=e.length;s<a;s++)o+=e[s].distanceTo(e[s-1]);return o},t._hitTestTolerance=function(){var e=this._getInternalSymbol(),o,s=0;if(Array.isArray(e)){o=0;for(var a=0;a<e.length;a++)X(e[a].lineWidth)&&e[a].lineWidth>o&&(o=e[a].lineWidth),X(e[a].lineStrokeWidth)&&(s=Math.max(s,e[a].lineStrokeWidth))}else o=e.lineWidth,s=e.lineStrokeWidth||0;return o+=s*2,n.prototype._hitTestTolerance.call(this)+(X(o)?o/2:1.5)},t._coords2Extent=function(e,o){if(!e||e.length===0||Array.isArray(e[0])&&e[0].length===0)return null;for(var s=new Je(o),a=0,l=e.length;a<l;a++)for(var h=0,u=e[a].length;h<u;h++)s._combine(e[a][h]);return s},r}(je);Zh.mergeOptions(TE);var z0="Polygon",it=function(n){function r(i,e){var o;return o=n.call(this,e)||this,o.type="Polygon",i&&o.setCoordinates(i),o}Q(r,n);var t=r.prototype;return t.getOutline=function(){var e=this._getPainter();if(!e)return null;var o=this.getExtent();return new r(o.toArray(),{symbol:{lineWidth:1,lineColor:"6b707b"}})},t.setCoordinates=function(e){if(!e)return this._coordinates=null,this._holes=null,this._projectRings(),this;var o=$.toCoordinates(e),s=o.length;if(!Array.isArray(o[0]))this._coordinates=this._trimRing(o);else if(this._coordinates=this._trimRing(o[0]),s>1){for(var a=[],l=1;l<s;l++)o[l]&&a.push(this._trimRing(o[l]));this._holes=a}else this._holes=null;return this._projectRings(),this},t.getCoordinates=function(){if(!this._coordinates)return[];for(var e=this.getHoles(),o=[this._copyAndCloseRing(this._coordinates)],s=0,a=e.length;s<a;s++)o.push(this._copyAndCloseRing(e[s]));return o},t.getCenterInExtent=function(e){return this._getCenterInExtent(e,this.getShell(),ml)},t.getShell=function(){return this._coordinates||[]},t.getHoles=function(){return this._holes||[]},t.hasHoles=function(){return this.getHoles().length>0},t._projectRings=function(){if(!this.getMap()){this.onShapeChanged();return}this._prjCoords=this._projectCoords(this._coordinates),this._prjHoles=this._projectCoords(this._holes),this.onShapeChanged()},t._setPrjCoordinates=function(e){this._prjCoords=e,this.onShapeChanged()},t._cleanRing=function(e){for(var o=e.length-1;o>=0;o--)e[o]||e.splice(o,1)},t._checkRing=function(e){if(this._cleanRing(e),!e||!$e(e))return!1;var o=e[e.length-1],s=!0;return(e[0].x!==o.x||e[0].y!==o.y)&&(s=!1),s},t._trimRing=function(e){var o=this._checkRing(e);return $e(e)&&o&&e.splice(e.length-1,1),e},t._copyAndCloseRing=function(e){e=e.slice(0);var o=this._checkRing(e);return $e(e)&&!o&&e.push(e[0].copy()),e},t._getPrjShell=function(){return this.getJSONType()===z0?this._getPrjCoordinates():(this._verifyProjection(),this._getProjection()&&!this._prjShell&&(this._prjShell=this._projectCoords(this._getShell?this._getShell():this.getShell())),this._prjShell)},t._getPrjHoles=function(){var e=this._getProjection();return this._verifyProjection(),e&&!this._prjHoles&&(this._prjHoles=this._projectCoords(this.getHoles())),this._prjHoles},t._computeGeodesicLength=function(e){var o=this.getCoordinates();if(!$e(o))return 0;for(var s=0,a=0,l=o.length;a<l;a++)s+=e.measureLength(o[a]);return s},t._computeGeodesicArea=function(e){var o=this.getCoordinates();if(!$e(o))return 0;for(var s=e.measureArea(o[0]),a=1,l=o.length;a<l;a++)s-=e.measureArea(o[a]);return s},t._updateCache=function(){n.prototype._updateCache.call(this),this._prjHoles&&(this._holes=this._unprojectCoords(this._getPrjHoles()))},t._clearCache=function(){return delete this._prjShell,n.prototype._clearCache.call(this)},t._clearProjection=function(){this._prjHoles&&(this._prjHoles=null),this._prjShell&&(this._prjShell=null),n.prototype._clearProjection.call(this)},r}(Zh);it.registerJSONType(z0);function vd(n){return function(r){function t(){return r.apply(this,arguments)||this}Q(t,r);var i=t.prototype;return i.getCoordinates=function(){return this._coordinates},i.setCoordinates=function(o){var s=o instanceof $?o:new $(o);if(this._translateRotatePivot(s),this._coordinates=s,!this.getMap())return this._dirtyCoords=!0,this.onPositionChanged(),this;var a=this._getProjection();return this._setPrjCoordinates(a.project(this._coordinates)),this},i._getCenter2DPoint=function(o){var s=this.getMap();if(!s)return null;var a=this._getPrjCoordinates();return a?(o||(o=s._getResolution()),s._prjToPointAtRes(a,o)):null},i._getPrjCoordinates=function(){var o=this._getProjection();return this._verifyProjection(),!this._pcenter&&o&&this._coordinates&&(this._pcenter=o.project(this._coordinates)),this._pcenter},i._setPrjCoordinates=function(o){this._pcenter=o,this.onPositionChanged()},i._updateCache=function(){this._clearCache();var o=this._getProjection();this._pcenter&&o&&(this._coordinates=o.unproject(this._pcenter))},i._clearProjection=function(){this._pcenter=null,r.prototype._clearProjection.call(this)},i._computeCenter=function(){return this._coordinates?this._coordinates.copy():null},t}(n)}var Lv=new Le,bE={symbol:{markerType:"path",markerPath:[{path:"M8 23l0 0 0 0 0 0 0 0 0 0c-4,-5 -8,-10 -8,-14 0,-5 4,-9 8,-9l0 0 0 0c4,0 8,4 8,9 0,4 -4,9 -8,14z M3,9 a5,5 0,1,0,0,-0.9Z",fill:"#DE3333"}],markerPathWidth:16,markerPathHeight:23,markerWidth:24,markerHeight:34},hitTestForEvent:!1,collision:!0},et=function(n){function r(i,e){var o;return o=n.call(this,e)||this,o.isPoint=!0,o.type="Point",i&&o.setCoordinates(i),o}Q(r,n);var t=r.prototype;return t.getOutline=function(){var e=this.getCoordinates(),o=this.getContainerExtent(),s=this.getMap().coordToContainerPoint(e);return new r(e,{symbol:{markerType:"square",markerWidth:o.getWidth(),markerHeight:o.getHeight(),markerLineWidth:1,markerLineColor:"6b707b",markerFill:"rgba(0, 0, 0, 0)",markerDx:o.xmin-(s.x-o.getWidth()/2),markerDy:o.ymin-(s.y-o.getHeight()/2)}})},t.setSymbol=function(e){return delete this._fixedExtent,n.prototype.setSymbol.call(this,e)},t._getSizeSymbol=function(e){for(var o={},s=!1,a=!1,l=0;l<Uu.length;l++){var h=e[Uu[l]];O(h)||(!s&&rt(h)&&(s=!0,a=!0),o[Uu[l]]=h)}for(var u=0;u<Ju.length;u++){var c=e[Ju[u]];O(c)||(!s&&rt(c)&&(s=!0),o[Ju[u]]=c)}var f;return s?(f=ea(o,this),a&&(f._dynamic=!0)):f=o,f},t._setExternSymbol=function(e){return this._symbol||delete this._fixedExtent,n.prototype._setExternSymbol.call(this,e)},t._isDynamicSize=function(){return this._sizeSymbol&&this._sizeSymbol._dynamic},t._getFixedExtent=function(){if(this._fixedExtent&&!this._isDynamicSize())return this._fixedExtent;this._fixedExtent=this._fixedExtent||new Le,this._fixedExtent.set(null,null,null,null);var e=this._sizeSymbol;if(!e)return this._fixedExtent;var o=this.getLayer()&&this.getLayer().getRenderer(),s=o&&o.resources,a=this.getTextDesc();if(Array.isArray(e)){Lv.set(1/0,1/0,-1/0,-1/0);for(var l=0;l<e.length;l++)e[l]&&this._fixedExtent._combine(af(Lv,e[l],s,a&&a[l]))}else this._fixedExtent=af(this._fixedExtent,e,s,a);return this._fixedExtent},t._isVectorMarker=function(){var e=this._getInternalSymbol();return Array.isArray(e)?!1:Yl(e)},t._canEdit=function(){var e=this._getInternalSymbol();return Array.isArray(e)?!1:Yl(e)||cd(e)||ud(e)},t._containsPoint=function(e,o){var s=this.getContainerExtent();return o&&(s=s.expand(o)),s.contains(e)?this.options.hitTestForEvent?n.prototype._containsPoint.call(this,e,o):!0:!1},t._computeExtent=function(){return Iv.call(this,"getCenter")},t._computePrjExtent=function(){return Iv.call(this,"_getPrjCoordinates")},t._computeGeodesicLength=function(){return 0},t._computeGeodesicArea=function(){return 0},t._getSprite=function(e,o){return this._getPainter()?this._getPainter().getSprite(e,o):new pd(this).getSprite(e,o)},r}(vd(je));et.mergeOptions(bE);et.registerJSONType("Marker");function Iv(n){var r=this[n]();return r?new Je(r,r,this._getProjection()):null}var ME={arrowStyle:null,arrowPlacement:"vertex-last"},pt=function(n){function r(i,e){var o;return o=n.call(this,e)||this,o.type="LineString",i&&o.setCoordinates(i),o}Q(r,n);var t=r.prototype;return t.getOutline=function(){return it.prototype.getOutline.call(this)},t.setCoordinates=function(e){return e?(this._coordinates=$.toCoordinates(e),this.getMap()?this._setPrjCoordinates(this._projectCoords(this._coordinates)):this.onShapeChanged(),this):(this._coordinates=null,this._setPrjCoordinates(null),this)},t.getCoordinates=function(){return this._coordinates||[]},t.getCenterInExtent=function(e){return this._getCenterInExtent(e,this.getCoordinates(),Es)},t._computeGeodesicLength=function(e){return e.measureLength(this.getCoordinates())},t._computeGeodesicArea=function(){return 0},r}(Zh);pt.mergeOptions(ME);pt.registerJSONType("LineString");var PE=new Le,aa=function(n){function r(i,e){var o;return o=n.call(this,e)||this,o.type="GeometryCollection",o._lastUndoEditIndex=0,o._lastRedoEditIndex=0,o.setGeometries(i),o}Q(r,n);var t=r.prototype;return t.getContainerExtent=function(e){var o=e||new Le;return this.forEach(function(s){o._combine(s.getContainerExtent(PE))}),o},t.setGeometries=function(e){for(var o=this._checkGeometries(e||[]),s=this._getSymbol(),a=this.config(),l=this.getProperties(),h=o.length-1;h>=0;h--)o[h]._initOptions(a),o[h]._setParent(this),o[h]._setEventParent(this),s&&o[h].setSymbol(s),l&&o[h].setProperties(l);return this._geometries=o,this.getLayer()&&(this._bindGeometriesToLayer(),this.onShapeChanged()),this},t.getGeometries=function(){return this._geometries||[]},t.forEach=function(e,o){for(var s=this.getGeometries(),a=0,l=s.length;a<l;a++)s[a]&&(o?e.call(o,s[a],a):e(s[a],a));return this},t.filter=function(e,o){if(!e)return new r;var s=[],a=Oe(e),l=a?e:zh(e);return this.forEach(function(h){var u=a?h:jl(h);(o?l.call(o,u):l(u))&&s.push(h)},this),new r(s)},t.translate=function(e){if(!e)return this;if(this.isEmpty())return this;var o=arguments;return this.forEach(function(s){s&&s.translate&&s.translate.apply(s,o)}),this},t.isEmpty=function(){return!$e(this.getGeometries())},t.remove=function(){return this.forEach(function(e){e._unbind()}),je.prototype.remove.apply(this,arguments)},t.show=function(){return this.options.visible=!0,this.forEach(function(e){e.show()}),this},t.hide=function(){return this.options.visible=!1,this.forEach(function(e){e.hide()}),this},t.onConfig=function(e){this.forEach(function(o){o.config(e)})},t.getSymbol=function(){var e=n.prototype.getSymbol.call(this);if(!e){var o=[],s=!1;this.forEach(function(a){var l=a.getSymbol();l&&!s&&(s=!0),o.push(a.getSymbol())}),s&&(e={children:o})}return e},t.setSymbol=function(e){var o=this;if(e&&e.children)this._symbol=null,this.forEach(function(a,l){a._eventSymbolProperties=o._eventSymbolProperties,a.setSymbol(e.children[l])});else{var s=this._prepareSymbol(e);this._symbol=s,this.forEach(function(a){a._eventSymbolProperties=o._eventSymbolProperties,a.setSymbol(s)})}return this.onSymbolChanged(),this},t._setExternSymbol=function(e){return e=this._prepareSymbol(e),this._externSymbol=e,this.forEach(function(o){o._setExternSymbol(e)}),this.onSymbolChanged(),this},t._bindLayer=function(){n.prototype._bindLayer.apply(this,arguments),this._bindGeometriesToLayer()},t._bindGeometriesToLayer=function(){var e=this.getLayer();this.forEach(function(o){o._bindLayer(e)})},t._checkGeometries=function(e){var o="The geometry added to collection is invalid.";e=Array.isArray(e)?e:[e];for(var s=[],a=0,l=e.length;a<l;a++){var h=e[a];if(h){if(!this._checkGeo(h)){console.error(o+" Index: "+a);continue}if(EE(h)){wr.isTest||console.error(h," is GeometryCollection sub class,it Cannot be placed in GeometryCollection");continue}s.push(h)}}return s},t._checkGeo=function(e){return e instanceof je},t._updateCache=function(){this._clearCache(),!this.isEmpty()&&this.forEach(function(e){e&&e._updateCache&&e._updateCache()})},t._removePainter=function(){this._painter&&this._painter.remove(),delete this._painter,this.forEach(function(e){e._removePainter()})},t._computeCenter=function(e){if(!e||this.isEmpty())return null;for(var o=0,s=0,a=0,l=this.getGeometries(),h=0,u=l.length;h<u;h++)if(l[h]){var c=l[h]._computeCenter(e);c&&(o+=c.x,s+=c.y,a++)}return a===0?null:new $(o/a,s/a)},t._containsPoint=function(e,o){if(this.isEmpty())return!1;delete this._pickGeometryIndex;for(var s=this.getGeometries(),a=0,l=s.length;a<l;a++)if(s[a]._containsPoint(e,o))return this._pickGeometryIndex=a,!0;return!1},t._hitTestTolerance=function(){for(var e=this.getGeometries(),o=0,s=0,a=e.length;s<a;s++){var l=e[s]._hitTestTolerance();o=Math.max(o,l)}return o},t._computeExtent=function(e){return Dv.call(this,e,"_computeExtent")},t._computePrjExtent=function(e){return Dv.call(this,e,"_computePrjExtent")},t._computeGeodesicLength=function(e){if(!e||this.isEmpty())return 0;for(var o=this.getGeometries(),s=0,a=0,l=o.length;a<l;a++)o[a]&&(s+=o[a]._computeGeodesicLength(e));return s},t._computeGeodesicArea=function(e){if(!e||this.isEmpty())return 0;for(var o=this.getGeometries(),s=0,a=0,l=o.length;a<l;a++)o[a]&&(s+=o[a]._computeGeodesicArea(e));return s},t._exportGeoJSONGeometry=function(){var e=[];if(!this.isEmpty())for(var o=this.getGeometries(),s=0,a=o.length;s<a;s++)o[s]&&e.push(o[s]._exportGeoJSONGeometry());return{type:"GeometryCollection",geometries:e}},t._toJSON=function(e){e=oe({},e);var o={type:"Feature",geometry:{type:"GeometryCollection",geometries:this.getGeometries().filter(function(l){return l&&l._toJSON}).map(function(l){var h=l._toJSON();return h.subType?h:l._exportGeoJSONGeometry()})}},s=this.getId();O(s)||(o.id=s);var a;return(O(e.properties)||e.properties)&&(a=this._exportProperties()),o.properties=a,e.feature=o,e},t._clearProjection=function(){if(!this.isEmpty())for(var e=this.getGeometries(),o=0,s=e.length;o<s;o++)e[o]&&e[o]._clearProjection()},t._getConnectPoints=function(){var e=this.getExtent(),o=[new $(e.xmin,e.ymax),new $(e.xmax,e.ymin),new $(e.xmin,e.ymin),new $(e.xmax,e.ymax)];return o},t._getExternalResources=function(){if(this.isEmpty())return[];for(var e=this.getGeometries(),o=[],s={},a,l,h,u=0,c=e.length;u<c;u++)if(e[u]){a=e[u]._getInternalSymbol(),l=ba(a);for(var f=0,d=l.length;f<d;f++)h=l[f].join(),s[h]||(o.push(l[f]),s[h]=1)}return o},t.startEdit=function(e){var o=this;if(this.isEmpty())return this;e||(e={}),e.symbol&&(this._originalSymbol=this.getSymbol(),this.setSymbol(e.symbol)),this._draggbleBeforeEdit=this.options.draggable,this.config("draggable",!1),this._recordVisible();for(var s=this.getGeometries(),a=0,l=s.length;a<l;a++)s[a].startEdit(e);this._editing=!0;var h=this.getLayer(),u=h&&h.options.renderer==="canvas";return u&&this.hide(),setTimeout(function(){o.fire("editstart")},1),this},t.endEdit=function(){if(this.isEmpty())return this;this._recoveryVisible();for(var e=this.getGeometries(),o=0,s=e.length;o<s;o++)e[o].endEdit();return this._originalSymbol&&(this.setSymbol(this._originalSymbol),delete this._originalSymbol),this._editing=!1,this.show(),this.config("draggable",this._draggbleBeforeEdit),this.fire("editend"),this},t.isEditing=function(){return!!this._editing},t.undoEdit=function(){if(this.isEmpty())return this;this._recoveryVisible();for(var e=this.getGeometries(),o=this._lastUndoEditIndex;o<e.length;o++)if(!e[o].undoEditcheck()){e[o].undoEdit(),this._lastUndoEditIndex=o;break}return o===e.length&&(this._lastUndoEditIndex=0),this.fire("undoedit"),this},t.redoEdit=function(){if(this.isEmpty())return this;this._recoveryVisible();for(var e=this.getGeometries(),o=this._lastRedoEditIndex;o<e.length;o++)if(!e[o].redoEditcheck()){e[o].redoEdit(),this._lastRedoEditIndex=o;break}return o===e.length&&(this._lastRedoEditIndex=0),this.fire("redoedit"),this},t.undoEditcheck=function(){for(var e=this.getGeometries(),o=0;o<e.length;o++)if(!e[o].undoEditcheck())return!1;return!0},t.redoEditcheck=function(){for(var e=this.getGeometries(),o=0;o<e.length;o++)if(!e[o].redoEditcheck())return!1;return!0},r}(je);aa.registerJSONType("GeometryCollection");function Dv(n,r){if(this.isEmpty())return null;for(var t=new Je,i=this.getGeometries(),e=0,o=i.length;e<o;e++)if(i[e]){var s=i[e][r](n);s&&t._combine(s)}return t}function EE(n){return n instanceof aa}var B0=function(n){function r(i,e,o,s){var a;return a=n.call(this,null,s)||this,a.GeometryType=i,a.type=e,a._initData(o),a}Q(r,n);var t=r.prototype;return t.getCoordinates=function(){for(var e=[],o=this.getGeometries(),s=0,a=o.length;s<a;s++){var l=o[s];e.push(l.getShell&&l.getJSONType()!=="Polygon"?[l.getShell()]:l.getCoordinates())}return e},t.setCoordinates=function(e){e=e||[];for(var o=[],s=0,a=e.length;s<a;s++){var l=new this.GeometryType(e[s],this.config());o.push(l)}return this.setGeometries(o),this},t._initData=function(e){e=e||[],e.length&&(e[0]instanceof this.GeometryType?this.setGeometries(e):this.setCoordinates(e))},t._checkGeo=function(e){return e instanceof this.GeometryType},t._exportGeoJSONGeometry=function(){var e=this.getCoordinates(),o=$.toNumberArrays(e);return{type:this.getType(),coordinates:o}},t._toJSON=function(e){return{feature:this.toGeoJSON(e)}},r}(aa),Po=function(n){function r(i,e){return n.call(this,et,"MultiPoint",i,e)||this}Q(r,n);var t=r.prototype;return t.findClosest=function(e){if(!e)return null;var o=this.getCoordinates(),s=null,a=1/0;return o.forEach(function(l){var h=SE(l,e);h<a&&(s=l,a=h)}),s},r}(B0);Po.registerJSONType("MultiPoint");function SE(n,r){var t=r.x-n.x,i=r.y-n.y;return Math.sqrt(t*t+i*i)}var G0=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.getCenterInExtent=function(e){var o=this.getGeometries(),[s,a,l]=[0,0,0];return o.forEach(function(h){var u=h.getCenterInExtent(e);u&&(s+=u.x*u.count,a+=u.y*u.count,l+=u.count)}),l===0?null:new $(s,a)._multi(1/l)},r}(B0),Eo=function(n){function r(t,i){return n.call(this,pt,"MultiLineString",t,i)||this}return Q(r,n),r}(G0);Eo.registerJSONType("MultiLineString");var ql=function(n){function r(t,i){return n.call(this,it,"MultiPolygon",t,i)||this}return Q(r,n),r}(G0);ql.registerJSONType("MultiPolygon");var OE={Marker:et,LineString:pt,Polygon:it,MultiPoint:Po,MultiLineString:Eo,MultiPolygon:ql},F0="geojson-fetch-worker-page-async",kE=`
|
|
216
|
-
function (exports) {
|
|
217
|
-
const resultMap = {};
|
|
218
|
-
|
|
219
|
-
function handleResult(msg, postResponse) {
|
|
220
|
-
const data = msg.data || {};
|
|
221
|
-
const { taskId } = data;
|
|
222
|
-
const features = resultMap[taskId];
|
|
223
|
-
if (!features) {
|
|
224
|
-
postResponse('not find geojson dataset the taskId:' + taskId);
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
if (features.length === 0) {
|
|
228
|
-
delete resultMap[taskId];
|
|
229
|
-
postResponse(null, []);
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
const pageSize = data.pageSize || 2000;
|
|
233
|
-
const pageFeatures = features.slice(0, pageSize);
|
|
234
|
-
resultMap[taskId] = features.slice(pageSize, Infinity);
|
|
235
|
-
postResponse(null, pageFeatures);
|
|
236
|
-
}
|
|
237
|
-
//worker init
|
|
238
|
-
exports.initialize = function () {
|
|
239
|
-
// console.log("geojson fetch init");
|
|
240
|
-
};
|
|
241
|
-
//recive message
|
|
242
|
-
exports.onmessage = function (msg, postResponse) {
|
|
243
|
-
const { taskId, type, url } = msg.data || {};
|
|
244
|
-
if (!taskId) {
|
|
245
|
-
postResponse('not find task id for get geojson dataset,taskId=' + taskId);
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
if (type === 'fetchdata') {
|
|
249
|
-
if (!url) {
|
|
250
|
-
postResponse('url is null,url=' + url);
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
fetch(url).then(res => res.json()).then(geojson => {
|
|
254
|
-
let features;
|
|
255
|
-
if (Array.isArray(geojson)) {
|
|
256
|
-
features = geojson;
|
|
257
|
-
} else if (geojson.features) {
|
|
258
|
-
features = geojson.features;
|
|
259
|
-
} else {
|
|
260
|
-
features = [geojson];
|
|
261
|
-
}
|
|
262
|
-
resultMap[taskId] = features;
|
|
263
|
-
handleResult(msg, postResponse);
|
|
264
|
-
}).catch(errror => {
|
|
265
|
-
postResponse(errror.message);
|
|
266
|
-
});
|
|
267
|
-
} else if (type === 'pagefeatures') {
|
|
268
|
-
handleResult(msg, postResponse);
|
|
269
|
-
} else {
|
|
270
|
-
postResponse('not support task type:' + type);
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
}`,RE=function(n){function r(){return n.call(this,F0)||this}Q(r,n);var t=r.prototype;return t._sendMsg=function(e,o,s){var a=this;this.send(e,[],function(l,h){l?s(l):a._pageFeatures(e,h,o,s)},e.workerId)},t._fetchGeoJSON=function(e,o,s=[],a){var l=oe({},o);l.type="fetchdata",l.url=e,this._sendMsg(l,s,a)},t._pageFeatures=function(e,o,s,a){if(s.push(o),o.length===0){a(null,s);return}var l=oe({},e);l.type="pagefeatures",this._sendMsg(l,s,a)},r}(Hh);rd(F0,function(){return kE});var rl,Or={toGeometry:function(r,t,i){Ee(r)&&(r=Js(r));var e;if(Array.isArray(r)){e=[];for(var o=0,s=r.length;o<s;o++){var a=Or._convert(r[o],t);Array.isArray(a)?Yt(e,a):e.push(a)}}else e=Or._convert(r,t);return i&&Oe(i)&&Array.isArray(e)?e.filter(i):e},toGeometryAsync:function(r,t,i,e){return Ee(r)&&(r=Js(r)),new Promise(function(o){var s=[];if(r&&(Array.isArray(r)||Array.isArray(r.features))){var a=X(i)?Math.round(i):2e3,l=r.features||r,h=Math.ceil(l.length/a),u=1,c=function(){var g=(u-1)*a,p=u*a,m=l.slice(g,p),v=Or.toGeometry(m,t,e);return u++,v};aM({count:h,run:c}).then(function(d){for(var g=0,p=d.length;g<p;g++){var m=d[g];m&&(Array.isArray(m)?Yt(s,m):s.push(m))}o(s)})}else{var f=Or.toGeometry(r,t);o(f)}})},_convert:function(r,t){if(!r||O(r.type))return null;var i=r.type;if(i==="Feature"){var e=r.geometry,o=Or._convert(e);return o?(o.setId(r.id),o.setProperties(r.properties),t&&t(o),o):null}else if(i==="FeatureCollection"){var s=r.features;return s?Or.toGeometry(s,t):null}else if(["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"].indexOf(i)>=0){var a=i==="Point"?"Marker":i,l=new OE[a](r.coordinates);return t&&t(l),l}else if(i==="GeometryCollection"){var h=r.geometries;if(!$e(h)){var u=new aa;return t&&t(u),u}for(var c=[],f=h.length,d=0;d<f;d++)h[d].subType?c.push(je.getJSONClass(h[d].subType).fromJSON(h[d])):c.push(Or._convert(h[d]));var g=new aa(c);return t&&t(g),g}return null},_isGeoJSON:function(r){if(!r)return!1;if(r=r||{},Array.isArray(r)&&r.length)return Or.isGeoJSON(r[0]);var t=r.type;if(!t||jf.indexOf(t)===-1)return!1;var{features:i,geometries:e,geometry:o,coordinates:s}=r;if(s&&Array.isArray(s)||Array.isArray(e)||Array.isArray(i))return!0;if(o){var a=o.coordinates;if(a&&Array.isArray(a))return!0}return!1},fetch:function(r,t=2e3){return new Promise(function(i,e){if(!r||!Ee(r)){e("url is error,It should be string");return}var o=oe({pageSize:2e3},{pageSize:t});r=Ph(r),rl||(rl=new RE);var s=rl.workers.length,a=Math.floor(Math.random()*s);a=Math.min(s-1,a),o.workerId=a,o.taskId=ty(),rl._fetchGeoJSON(r,o,[],function(l,h){if(l){e(l);return}var u=[];h.forEach(function(c){for(var f=0,d=c.length;f<d;f++)u.push(c[f])}),i({type:"FeatureCollection",features:u})})})}},AE={numberOfShellPoints:60},zr=function(n){function r(i,e,o){var s;return s=n.call(this,null,o)||this,i&&s.setCoordinates(i),s._radius=e,s}Q(r,n),r.fromJSON=function(e){var o=e.feature,s=new r(e.coordinates,e.radius,e.options);return s.setProperties(o.properties),s};var t=r.prototype;return t.getRadius=function(){return this._radius},t.setRadius=function(e){return this._radius=e,this.onShapeChanged(),this},t.getShell=function(){for(var e=this._getMeasurer(),o=this.getCoordinates(),s=this.options.numberOfShellPoints,a=this.getRadius(),l=[],h,u,c,f=0,d=s-1;f<d;f++){h=360*f/d*Math.PI/180,u=a*Math.cos(h),c=a*Math.sin(h);var g=e.locate(o,u,c);g.z=o.z,l.push(g)}return l.push(l[0]),l},t.getHoles=function(){return[]},t.animateShow=function(){return this.show()},t._containsPoint=function(e,o){var s=this.getMap(),a=dt[s.id],l=a?a.pitch:s.getPitch();if(l)return n.prototype._containsPoint.call(this,e,o);var h=s._pointToContainerPoint(this._getCenter2DPoint()),u=this.getSize(),c=this._hitTestTolerance()+(o||0),f=h.add(u.width/2,u.height/2);return p0(e,h,f,c)},t._computePrjExtent=function(e){var o=this._getMinMax(e);if(!o)return null;var s=this._getPrjCoordinates(),a=o.map(function(f){return e.project(f)}),l=a[0].x-s.x,h=a[1].x-s.x,u=a[2].y-s.y,c=a[3].y-s.y;return new Je(s.add(l,u),s.add(h,c))},t._computeExtent=function(e){var o=this._getMinMax(e);return o?new Je(o[0].x,o[2].y,o[1].x,o[3].y,this._getProjection()):null},t._getMinMax=function(e){if(!e||!this._coordinates||O(this._radius))return null;var o=this._radius,s=e.locate(this._coordinates,-o,0),a=e.locate(this._coordinates,o,0),l=e.locate(this._coordinates,0,o),h=e.locate(this._coordinates,0,-o);return[s,a,l,h]},t._computeGeodesicLength=function(){return O(this._radius)?0:Math.PI*2*this._radius},t._computeGeodesicArea=function(){return O(this._radius)?0:Math.PI*Math.pow(this._radius,2)},t._exportGeoJSONGeometry=function(){var e=$.toNumberArrays([this.getShell()]);return{type:"Polygon",coordinates:e}},t._toJSON=function(e){var o=this.getCenter(),s=oe({},e);s.geometry=!1;var a=this.toGeoJSON(s);return a.geometry={type:"Polygon"},{feature:a,subType:"Circle",coordinates:o.toArray(),radius:this.getRadius()}},r}(vd(it));zr.mergeOptions(AE);zr.registerJSONType("Circle");function LE(n){return n*n*n*n}function IE(n){for(var r=[],t=[],i=0;i<n;i++)t.push(LE(i/n));var e=t.map(function(h){return h}).reverse(),o=[];Yt(o,t,e,t,e);for(var s=0,a=0,l=o.length;a<l;a+=4)r.push(o[a]),s+=o[a];return{fs:r,sum:s}}var DE={numberOfShellPoints:81},Di=function(n){function r(i,e,o,s){var a;return a=n.call(this,null,s)||this,i&&a.setCoordinates(i),a.width=e,a.height=o,a}Q(r,n),r.fromJSON=function(e){var o=e.feature,s=new r(e.coordinates,e.width,e.height,e.options);return s.setProperties(o.properties),s};var t=r.prototype;return t.getWidth=function(){return this.width},t.setWidth=function(e){return this.width=e,this.onShapeChanged(),this},t.getHeight=function(){return this.height},t.setHeight=function(e){return this.height=e,this.onShapeChanged(),this},t.getShell=function(){return this.isRotated()?this.getRotatedShell():this._getShell()},t._getShell=function(){var e=this._getMeasurer(),o=this.getCoordinates(),s=this.options.numberOfShellPoints-1,a=this.getWidth(),l=this.getHeight(),h=[],u=Math.pow(a/2,2)*Math.pow(l/2,2),c=Math.pow(a/2,2),f=Math.pow(l/2,2),d=[];if(Math.max(a/l,l/a)>2){var{fs:g,sum:p}=IE(s),m=360/p,v=0;l>a&&(v=90);for(var _=0,y=0,w=g.length;y<w;y++)_+=m*g[y],d.push(_+v)}else for(var x=0;x<s;x++){var C=360*x/s;d.push(C)}this.options.debug&&console.log(d);for(var b,E,T,S,B=0;B<d.length;B++){b=d[B],E=b*Math.PI/180,T=Math.sqrt(u/(c*Math.pow(Math.tan(E),2)+f)),S=Math.sqrt(u/(f*Math.pow(1/Math.tan(E),2)+c)),b>90&&b<270&&(T*=-1),b>180&&b<360&&(S*=-1);var L=e.locate(o,T,S);L.z=o.z,h.push(L)}return h.push(h[0].copy()),h},t._getPrjShell=function(){var e=n.prototype._getPrjShell.call(this);return this._rotatePrjCoordinates(e)},t.getHoles=function(){return[]},t.animateShow=function(){return this.show()},t._containsPoint=function(e,o){var s=this.getMap();if(s.isTransforming())return n.prototype._containsPoint.call(this,e,o);var a=s.getProjection(),l=this._hitTestTolerance()+(o||0),h=a.projectCoords([this._coordinates,s.locate(this._coordinates,this.getWidth()/2,this.getHeight()/2)],this.options.antiMeridian),u=s.prjToContainerPoint(h[0]),c=s.prjToContainerPoint(h[1]);return p0(e,u,c,l)},t._computePrjExtent=function(){return this.isRotated()?this._computeRotatedPrjExtent():zr.prototype._computePrjExtent.apply(this,arguments)},t._computeExtent=function(){return zr.prototype._computeExtent.apply(this,arguments)},t._getMinMax=function(e){if(!e||!this._coordinates||O(this.width)||O(this.height))return null;var o=this.getWidth(),s=this.getHeight(),a=e.locate(this._coordinates,-o/2,0),l=e.locate(this._coordinates,o/2,0),h=e.locate(this._coordinates,0,-s/2),u=e.locate(this._coordinates,0,s/2);return[a,l,h,u]},t._computeGeodesicLength=function(){if(O(this.width)||O(this.height))return 0;var e=this.width>this.height?this.width:this.height;return 2*Math.PI*e/2-4*Math.abs(this.width-this.height)},t._computeGeodesicArea=function(){return O(this.width)||O(this.height)?0:Math.PI*this.width*this.height/4},t._exportGeoJSONGeometry=function(){var e=$.toNumberArrays([this.getShell()]);return{type:"Polygon",coordinates:e}},t._toJSON=function(e){var o=oe({},e),s=this.getCenter();o.geometry=!1;var a=this.toGeoJSON(o);return a.geometry={type:"Polygon"},{feature:a,subType:"Ellipse",coordinates:s.toArray(),width:this.getWidth(),height:this.getHeight()}},r}(vd(it));Di.mergeOptions(DE);Di.registerJSONType("Ellipse");var Sn=function(n){function r(i,e,o,s){var a;return a=n.call(this,null,s)||this,i&&a.setCoordinates(i),a._width=e,a._height=o,a}Q(r,n),r.fromJSON=function(e){var o=e.feature,s=new r(e.coordinates,e.width,e.height,e.options);return s.setProperties(o.properties),s};var t=r.prototype;return t.getCoordinates=function(){return this._coordinates},t.setCoordinates=function(e){var o=e instanceof $?e:new $(e);if(this._translateRotatePivot(o),this._coordinates=o,!this._coordinates||!this.getMap())return this.onPositionChanged(),this;var s=this._getProjection();return this._setPrjCoordinates(s.project(this._coordinates)),this},t.getWidth=function(){return this._width},t.setWidth=function(e){return this._width=e,this.onShapeChanged(),this},t.getHeight=function(){return this._height},t.setHeight=function(e){return this._height=e,this.onShapeChanged(),this},t.getShell=function(){return this.isRotated()?this.getRotatedShell():this._getShell()},t._getShell=function(){var e=this._getMeasurer(),o=this._coordinates,s=this.getMap(),a=1,l=-1;if(s){var h=s.getFullExtent();h.left>h.right&&(a=-1),h.bottom>h.top&&(l=1)}var u=[];u.push(o);var c=e.locate(o,a*this._width,0);c.z=o.z,u.push(c);var f=e.locate(o,a*this._width,l*this._height);f.z=o.z,u.push(f);var d=e.locate(o,0,l*this._height);return u.push(d),d.z=o.z,u.push(o),u},t.getHoles=function(){return[]},t.animateShow=function(){return this.show()},t._getPrjCoordinates=function(){var e=this._getProjection();return this._verifyProjection(),!this._pnw&&e&&this._coordinates&&(this._pnw=e.project(this._coordinates)),this._pnw},t._setPrjCoordinates=function(e){this._pnw=e,this.onPositionChanged()},t._getPrjShell=function(){var e=n.prototype._getPrjShell.call(this),o=this._getProjection();if(!o.isSphere())return this._rotatePrjCoordinates(e);for(var s=o.getSphereExtent(),a=s.sx,l=s.sy,h=this._getProjection().getCircum(),u=e[0],c=1,f=e.length;c<f;c++){var d=e[c],g=0,p=0;a*(u.x-d.x)>0&&(g=h.x*a),l*(u.y-d.y)<0&&(p=h.y*l),e[c]._add(g,p)}return this._rotatePrjCoordinates(e)},t._updateCache=function(){this._clearCache();var e=this._getProjection();this._pnw&&e&&(this._coordinates=e.unproject(this._pnw))},t._clearProjection=function(){this._pnw=null,n.prototype._clearProjection.call(this)},t._computeCenter=function(e){return e.locate(this._coordinates,this._width/2,-this._height/2)},t._containsPoint=function(e,o){var s=this.getMap();if(s.isTransforming())return n.prototype._containsPoint.call(this,e,o);var a=O(o)?this._hitTestTolerance():o,l=s._getResolution()*a,h=this._getPrjExtent().expand(l),u=s._containerPointToPrj(e);return h.contains(u)},t._computePrjExtent=function(e){if(this.isRotated())return this._computeRotatedPrjExtent();var o=this._getSouthEast(e);if(!o)return null;var s=e.projectCoords([new $(this._coordinates.x,o.y),new $(o.x,this._coordinates.y)],this.options.antiMeridian);return new Je(s[0],s[1])},t._computeExtent=function(e){var o=this._getSouthEast(e);return o?new Je(this._coordinates,o,this._getProjection()):null},t._getSouthEast=function(e){if(!e||!this._coordinates||O(this._width)||O(this._height))return null;var o=this.getWidth(),s=this.getHeight(),a=o,l=-s;if(e.fullExtent){var h=e.fullExtent,u=h.right>h.left?1:-1,c=h.top>h.bottom?1:-1;a*=u,l*=c}var f=e.locate(this._coordinates,a,0),d=e.locate(this._coordinates,0,l);return f.y=d.y,f},t._computeGeodesicLength=function(){return O(this._width)||O(this._height)?0:2*(this._width+this._height)},t._computeGeodesicArea=function(){return O(this._width)||O(this._height)?0:this._width*this._height},t._exportGeoJSONGeometry=function(){var e=$.toNumberArrays([this.getShell()]);return{type:"Polygon",coordinates:e}},t._toJSON=function(e){var o=oe({},e),s=this.getCoordinates();o.geometry=!1;var a=this.toGeoJSON(o);return a.geometry={type:"Polygon"},{feature:a,subType:"Rectangle",coordinates:s.toArray(),width:this.getWidth(),height:this.getHeight()}},r}(it);Sn.registerJSONType("Rectangle");var zE={numberOfShellPoints:60},No=function(n){function r(i,e,o,s,a){var l;return l=n.call(this,i,e,a)||this,l.startAngle=o,l.endAngle=s,l}Q(r,n),r.fromJSON=function(e){var o=e.feature,s=new r(e.coordinates,e.radius,e.startAngle,e.endAngle,e.options);return s.setProperties(o.properties),s};var t=r.prototype;return t.getStartAngle=function(){return this.startAngle},t.setStartAngle=function(e){return this.startAngle=e,this.onShapeChanged(),this},t.getEndAngle=function(){return this.endAngle},t.setEndAngle=function(e){return this.endAngle=e,this.onShapeChanged(),this},t._correctAngles=function(){var e=this.getStartAngle(),o=this.getEndAngle();if(o<e)return console.error("The ending angle should be greater than the starting angle ",e,o),[0,0];var s=360;return o-e>s?(console.error("The difference between the end angle and the start angle is greater than 360 degrees ",e,o),[0,0]):(e<0&&(e+=s,o+=s),[e,o])},t.getShell=function(){return this.isRotated()?this.getRotatedShell():this._getShell()},t._getShell=function(){for(var[e,o]=this._correctAngles(),s=this._getMeasurer(),a=this.getCoordinates(),l=this.options.numberOfShellPoints-2,h=this.getRadius(),u=[a.copy()],c=o-e,f,d,g,p=0;p<l;p++){f=(c*p/(l-1)+e)*Math.PI/180,d=h*Math.cos(f),g=h*Math.sin(f);var m=s.locate(a,d,g);m.z=a.z,u.push(m)}return u.push(a.copy()),u},t.getRotateOffsetAngle=function(){return 90},t._getPrjShell=function(){var e=n.prototype._getPrjShell.call(this);return this._rotatePrjCoordinates(e)},t._computePrjExtent=function(){return this.isRotated()?this._computeRotatedPrjExtent():zr.prototype._computePrjExtent.apply(this,arguments)},t._containsPoint=function(e,o){return je.prototype._containsPoint.call(this,e,o)},t._computeGeodesicLength=function(){if(O(this._radius))return 0;var[e,o]=this._correctAngles();return Math.PI*2*this._radius*Math.abs(e-o)/360+2*this._radius},t._computeGeodesicArea=function(){if(O(this._radius))return 0;var[e,o]=this._correctAngles();return Math.PI*Math.pow(this._radius,2)*Math.abs(e-o)/360},t._toJSON=function(e){var o=oe({},e),s=this.getCenter();o.geometry=!1;var a=this.toGeoJSON(o);return a.geometry={type:"Polygon"},{feature:a,subType:"Sector",coordinates:s.toArray(),radius:this.getRadius(),startAngle:this.getStartAngle(),endAngle:this.getEndAngle()}},r}(zr);No.mergeOptions(zE);No.registerJSONType("Sector");var BE={enableSimplify:!1,enableClip:!1},Oa=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t._arc=function(e,o,s){var a=this.options.arcDegree;a===0&&(a=1);for(var l=a*Math.PI/180,h=1,u=o.length;h<u;h++)J._arcBetween(e,o[h-1],o[h],l),J._stroke(e,s)},t._quadraticCurve=function(e,o){if(o.length<=2){J._path(e,o);return}var s,a;for(s=2,a=o.length;s<a;s+=2)e.quadraticCurveTo(o[s-1].x,o[s-1].y,o[s].x,o[s].y);if(s-=1,s<a)for(;s<a;s++)e.lineTo(o[s].x,o[s].y)},t._bezierCurve=function(e,o){if(o.length<=3){J._path(e,o);return}var s,a;for(s=1,a=o.length;s+2<a;s+=3)e.bezierCurveTo(o[s].x,o[s].y,o[s+1].x,o[s+1].y,o[s+2].x,o[s+2].y);if(s<a)for(;s<a;s++)e.lineTo(o[s].x,o[s].y)},t._getCurveArrowPoints=function(e,o,s,a,l,h){var u=o.length,c;for(c=h;c<u;c+=h){var f=this._getArrowShape(o[c-1],o[c],s,a,l);f&&e.push(f)}if(c-=h,c<u-1)for(c+=1;c<u;c++){var d=this._getArrowShape(o[c-1],o[c],s,a,l);d&&e.push(d)}},r}(pt);Oa.mergeOptions(BE);var GE={arcDegree:90},Vh=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t._toJSON=function(e){return{feature:this.toGeoJSON(e),subType:"ArcCurve"}},t._paintOn=function(e,o,s){e.beginPath(),this._arc(e,o,s),J._stroke(e,s),this._paintArrow(e,o,s)},r.fromJSON=function(e){var o=e.feature,s=new r(o.geometry.coordinates,e.options);return s.setProperties(o.properties),s},r}(Oa);Vh.registerJSONType("ArcCurve");Vh.mergeOptions(GE);var N0=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n),r.fromJSON=function(e){var o=e.feature,s=new r(o.geometry.coordinates,e.options);return s.setProperties(o.properties),s};var t=r.prototype;return t._toJSON=function(e){return{feature:this.toGeoJSON(e),subType:"CubicBezierCurve"}},t._paintOn=function(e,o,s){e.beginPath(),e.moveTo(o[0].x,o[0].y),this._bezierCurve(e,o),J._stroke(e,s),this._paintArrow(e,o,s)},t._getArrowPoints=function(e,o,s,a,l){return this._getCurveArrowPoints(e,o,s,a,l,3)},r}(Oa);N0.registerJSONType("CubicBezierCurve");var H0=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n),r.fromJSON=function(e){var o=e.feature,s=new r(o.geometry.coordinates,e.options);return s.setProperties(o.properties),s};var t=r.prototype;return t._toJSON=function(e){return{feature:this.toGeoJSON(e),subType:"QuadBezierCurve"}},t._paintOn=function(e,o,s){e.beginPath(),e.moveTo(o[0].x,o[0].y),this._quadraticCurve(e,o,s),J._stroke(e,s),this._paintArrow(e,o,s)},t._getArrowPoints=function(e,o,s,a,l){return this._getCurveArrowPoints(e,o,s,a,l,2)},r}(Oa);H0.registerJSONType("QuadBezierCurve");var FE={textFaceName:"monospace",textSize:12,textLineSpacing:8,textWrapCharacter:`
|
|
274
|
-
`,textHorizontalAlignment:"middle",textVerticalAlignment:"middle"},NE={markerType:"square",markerLineColor:"#000",markerLineWidth:2,markerLineOpacity:1,markerFill:"#fff",markerOpacity:1},md=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.getContent=function(){return this._content},t.setContent=function(e){var o=this._content;return this._content=Ca(e),this._refresh(),this._fireEvent("contentchange",{old:o,new:e}),this},t.onAdd=function(){this._refresh()},t.toJSON=function(){var e=n.prototype.toJSON.call(this);return delete e.symbol,e},t.setSymbol=function(e){if(this._refreshing||!e)return n.prototype.setSymbol.call(this,e);var o=this._parseSymbol(e);if(this.setTextStyle){var s=this.getTextStyle()||{};s.symbol=o[0],this.setTextStyle(s)}else this.setTextSymbol&&this.setTextSymbol(o[0]);if(this.setBoxStyle){var a=this.getBoxStyle()||{};a.symbol=o[1],this.setBoxStyle(a)}else this.setBoxSymbol&&this.setBoxSymbol(o[1]);return this},t._parseSymbol=function(e){var o={},s={};for(var a in e)Bo(e,a)&&(a.indexOf("text")===0?o[a]=e[a]:s[a]=e[a]);return[o,s]},t._getTextSize=function(e){return kh(this._content,e).size},t._getInternalSymbol=function(){return this._symbol},t._getDefaultTextSymbol=function(){return oe({},FE)},t._getDefaultBoxSymbol=function(){return oe({},NE)},t._getDefaultPadding=function(){return[12,8]},r}(et),HE={textStyle:{wrap:!0,padding:[12,8],verticalAlignment:"middle",horizontalAlignment:"middle"},boxSymbol:null},Kl=function(n){function r(i,e,o,s,a={}){var l;return l=n.call(this,e,a)||this,l._content=Ca(i),l._width=O(o)?100:o,l._height=O(s)?40:s,a.boxSymbol&&l.setBoxSymbol(a.boxSymbol),a.textStyle&&l.setTextStyle(a.textStyle),l._refresh(),l}Q(r,n);var t=r.prototype;return t.getWidth=function(){return this._width},t.setWidth=function(e){return this._width=e,this._refresh(),this},t.getHeight=function(){return this._height},t.setHeight=function(e){return this._height=e,this._refresh(),this},t.getBoxSymbol=function(){return oe({},this.options.boxSymbol)},t.setBoxSymbol=function(e){return this.options.boxSymbol=e&&oe({},e),this.getSymbol()&&this._refresh(),this},t.getTextStyle=function(){return this.options.textStyle?oe({},this.options.textStyle):null},t.setTextStyle=function(e){return this.options.textStyle=e&&oe({},e),this.getSymbol()&&this._refresh(),this},r.fromJSON=function(e){var o=e.feature,s=new r(e.content,o.geometry.coordinates,e.width,e.height,e.options);return s.setProperties(o.properties),s.setId(o.id),e.symbol&&s.setSymbol(e.symbol),s},t._toJSON=function(e){return{feature:this.toGeoJSON(e),width:this.getWidth(),height:this.getHeight(),subType:"TextBox",content:this._content}},t._refresh=function(){var e=this.getTextStyle()||{},o=e.padding||[12,8],s,a;if(rt(this._width)){s=JSON.parse(JSON.stringify(this._width));var l=s.stops;if(l)for(var h=0;h<l.length;h++)l[h][1]=l[h][1]-2*o[0]}else s=this._width-2*o[0];if(rt(this._height)){a=JSON.parse(JSON.stringify(this._height));var u=a.stops;if(u)for(var c=0;c<u.length;c++)u[c][1]=u[c][1]-2*o[1]}else a=this._height-2*o[1];var f=oe({},e.symbol||this._getDefaultTextSymbol(),this.options.boxSymbol||this._getDefaultBoxSymbol(),{textName:this._content,markerWidth:this._width,markerHeight:this._height,textHorizontalAlignment:"middle",textVerticalAlignment:"middle",textMaxWidth:s,textMaxHeight:a});e.wrap&&!f.textWrapWidth&&(f.textWrapWidth=s);var d=e.horizontalAlignment;f.textDx=f.markerDx||0;var g;if(rt(this._width)){g=JSON.parse(JSON.stringify(this._width));var p=g.stops;if(p)for(var m=0;m<p.length;m++)p[m][1]=p[m][1]/2-o[0],d==="left"&&(p[m][1]*=-1)}else g=f.markerWidth/2-o[0],d==="left"&&(g*=-1);d==="left"?(f.textHorizontalAlignment="right",f.textDx=g):d==="right"&&(f.textHorizontalAlignment="left",f.textDx=g);var v=e.verticalAlignment;f.textDy=f.markerDy||0;var _;if(rt(this._height)){_=JSON.parse(JSON.stringify(this._height));var y=_.stops;if(y)for(var w=0;w<y.length;w++)y[w][1]=y[w][1]/2-o[1],v==="top"&&(y[w][1]*=-1)}else _=f.markerHeight/2-o[1],v==="top"&&(_*=-1);v==="top"?(f.textVerticalAlignment="bottom",f.textDy=_):v==="bottom"&&(f.textVerticalAlignment="top",f.textDy=_),this._refreshing=!0,this.updateSymbol(f),delete this._refreshing},t.startEdit=function(e){var o=this._getCompiledSymbol();if(rt(this._width)){var s=o.markerWidth;this._oldWidth=this._width,this.setWidth(s)}if(rt(this._height)){var a=o.markerHeight;this._oldHeight=this._height,this.setHeight(a)}return n.prototype.startEdit.call(this,e)},t.endEdit=function(){var e=this.getMap(),o=e&&e.getZoom();if(this._oldWidth){for(var s=this._width,a=Qs(this._oldWidth),l=a(o),h=s/l,u=this._oldWidth.stops,c=0;c<u.length;c++)u[c][1]*=h;this.setWidth(this._oldWidth),delete this._oldWidth}if(this._oldHeight){for(var f=this._height,d=Qs(this._oldHeight),g=d(o),p=f/g,m=this._oldHeight.stops,v=0;v<m.length;v++)m[v][1]*=p;this.setHeight(this._oldHeight),delete this._oldHeight}return n.prototype.endEdit.call(this)},r}(md);Kl.mergeOptions(HE);Kl.registerJSONType("TextBox");var jE={boxStyle:null,textSymbol:null},To=function(n){function r(i,e,o={}){var s;return s=n.call(this,e,o)||this,s._content=Ca(i),o.textSymbol&&s.setTextSymbol(o.textSymbol),o.boxStyle&&s.setBoxStyle(o.boxStyle),s._refresh(),s}Q(r,n);var t=r.prototype;return t.getBoxStyle=function(){return this.options.boxStyle?oe({},this.options.boxStyle):null},t.setBoxStyle=function(e){return this.options.boxStyle=e&&oe({},e),this._refresh(),this},t.getTextSymbol=function(){return oe({},this._getDefaultTextSymbol(),this.options.textSymbol)},t.setTextSymbol=function(e){return this.options.textSymbol=e&&oe({},e),this._refresh(),this},r.fromJSON=function(e){var o=e.feature,s=new r(e.content,o.geometry.coordinates,e.options);return s.setProperties(o.properties),s.setId(o.id),e.symbol&&s.setSymbol(e.symbol),s},t._canEdit=function(){return!1},t._toJSON=function(e){return{feature:this.toGeoJSON(e),subType:"Label",content:this._content}},t._refresh=function(){var e=oe({},this.getTextSymbol(),{textName:this._content}),o=this.getBoxStyle();if(o){oe(e,o.symbol);var s=this._getBoxSize(e),a=s[1],l=o.padding||this._getDefaultPadding(),h=s[0];e.markerWidth=h.width,e.markerHeight=h.height;var u=e.textDx||0,c=e.textDy||0,f=li(a,e.textHorizontalAlignment,e.textVerticalAlignment)._add(u,c),d=o.horizontalAlignment||"middle";e.markerDx=f.x,d==="left"?e.markerDx+=e.markerWidth/2-l[0]:d==="right"?e.markerDx-=e.markerWidth/2-a.width-l[0]:e.markerDx+=a.width/2;var g=o.verticalAlignment||"middle";e.markerDy=f.y,g==="top"?e.markerDy+=e.markerHeight/2-l[1]:g==="bottom"?e.markerDy-=e.markerHeight/2-a.height-l[1]:e.markerDy+=a.height/2}this._refreshing=!0,this.updateSymbol(e),delete this._refreshing},t._getBoxSize=function(e){e.markerType||(e.markerType="square");var o=this.getBoxStyle(),s=this._getTextSize(e),a,l,h=o.padding||this._getDefaultPadding();return a=s.width+h[0]*2,l=s.height+h[1]*2,o.minWidth&&(!a||a<o.minWidth)&&(a=o.minWidth),o.minHeight&&(!l||l<o.minHeight)&&(l=o.minHeight),[new ft(a,l),s]},r}(md);To.mergeOptions(jE);To.registerJSONType("Label");var j0=function(r){return function(t){function i(...o){return t.call(this,...o)||this}Q(i,t),i._hasConnectors=function(s){return!O(s.__connectors)&&s.__connectors.length>0},i._getConnectors=function(s){return s.__connectors};var e=i.prototype;return e.getConnectSource=function(){return this._connSource},e.setConnectSource=function(s){var a=this._connTarget;return this.onRemove(),this._connSource=s,this._connTarget=a,this.onAdd(),this},e.getConnectTarget=function(){return this._connTarget},e.setConnectTarget=function(s){var a=this._connSource;return this.onRemove(),this._connSource=a,this._connTarget=s,this._updateCoordinates(),this._registerEvents(),this},e._updateCoordinates=function(){var s=this.getMap();if(!s&&this._connSource&&(s=this._connSource.getMap()),!s&&this._connTarget&&(s=this._connTarget.getMap()),!!s&&!(!this._connSource||!this._connTarget)){for(var a=this._connSource._getConnectPoints(),l=this._connTarget._getConnectPoints(),h=0,u=this.getCoordinates(),c,f,d=0,g=a.length;d<g;d++)for(var p=a[d],m=0,v=l.length;m<v;m++){var _=l[m],y=s.computeLength(p,_);d===0&&m===0?(c=p,f=_,h=y):y<h&&(c=p,f=_)}(!$e(u)||!u[0].equals(c)||!u[1].equals(f))&&this.setCoordinates([c,f])}},e.onAdd=function(){this._registerEvents(),this._updateCoordinates()},e.onRemove=function(){if(this._connSource&&(this._connSource.__connectors&&Dl(this,this._connSource.__connectors),this._connSource.off("dragging positionchange",this._updateCoordinates,this).off("remove",this.onRemove,this),this._connSource.off("dragstart mousedown mouseover",this._showConnect,this),this._connSource.off("dragend mouseup mouseout",this.hide,this),this._connSource.off("show",this._showConnect,this).off("hide",this.hide,this),delete this._connSource),this._connTarget&&(Dl(this,this._connTarget.__connectors),this._connTarget.off("dragging positionchange",this._updateCoordinates,this).off("remove",this.onRemove,this),this._connTarget.off("show",this._showConnect,this).off("hide",this.hide,this),delete this._connTarget),!(this._connSource instanceof je)||!(this._connTarget instanceof je)){var s=this.getMap();s&&s.off("movestart moving moveend zoomstart zooming zoomend rotate pitch fovchange spatialreferencechange",this._updateCoordinates,this)}},e._showConnect=function(){!this._connSource||!this._connTarget||this._connSource.isVisible()&&this._connTarget.isVisible()&&(this._updateCoordinates(),this.show())},e._registerEvents=function(){if(!(!this._connSource||!this._connTarget)){this._connSource.__connectors||(this._connSource.__connectors=[]),this._connTarget.__connectors||(this._connTarget.__connectors=[]),this._connSource.__connectors.push(this),this._connTarget.__connectors.push(this),this._connSource.on("dragging positionchange",this._updateCoordinates,this).on("remove",this.remove,this),this._connTarget.on("dragging positionchange",this._updateCoordinates,this).on("remove",this.remove,this),this._connSource.on("show",this._showConnect,this).on("hide",this.hide,this),this._connTarget.on("show",this._showConnect,this).on("hide",this.hide,this);var s=this.options.showOn;if(this.hide(),s==="moving"?(this._connSource.on("dragstart",this._showConnect,this).on("dragend",this.hide,this),this._connTarget.on("dragstart",this._showConnect,this).on("dragend",this.hide,this)):s==="click"?(this._connSource.on("mousedown",this._showConnect,this).on("mouseup",this.hide,this),this._connTarget.on("mousedown",this._showConnect,this).on("mouseup",this.hide,this)):s==="mouseover"?(this._connSource.on("mouseover",this._showConnect,this).on("mouseout",this.hide,this),this._connTarget.on("mouseover",this._showConnect,this).on("mouseout",this.hide,this)):this._showConnect(),!(this._connSource instanceof je)||!(this._connTarget instanceof je)){var a=this.getMap();a&&a.on("movestart moving moveend zoomstart zooming zoomend rotate pitch fovchange spatialreferencechange",this._updateCoordinates,this)}}},i}(r)},Z0={showOn:"always"},Ql=function(n){function r(t,i,e){var o;return o=n.call(this,null,e)||this,arguments.length===1&&(e=t,t=null,i=null),o._connSource=t,o._connTarget=i,o}return Q(r,n),r}(j0(pt));Ql.mergeOptions(Z0);Ql.registerJSONType("ConnectorLine");var V0=function(n){function r(t,i,e){var o;return o=n.call(this,null,e)||this,arguments.length===1&&(e=t,t=null,i=null),o._connSource=t,o._connTarget=i,o}return Q(r,n),r}(j0(Vh));V0.mergeOptions(Z0);V0.registerJSONType("ArcConnectorLine");function ys(n){return n&&n instanceof je}var ZE={drawImmediate:!1,geometryEvents:!0,geometryEventTolerance:1},zv=[],_d=function(n){function r(i,e,o){var s;e&&!ys(e)&&!Array.isArray(e)&&jf.indexOf(e.type)<0&&(o=e,e=null),s=n.call(this,i,o)||this,s._maxZIndex=0,s._minZIndex=0,s._initCache(),e&&s.addGeometry(e);var a=s.options.style;return a&&s.setStyle(a),s}Q(r,n);var t=r.prototype;return t.getAltitude=function(){return 0},t.getGeometryById=function(e){return O(e)||e===""||!this._geoMap[e]?null:this._geoMap[e]},t.getGeometries=function(e,o){if(!e)return this._geoList.slice(0);for(var s=[],a,l,h=0,u=this._geoList.length;h<u;h++)a=this._geoList[h],o?l=e.call(o,a):l=e(a),l&&s.push(a);return s},t.getFirstGeometry=function(){return this._geoList.length?this._geoList[0]:null},t.getLastGeometry=function(){var e=this._geoList.length;return e===0?null:this._geoList[e-1]},t.getCount=function(){return this._geoList.length},t.getExtent=function(){if(this.getCount()===0)return null;var e=new Je(this.getProjection());return this.forEach(function(o){e._combine(o.getExtent())}),e},t.forEach=function(e,o){for(var s=this._geoList.slice(0),a=0,l=s.length;a<l;a++)o?e.call(o,s[a],a):e(s[a],a);return this},t.filter=function(e,o){var s=[],a=Oe(e),l=a?e:zh(e);return this.forEach(function(h){var u=a?h:jl(h);(o?l.call(o,u):l(u))&&s.push(h)},this),s},t.isEmpty=function(){return!this._geoList.length},t.addGeometry=function(e,o){if(!e)return this;if(e.type==="FeatureCollection")return this.addGeometry(Or.toGeometry(e),o);if(Array.isArray(e)){if(e.length===0)return this}else{var s=arguments.length,a=arguments[s-1];return e=Array.prototype.slice.call(arguments,0,s-1),o=a,a&&Xt(a)&&("type"in a||ys(a))&&(e.push(a),o=!1),this.addGeometry(e,o)}this._initCache();var l;o&&(l=new Je),this._toSort=this._maxZIndex>0;for(var h=[],u=0,c=e.length;u<c;u++){var f=e[u];if(!(f&&(Or._isGeoJSON(f)||ys(f))))throw new Error("Invalid geometry to add to layer("+this.getId()+") at index:"+u);if(!(f.getLayer&&f.getLayer()===this)){if(!ys(f)&&(f=je.fromJSON(f),Array.isArray(f)))for(var d=0,g=f.length;d<g;d++)this._add(f[d],l,u),h.push(f[d]);if(!f)throw new Error("Invalid geometry to add to layer("+this.getId()+") at index:"+u);Array.isArray(f)||(this._add(f,l,u),h.push(f))}}var p=this.getMap();if(p&&(this._getRenderer().onGeometryAdd(h),l&&!O(l.xmin))){var m=l.getCenter(),v=p.getFitZoom(l);if(Xt(o)){var _=Oe(o.step)?o.step:function(){};p.animateTo({center:m,zoom:v},oe({duration:p.options.zoomAnimationDuration,easing:"out"},o),_)}else o===!0&&p.setCenterAndZoom(m,v)}return this.fire("addgeo",{type:"addgeo",target:this,geometries:e}),this},t.getGeoMinZIndex=function(){return this._minZIndex},t.getGeoMaxZIndex=function(){return this._maxZIndex},t._add=function(e,o,s){this._toSort||(this._toSort=e.getZIndex()!==0),this._updateZIndex(e.getZIndex());var a=e.getId();if(!O(a)){if(!O(this._geoMap[a]))throw new Error("Duplicate geometry id in layer("+this.getId()+"):"+a+", at index:"+s);this._geoMap[a]=e}var l=ui();e._setInternalId(l),this._geoList.push(e),this.onAddGeometry(e),e._bindLayer(this),e.onAdd&&e.onAdd(),o&&o._combine(e.getExtent()),e._fireEvent("add",{layer:this}),this._cookedStyles&&this._styleGeometry(e)},t.removeGeometry=function(e){if(!Array.isArray(e))return this.removeGeometry([e]);for(var o=e.length-1;o>=0;o--)e[o]instanceof je||(e[o]=this.getGeometryById(e[o])),!(!e[o]||this!==e[o].getLayer())&&e[o].remove();return this},t.clear=function(){this._clearing=!0,this.forEach(function(s){s.remove()}),this._geoMap={};var e=this._geoList;this._geoList=[];var o=this._getRenderer();return o&&(o.onGeometryRemove(e),o.clearImageData&&(o.clearImageData(),delete o._lastGeosToDraw)),this._clearing=!1,this.fire("clear"),this},t.onRemoveGeometry=function(e){if(!(!e||this._clearing)&&this===e.getLayer()){var o=e._getInternalId();if(!O(o)){var s=e.getId();O(s)||delete this._geoMap[s];var a=this._findInList(e);a>=0&&this._geoList.splice(a,1),this._getRenderer()&&this._getRenderer().onGeometryRemove([e])}}},t.getStyle=function(){return this.options.style?this.options.style:null},t.setStyle=function(e){return this.options.style=e,e=ky(e),this._cookedStyles=Yf(e),this.forEach(function(o){this._styleGeometry(o)},this),this.fire("setstyle",{type:"setstyle",target:this,style:e}),this},t._styleGeometry=function(e){if(!this._cookedStyles)return!1;for(var o=jl(e),s=0,a=this._cookedStyles.length;s<a;s++)if(this._cookedStyles[s].filter(o)===!0)return e._setExternSymbol(this._cookedStyles[s].symbol),!0;return!1},t.removeStyle=function(){return this.options.style?(delete this.options.style,delete this._cookedStyles,this.forEach(function(e){e._setExternSymbol(null)},this),this.fire("removestyle"),this):this},t.onAddGeometry=function(e){var o=this.getStyle();o&&this._styleGeometry(e)},t.hide=function(){for(var e=0,o=this._geoList.length;e<o;e++)this._geoList[e].onHide();return hr.prototype.hide.call(this)},t._initCache=function(){this._geoList||(this._geoList=[],this._geoMap={})},t._updateZIndex=function(...e){this._maxZIndex=Math.max(this._maxZIndex,Math.max(...e)),this._minZIndex=Math.min(this._minZIndex,Math.min(...e))},t._sortGeometries=function(){var e=this;this._toSort&&(this._maxZIndex=0,this._minZIndex=0,this._geoList.sort(function(o,s){return e._updateZIndex(o.getZIndex(),s.getZIndex()),e._compare(o,s)}),this._toSort=!1)},t._compare=function(e,o){return e.getZIndex()===o.getZIndex()?e._getInternalId()-o._getInternalId():e.getZIndex()-o.getZIndex()},t._findInList=function(e){var o=this._geoList.length;if(o===0)return-1;this._sortGeometries();for(var s=0,a=o-1,l;s<=a;){if(l=Math.floor((s+a)/2),this._geoList[l]===e)return l;this._compare(this._geoList[l],e)>0?a=l-1:s=l+1}return-1},t.onGeometryEvent=function(e){return this._onGeometryEvent(e)},t._onGeometryEvent=function(e){if(!(!e||!e.target)){var o=e.type;o==="idchange"?this._onGeometryIdChange(e):o==="zindexchange"?this._onGeometryZIndexChange(e):o==="positionchange"?this._onGeometryPositionChange(e):o==="shapechange"?this._onGeometryShapeChange(e):o==="symbolchange"?this._onGeometrySymbolChange(e):o==="show"?this._onGeometryShow(e):o==="hide"?this._onGeometryHide(e):o==="propertieschange"&&this._onGeometryPropertiesChange(e)}},t._onGeometryIdChange=function(e){if(!(e.new===e.old&&this._geoMap[e.old]&&this._geoMap[e.old]===e.target)){if(!O(e.new)){if(this._geoMap[e.new])throw new Error("Duplicate geometry id in layer("+this.getId()+"):"+e.new);this._geoMap[e.new]=e.target}!O(e.old)&&e.new!==e.old&&delete this._geoMap[e.old]}},t._onGeometryZIndexChange=function(e){e.old!==e.new&&(this._updateZIndex(e.new),this._toSort=!0,this._getRenderer()&&this._getRenderer().onGeometryZIndexChange(e))},t._onGeometryPositionChange=function(e){this._getRenderer()&&this._getRenderer().onGeometryPositionChange(e)},t._onGeometryShapeChange=function(e){this._getRenderer()&&this._getRenderer().onGeometryShapeChange(e)},t._onGeometrySymbolChange=function(e){this._getRenderer()&&this._getRenderer().onGeometrySymbolChange(e)},t._onGeometryShow=function(e){this._getRenderer()&&this._getRenderer().onGeometryShow(e)},t._onGeometryHide=function(e){this._getRenderer()&&this._getRenderer().onGeometryHide(e)},t._onGeometryPropertiesChange=function(e){this._getRenderer()&&this._getRenderer().onGeometryPropertiesChange(e)},t._hasGeoListeners=function(e){if(!e)return!1;Array.isArray(e)||(zv[0]=e,e=zv);for(var o=this.getGeometries()||[],s=0,a=o.length;s<a;s++){var l=o[s];if(l){if(l.options.cursor)return!0;for(var h=0,u=e.length;h<u;h++){var c=e[h],f=l.listens(c);if(f>0)return!0}}}return!1},t._getRenderer=function(){return n.prototype._getRenderer.call(this)},r}(hr);_d.mergeOptions(ZE);var VE={renderer:null},So=function(n){function r(i,e,o={}){var s;e&&!ys(e)&&!Array.isArray(e)&&jf.indexOf(e.type)<0&&(o=e,e=null),s=n.call(this,i,o)||this;var a=s.options.depthFunc||"always";return o.sceneConfig={depthFunc:a},s._markerLayer=new r.markerLayerClazz(i+"_____________marker",o),s._lineLayer=new r.lineLayerClazz(i+"_____________line",o),s._polygonLayer=new r.polygonLayerClazz(i+"_____________polygon",o),e&&s.addGeometry(e),s}Q(r,n),r.setLayerClass=function(e,o,s){r.markerLayerClazz=e,r.lineLayerClazz=o,r.polygonLayerClazz=s};var t=r.prototype;return t.clear=function(){return n.prototype.clear.call(this),this._markerLayer.clear(),this._lineLayer.clear(),this._polygonLayer.clear(),this},t.bringToFront=function(){return this._polygonLayer.bringToFront(),this._lineLayer.bringToFront(),this._markerLayer.bringToFront(),this},t.addGeometry=function(e){Array.isArray(e)||(e=[e]),Yt(this._geoList,e);for(var o=0;o<e.length;o++){if(this._markerLayer.isVectorLayer){this._markerLayer.addGeometry(e[o]);continue}e[o]instanceof et||e[o]instanceof Po?this._markerLayer.addGeometry(e[o]):e[o]instanceof pt||e[o]instanceof Eo?this._lineLayer.addGeometry(e[o]):(e[o]instanceof it||e[o]instanceof ql)&&this._polygonLayer.addGeometry(e[o])}},t.getGeometryById=function(e){return O(e)||e===""?null:this._markerLayer.getGeometryById(e)||this._lineLayer.getGeometryById(e)||this._polygonLayer.getGeometryById(e)},t.removeGeometry=function(e){Array.isArray(e)||(e=[e]);for(var o=0;o<e.length;o++){var s=this._findInList(e[o]);if(s>=0&&this._geoList.splice(s,1),this._markerLayer.isVectorLayer){this._markerLayer.removeGeometry(e[o]);continue}e[o]instanceof et||e[o]instanceof Po?this._markerLayer.removeGeometry(e[o]):e[o]instanceof pt||e[o]instanceof Eo?this._lineLayer.removeGeometry(e[o]):(e[o]instanceof it||e[o]instanceof ql)&&this._polygonLayer.removeGeometry(e[o])}},t._onRemoveDrawToolGeo=function(e){for(var o=e.geometries,s=0;s<o.length;s++)if(o[s]){var a=this._findInList(o[s]);a>=0&&this._geoList.splice(a,1)}},t.onRemove=function(){return this._geoList=[],this._markerLayer.off("removegeo",this._onRemoveDrawToolGeo,this),this._lineLayer.off("removegeo",this._onRemoveDrawToolGeo,this),this._polygonLayer.off("removegeo",this._onRemoveDrawToolGeo,this),this._markerLayer.remove(),this._lineLayer.remove(),this._polygonLayer.remove(),delete this._markerLayer,delete this._lineLayer,delete this._polygonLayer,n.prototype.onRemove.call(this)},t.onAdd=function(){var e=this.getMap();return this._polygonLayer.addTo(e),this._lineLayer.addTo(e),this._markerLayer.addTo(e),this._markerLayer.on("removegeo",this._onRemoveDrawToolGeo,this),this._lineLayer.on("removegeo",this._onRemoveDrawToolGeo,this),this._polygonLayer.on("removegeo",this._onRemoveDrawToolGeo,this),n.prototype.onAdd.call(this)},t.getRenderer=function(){return this._getRenderer()},t._getRenderer=function(){return this._markerLayer.getRenderer()},r}(_d);So.mergeOptions(VE);var il="_map_tool",Bv=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.addTo=function(e){return e?(this._map=e,e[il]&&e[il].disable(),this.onAdd&&this.onAdd(),this.enable(),e[il]=this,this._fireEvent("add"),this):this},t.getMap=function(){return this._map},t.enable=function(){var e=this._map;return!e||this._enabled?this:(this._enabled=!0,this._switchEvents("off"),this._registerEvents(),this.onEnable&&this.onEnable(),this._fireEvent("enable"),this)},t.disable=function(){return!this._enabled||!this._map?this:(this._enabled=!1,this._switchEvents("off"),this.onDisable&&this.onDisable(),this._fireEvent("disable"),this)},t.isEnabled=function(){return!!this._enabled},t.remove=function(){return this._map?(this.disable(),this._map&&(delete this._map[il],delete this._map),this._fireEvent("remove"),this):this},t._registerEvents=function(){this._switchEvents("on")},t._switchEvents=function(e){var o=this.getEvents();o&&this._map[e](o,this)},t._fireEvent=function(e,o){o||(o={}),this.fire(e,o)},r}(ci(br)),WE={symbol:{lineColor:"#000",lineWidth:2,lineOpacity:1,polygonFill:"#fff",polygonOpacity:.3},doubleClickZoom:!1,mode:null,once:!1,autoPanAtEdge:!1,ignoreMouseleave:!0,blockGeometryEvents:!1,zIndex:Number.MAX_VALUE,enableAltitude:!0,interactive:!0,transformCoordinate:null},nc={},At=function(n){function r(i){var e;return e=n.call(this,i)||this,e.id=ui(),e._checkMode(),e._events={click:e._clickHandler,"mousemove touchmove":e._mouseMoveHandler,dblclick:e._doubleClickHandler,"mousedown touchstart":e._mouseDownHandler,"mouseup touchend":e._mouseUpHandler,mousemove:e._mouseMoveHandler,mousedown:e._mouseDownHandler,mouseup:e._mouseUpHandler},e}Q(r,n),r.registerMode=function(e,o){nc[e.toLowerCase()]=o},r.getRegisterMode=function(e){return nc[e.toLowerCase()]},r.getAllRegisterMode=function(){return Object.assign({},nc)};var t=r.prototype;return t.getMode=function(){return this.options.mode?this.options.mode.toLowerCase():null},t.setMode=function(e){return this._geometry&&(this._geometry.remove(),delete this._geometry),this._clearStage(),this._switchEvents("off"),this.options.mode=e,this._checkMode(),this.isEnabled()&&(this._switchEvents("on"),this._restoreMapCfg(),this._saveMapCfg()),this},t.getSymbol=function(){var e=this.options.symbol;return Zr(e||this.options.symbol)},t.setSymbol=function(e){return e?(this.options.symbol=e,this._geometry&&this._geometry.setSymbol(e),this):this},t.getCurrentGeometry=function(){return this._geometry},t.onAdd=function(){this._checkMode()},t.onEnable=function(){this._saveMapCfg(),this._drawToolLayer=this._getDrawLayer(),this._clearStage(),this._loadResources();var e=this.getMap();return this.options.autoPanAtEdge&&(this._mapAutoPanAtEdge=e.options.autoPanAtEdge,this._mapAutoPanAtEdge||e.config({autoPanAtEdge:!0})),this._geometryEvents=e.options.geometryEvents,this.options.blockGeometryEvents&&e.config("geometryEvents",!1),this},t.onDisable=function(){var e=this.getMap();return this._restoreMapCfg(),this.endDraw({ignoreEndEvent:!0}),this._map&&(e.removeLayer(this._getDrawLayer()),this.options.autoPanAtEdge&&(this._mapAutoPanAtEdge||e.config({autoPanAtEdge:!1}))),this.options.blockGeometryEvents&&e.config("geometryEvents",this._geometryEvents),this},t.undo=function(){var e=this._getRegisterMode(),o=e.action;if(!this._shouldRecordHistory(o)||!this._historyPointer)return this;var s=this._clickCoords.slice(0,--this._historyPointer);return e.update(this.getMap().getProjection(),s,this._geometry),this},t.redo=function(){var e=this._getRegisterMode(),o=e.action;if(!this._shouldRecordHistory(o)||O(this._historyPointer)||this._historyPointer===this._clickCoords.length)return this;var s=this._clickCoords.slice(0,++this._historyPointer);return e.update(this.getMap().getProjection(),s,this._geometry),this},t._shouldRecordHistory=function(e){return Array.isArray(e)&&e[0]==="click"&&e[1]==="mousemove"&&e[2]==="dblclick"},t._checkMode=function(){this._getRegisterMode()},t._saveMapCfg=function(){var e=this.getMap();this._mapDoubleClickZoom=e.options.doubleClickZoom,e.config({doubleClickZoom:this.options.doubleClickZoom});for(var o=this._getRegisterMode().action,s=!1,a=0;a<o.length;a++)if(o[a].indexOf("mousedown")>=0||o[a].indexOf("touchstart")>=0){s=!0;break}if(s){var l=this.getMap();this._mapDraggable=l.options.draggable,l.config({draggable:!1})}},t._restoreMapCfg=function(){var e=this.getMap();e.config({doubleClickZoom:this._mapDoubleClickZoom}),O(this._mapDraggable)||e.config("draggable",this._mapDraggable),delete this._mapDraggable,delete this._mapDoubleClickZoom},t._loadResources=function(){var e=this.getSymbol(),o=ba(e);o.length>0&&this._drawToolLayer.getRenderer().loadResources(o)},t._getProjection=function(){return this._map.getProjection()},t._getRegisterMode=function(){var e=this.getMode(),o=r.getRegisterMode(e);if(!o)throw new Error(e+" is not a valid mode of DrawTool.");return o},t.getEvents=function(){var e=this._getRegisterMode().action,o={};if(Array.isArray(e)){for(var s=0;s<e.length;s++)o[e[s]]=this._events[e[s]];return o}return null},t._mouseDownHandler=function(e){e!=null&&e.coordinate&&this._createGeometry(e)},t._mouseUpHandler=function(e){e!=null&&e.coordinate&&this.endDraw(e)},t._copyMapEventOnSnapTo=function(e,o){var s=this.getMap();return s?Object.assign({},e,{containerPoint:s.prjToContainerPoint(o)}):e},t._clickHandler=function(e){if(e!=null&&e.coordinate){if(!this.options.interactive)return this;e.enableAltitude=this.options.enableAltitude;var o=this.getMap(),s=this._getRegisterMode();if(this._clickCoords&&this._clickCoords.length){var a=this._clickCoords.length,l=o._pointToPrj(e.point2d);if(this._clickCoords[a-1].equals(l))return}if(!this._geometry)this._createGeometry(e);else{var h=o._pointToPrj(e.point2d);O(this._historyPointer)||(this._clickCoords=this._clickCoords.slice(0,this._historyPointer));var u=this._geometry.snapTo,c;if(u&&Oe(u)){var f=this._getSnapResult(u,e.containerPoint);if(h=f.prjCoord,c=this._copyMapEventOnSnapTo(e,h),this._clickCoords=this._clickCoords.concat(f.effectedVertex),this._clickCoords[this._clickCoords.length-1].equals(h))return}if(this._clickCoords.push(h),this._historyPointer=this._clickCoords.length,e.drawTool=this,s.update(o.getProjection(),this._clickCoords,this._geometry,c||e),this.getMode()==="point"){this.endDraw(e);return}this._clickCoords.length<=1?this._fireEvent("drawstart",e):this._fireEvent("drawvertex",e),s.clickLimit&&s.clickLimit===this._historyPointer&&this.endDraw(e)}}},t._createGeometry=function(e){var o=this.getMode(),s=this.getMap(),a=this._getRegisterMode(),l=s._pointToPrj(e.point2d),h=this.getSymbol();if(!this._geometry){this._fireEvent("drawprepare",e),this._clickCoords=[l],e.drawTool=this,this._geometry=a.create(this.getMap().getProjection(),this._clickCoords,e),h&&o!=="point"?this._geometry.setSymbol(h):this.options.hasOwnProperty("symbol")&&this._geometry.setSymbol(this.options.symbol),this._addGeometryToStage(this._geometry),this._fireEvent("drawstart",e);var u=this._geometry.snapTo;if(u&&Oe(u)){var c=this._getSnapResult(u,e.containerPoint),f=this.getMap();if(f&&c){var d=c.prjCoord;this._clickCoords=[d],this._geometry._firstClick&&(this._geometry._firstClick=d);var g=this._copyMapEventOnSnapTo(e,d);a.update(f.getProjection(),this._clickCoords,this._geometry,g)}}}o==="point"&&e.type!=="mousemove"&&this.endDraw(e)},t._mouseMoveHandler=function(e){if(e!=null&&e.coordinate){if(!this.options.interactive)return this;e.enableAltitude=this.options.enableAltitude;var o=this.getMap();if(!(!o||o.isInteracting())){if(this.getMode()==="point"&&!this._geometry){this._createGeometry(e);return}if(this._geometry){var s=this._getMouseContainerPoint(e);if(this._isValidContainerPoint(s)){var a=o._pointToPrj(e.point2d),l=[],h=this._geometry.snapTo,u;if(h&&Oe(h)){var c=this._getSnapResult(h,s);a=c.prjCoord,l=c.effectedVertex,u=this._copyMapEventOnSnapTo(e,a)}var f=o.getProjection();e.drawTool=this;var d=this._getRegisterMode();if(this._shouldRecordHistory(d.action)){var g=this._clickCoords.slice(0,this._historyPointer);if(g&&g.length>0&&a.equals(g[g.length-1]))return;d.update(f,g.concat(l,[a]),this._geometry,u||e)}else d.update(f,a,this._geometry,u||e);this._fireEvent("mousemove",e)}}}}},t._doubleClickHandler=function(e){if(e!=null&&e.coordinate){if(!this.options.interactive)return this;if(e.enableAltitude=this.options.enableAltitude,!!this._geometry){var o=this._getMouseContainerPoint(e);if(this._isValidContainerPoint(o)){var s=this._getRegisterMode(),a=this._clickCoords;if(!(!a||a.length<2)){var l=this.getMode();if(!(l&&l.indexOf("polygon")>-1&&a.length<3)){for(var h=this.getMap().getProjection(),u=[a[0]],c=1,f=a.length;c<f;c++)(a[c].x!==a[c-1].x||a[c].y!==a[c-1].y)&&u.push(a[c]);u.length<2||this._geometry&&this._geometry instanceof it&&u.length<3||(e.drawTool=this,s.update(h,u,this._geometry,e),this.endDraw(e))}}}}}},t._addGeometryToStage=function(e){var o=this._getDrawLayer();o.addGeometry(e)},t.endDraw=function(e){if(!this._geometry||this._ending)return this;this._ending=!0;var o=this._geometry;return this._clearStage(),e=e||{},this._geometry=o,e.ignoreEndEvent||this._fireEvent("drawend",e),delete this._geometry,this.options.once&&this.disable(),delete this._ending,delete this._historyPointer,this._vertexes&&(this._vertexes=[]),this},t._clearStage=function(){this._getDrawLayer().clear(),delete this._geometry,delete this._clickCoords},t._getMouseContainerPoint=function(e){var o=this._getRegisterMode().action;return(o[0].indexOf("mousedown")>=0||o[0].indexOf("touchstart")>=0)&&nr(e.domEvent),e.containerPoint},t._isValidContainerPoint=function(e){var o=this._map.getSize(),s=o.width,a=o.height;return e.x<0||e.y<0?!1:!(e.x>s||e.y>a)},t._getSnapResult=function(e,o){var s=this.getMap(),a=[];if(this.options.edgeAutoComplete){var l=this._clickCoords[(this._historyPointer||1)-1];a.push(s.prjToContainerPoint(l));var h=this._clickCoords[(this._historyPointer||1)-2];h&&a.push(s.prjToContainerPoint(h))}var u=e(o,a);o=(u.effectedVertex?u.point:u)||o;var c=s._containerPointToPrj(o);return u.effectedVertex&&(u.effectedVertex=u.effectedVertex.map(function(f){return s._containerPointToPrj(f)})),{prjCoord:c,effectedVertex:u.effectedVertex||[]}},t._getDrawLayer=function(){var e=xa+"drawtool"+(""+this.id),o=this._map.getLayer(e);return o||(o=new So(e,{enableSimplify:!1,enableAltitude:this.options.enableAltitude,zIndex:this.options.zIndex}),this._map.addLayer(o)),this._pushLayers(o),o},t._fireEvent=function(e,o){o||(o={}),o=oe({},o),this._geometry&&(o.geometry=this._getRegisterMode().generate(this._geometry,{drawTool:this}),o.tempGeometry=this._geometry),Bv.prototype._fireEvent.call(this,e,o)},t._pushLayers=function(e){var o=this;return e?(Array.isArray(e)||(e=[e]),this._layers=this._layers||[],e.forEach(function(s){o._layers.indexOf(s)===-1&&o._layers.push(s)}),this):this},t._outLayers=function(e){var o=this;return e?(Array.isArray(e)||(e=[e]),this._layers=this._layers||[],e.forEach(function(s){for(var a=0,l=o._layers.length;a<l;a++)if(s===o._layers[a]){o._layers.splice(a,1);break}}),this):this},t.setLayerZIndex=function(e){return X(e)?(this.options.zIndex=e,this._layers=this._layers||[],this._layers.forEach(function(o){o&&o.setZIndex&&o.setZIndex(e)}),this):this},t.addCoordinate=function(e){if(!this.isEnabled())return this;var o=this.getMap();if(!o)return this;e=new $(e);var s=o._parseEventFromCoord(e);return this._clickHandler(s),this},t.getTempGeometry=function(){return this._geometry},r}(Bv);At.mergeOptions(WE);var $E=function(n){function r(i){var e;return e=n.call(this,i)||this,e.drawTool=new At({mode:"boxZoom",ignoreMouseleave:!1}),e}Q(r,n);var t=r.prototype;return t.addHooks=function(){this.target.on("_mousedown",this._onMouseDown,this)},t.removeHooks=function(){this.target.off("_mousedown",this._onMouseDown,this),this.drawTool.isEnabled()&&this.drawTool.remove()},t._onMouseDown=function(e){this.target.options.boxZoom&&e.domEvent.shiftKey&&this.drawTool.setSymbol(this.target.options.boxZoomSymbol).on("drawend",this._boxZoom,this).addTo(this.target)},t._boxZoom=function(e){var o=this.target;this.drawTool.remove();var s=e.geometry,a=s.getCenter(),l=s.getSymbol(),h=l.markerWidth,u=l.markerHeight,c=new Je(a,o.locateByPoint(a,h,u),o.getProjection()),f=o.getFitZoom(c);o._animateTo({center:c.getCenter(),zoom:f})},r}(Bn);Se.mergeOptions({boxZoom:!0,boxZoomSymbol:{markerType:"rectangle",markerLineWidth:3,markerLineColor:"#1bbc9b",markerLineDasharray:[10,5],markerFillOpacity:.1,markerFill:"#1bbc9b",markerWidth:1,markerHeight:1}});Se.addOnLoadHook("addHandler","boxZoom",$E);var Hi=30,UE=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.addHooks=function(){this.target&&this.target.on("_mousemove",this._onMouseMove,this)},t.removeHooks=function(){this.target&&this.target.off("_mousemove",this._onMouseMove,this)},t._onMouseMove=function(e){var o=this.target;if(o.options.autoPanAtEdge){var{containerPoint:s}=e,a=o.getContainerExtent();if(a){var{x:l,y:h}=s,{xmax:u,ymax:c}=a,f;l<Hi&&(f=[Math.abs(l-Hi),0]),h<Hi&&(f=[0,Math.abs(h-Hi)]),l+Hi>u&&(f=[-Math.abs(l+Hi-u),0]),h+Hi>c&&(f=[0,-Math.abs(h+Hi-c)]),f&&o.panBy(f,{duration:1})}}},r}(Bn);Se.mergeOptions({autoPanAtEdge:!1});Se.addOnLoadHook("addHandler","autoPanAtEdge",UE);function Gv(n,r){var t=n.bearing,i=r.getBearing();return!(i>=0&&t>180||i<=0&&t<-180)}function Fv(n,r){var t=n.bearing,i=r.getBearing();i>=0&&t<0&&(n.bearing=180+(180-Math.abs(t))),i<=0&&t>0&&(n.bearing=-180-(180-Math.abs(t))),i>=0&&t>0&&(n.bearing=-180-(180-Math.abs(t))),i<=0&&t<0&&(n.bearing=180+(180-Math.abs(t)))}Se.include({animateTo:function(r,t={},i){var e=this;r=oe({},this.getView(),r),r.bearing=r.bearing%360,Oe(t)&&(i=t,t={}),t.counterclockwise&&Fv(r,this),Gv(r,this)&&this._validateView(r);var o=this.getProjection(),s=this.getView(),a={},l=!0;for(var h in r)if(Bo(r,h)&&!O(r[h])&&(h==="prjCenter"||!O(s[h])))if(l=!1,h==="center"){var u=new $(s[h]),c=new $(r[h]);u.equals(c)||(a.center=[u,c])}else if(h==="prjCenter"){var f=new $(this._getPrjCenter()),d=new $(r[h]);f.equals(d)||(a.prjCenter=[f,d])}else s[h]!==r[h]&&h!=="around"&&(a[h]=[s[h],r[h]]);if(l)return null;this._animPlayer&&(this._isInternalAnimation?this._animPlayer.playState==="running"&&(this._animPlayer.pause(),this._prevAnimPlayer=this._animPlayer):(delete this._prevAnimPlayer,this._stopAnim(this._animPlayer)));var g=r.around||null,p=this._getRenderer(),m=function(y){p.callInNextFrame(y)},v=this._animPlayer=Mt.animate(a,{easing:t.easing||"out",duration:t.duration||this.options.zoomAnimationDuration,framer:m,repeat:t.repeat},function(_){if(e.isRemoved()){v.finish();return}if(v.playState==="running"){if(_.styles.center){var y=_.styles.center;e._setPrjCenter(o.project(y)),e.onMoving(e._parseEventFromCoord(e.getCenter()))}else if(_.styles.prjCenter){var w=_.styles.prjCenter;e._setPrjCenter(w),e.onMoving(e._parseEventFromCoord(e.getCenter()))}O(_.styles.zoom)||e.onZooming(_.styles.zoom,g),O(_.styles.pitch)||e._setPitch(_.styles.pitch),O(_.styles.bearing)||e._setBearing(_.styles.bearing),e._fireEvent("animating")}else(v.playState!=="paused"||v===e._mapAnimPlayer)&&(v._interupted||(a.center?e._setPrjCenter(o.project(a.center[1])):a.prjCenter&&e._setPrjCenter(a.prjCenter[1]),O(a.pitch)||e._setPitch(a.pitch[1]),O(a.bearing)||e._setBearing(a.bearing[1])),e._endAnim(v,a,g,t));i&&i(_)},this);return this._startAnim(a,g),v},_animateTo:function(r,t={},i){return this._mapAnimPlayer&&this._stopAnim(this._mapAnimPlayer),this._isInternalAnimation=!0,this._mapAnimPlayer=this.animateTo(r,t,i),delete this._isInternalAnimation,this._mapAnimPlayer},flyTo:function(r,t={},i){var e=this;r=oe({},this.getView(),r),r.bearing=r.bearing%360,t.counterclockwise&&Fv(r,this),Gv(r,this)&&this._validateView(r),this._animPlayer&&(this._isInternalAnimation?this._animPlayer.playState==="running"&&(this._animPlayer.pause(),this._prevAnimPlayer=this._animPlayer):(delete this._prevAnimPlayer,this._stopAnim(this._animPlayer))),Oe(t)&&(i=t,t={}),t=oe({curve:1.42},t);var o=this;function s(de,_e){return o.getResolution(_e)/o.getResolution(de)}var a=r.around||new z(this.width/2,this.height/2),l=this.getMinZoom(),h=this.getMaxZoom(),u=this.getProjection(),c=this.getView(),f=c.zoom,d=c.bearing,g=c.pitch,p="zoom"in r?Bl(+r.zoom,l,h):f,m="bearing"in r?+r.bearing:d,v="pitch"in r?+r.pitch:g,_=u.project(r.center&&new $(r.center)||this.getCenter()),y=s(p,f),w=u.project(this.getCenter()),x=_.sub(w),C=t.curve,b=Math.max(this.width,this.height),E=b/y,T=x.mag();if("minZoom"in t){var S=Bl(Math.min(t.minZoom,f,p),l,h),B=b/s(S,f);C=Math.sqrt(B/T*2)}var L=C*C;function D(de){var _e=(E*E-b*b+(de?-1:1)*L*L*T*T)/(2*(de?E:b)*L*T);return Math.log(Math.sqrt(_e*_e+1)-_e)}function N(de){return(Math.exp(de)-Math.exp(-de))/2}function G(de){return(Math.exp(de)+Math.exp(-de))/2}function I(de){return N(de)/G(de)}var A=D(0),k=function(_e){return G(A)/G(A+C*_e)},Z=function(_e){return b*((G(A)*I(A+C*_e)-N(A))/L)/T},W=(D(1)-A)/C;if(Math.abs(T)<1e-6||!isFinite(W)){if(Math.abs(b-E)<1e-6)return this.animateTo(r,t,i);var re=E<b?-1:1;W=Math.abs(Math.log(E/b))/C,Z=function(){return 0},k=function(_e){return Math.exp(re*C*_e)}}var se=this._getRenderer(),me=function(_e){se.callInNextFrame(_e)},ge=this._animPlayer=Mt.animate({k:[0,1]},{easing:t.easing||"out",duration:t.duration||8,framer:me},function(de){if(e.isRemoved()){ge.finish();return}var _e=de.styles.k,Te=_e*W,Ge=1/k(Te),Me={};if(r.center){var Be=_e===1?_:w.add(x.multi(Z(Te)));Me.prjCenter=[_,Be]}if(f!==p){var lt=_e===1?p:e.getZoomForScale(Ge,f,!0);Me.zoom=[f,lt]}if(g!==v){var M=Nv(g,v,_e);Me.pitch=[v,M]}if(d!==m){var R=Nv(d,m,_e);Me.bearing=[m,R]}if(ge.playState==="running"){if(Me.prjCenter){var V=Me.prjCenter;e._setPrjCenter(V[1]),e.onMoving(e._parseEventFromCoord(e.getCenter()))}Me.zoom&&e.onZooming(Me.zoom[1],a),Me.pitch&&e._setPitch(Me.pitch[1]),Me.bearing&&e._setBearing(Me.bearing[1]),e._fireEvent("animating")}else(ge.playState!=="paused"||ge===e._mapAnimPlayer)&&(ge._interupted||(Me.prjCenter&&e._setPrjCenter(Me.prjCenter[1]),Me.pitch&&e._setPitch(Me.pitch[1]),Me.bearing&&e._setBearing(Me.bearing[1])),e._endAnim(ge,Me,a,t));i&&i(de)},{});return this._startAnim({center:r.center,zoom:r.zoom!==f,pitch:v!==g,bearing:m!==d},a),this},isAnimating:function(){return!!this._animPlayer},isRotating:function(){return this.isDragRotating()||!!this._animRotating},_endAnim:function(r,t,i,e){delete this._animRotating;var o=r._interupted?"animateinterrupted":"animateend";if(r===this._animPlayer&&delete this._animPlayer,r===this._mapAnimPlayer&&delete this._mapAnimPlayer,t.center){var s;r._interupted?s=this.getCenter():s=t.center[1],this.onMoveEnd(this._parseEventFromCoord(s))}else if(t.prjCenter){var a;r._interupted?a=this._getPrjCenter():a=t.prjCenter[1];var l=this._parseEventFromCoord(this.getProjection().unproject(a));l.point2d=this._prjToPoint(a),this.onMoveEnd(l)}O(t.zoom)||(r._interupted?this.onZoomEnd(this.getZoom()):e.wheelZoom?this.onZooming(t.zoom[1],i):this.onZoomEnd(t.zoom[1])),o&&this._fireEvent(o),!O(t.pitch)&&!this.getPitch()&&this.getRenderer().setToRedraw(),e.wheelZoom||this._resumePrev(r)},_startAnim:function(r,t){this._animPlayer&&((r.center||r.prjCenter)&&this.onMoveStart(),r.zoom&&!this.isZooming()&&this.onZoomStart(r.zoom[1],t),(r.pitch||r.bearing)&&(this._animRotating=!0),this._fireEvent("animatestart"),this._animPlayer.play())},_stopAnim:function(r){r&&(delete this._animRotating,r.playState!=="finished"&&(r._interupted=!0,r.cancel()),r===this._animPlayer&&delete this._animPlayer,r===this._mapAnimPlayer&&delete this._mapAnimPlayer)},_resumePrev:function(r){if(this._prevAnimPlayer){var t=this._prevAnimPlayer;t.playState!=="paused"&&delete this._prevAnimPlayer,r!==t&&(this._animPlayer=t,t.play())}}});function Nv(n,r,t){return n*(1-t)+r*t}var Hv=[60,120];function jv(n){n.stopPropagation(),n.preventDefault()}var Zv=["dragstart","dragenter","dragend","dragleave","dragover"].join(" ").toString(),Vv="mousedown mouseup mouseover mouseout mouseenter mouseleave mousemove click dblclick contextmenu keypress touchstart touchmove touchend drop ";Se.include({_registerDomEvents:function(){var r=this._panels.mapWrapper||this._containerDOM;Jr(r,Vv,this._handleDOMEvent,this),Jr(r,Zv,jv,this)},_removeDomEvents:function(){var r=this._panels.mapWrapper||this._containerDOM;In(r,Vv,this._handleDOMEvent),In(r,Zv,jv)},_handleDOMEvent:function(r){if(r&&r.type==="drop"){r.stopPropagation(),r.preventDefault();var t=this._parseEvent(r,r.type);t=oe({},t,{dataTransfer:r.dataTransfer}),this._fireEvent(r.type,t);return}var i=this.options.clickTimeThreshold,e=r.type;if(!(Hl(e)&&!wr.isTest&&this.options.mousemoveThrottleEnable&&my(this,this.options.mousemoveThrottleTime))){var o=e==="mousedown"||e==="touchstart"&&(!r.touches||r.touches.length===1);o&&(this._domMouseDownTime=He(),this._domMouseDownView=this.getView());var s=e==="contextmenu"&&JE(this);if(e==="contextmenu"){hi(r);var a=this._domMouseDownTime,l=He();l-a<=i&&!s&&this._fireDOMEvent(this,r,"dom:"+r.type)}else this._fireDOMEvent(this,r,"dom:"+r.type);if(!this._ignoreEvent(r)){var h=!1;if(o)this._mouseDownTime=He();else if(e==="click"||e==="touchend"||e==="contextmenu")if(this._mouseDownTime){var u=this._mouseDownTime;delete this._mouseDownTime;var c=He();if(c-u>i){if(e==="click"||e==="contextmenu")return}else if(e==="contextmenu"){if(s)return}else e==="touchend"&&(h=!0)}else return;var f;h&&(this._clickTime&&He()-this._clickTime<=i?(delete this._clickTime,f="dblclick",this._fireDOMEvent(this,r,"dom:dblclick")):(this._clickTime=He(),f="click",this._fireDOMEvent(this,r,"dom:click"))),!this._ignoreEvent(r)&&(this._fireDOMEvent(this,r,e),f&&this._fireDOMEvent(this,r,f))}}},_ignoreEvent:function(r){if(!r||!this._panels.control)return!1;var t=r.srcElement||r.target,i;if(t)for(;t&&t!==this._containerDOM;){if(t.className&&t.className.indexOf&&(t.className.indexOf("maptalks-control")>=0||t.className.indexOf("maptalks-ui")>=0&&i&&!i.eventsPropagation))return!0;i=t,t=t.parentNode}return!1},_isEventOutMap:function(r){var t=this._getActualEvent(r),i=yr(t,this._containerDOM);return this._isContainerPointOutOfMap(i)},_isContainerPointOutOfMap:function(){var n=[0,0,0],r=[0,0,0],t=new Jb(n,r),i=[0,0,0];return function(e){var o=this.getPitch();if(o>Hv[0]&&o<Hv[1]){this.getContainerPointRay(n,r,e,0,.5),t.setFromTo(n,r);var s=t.intersectGround(i);if(!s)return!0;var a=t.distanceToGround();if(a<=0)return!0}return!1}}(),_wrapTerrainData:function(r){this.options.queryTerrainInMapEvents&&r.containerPoint&&!r.terrain&&!this.isInteracting()&&(r.terrain=this._queryTerrainInfo(r.containerPoint))},_parseEvent:function(r,t){if(!r)return null;var i={domEvent:r};if(t!=="keypress"){var e=this._getActualEvent(r);if(e&&e.clientX!==void 0){var o=yr(e,this._containerDOM);i=oe(i,{containerPoint:o,viewPoint:this.containerPointToViewPoint(o)}),this._isContainerPointOutOfMap(o)||(i=oe(i,{coordinate:this.containerPointToCoord(o),point2d:this._containerPointToPoint(o)}))}}return this._wrapTerrainData(i),i},_parseEventFromCoord:function(r){var t=this.coordToContainerPoint(r),i=this.containerPointToViewPoint(t),e={coordinate:r,containerPoint:t,viewPoint:i,point2d:this.coordToPoint(r)};return e},_getActualEvent:function(r){return r=r,r.touches&&r.touches.length>0?r.touches[0]:r.changedTouches&&r.changedTouches.length>0?r.changedTouches[0]:r},_fireDOMEvent:function(r,t,i){var e=this;if(!this.isRemoved()){var o=this._parseEvent(t,i);if(!(!o.coordinate&&i!=="keypress"&&i.indexOf("dom:")===-1)){this._wrapTerrainData(o);var s=function(){if(o.domEvent&&o.domEvent._cancelBubble){e._fireEvent("_"+i,o);return}e._fireEvent(i,o)};Hl(i)?this.options.mousemoveThrottleEnable?this.getRenderer().callInNextFrame(function(){s()}):s():this._fireEvent(i,o)}}},_getEventParams:function(r){var t=this,i={domEvent:r},e=r.touches&&r.touches.length>0?r.touches[0]:r.changedTouches&&r.changedTouches.length>0?r.changedTouches[0]:r;if(e){var o=yr(e,t.getContainer());i.coordinate=t.containerPointToCoordinate(o),i.containerPoint=o,i.viewPoint=t.containerPointToViewPoint(o),i.point2d=t._containerPointToPoint(o)}return this._wrapTerrainData(i),i}});Se.addOnLoadHook("_registerDomEvents");Se.mergeOptions({queryTerrainInMapEvents:!1});function JE(n){if(!n._domMouseDownView)return!0;var r=n.getView(),t=n._domMouseDownView;return r.bearing!==t.bearing||r.pitch!==t.pitch}Se.include({isFullScreen:function(){var r=document;return!!(r.webkitIsFullScreen||r.mozFullScreen||r.msFullscreenElement||r.fullscreenElement)},requestFullScreen:function(r){return this._fireEvent("fullscreenstart"),this._requestFullScreen(r||this._containerDOM),this._fireEvent("fullscreenend"),this},cancelFullScreen:function(){return this._cancelFullScreen(),this._fireEvent("cancelfullscreen"),this},_requestFullScreen:function(r){if(r.requestFullscreen)r.requestFullscreen();else if(r.mozRequestFullScreen)r.mozRequestFullScreen();else if(r.webkitRequestFullScreen)r.webkitRequestFullScreen();else if(r.msRequestFullScreen)r.msRequestFullScreen();else{var t="fullscreen=1,status=no,resizable=yes,top=0,left=0,scrollbars=no,titlebar=no,menubar=no,location=no,toolbar=no,z-look=yes,width="+(screen.availWidth-8)+",height="+(screen.availHeight-45),i=window.open(location.href,"_blank",t);i!==null&&(window.opener=null,window.close())}},_cancelFullScreen:function(){var r=document;if(document.exitFullscreen)document.exitFullscreen();else if(r.mozCancelFullScreen)r.mozCancelFullScreen();else if(r.webkitCancelFullScreen)r.webkitCancelFullScreen();else{var t="fullscreen=no,status=yes,resizable=yes,scrollbars=no,titlebar=no,menubar=yes,location=yes,toolbar=yes,z-look=yes",i=window.open(location.href,"_blank",t);i!==null&&(window.opener=null,window.close())}}});Se.include({panTo:function(r,t={},i){if(!r)return this;if(Oe(t)&&(i=t,t={}),r=new $(r),typeof t.animation>"u"||t.animation){var e=this.getProjection().project(r);return this._panAnimation(e,t.duration,i)}else this.setCenter(r);return this},_panTo:function(r,t={}){return typeof t.animation>"u"||t.animation?this._panAnimation(r,t.duration):(this.onMoveStart(),this._setPrjCenter(r),this.onMoveEnd(this._parseEventFromCoord(this.getCenter())),this)},panBy:function(r,t={},i){if(!r)return this;Oe(t)&&(i=t,t={}),r=new z(r);var e=this.getContainerExtent(),o=e.ymin;if(o>0&&r.y>30){var s=r.y;r.y=30,r.x=r.x*30/s,console.warn("offset is limited to panBy when pitch is above maxPitch")}if(typeof t.animation>"u"||t.animation){r=r.multi(-1);var a=this._containerPointToPrj(new z(this.width/2+r.x,this.height/2+r.y));this._panAnimation(a,t.duration,i)}else{this.onMoveStart(),this._offsetCenterByPixel(r);var l=this.containerPointToCoord(new z(this.width/2,this.height/2));this.onMoveEnd(this._parseEventFromCoord(l))}return this},_panAnimation:function(r,t,i){return this._animateTo({prjCenter:r},{duration:t||this.options.panAnimationDuration},i)}});Se.include({computeLength:function(r,t){if(!this.getProjection())return null;var i=new $(r),e=new $(t);return i.equals(e)?0:this.getProjection().measureLength(i,e)},computeGeometryLength:function(r){return r._computeGeodesicLength(this.getProjection())},computeGeometryArea:function(r){return r._computeGeodesicArea(this.getProjection())},identify:function(r,t){r=r||{};var i=new $(r.coordinate);return this._identify(r,t,function(e){return e.identify(i,r)})},identifyAtPoint:function(r,t){var i=r.includeInternals,e=r.tolerance;r=r||{};var o=new z(r.containerPoint),s=this.containerPointToCoord(o);return this._identify(r,t,function(a){var l,h=r.containerPoint;if(i&&!O(a.options.geometryEventTolerance)&&(r.tolerance=r.tolerance||0,r.tolerance+=a.options.geometryEventTolerance),a._hasGeoListeners&&i&&r.eventTypes.indexOf("mousemove")>=0&&!a._hasGeoListeners(r.eventTypes))return[];if(a.identifyAtPoint?l=a.identifyAtPoint(h,r):s&&a.identify?l=a.identify(s,r):l=[],i&&(O(e)?delete r.tolerance:r.tolerance=e),(!l||!l.length)&&(a.fire("identifyempty",r),a.getLayers&&Oe(a.getLayers))){var u=(a.getLayers()||[]).filter(function(c){return c});u.forEach(function(c){c.fire("identifyempty",r)})}return l})},_identify:function(r,t,i){var e=r.layers;if(!$e(e))return this;for(var o=r.eventTypes,s=[],a=0,l=e.length;a<l;a++)Ee(e[a])?s.push(this.getLayer(e[a])):s.push(e[a]);o&&(s=s.filter(function(p){return p._hasGeoListeners?p._hasGeoListeners(o):!0}));for(var h=[],u=s.length-1;u>=0&&!(r.count&&h.length>=r.count);u--){var c=s[u];if(!(!c||!c.getMap()||!r.includeInvisible&&!c.isVisible()||!r.includeInternals&&c.getId().indexOf(xa)>=0)){var f=i(c),d=c.getId();if(f)if(Array.isArray(f)){for(var g=0;g<f.length;g++)f[g]&&!f[g].getLayer&&O(f[g].layer)&&(f[g].layer=d);Yt(h,f)}else!f.getLayer&&O(f.layer)&&(f.layer=d),h.push(f)}}return t.call(this,h),this}});Se.include({_zoom:function(r,t){!this.options.zoomable||this.isZooming()||(t=this._checkZoomOrigin(t),r=this._checkZoom(r),this.onZoomStart(r,t),this._frameZoom=this.getZoom(),this.onZoomEnd(r,t))},_zoomAnimation:function(r,t,i){!this.options.zoomable||this.isZooming()||(r=this._checkZoom(r),this.getZoom()!==r&&(t=this._checkZoomOrigin(t),this._startZoomAnim(r,t,i)))},_checkZoomOrigin:function(r){return(!r||this.options.zoomInCenter||this._isContainerPointOutOfMap(r))&&(r=new z(this.width/2,this.height/2)),this.options.zoomOrigin&&(r=new z(this.options.zoomOrigin)),r},_startZoomAnim:function(r,t,i){O(i)&&(i=1);var e=this._getResolution(this._startZoomVal)/this._getResolution(r),o=this.options.zoomAnimationDuration*Math.abs(e-i)/Math.abs(e-1);this._frameZoom=this._startZoomVal,this._animateTo({zoom:r,around:t},{continueOnViewChanged:!0,duration:o})},onZoomStart:function(r,t){!this.options.zoomable||this.isZooming()||(this._mapAnimPlayer&&this._stopAnim(this._mapAnimPlayer),delete this.cameraZenithDistance,this._zooming=!0,this._startZoomVal=this.getZoom(),this._startZoomCoord=t&&this._containerPointToPrj(t),this._fireEvent("zoomstart",{from:this._startZoomVal,to:r}))},onZooming:function(r,t,i){if(this.options.zoomable){var e=this._frameZoom;if(e!==r){O(i)&&(i=1),this._zoomTo(r,t);var o=this.getResolution(r),s=this.getResolution(this._startZoomVal),a=s/o/i,l=this._startZoomCoord&&this.prjToContainerPoint(this._startZoomCoord,this._startZoomVal),h=this.getViewPoint();if(!this.isRotating()&&l&&t&&!l.equals(t)&&a!==1){var u=this.getPitch(),c=l._sub(t)._multi(1/(1-a));u&&(c.y/=Math.cos(u*Math.PI/180)),t=t.add(c)}var f=t&&t.x||this.width/2,d=t&&t.y||this.height/2,g={view:[a,0,0,a,(f-h.x)*(1-a),(d-h.y)*(1-a)]},p=this.getDevicePixelRatio();g.container=[a,0,0,a,f*p*(1-a),d*p*(1-a)],this._fireEvent("zooming",{from:this._startZoomVal,to:r,origin:new z(f,d),matrix:g}),this._frameZoom=r}}},onZoomEnd:function(r,t){if(this.options.zoomable){var i=this._startZoomVal;this._zoomTo(r,t),this._zooming=!1,this._getRenderer().onZoomEnd(),this._suppressRecenter||this._recenterOnTerrain(),this._fireEvent("zoomend",{from:i,to:r}),!this._verifyExtent(this._getPrjCenter())&&!this.options.limitExtentOnMaxExtent&&this._panTo(this._prjMaxExtent.getCenter())}},_zoomTo:function(r,t){if(this._zoomLevel=r,this._calcMatrices(),t&&this._startZoomCoord){var i=this._containerPointToPoint(t),e=i._sub(this._prjToPoint(this._getPrjCenter()));this._setPrjCoordAtOffsetToCenter(this._startZoomCoord,e)}},_checkZoom:function(r){var t=this.getMaxZoom(),i=this.getMinZoom();return r<i&&(r=i),r>t&&(r=t),r}});function oc(n,r,t){var i=r[0],e=r[1],o=r[2],s=1/(t[3]*i+t[7]*e+t[11]*o+t[15]);return n[0]=(t[0]*i+t[4]*e+t[8]*o+t[12])*s,n[1]=(t[1]*i+t[5]*e+t[9]*o+t[13])*s,n[2]=(t[2]*i+t[6]*e+t[10]*o+t[14])*s,n}function XE(n,r){var t=r[0],i=r[4],e=r[8],o=r[1],s=r[5],a=r[9],l=r[2],h=r[6],u=r[10],c=t+s+u,f;return c>0?(f=.5/Math.sqrt(c+1),n.w=.25/f,n.x=(h-a)*f,n.y=(e-l)*f,n.z=(o-i)*f):t>s&&t>u?(f=2*Math.sqrt(1+t-s-u),n.w=(h-a)/f,n.x=.25*f,n.y=(i+o)/f,n.z=(e+l)/f):s>u?(f=2*Math.sqrt(1+s-t-u),n.w=(e-l)/f,n.x=(i+o)/f,n.y=.25*f,n.z=(a+h)/f):(f=2*Math.sqrt(1+u-t-s),n.w=(o-i)/f,n.x=(e+l)/f,n.y=(a+h)/f,n.z=.25*f),this}function YE(n,r){var t=n,i=r.x,e=r.y,o=r.z,s=r.w,a=i+i,l=e+e,h=o+o,u=i*a,c=i*l,f=i*h,d=e*l,g=e*h,p=o*h,m=s*a,v=s*l,_=s*h;return t[0]=1-(d+p),t[4]=c-_,t[8]=f+v,t[1]=c+_,t[5]=1-(u+p),t[9]=g-m,t[2]=f-v,t[6]=g+m,t[10]=1-(u+d),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function qE(n,r){var t=n;return t[12]=r[0],t[13]=r[1],t[14]=r[2],n}function KE(n,r,t,i){var e=[0,0,0],o=[0,0,0],s=[0,0,0];return xn(s,r,t),jp(s)===0&&(s[2]=1),Qi(s,s),en(e,i,s),jp(s)===0&&(Math.abs(i[2])===1?s[0]+=1e-4:s[2]+=1e-4,Qi(s,s),en(e,i,s)),Qi(e,e),en(o,s,e),n[0]=e[0],n[4]=o[0],n[8]=s[0],n[1]=e[1],n[5]=o[1],n[9]=s[1],n[2]=e[2],n[6]=o[2],n[10]=s[2],n}var qt=Math.PI/180,QE=.6435011087932844,sc=new $(0,0),Wv=new z(0,0),eS=[0,-1,0],$v=[];Se.include({getFov:function(){return this._fov||(this._fov=QE),this._fov/qt},setFov:function(r){if(this.isZooming())return this;if(r=Math.max(.01,Math.min(60,r)),this._fov===r)return this;var t=this.getFov();return this._fov=r*qt,this._calcMatrices(),this._renderLayers(),this._fireEvent("fovchange",{from:t,to:this.getFov()}),this},getBearing:function(){return this._angle?-this._angle/qt:0},setBearing:function(r){var t={bearing:r};return this._validateView(t),this._mapAnimPlayer&&this._stopAnim(this._mapAnimPlayer),this._setBearing(t.bearing)},_setBearing:function(r){if(Ce.ie9)throw new Error("map can't rotate in IE9.");var t=-An(r,-180,180)*qt;if(this._angle===t)return this;var i=this.getBearing();return this._fireEvent("rotatestart",{from:i,to:t}),this._angle=t,this._calcMatrices(),this._renderLayers(),this._fireEvent("rotate",{from:i,to:t}),this._fireEvent("rotateend",{from:i,to:t}),this},getPitch:function(){return this._pitch?this._pitch/Math.PI*180:0},setPitch:function(r){var t={pitch:r};return this._validateView(t),this._mapAnimPlayer&&this._stopAnim(this._mapAnimPlayer),this._setPitch(t.pitch)},_setPitch:function(r){if(Ce.ie9)throw new Error("map can't tilt in IE9.");var t=Bl(r,0,this.options.maxPitch)*qt;if(this._pitch===t)return this;var i=this.getPitch();return this._fireEvent("pitchstart",{from:i,to:t}),this._pitch=t,this._calcMatrices(),this._renderLayers(),this._fireEvent("pitch",{from:i,to:t}),this._fireEvent("pitchend",{from:i,to:t}),this},setCameraMovements:function(r,t){var i=this;if(!Array.isArray(r)||!r.length)return this;if(r.forEach(function(f){i._validateView(f)}),this.setView({center:r[0].center,zoom:r[0].zoom,pitch:r[0].pitch,bearing:r[0].bearing}),r.length===1)return this;var e=1,o=function(d){if(d.state.playState==="finished"){e++,e===r.length-1&&(o=null);var g=r[e];g.duration=g.timestamp-r[e-1].timestamp,t&&t.autoRotate&&(g.bearing=tS(r[e-1].center,g.center)),i._setCameraMovement(g,o)}};r.length===2&&(o=null);var s=this.getBearing();this._setCameraMovement(Object.assign({bearing:s,duration:r[e].timestamp-r[e-1].timestamp},r[e]),o);var a=function(){i._animPlayer.play()},l=function(){i._animPlayer.pause()},h=function(){i._animPlayer.cancel()},u=function(){i._animPlayer.finish()},c=function(){i._animPlayer.reverse()};return{play:a,pause:l,cancel:h,finish:u,reverse:c}},_setCameraMovement:function(r,t){this.animateTo({zoom:r.zoom,center:r.center,pitch:r.pitch,bearing:r.bearing},{duration:r.duration,easing:"out"},t)},lookAt:function(r){var{coordinates:t,bearing:i,pitch:e,distance:o}=r;if(t=r.center||t,Array.isArray(t)&&(t=new $(t)),!t.z&&!o)return this.setCenter(t);var s=this.getGLRes();i=O(i)?this.getBearing():i,e=O(e)?this.getPitch():e;var a=e*qt,l=i*qt;if(o){var h=o*Math.sin(a),u=Math.sin(a)*o,c=u*Math.sin(l),f=u*Math.cos(l);h=h*this._meterToGLPoint,u=this.distanceToPointAtRes(c,f,s).mag(),o=Math.sqrt(u*u+h*h)}var d=this.coordToPointAtRes(t,s);d.z=0,t.z&&(d.z=t.z*this._meterToGLPoint);var g=o||this.cameraToGroundDistance||this.cameraToCenterDistance,p=Math.sin(a)*g,m=g*Math.cos(a),v=d.x-p*Math.sin(l),_=d.y-p*Math.cos(l),y=[v,_,m+d.z],w=new z(y),x=this.pointAtResToCoord(w,s),C=w.z/this._meterToGLPoint;return x.z=C,this.setCameraOrientation({position:x.toArray(),bearing:i,pitch:e})},setCameraOrientation:function(r){var{position:t}=r;this._validateView(r);var{pitch:i,bearing:e}=r;i=i||0,e=e||0;var{zoom:o,cameraToGroundDistance:s}=this.getFitZoomForCamera(t,i),a=Math.sin(i*qt)*s,l=An(e,-180,180),h=l*qt,u=this.getGLRes(),c=new $(t[0],t[1]),f=this.coordToPointAtRes(c,u),d=new z(0,0);d.x=f.x+a*Math.sin(h),d.y=f.y+a*Math.cos(h);var g=this._pointToPrjAtRes(d,this.getGLRes());return this._setPrjCenter(g),this.setView({bearing:e,pitch:i,zoom:o}),this},setCameraPosition:function(r){var t=this.getGLRes(),i=this.coordToPointAtRes(r,t);i.z=this.altitudeToPoint(r.z||0,t);var e=this.getCenter(),o=this.coordToPointAtRes(e,t);o.z=this.altitudeToPoint(e.z,t);var s=xn([],i.toArray(),o.toArray());return jt(this.cameraUp||[0,0,0],0,0,1),this._pitch=Zp(s,this.cameraUp),jt($v,s[0],s[1],0),this._angle=-Zp($v,eS),this._zoomLevel=this.getFitZoomForCamera(r,this._pitch).zoom,this._calcMatrices(),this},getFitZoomForCamera:function(r,t){X(t)||(t=0);var i=Array.isArray(r)?r[2]||0:r.z||0,e=i*this._meterToGLPoint,o=this.centerAltitude||0,s=o*this._meterToGLPoint,a=e-s,l=t*qt,h=a/Math.cos(l),u=h+s,c=this.getFitZoomForAltitude(u);return{zoom:c,cameraToGroundDistance:h}},getFitZoomForAltitude:function(r){var t=this._getFovRatio(),i=r*t*2/(this.height||1)*this.getGLRes();return this.getZoomFromRes(i)},isTransforming:function(){return!!(this._pitch||this._angle||this._terrainLayer)},getFrustumAltitude:function(){return this._frustumAltitude},_calcFrustumAltitude:function(){var r=90-this.getPitch(),t=this.getFov()/2,i=this.cameraPosition?this.cameraPosition[2]:0;if(t<=r)return i;t=Math.PI*t/180;var e=new z(this.cameraPosition).distanceTo(new z(this.cameraLookAt)),o=i*Math.tan(t*2),s=Math.tan(t)*(e+o);return i+s},_pointToContainerPoint:function(r,t,i=0,e){var o=this._getResolution(t);return this._pointAtResToContainerPoint(r,o,i,e)},_pointAtResToContainerPoint:function(r,t,i=0,e){e||(e=new z(0,0)),r=this._pointAtResToPoint(r,t,e);var o=this.isTransforming(),s;return!o&&!i&&(s=this._prjToPoint(this._getPrjCenter(),void 0,sc)),this._toContainerPoint(e,o,i,s),e},_pointsAtResToContainerPoints:function(r,t,i=[],e=[]){var o=this.getPitch(),s=this.getBearing(),a=t/this._getResolution();if(o===0&&s===0&&!hf(i)){var{xmin:l,ymin:h,xmax:u,ymax:c}=this.get2DExtent();if(u>l&&c>h){for(var{width:f,height:d}=this.getSize(),g=(u-l)/f,p=(c-h)/d,m=0,v=r.length;m<v;m++){if(!r[m]){e[m]=null;continue}var _=e[m];_.x=r[m].x,_.y=r[m].y,_._multi(a),_.x=(_.x-l)*g,_.y=d-(_.y-h)*p}return e}}for(var y=Array.isArray(i),w=this.isTransforming(),x=this._prjToPoint(this._getPrjCenter(),void 0,sc),C=0,b=r.length;C<b;C++){if(!r[C]){e[C]=null;continue}var E=e[C];E.x=r[C].x,E.y=r[C].y,E._multi(a);var T=y?i[C]||0:i;this._toContainerPoint(E,w,T,x)}return e},_toContainerPoint:function(){var n=[0,0,0];return function(r,t,i,e){var o=this.width/2,s=this.height/2;if(t||i){this._altitudeScale||(this._altitudeScale=this.altitudeToPoint(100,this.getGLRes())/100);var a=this._glScale;jt(n,r.x*a,r.y*a,i*this._altitudeScale);var l=this._projIfBehindCamera(n,this.cameraPosition,this.cameraForward);oc(l,l,this.projViewMatrix),r.x=l[0]*o+o,r.y=-(l[1]*s)+s}else r._sub(e.x,e.y),r.set(r.x,-r.y),r._add(o,s)}}(),_projIfBehindCamera:function(){var n=new Array(3),r=new Array(3),t=new Array(3);return function(i,e,o){xn(n,i,e);var s=Ci(o,n);return s<=0&&(Zy(r,o,s*1.01),jy(i,e,xn(t,n,r))),i}}(),_containerPointToPoint:function(r,t,i,e){var o=this._getResolution(t);return this._containerPointToPointAtRes(r,o,i,e)},_containerPointToPointAtRes:function(){var n=[0,0,0],r=[0,0,0];return function(t,i,e,o){if(this.isTransforming()||o){this.getContainerPointRay(n,r,t);var s=n[0],a=r[0],l=n[1],h=r[1],u=n[2],c=r[2],f=this.getGLRes(),d=o?this.altitudeToPoint(o,f):0,g=u===c?d:(d-u)/(c-u),p=zl(s,a,g),m=zl(l,h,g);return e?(e.x=p,e.y=m):e=new z(p,m),e._multi(1/this._glScale),this._getResolution()===i?e:this._pointToPointAtRes(e,i,e)}var v=this._prjToPointAtRes(this._getPrjCenter(),i,e),_=this._getResolution()/i,y=_*(t.x-this.width/2),w=_*(t.y-this.height/2);return v._add(y,-w)}}(),getContainerPointRay:function(){var n=[0,0,0],r=[0,0,0,1],t=[0,0,0,1];return function(i,e,o,s=0,a=1){var l=this.width/2||1,h=this.height/2||1,u=o;jt(n,(u.x-l)/l,(h-u.y)/h,0),jt(r,n[0],n[1],s),jt(t,n[0],n[1],a),r[3]=t[3]=1,oc(i,r,this.projViewMatrixInverse),oc(e,t,this.projViewMatrixInverse)}}(),_calcMatrices:function(){var n=Er();return function(){delete this._mapRes,delete this._mapGlRes,delete this._mapExtent2D,delete this._mapGlExtent2D;var r=this.getSize(),t=r.width||1,i=r.height||1;this._glScale=this.getGLScale();var e=this._getCameraWorldMatrix(),o=this.getFov()*Math.PI/180,s=this._getCameraFar(o,this.getPitch());this.cameraFar=s,this.cameraNear=this.cameraCenterDistance/20;var a=this.projMatrix||Er(),l=this.options.renderer==="gpu";l?Iy(a,o,t/i,this.cameraNear,s):Wc(a,o,t/i,this.cameraNear,s),this.projMatrix=a,this.viewMatrix=$c(this.viewMatrix||Er(),e),this.projViewMatrix=so(this.projViewMatrix||Er(),a,this.viewMatrix),this._calcCascadeMatrixes(),this.projViewMatrixInverse=so(this.projViewMatrixInverse||Er(),e,$c(n,a)),this.domCssMatrix=this._calcDomMatrix(),this._frustumAltitude=this._calcFrustumAltitude(),this._mapRes=this._getResolution(),this._mapGlRes=this.getGLRes(),this._mapExtent2D=this.get2DExtent(),this._mapGlExtent2D=this.get2DExtentAtRes(this._mapGlRes);var h=this.getRenderer();h&&h._updateMapStateCache&&h._updateMapStateCache()}}(),_getCameraFar:function(r,t){var i=this.cameraCenterDistance=Xc(this.cameraPosition,this.cameraLookAt),e=i/this._meterToGLPoint;t=Math.min(t,85),t=t*Math.PI/180;var o=e+this.options.cameraFarUndergroundInMeter/Math.cos(t);return Math.max(o*this._meterToGLPoint,i*5)},_calcCascadeMatrixes:function(){var n=Er();function r(t,i,e){var o=this.width,s=this.height,a=this.getFov()*Math.PI/180,l=this._getCameraFar(a,i),h=this.cameraCenterDistance;l=h+(l-h)/Math.cos((90-i)*Math.PI/180)*Math.cos((90-t)*Math.PI/180),Wc(n,a,o/s,.1,l);var u=this.viewMatrix;return so(e,n,u)}return function(){var t=this.getPitch(),i=this.options.cascadePitches[0],e=this.options.cascadePitches[1],o=this.cascadeFrustumMatrix0=this.cascadeFrustumMatrix0||Er(),s=this.cascadeFrustumMatrix1=this.cascadeFrustumMatrix1||Er();t>i?r.call(this,t,i,o):Uc(this.cascadeFrustumMatrix0,this.projViewMatrix),t>e?r.call(this,t,e,s):Uc(this.cascadeFrustumMatrix1,this.cascadeFrustumMatrix0)}}(),_calcDomMatrix:function(){var n=Er(),r=Er(),t=[1,-1,1],i=[0,0,0];return function(){var e=this.width||1,o=this.height||1,s=.5/Math.tan(this._fov/2)*o;return $l(n,this.projMatrix,t),Kf(n,n,jt(i,0,0,-s)),this._pitch&&Dy(n,n,this._pitch),this._angle&&zy(n,n,this._angle),Gh(r),$l(r,r,jt(i,e/2,-o/2,1)),so(this.domCssMatrix||Er(),r,n)}}(),_getFovZ:function(r){var t=this.getGLScale(r),i=this._getFovRatio();return t*(this.height||1)/2/i},_getCameraWorldMatrix:function(){var n={};return function(){var r=this.getGLRes();this._meterToGLPoint||(this._meterToGLPoint=this.altitudeToPoint(100,r)/100);var t=this._prjToPointAtRes(this._prjCenter,r,Wv),i=this.getCenter().z,e=i!==void 0?i:this.centerAltitude||0,o=e*this._meterToGLPoint;this.cameraLookAt=jt(this.cameraLookAt||[0,0,0],t.x,t.y,o);var s=this.getPitch()*qt,a=this.getBearing()*qt,l=this._getFovZ(),h=this.cameraZenithDistance===void 0?l:this.cameraZenithDistance,u=h-o;this.cameraToGroundDistance=u;var c=u*Math.cos(s),f=Math.sin(s)*u,d=t.x-f*Math.sin(a),g=t.y-f*Math.cos(a);this.cameraPosition=jt(this.cameraPosition||[0,0,0],d,g,c+o),this.cameraToCenterDistance=l,this.cameraUp=this.cameraUp||[0,0,0],this.cameraUp=this._getCameraUp(this.cameraUp,this.cameraLookAt,this.cameraPosition,s,a);var p=this.cameraWorldMatrix=this.cameraWorldMatrix||Er();KE(p,this.cameraPosition,this.cameraLookAt,this.cameraUp);var m=this.cameraForward||[0,0,0];return xn(m,this.cameraLookAt,this.cameraPosition),this.cameraForward=Qi(m,m),XE(n,p),YE(p,n),qE(p,this.cameraPosition),p}}(),_getCameraUp:function(){var n=[0,0,0],r=[0,0,0],t=[0,0,0];return function(i,e,o,s,a){jt(t,0,0,1),s===0?jt(t,Math.sin(a),Math.cos(a),0):s===Math.PI&&jt(t,-Math.sin(a),-Math.cos(a),0);var l=xn(n,e,o);Qi(l,l);var h=en(r,l,t);return en(i,h,l)}}(),updateCenterAltitude:function(){this.getRenderer().setToRedraw(),!this.centerAltitude&&this._hasAltitudeLayer()&&(this.centerAltitude=0),this._recenterOnTerrain()},_recenterOnTerrain:function(){if(this.centerAltitude!==void 0){var r=this._queryTerrainByProjCoord(this._prjCenter);if(O(r)&&this._hasAltitudeLayer()&&(r=this.centerAltitude),!(r>=this.centerAltitude)){var t=r>0&&r||0,i=this.getPitch()*qt,e=this.getBearing()*qt,o=(t-this.centerAltitude)*this._meterToGLPoint,s=this._getFovZ(),a=this.cameraZenithDistance===void 0?s:this.cameraZenithDistance,l=a-this.centerAltitude*this._meterToGLPoint,h=l-o/Math.cos(i),u=this.cameraPosition,c=Math.sin(i)*h,f=Wv;f.x=u[0]+c*Math.sin(e),f.y=u[1]+c*Math.cos(e);var d=t*this._meterToGLPoint;this.cameraZenithDistance=(u[2]-d)/Math.cos(i)+d,this.centerAltitude=t;var g=this.pointAtResToCoordinate(f,this.getGLRes(),sc);this._eventSilence=!0,this._suppressRecenter=!0,this.setCenter(g),delete this._suppressRecenter,delete this._eventSilence,O(r)&&delete this.centerAltitude}}},_queryTerrainByProjCoord:function(r){for(var t=this._getLayers(),i=0;i<t.length;i++)if(t[i].queryTerrainByProjCoord)return t[i].queryTerrainByProjCoord(r)[0];return 0},_hasAltitudeLayer:function(){for(var r=this._getLayers(),t=0;t<r.length;t++)if(r[t].getTerrainLayer&&r[t].getTerrainLayer())return!0;return!1},_queryTerrainInfo:function(r){if(r){var t=this._findTerrainLayer();if(!t)return null;var i=t.queryTerrainAtPoint(r);if(i)return{coordinate:i,altitude:i.z}}return null},_query3DTilesInfo:function(r){for(var t=this._getLayers()||[],i=0;i<t.length;i++){var e=t[i];if(r&&e&&e.query3DTilesAtPoint){var o=e.query3DTilesAtPoint(r);if(o)return{coordinate:o,altitude:o.z};break}}return null},queryPrjCoordAtContainerPoint:function(r){var t=this._query3DTilesInfo(r);if(t||(t=this._queryTerrainInfo(r)),t){var i=this.getProjection().project(t.coordinate);return i.z=t.altitude,i}return this._isContainerPointOutOfMap(r)&&(r=new z(this.width/2,this.height/2)),this._containerPointToPrj(r)},_getFovRatio:function(){var r=this.getFov();return Math.tan(r/2*qt)},_renderLayers:function(){if(!this.isInteracting()){var r=this._getLayers();r.forEach(function(t){if(t){var i=t._getRenderer();i&&i.setToRedraw&&i.setToRedraw()}})}}});function Er(){return Gh(new Array(16))}function tS(n,r){var t=mt(n[0]),i=mt(r[0]),e=mt(n[1]),o=mt(r[1]),s=Math.sin(i-t)*Math.cos(o),a=Math.cos(e)*Math.sin(o)-Math.sin(e)*Math.cos(o)*Math.cos(i-t);return Bf(Math.atan2(s,a))}Se.include({_onViewChange:function(r){this._viewHistory||(this._viewHistory=[],this._viewHistoryPointer=0);for(var t=this._getCurrentView(),i=this._viewHistory.length-1;i>=0;i--)if(Fl(r,this._viewHistory[i])){this._viewHistoryPointer=i,this._fireViewChange(t,r);return}this._viewHistoryPointer<this._viewHistory.length-1&&this._viewHistory.splice(this._viewHistoryPointer+1),this._viewHistory.push(r);var e=this.options.viewHistoryCount;e>0&&this._viewHistory.length>e&&this._viewHistory.splice(0,this._viewHistory.length-e),this._viewHistoryPointer=this._viewHistory.length-1,this._fireViewChange(t,r)},zoomToPreviousView:function(r={}){if(!this.hasPreviousView())return null;var t=this._viewHistory[--this._viewHistoryPointer];return this._zoomToView(t,r),t},hasPreviousView:function(){return!(!this._viewHistory||this._viewHistoryPointer===0)},zoomToNextView:function(r={}){if(!this.hasNextView())return null;var t=this._viewHistory[++this._viewHistoryPointer];return this._zoomToView(t,r),t},hasNextView:function(){return!(!this._viewHistory||this._viewHistoryPointer===this._viewHistory.length-1)},_zoomToView:function(r,t){var i=this,e=this.getView();t.animation?this._animateTo(r,{duration:t.duration},function(o){o.state.playState==="finished"&&i._fireViewChange(e,r)}):(this.setView(r),this._fireViewChange(e,r))},getViewHistory:function(){return this._viewHistory},_fireViewChange:function(r,t){this._fireEvent("viewchange",{old:r,new:t}),this._insertUICollidesQueue()},_getCurrentView:function(){return this._viewHistory?this._viewHistory[this._viewHistoryPointer]:null}});Se.mergeOptions({viewHistory:!0,viewHistoryCount:10});var rS=new Go;Se.include({getCollisionIndex:function(){return this._collisionIndex||this.createCollisionIndex(),this._collisionIndex||this.createCollisionIndex()},createCollisionIndex:function(){return this.clearCollisionIndex(),this._collisionIndex=new Go,this._collisionIndex},clearCollisionIndex:function(){return this.collisionFrameTime=0,this._collisionIndex&&this._collisionIndex.clear(),this},_insertUICollidesQueue:function(){return this._uiCollidesQueue||(this._uiCollidesQueue=[]),this._uiCollidesQueue.push(1),this},uiCollides:function(){if(!this.uiList||this.uiList.length===0||!this._uiCollidesQueue||this._uiCollidesQueue.length===0)return this;var r=rS;r.clear();for(var t=this.uiList,i=0,e=t.length;i<e;i++){var o=t[i],{collisionBufferSize:s,collision:a}=o.options;if(!a){o._collidesEffect(!0);continue}var l=o.getDOM();if(!(!o.isVisible()||!l)&&l.getBoundingClientRect){o.bbox||(o.bbox=[0,0,0,0]);var h=l.getBoundingClientRect(),{x:u,y:c}=h,{width:f,height:d}=h;if(f===0||d===0){var g=o.getSize();g&&(f=g.width,d=g.height)}var p=u-s,m=u+f+s,v=c-s,_=c+d+s;if(o.bbox[0]=p,o.bbox[1]=v,o.bbox[2]=m,o.bbox[3]=_,r.collides(o.bbox)){o._collidesEffect(!1);continue}r.insertBox(o.bbox),o._collidesEffect(!0)}}return this._uiCollidesQueue=[],this},_addUI:function(r){this.uiList||(this.uiList=[]);var t=this.uiList.indexOf(r);return t>-1?this:(this.uiList.push(r),this._sortUI())},_sortUI:function(){return this.uiList=this.uiList||[],this.uiList=this.uiList.sort(function(r,t){return t.options.collisionWeight-r.options.collisionWeight}),this},_removeUI:function(r){if(!this.uiList)return-1;var t=this.uiList.indexOf(r);return t<0||this.uiList.splice(t,1),t}});var iS=new $(0,0);Se.include({coordinateToPoint:function(r,t,i){var e=this._getResolution(t);return this.coordinateToPointAtRes(r,e,i)},coordinateToPointAtRes:function(){var n=new $(0,0);return function(r,t,i){var e=this.getProjection().project(r,n);return this._prjToPointAtRes(e,t,i)}}(),pointToCoordinate:function(){var n=new $(0,0);return function(r,t,i){var e=this._pointToPrj(r,t,n);return this.getProjection().unproject(e,i)}}(),pointAtResToCoordinate:function(){var n=new $(0,0);return function(r,t,i){var e=this._pointToPrjAtRes(r,t,n);return this.getProjection().unproject(e,i)}}(),coordinateToViewPoint:function(){var n=new $(0,0);return function(r,t,i){return this._prjToViewPoint(this.getProjection().project(r,n),t,i)}}(),viewPointToCoordinate:function(){var n=new $(0,0);return function(r,t){return this.getProjection().unproject(this._viewPointToPrj(r,n),t)}}(),coordinateToContainerPoint:function(r,t,i){var e=this._getResolution(t);return this.coordinateToContainerPointAtRes(r,e,i)},coordinateToContainerPointAtRes:function(){var n=new $(0,0);return function(r,t,i){var e=this.getProjection().project(r,n);return this._prjToContainerPointAtRes(e,t,i,e.z)}}(),coordinatesToContainerPoints:function(r,t){var i=this._getResolution(t);return this.coordinatesToContainerPointsAtRes(r,i)},coordinatesToContainerPointsAtRes:function(){return function(n,r){for(var t=[],i=this._spatialReference.getTransformation(),e=r/this._getResolution(),o=this.getProjection(),s=new $(0,0),a=this.isTransforming(),l=this._prjToPoint(this._getPrjCenter(),void 0,iS),h=0,u=n.length;h<u;h++){var c=o.project(n[h],s),f=i.transform(c,r);f=f._multi(e),this._toContainerPoint(f,a,n[h].z,l),t.push(f)}return t}}(),containerPointToCoordinate:function(){var n=new $(0,0);return function(r,t){var i=this._containerPointToPrj(r,n);return this.getProjection().unproject(i,t)}}(),containerPointToCoordinate3:function(){var n=new z(0,0);return function(r,t,i){var e=this.getGLRes(),o=this._containerPointToPointAtRes(r,e,n,t),s=this.pointAtResToCoord(o,e,i);return s.z=t,s}}(),containerToExtent:function(){var n=new z(0,0),r=new z(0,0);return function(t){var i=new Le(this._containerPointToPoint(t.getMin(n),void 0,n),this._containerPointToPoint(t.getMax(r),void 0,r));return this._pointToExtent(i)}}(),distanceToPixel:function(){var n=new z(0,0),r=new z(0,0);return function(t,i,e){var o=this.getProjection();if(!o)return null;var s=this.getScale()/this.getScale(e),a=this.getCenter(),l=o.locate(a,t,i),h=this.coordToContainerPoint(a,void 0,n),u=this.coordToContainerPoint(l,void 0,r);return u._sub(h)._multi(s)._abs(),new ft(u.x,u.y)}}(),distanceToPoint:function(r,t,i,e){var o=this._getResolution(i);return this.distanceToPointAtRes(r,t,o,e)},distanceToPointAtRes:function(){var n=new z(0,0),r=new $(0,0);return function(t,i,e,o,s){var a=this.getProjection();if(!a)return null;var l=o||this.getCenter(),h=a.locate(l,t,i,r),u=this.coordToPointAtRes(l,e,n),c=this.coordToPointAtRes(h,e,s);return c._sub(u)._abs(),c}}(),altitudeToPoint:function(){var n=new $(0,40),r=new z(0,0);return function(t=0,i,e){this._altitudeOriginDirty&&(n.x=this._originLng,this._altitudeOriginDirty=!1);var o=this.distanceToPointAtRes(t,t,i,e||n,r),s=this.options.heightFactor;return s&&s!==1&&(o.x*=s,o.y*=s),o.x*Math.sign(t)}}(),pointAtResToAltitude:function(){var n=new $(0,40);return function(r=0,t,i){var e=this.pointAtResToDistance(r,0,t,i||n);return e*Math.sign(r)}}(),pixelToDistance:function(){var n=new $(0,0),r=new $(0,0),t=new $(0,0),i=new $(0,0);return function(e,o){var s=this.getProjection();if(!s)return null;var a=this.getFullExtent(),l=a.top>a.bottom?-1:1,h=n.set(this.width/2,this.height/2),u=r.set(this.width/2+e,this.height/2+l*o),c=this.containerPointToCoord(h,t),f=this.containerPointToCoord(u,i);return s.measureLength(c,f)}}(),pointToDistance:function(r,t,i){var e=this.getResolution(i);return this.pointAtResToDistance(r,t,e)},pointAtResToDistance:function(){var n=new z(0,0),r=new $(0,0),t=new $(0,0),i=new $(0,0);return function(e,o,s,a){var l=this.getProjection();if(!l)return null;var h=a?l.project(a,r):this._getPrjCenter(),u=this._prjToPointAtRes(h,s,n);u._add(e,o);var c=this.pointAtResToCoord(u,s,t),f=a||l.unproject(h,i);return f.z=0,c.z=0,l.measureLength(f,c)}}(),locateByPoint:function(){var n=new z(0,0);return function(r,t,i){var e=this.coordToContainerPoint(r,void 0,n);return this.containerPointToCoord(e._add(t,i))}}(),_get2DExtent:function(r,t){var i;if((r===void 0||r===this._zoomLevel)&&this._mapExtent2D&&(i=this._mapExtent2D),i)return t?(t.set(i.xmin,i.ymin,i.xmax,i.ymax),t):i.copy();var e=this._getResolution(r);return this._get2DExtentAtRes(e,t)},get2DExtent:function(r,t){return this._get2DExtent(r,t)},_get2DExtentAtRes:function(){var n=new z(0,0);return function(r,t){var i=this;if(r===this._mapGlRes&&this._mapGlExtent2D)return this._mapGlExtent2D;var e=this.getContainerExtent();return e.convertTo(function(o){return i._containerPointToPointAtRes(o,r,n)},t)}}(),get2DExtentAtRes:function(r,t){return this._get2DExtentAtRes(r,t)},pointToExtent:function(r){return this._pointToExtent(r)},_pointToExtent:function(){var n=new $(0,0),r=new $(0,0);return function(t){var i=t.getMin(),e=t.getMax(),o=this.getFullExtent(),[s,a]=!o||o.left<=o.right?[i.x,e.x]:[e.x,i.x],[l,h]=!o||o.top>o.bottom?[e.y,i.y]:[i.y,e.y],u=i.set(s,h),c=e.set(a,l);return new Je(this.pointToCoord(u,void 0,n),this.pointToCoord(c,void 0,r),this.getProjection())}}(),getViewPointFrameOffset:function(){var n=new z(0,0);return function(){if(this.isZooming())return null;var r=this._getPrjCenter();return this._mapViewCoord&&!this._mapViewCoord.equals(r)?this._prjToContainerPoint(this._mapViewCoord)._sub(this._prjToContainerPoint(r,void 0,n)):null}}(),_viewPointToPrj:function(){var n=new z(0,0);return function(r,t){return this._containerPointToPrj(this.viewPointToContainerPoint(r,n),t)}}(),viewPointToPrj:function(r,t){return this._viewPointToPrj(r,t)},_prjToContainerPoint:function(r,t,i,e){var o=this._getResolution(t);return this._prjToContainerPointAtRes(r,o,i,e)},prjToContainerPoint:function(r,t,i,e){return this._prjToContainerPoint(r,t,i,e)},_prjToContainerPointAtRes:function(){var n=new z(0,0);return function(r,t,i,e){return this._pointAtResToContainerPoint(this._prjToPointAtRes(r,t,n),t,e||0,i)}}(),prjToContainerPointAtRes:function(r,t,i,e){return this.prjToContainerPointAtRes(r,t,i,e)},_prjToViewPoint:function(){var n=new z(0,0);return function(r,t,i){var e=this._prjToContainerPoint(r,void 0,n,i);return this.containerPointToViewPoint(e,t)}}(),prjToViewPoint:function(r,t,i){return this._prjToViewPoint(r,t,i)},_viewPointToPoint:function(){var n=new z(0,0);return function(r,t,i){return this._containerPointToPoint(this.viewPointToContainerPoint(r,n),t,i)}}(),viewPointToPoint:function(r,t,i){return this._viewPointToPoint(r,t,i)},_pointToViewPoint:function(){var n=new $(0,0);return function(r,t,i){return this._prjToViewPoint(this._pointToPrj(r,t,n),i)}}(),pointToViewPoint:function(r,t,i){return this._pointToViewPoint(r,t,i)}});var nS={start:"起点",units:{mile:" 英里",feet:" 英尺",kilometer:" 公里",meter:" 米"}},oS={units:{mile:" 平方英里",feet:" 平方英尺",kilometer:" 平方公里",meter:" 平方米"}},sS={distancetool:nS,areatool:oS},aS={start:"Inicio",units:{mile:" mi",feet:" ft",kilometer:" km",meter:" m"}},lS={units:{mile:" mi²",feet:" ft²",kilometer:" km²",meter:" m²"}},hS={distancetool:aS,areatool:lS},uS={start:"Start",units:{mile:" mi",feet:" ft",kilometer:" km",meter:" m"}},cS={units:{mile:" mi²",feet:" ft²",kilometer:" km²",meter:" m²"}},fS={distancetool:uS,areatool:cS},Jn=function(n){function r(t){var i;return i=n.call(this,"Translator: "+t)||this,i.name="TranslatorError",i}return Q(r,n),r}(Fc(Error)),W0=function(n){function r(i){var e;return e=n.call(this)||this,e.languages={"zh-CN":sS,"es-MX":hS,"en-US":fS},e.setLang(i||"zh-CN"),e}Q(r,n);var t=r.prototype;return t.setLang=function(e){var o=this.languages[e];if(!o)throw new Jn("Setted Lang does not exist");this.nodes=o},t._validateNestedProps=function(e){e.forEach(function(o){if(o==="")throw new Jn('Any of sides of a dot "." cannot be empty')})},t.translate=function(e=null){if(e==null)throw new Jn("Missing parameter textNode");if(typeof e=="string"){var o=null;if(e.includes(".")){var s=e.split(".");if(s.length>3)throw new Jn("Translate function can only access through 3 nested properties, trying to access -> "+s.length);this._validateNestedProps(s);try{var a=null;switch(s.length){case 2:a=this.nodes[s[0]][s[1]];break;case 3:a=this.nodes[s[0]][s[1]][s[2]];break}return a}catch(l){throw new Jn("Unable to find the text translated in lang json"+l.message)}}else return o=this.nodes[e],o}else throw new Jn("Param passed has to be a String")},r}(br),dS={formatLabelContent:null,decimalPlaces:2,mode:"LineString",language:"zh-CN",metric:!0,imperial:!1,symbol:{lineColor:"#000",lineWidth:3,lineOpacity:1},vertexSymbol:{markerType:"ellipse",markerFill:"#fff",markerLineColor:"#000",markerLineWidth:3,markerWidth:11,markerHeight:11},labelOptions:{textSymbol:{textFaceName:"monospace",textLineSpacing:1,textHorizontalAlignment:"right",textDx:15},boxStyle:{padding:[6,2],symbol:{markerType:"square",markerFill:"#fff",markerFillOpacity:.9,markerLineColor:"#b4b3b3"}}},clearButtonSymbol:[{markerType:"square",markerFill:"#fff",markerLineColor:"#b4b3b3",markerLineWidth:2,markerWidth:15,markerHeight:15,markerDx:20},{markerType:"x",markerWidth:10,markerHeight:10,markerDx:20}]},$0=function(n){function r(i){var e;return e=n.call(this,i)||this,e.on("enable",e._afterEnable,e).on("disable",e._afterDisable,e),e._measureLayers=[],e.translator=new W0(e.options.language),e}Q(r,n);var t=r.prototype;return t.clear=function(){if($e(this._measureLayers))for(var e=0;e<this._measureLayers.length;e++)this._measureLayers[e].remove();return delete this._lastMeasure,delete this._lastVertex,this._outLayers(this._measureLayers),this._measureLayers=[],this},t.getMeasureLayers=function(){return this._measureLayers},t.getLastMeasure=function(){return this._lastMeasure?this._lastMeasure:0},t.undo=function(){n.prototype.undo.call(this);var e=this._historyPointer;if(e!==this._vertexes.length)for(var o=e;o<this._vertexes.length;o++)this._vertexes[o].label&&this._vertexes[o].label.remove(),this._vertexes[o].marker.remove();return this},t.redo=function(){n.prototype.redo.call(this);var e=this._historyPointer-1;return this._vertexes[e]&&(this._vertexes[e].marker.getLayer()||(this._vertexes[e].label&&this._vertexes[e].label.addTo(this._measureMarkerLayer),this._vertexes[e].marker.addTo(this._measureMarkerLayer))),this},t._formatLabelContent=function(e){var o=this.options.formatLabelContent;return o&&Oe(o)?o.call(this,e)+"":null},t._measure=function(e){var o=this.getMap(),s;e instanceof je?s=o.computeGeometryLength(e):Array.isArray(e)&&(s=o.getProjection().measureLength(e)),this._lastMeasure=s;var a=this._formatLabelContent(s);if(a)return a;var l=[this.translator.translate("distancetool.units.meter"),this.translator.translate("distancetool.units.kilometer"),this.translator.translate("distancetool.units.feet"),this.translator.translate("distancetool.units.mile")],h="",u=this.options.decimalPlaces;return this.options.metric&&(h+=s<1e3?s.toFixed(u)+l[0]:(s/1e3).toFixed(u)+l[1]),this.options.imperial&&(s*=3.2808399,h.length>0&&(h+=`
|
|
275
|
-
`),h+=s<5280?s.toFixed(u)+l[2]:(s/5280).toFixed(u)+l[3]),h},t._registerMeasureEvents=function(){this.on("drawstart",this._msOnDrawStart,this).on("drawvertex",this._msOnDrawVertex,this).on("mousemove",this._msOnMouseMove,this).on("drawend",this._msOnDrawEnd,this)},t._afterEnable=function(){this._registerMeasureEvents()},t._afterDisable=function(){this.off("drawstart",this._msOnDrawStart,this).off("drawvertex",this._msOnDrawVertex,this).off("mousemove",this._msOnMouseMove,this).off("drawend",this._msOnDrawEnd,this)},t._msOnDrawStart=function(e){var o=this.getMap(),s=ui(),a="distancetool_"+s,l="distancetool_markers_"+s,h=this.options.zIndex,u=this.options.enableAltitude;o.getLayer(a)?(this._measureLineLayer=o.getLayer(a),this._measureMarkerLayer=o.getLayer(l)):(this._measureLineLayer=new So(a,{zIndex:h,enableAltitude:u}).addTo(o),this._measureMarkerLayer=new So(l,{zIndex:h,enableAltitude:u}).addTo(o)),this._measureLayers.push(this._measureLineLayer),this._measureLayers.push(this._measureMarkerLayer),this._pushLayers([this._measureLineLayer,this._measureMarkerLayer]);var c=this._getFirstCoordinate()||e.coordinate,f=new et(c.copy(),{symbol:this.options.vertexSymbol}),d=this.translator.translate("distancetool.start"),g=new To(d,c.copy(),this.options.labelOptions);this._lastVertex=g,this._addVertexMarker(f,g)},t._msOnMouseMove=function(e){var o=this._measure(this._msGetCoordsToMeasure(e));if(!this._tailMarker){var s=Zr(this.options.vertexSymbol);s.markerWidth/=2,s.markerHeight/=2,this._tailMarker=new et(e.coordinate,{symbol:s}).addTo(this._measureMarkerLayer),this._tailLabel=new To(o,e.coordinate,this.options.labelOptions).addTo(this._measureMarkerLayer)}var a=this._getLasttCoordinate()||e.coordinate;this._tailMarker.setCoordinates(a.copy()),this._tailLabel.setContent(o),this._tailLabel.setCoordinates(a.copy())},t._msGetCoordsToMeasure=function(e){return e.geometry.getCoordinates().concat([e.coordinate])},t._msOnDrawVertex=function(e){var o=this._getLasttCoordinate()||e.coordinate,s=e.geometry,a=new et(o.copy(),{symbol:this.options.vertexSymbol}),l=this._measure(s),h=new To(l,o.copy(),this.options.labelOptions);this._addVertexMarker(a,h),this._lastVertex=h},t._addVertexMarker=function(e,o){this._vertexes||(this._vertexes=[]),this._historyPointer!==void 0&&this._vertexes.length>this._historyPointer-1&&(this._vertexes.length=this._historyPointer-1),this._vertexes.push({label:o,marker:e}),this._measureMarkerLayer.addGeometry(e),o&&this._measureMarkerLayer.addGeometry(o)},t._msOnDrawEnd=function(e){if(this._clearTailMarker(),e.geometry.getCoordinates().length<2){this._lastMeasure=0,this._clearMeasureLayers();return}var o=this._lastVertex.getSize();o||(o=new ft(10,10)),this._addClearMarker(this._lastVertex.getCoordinates(),this._lastVertex._getPrjCoordinates(),o.width);var s=e.geometry.copy();s.setCoordinates(e.geometry.getCoordinates()),s.addTo(this._measureLineLayer),this._lastMeasure=s.getLength()},t._addClearMarker=function(e,o,s){var a=this.options.clearButtonSymbol,l={markerDx:(a.markerDx||0)+s,textDx:(a.textDx||0)+s};Array.isArray(a)&&(l=a.map(function(d){return d?{markerDx:(d.markerDx||0)+s,textDx:(d.textDx||0)+s}:null})),a=Zr(a,l);var h=new et(e,{symbol:a}),u=this._measureLineLayer,c=this._measureMarkerLayer,f=this._getDrawLayer?this._getDrawLayer():null;h.on("click",function(){return u.remove(),c.remove(),f&&f.remove(),!1},this),h.addTo(this._measureMarkerLayer)},t._clearTailMarker=function(){this._tailMarker&&(this._tailMarker.remove(),delete this._tailMarker),this._tailLabel&&(this._tailLabel.remove(),delete this._tailLabel)},t._clearMeasureLayers=function(){this._measureLineLayer.remove(),this._measureMarkerLayer.remove()},t._getFirstCoordinate=function(){if(!this._geometry)return null;var e=this._geometry.getCoordinates()||[],o=e[0];return Array.isArray(o)?o[0]:o},t._getLasttCoordinate=function(){if(!this._geometry)return null;var e=this._geometry.getCoordinates()||[],o=e[e.length-1];return Array.isArray(o)?o[o.length-1]:o},r}(At);$0.mergeOptions(dS);var gS={mode:"Polygon",symbol:{lineColor:"#000000",lineWidth:2,lineOpacity:1,lineDasharray:"",polygonFill:"#ffffff",polygonOpacity:.5},language:"zh-CN"},pS=function(n){function r(i){var e;return e=n.call(this,i)||this,e.translator=new W0(e.options.language),e._measureLayers=[],e}Q(r,n);var t=r.prototype;return t._measure=function(e){var o=this.getMap(),s;e instanceof je?s=o.computeGeometryArea(e):Array.isArray(e)&&(s=o.getProjection().measureArea(e)),this._lastMeasure=s;var a=this._formatLabelContent(s);if(a)return a;var l=[this.translator.translate("areatool.units.meter"),this.translator.translate("areatool.units.kilometer"),this.translator.translate("areatool.units.feet"),this.translator.translate("areatool.units.mile")],h="",u=this.options.decimalPlaces;if(this.options.metric&&(h+=s<1e6?s.toFixed(u)+l[0]:(s/1e6).toFixed(u)+l[1]),this.options.imperial){s*=Math.pow(3.2808399,2),h.length>0&&(h+=`
|
|
276
|
-
`);var c=5280*5280;h+=s<c?s.toFixed(u)+l[2]:(s/c).toFixed(u)+l[3]}return h},t._msGetCoordsToMeasure=function(e){return e.geometry.getShell().concat([e.coordinate])},t._msOnDrawVertex=function(e){var o=this._getLasttCoordinate()||e.coordinate,s=new et(o.copy(),{symbol:this.options.vertexSymbol});this._measure(e.geometry),this._lastVertex=s,this._addVertexMarker(s)},t._msOnDrawEnd=function(e){this._clearTailMarker();var o,s=this.getMap();if(e.point2d)o=s._pointToPrj(e.point2d);else{var a=e.geometry._getPrjCoordinates()||[];a=a.slice(0,a.length-1),o=a[a.length-1]}if(e.geometry.getShell().length<3){this._lastMeasure=0,this._clearMeasureLayers();return}var l=this._measure(e.geometry),h=this._getLasttCoordinate(),u=new To(l,h.copy(),this.options.labelOptions).addTo(this._measureMarkerLayer),c=u.getSize();c||(c=new ft(10,10)),this._addClearMarker(h.copy(),o,c.width);var f=e.geometry.copy();f.setCoordinates(e.geometry.getCoordinates()),f.addTo(this._measureLineLayer),this._lastMeasure=f.getArea()},r}($0);pS.mergeOptions(gS);function Ar(n,r,t){var i=Array.isArray(r);i||(r=[r]);var e,o;if(t&&t.drawTool&&t.drawTool.options&&(o=t.drawTool.options.transformCoordinate),o&&Oe(o))e=r.map(function(l){return n.unproject(l)}),e=e.map(function(l){var h=o(l,t);return h||l});else{if(!t||!t.target||!t.target._queryTerrainInfo)return e=r.map(function(l){return n.unproject(l)}),i?e:e[0];var s=t.target,a=t.enableAltitude;e=r.map(function(l){if(a){var h=s.prjToContainerPoint(l),u=s._queryTerrainInfo(h);if(u&&u.coordinate)return u.coordinate}return n.unproject(l)})}return i?e:e[0]}var U0={create:function(r,t,i){var e=Ar(r,t[0],i),o=new zr(e,0);return o._firstClick=t[0],o},update:function(r,t,i,e){var o=i.getCenter();i._firstClick&&(o=Ar(r,i._firstClick,e));var s=i.getMap(),a=Array.isArray(t)?t[t.length-1]:t,l=Ar(r,a,e),h=s.computeLength(o,l);i.setRadius(h)},generate:function(r){return r}};At.registerMode("circle",oe({clickLimit:2,action:["click","mousemove","click"]},U0));At.registerMode("freeHandCircle",oe({action:["mousedown touchstart","mousemove touchmove","mouseup touchend"]},U0));var J0={create:function(r,t,i){var e=Ar(r,t[0],i),o=new Di(e,0,0);return o},update:function(r,t,i,e){var o=i.getMap(),s=i.getCenter(),a=Array.isArray(t)?t[t.length-1]:t,l=Ar(r,a,e),h=o.computeLength(s,new $({x:l.x,y:s.y})),u=o.computeLength(s,new $({x:s.x,y:l.y}));i.setWidth(h*2),i.setHeight(u*2)},generate:function(r){return r}};At.registerMode("ellipse",oe({clickLimit:2,action:["click","mousemove","click"]},J0));At.registerMode("freeHandEllipse",oe({action:["mousedown touchstart","mousemove touchmove","mouseup touchend"]},J0));var X0={create:function(r,t){var i=new it([]);return i._firstClick=t[0],i},update:function(r,t,i,e){var o=i.getMap(),s=e.containerPoint,a=o.prjToContainerPoint(i._firstClick),l=[[a.x,a.y],[s.x,a.y],[s.x,s.y],[a.x,s.y]],h=l.map(function(c){return o._containerPointToPrj(new z(c))}),u=Ar(r,h,e);i.setCoordinates(u)},generate:function(r){return r}};At.registerMode("rectangle",oe({clickLimit:2,action:["click","mousemove","click"]},X0));At.registerMode("freeHandRectangle",oe({action:["mousedown touchstart","mousemove touchmove","mouseup touchend"]},X0));At.registerMode("point",{clickLimit:1,action:["click","mousemove"],create:function(r,t,i){var e=Ar(r,t[0],i),o=new et(e);return o},generate:function(r){return r},update:function(r,t,i,e){if(Array.isArray(t)&&(t=t[t.length-1]),!t)return i;var o=Ar(r,t,e);return i.setCoordinates(o),i}});var Y0={create:function(r,t,i){var e=Ar(r,t,i),o=new it([e]);return o.setCoordinates(e),o},update:function(r,t,i,e){var o=i.getSymbol(),s;Array.isArray(t)?s=t:(s=i._drawPrjs||[],s.push(t)),i._drawPrjs=s;var a=Ar(r,s,e);i.setCoordinates(a);var l=i.getLayer();if(l){var h=l.getGeometryById("polygon");if(!h&&s.length>=3){if(h=new it([a],{id:"polygon",zIndex:-1}),o){var u=Zr(o,{lineOpacity:0});h.setSymbol(u)}h.addTo(l)}h&&h.setCoordinates([a])}},generate:function(r){var t=new it(r.getCoordinates(),{symbol:r.getSymbol(),properties:r.getProperties()});return t._projCode=r._projCode,t}};At.registerMode("polygon",oe({action:["click","mousemove","dblclick"]},Y0));At.registerMode("freeHandPolygon",oe({action:["mousedown touchstart","mousemove touchmove","mouseup touchend"]},Y0));var ka={create:function(r,t,i){var e=Ar(r,t,i),o=new pt(e);return o.setCoordinates(e),o},update:function(r,t,i,e){var o;Array.isArray(t)?o=t:(o=i._drawPrjs||[],o.push(t)),i._drawPrjs=o;var s=Ar(r,o,e);i.setCoordinates(s)},generate:function(r){return r}};At.registerMode("linestring",oe({action:["click","mousemove","dblclick"]},ka));At.registerMode("freeHandLinestring",oe({action:["mousedown touchstart","mousemove touchmove","mouseup touchend"]},ka));At.registerMode("arccurve",{action:["click","mousemove","dblclick"],create:function(r,t){var i=t.map(function(o){return r.unproject(o)}),e=new Vh(i);return e._setPrjCoordinates(t),e},update:ka.update,generate:function(r){return r}});At.registerMode("quadbeziercurve",{action:["click","mousemove","dblclick"],create:function(r,t){var i=t.map(function(o){return r.unproject(o)}),e=new H0(i);return e._setPrjCoordinates(t),e},update:ka.update,generate:function(r){return r}});At.registerMode("cubicbeziercurve",{action:["click","mousemove","dblclick"],create:function(r,t){var i=t.map(function(o){return r.unproject(o)}),e=new N0(i);return e._setPrjCoordinates(t),e},update:ka.update,generate:function(r){return r}});At.registerMode("boxZoom",{action:["mousedown","mousemove","mouseup"],create:function(r,t){t=t[0];var i=r.unproject(t),e=new et(i);return e._firstClick=t,e},update:function(r,t,i,e){var o=i.getMap(),s=o.prjToContainerPoint(i._firstClick),a=e.containerPoint;t=o._containerPointToPrj(new $(Math.min(s.x,a.x),Math.min(s.y,a.y)));var l=r.unproject(t);i.setCoordinates(l)._setPrjCoordinates(t),i.updateSymbol({markerWidth:Math.abs(s.x-a.x),markerHeight:Math.abs(s.y-a.y)})},generate:function(r){return r}});var vS={eventsPropagation:!1,eventsToStop:null,dx:0,dy:0,autoPan:!1,autoPanDuration:600,single:!0,animation:"scale",animationOnHide:!1,animationDuration:500,pitchWithMap:!1,rotateWithMap:!1,visible:!0,roundPoint:!1,collision:!1,collisionBufferSize:2,collisionWeight:0,collisionFadeIn:!1,zIndex:0,enableScrollbar:!0},Uv=["collision","collisionBufferSize","collisionWeight","collisionFadeIn"],an=function(n){function r(i){var e;return e=n.call(this,i)||this,e.proxyOptions(),e}Q(r,n);var t=r.prototype;return t._appendCustomClass=function(e){if(!e)return console.warn("dom is null:",e),this;if(this.options.cssName){var o=this.options.cssName;Array.isArray(o)||(o=[o]),o.forEach(function(s){e.classList.add(s)})}return this},t.onAdd=function(){},t.onRemove=function(){},t.onDomRemove=function(){},t.getEvents=function(){return{}},t.getOwnerEvents=function(){return{}},t.buildOn=function(){return null},t.addTo=function(e){return this._owner=e,this._switchEvents("on"),this.onAdd&&this.onAdd(),this.fire("add"),this},t.getMap=function(){return this._owner?this._owner.getBaseLayer?this._owner:this._owner.getMap():null},t._collides=function(){var e=this.getMap();return e?(e._addUI(this),e._insertUICollidesQueue(),this):this},t._collidesEffect=function(e){var o=this.getDOM();if(!o)return this;var s=e?"visible":"hidden";if(o.style.visibility=s,!o.classList||!o.classList.add)return this;if(!this.options.collisionFadeIn)return this;var a=o.classList,l="mtk-ui-fadein",h=a.contains(l);return e&&!h?o.classList.add(l):!e&&h&&o.classList.remove(l),this},t.show=function(e){var o=this,s=this.getMap();if(!s)return this;this.options.visible=!0,e=e||this._coordinate||this._owner.getCenter(),e instanceof $||(e=new $(e));var a=this.isVisible();this._onlyUpdatePosition||this.fire("showstart");var l=this._getUIContainer();this._coordinate=e,this._onlyUpdatePosition||this._removePrevDOM(),this._mapEventsOn||this._switchMapEvents("on");var h;this._onlyUpdatePosition?h=this.__uiDOM:h=this.__uiDOM=this.buildOn(),h.eventsPropagation=this.options.eventsPropagation,this._observerDomSize(h);var u=this.options.zIndex;if(!h)return this._onlyUpdatePosition||this.fire("showend"),this._collides(),this.setZIndex(u),this;this._onlyUpdatePosition||this._measureSize(h),this._singleton()&&(h._uiComponent=this,s[this._uiDomKey()]=h),this._setPosition(),h.style[Ha]=null,this._onlyUpdatePosition||l.appendChild(h);var c=this._getAnimation();if(a&&(c.ok=!1),c.ok&&(c.fade&&(h.style.opacity="0"),c.scale)){if(this.getTransformOrigin){var f=this.getTransformOrigin();h.style[QT]=f}h.style[io]=this._toCSSTranslate(this._pos)+" scale(0)"}this.isSupportZoomFilter()||(h.style.display=""),this.options.eventsToStop&&vt(h,this.options.eventsToStop,nr);var d=c.transition;return c.ok&&d&&(h.offsetHeight,d&&(h.style[Ha]=d),c.fade&&(h.style.opacity="1"),c.scale&&(h.style[io]=this._toCSSTranslate(this._pos)+" scale(1)")),this._onlyUpdatePosition||this.fire("showend"),this._collides(),clearTimeout(this._autoPanId),this.options.autoPan&&(this._autoPanId=setTimeout(function(){o._autoPan()},32)),this.setZIndex(u),this},t.hide=function(){var e=this;if(!this.getDOM())return this;this._onDomMouseout&&this._onDomMouseout(),this.options.visible=!1;var o=this._getAnimation(),s=this.getDOM();return this.options.animationOnHide||(o.ok=!1),o.ok?(s.offsetHeight,s.style[Ha]=o.transition,setTimeout(function(){s.style.display="none",e.fire("hide")},this.options.animationDuration)):(s.style.display="none",this.fire("hide")),o.fade&&(s.style.opacity="0"),o.scale&&(s.style[io]=this._toCSSTranslate(this._pos)+" scale(0)"),this._switchMapEvents("off"),this._collides(),this},t.isVisible=function(){if(!this.options.visible)return!1;var e=this.getDOM();return this.getMap()&&e&&e.parentNode&&e.style.display!=="none"},t.remove=function(){if(delete this._mapEventsOn,!this._owner)return this;var e=this.getMap();return e&&e._removeUI(this),this.hide(),this._switchEvents("off"),this.onRemove&&this.onRemove(),!this._singleton()&&this.__uiDOM&&this._removePrevDOM(),delete this._owner,this.fire("remove"),this._collides(),this},t.getSize=function(){return this._domContentRect&&this._size&&(this._size.width=this._domContentRect.width,this._size.height=this._domContentRect.height),this._size?this._size.copy():null},t.getOwner=function(){return this._owner},t.getDOM=function(){return this.__uiDOM},t.setZIndex=function(e){if(!X(e))return this;var o=this.getDOM();return o?(o.style.zIndex=e+"",e!==this.options.zIndex&&(this.options.zIndex=e),this):this},t._roundPoint=function(e){return this.options.roundPoint&&(e=e._round()),e},t.getPosition=function(){if(!this.getMap())return null;var e=this._roundPoint(this._getViewPoint());if(this.getOffset){var o=this._roundPoint(this.getOffset());o&&e._add(o)}return e},t._getAnimation=function(){for(var e={fade:!1,scale:!1,ok:!1,transition:""},o=this.options.animation?this.options.animation.split(","):[],s=0;s<o.length;s++){var a=Sh(o[s]);a==="fade"?e.fade=!0:a==="scale"&&(e.scale=!0)}var l=null;return e.fade&&(l="opacity "+this.options.animationDuration+"ms"),e.scale&&(l=l?l+",":"",l+=io+" "+this.options.animationDuration+"ms"),e.transition=l,e.ok=l!==null,e},t._getViewPoint=function(){var e=0,o=this._coordinate||{};if(X(o.z)?e=o.z:this._owner&&this._owner.getAltitude&&(e=this._owner.getAltitude()||0,X(e)||(e=0)),this._owner.getLayer){var s=this._owner.getLayer();s&&s.isVectorLayer&&(e=this._owner._getAltitude()||0,X(e)||(e=0))}var a=this._meterToPoint(this._coordinate,e);return this.getMap().coordToViewPoint(this._coordinate,void 0,a)._add(this.options.dx,this.options.dy)},t._meterToPoint=function(e,o){return o},t._autoPan=function(){var e=this.getMap(),o=this.getDOM();if(!(!o||!e||e.isMoving())){var s=this._getViewPoint()._round(),a=e.width,l=e.height,h=e.getContainer();if(o&&h&&o.getBoundingClientRect){var u=h.getBoundingClientRect(),c=u.left,f=u.top,d=50,g=o.getBoundingClientRect(),p=0,m=0,{left:v,right:_,top:y,bottom:w}=g,{width:x,height:C}=g;if(v-=c,_-=c,y-=f,w-=f,x>0&&C>0){if(v<d&&(p=d-v),p===0&&_+d>a&&(p=-(_+d-a)),y<d&&(m=d-y),m===0&&w+d>l&&(m=-(w+d-l)),p!==0||m!==0){var b=dt[e.id],E=b?b.pitch:e.getPitch();E>40&&m!==0&&this._coordinate?e.animateTo({center:this._coordinate},{duration:e.options.panAnimationDuration}):e.panBy([Math.ceil(p),Math.ceil(m)])}return}}var T=e.viewPointToContainerPoint(s),S=this.getOffset(),B=T.add(S),L=e.viewPointToPrj(s),D=parseInt(o.clientWidth+""),N=parseInt(o.clientHeight+""),G=50,I=0,A=0;if(B.x<0?I=-B.x+G:B.x+D>a&&(I=-(B.x+D-a)-G),B.y-N<0?A=Math.abs(B.y-N)+G:B.y+N>l&&(A=l-(B.y+N)-G),D>=a&&(I=a/2-T.x),A!==0||I!==0){var k=T.add(I,A),Z=e._containerPointToPoint(k)._sub(e._prjToPoint(e._getPrjCenter())),W=e._pointToPrj(e._prjToPoint(L).sub(Z));e._panAnimation(W)}}},t._measureSize=function(e){var o=this._getUIContainer();e.style.position="absolute";var s=e.style.bottom?"bottom":"top";if(e.style.display="",o.appendChild(e),e.getBoundingClientRect){var a=e.getBoundingClientRect();this._size=new ft(a.width,a.height)}else this._size=new ft(e.clientWidth,e.clientHeight);return e.style.display="none",e.style.left="0px",e.style[s]="0px",this._size},t._removePrevDOM=function(){this.onDomRemove&&this.onDomRemove();var e=this.options.eventsToStop;if(this._singleton()){var o=this.getMap(),s=this._uiDomKey();if(o[s]){e&&yt(o[s],e,nr);var a=o[s]._uiComponent;a&&a!==this&&a.isVisible()&&a.fire("hide"),Ln(o[s]),a&&!this.hideDom&&a._switchMapEvents("off"),delete o[s]}delete this.__uiDOM}else this.__uiDOM&&(e&&yt(this.__uiDOM,e,nr),Ln(this.__uiDOM),delete this.__uiDOM);this._resizeObserver&&(this._resizeObserver.disconnect(),delete this._resizeObserver,delete this._domContentRect)},t._uiDomKey=function(){return"__ui_"+this._getClassName()},t._singleton=function(){return this.options.single},t._getUIContainer=function(){return this.getMap().getPanels().ui},t._getClassName=function(){return"UIComponent"},t._switchMapEvents=function(e){var o=this.getMap();if(o){this._mapEventsOn=e==="on";var s=this._getDefaultEvents();if(this.getEvents&&oe(s,this.getEvents()),s)for(var a in s)s.hasOwnProperty(a)&&o[e](a,s[a],this)}},t._switchEvents=function(e){var o=this._getOwnerEvents();if(this._owner)for(var s in o)o.hasOwnProperty(s)&&this._owner[e](s,o[s],this)},t._getDefaultEvents=function(){return{"zooming rotate pitch":this.onEvent,zoomend:this.onZoomEnd,moving:this.onMoving,moveend:this.onMoving,resize:this.onResize}},t._getOwnerEvents=function(){var e={};return this._owner&&this._owner instanceof je&&(e.positionchange=this.onGeometryPositionChange,e.symbolchange=this._updatePosition),this.getOwnerEvents&&oe(e,this.getOwnerEvents()),e},t.onGeometryPositionChange=function(e){if(this._owner&&this.isVisible()){this._onlyUpdatePosition=!0;var o=e.target,s=o.getCenter();if(o._getAltitude){var a=o._getAltitude();X(a)&&(s.z=a)}this.show(s),this._onlyUpdatePosition=!1}},t.onMoving=function(){this.isVisible()&&this.getMap().isTransforming()&&this._updatePosition()},t.onEvent=function(){this.isVisible()&&this._updatePosition()},t.onZoomEnd=function(){this.isVisible()&&this._setPosition()},t.onResize=function(){this.isVisible()&&this._setPosition()},t.onDomSizeChange=function(){this.isVisible()&&(this._setPosition(),this._collides())},t._updatePosition=function(){if(!this.getMap())return this;var e=this.getMap()._getRenderer();return e.callInNextFrame(this._setPosition.bind(this)),this},t._setPosition=function(){var e=this.getDOM();if(e){e.style[Ha]=null;var o=this.getPosition();this._pos=o,e.style[io]=this._toCSSTranslate(o)+" scale(1)"}},t._toCSSTranslate=function(e){if(!e)return"";if(Ce.any3d){var o=this.getMap(),s=0,a=0;if(o){var l=dt[o.id];s=l?l.bearing:o.getBearing(),a=l?l.pitch:o.getPitch()}var h="";return this.options.pitchWithMap&&a&&(h+=" rotateX("+Math.round(a)+"deg)"),this.options.rotateWithMap&&s&&(h+=" rotateZ("+Math.round(-s)+"deg)"),"translate3d("+Math.round(e.x)+"px,"+Math.round(e.y)+"px, 0px)"+h}else return"translate("+Math.round(e.x)+"px,"+Math.round(e.y)+"px)"},t._observerDomSize=function(e){var o=this;return!e||!Ce.resizeObserver||this._resizeObserver?this:(this._resizeObserver=new ResizeObserver(function(s){if(s.length){var a=s[0].borderBoxSize;a&&a.length?o._domContentRect={width:a[0].inlineSize,height:a[0].blockSize}:o._domContentRect=s[0].contentRect}else delete o._domContentRect;o.onDomSizeChange&&o.onDomSizeChange()}),this._resizeObserver.observe(e),this)},t.isSupportZoomFilter=function(){return!1},t.onConfig=function(e){var o=!1;if(e)for(var s=0,a=Uv.length;s<a;s++){var l=Uv[s];if(l in e){o=!0;break}}if(this._updatePosition(),o){this._collides();var h=this.getMap();h&&h._sortUI&&h._sortUI()}return this},r.isSupport=function(e){return!!(e&&Oe(e.on)&&Oe(e.off)&&Oe(e.getCenter))},t._bindDomEvents=function(e,o){if(e){var s=this._getDomEvents()||{},a=o==="on"?vt:yt;for(var l in s)o==="on"&&yt(e,l,s[l]),a(e,l,s[l],this)}},t._getDomEvents=function(){return{mouseover:this._onDomMouseover,mouseout:this._onDomMouseout}},t._configMapPreventWheelScroll=function(e){var o=this.getMap();o&&this.options.enableScrollbar&&(this.options.eventsPropagation||(o.options.preventWheelScroll=e))},t._onDomMouseover=function(){this._configMapPreventWheelScroll(!1),this.fire("mouseover")},t._onDomMouseout=function(){this._configMapPreventWheelScroll(!0),this.fire("mouseout")},r}(ci(br));an.mergeOptions(vS);var mS={containerClass:null,eventsPropagation:!0,draggable:!1,single:!1,content:null,altitude:0,minZoom:0,maxZoom:null,horizontalAlignment:"middle",verticalAlignment:"middle"},Jv="mousedown mouseup mouseenter mouseover mouseout mousemove click dblclick contextmenu keypress touchstart touchmove touchend",Wh=function(n){function r(i,e){var o;return o=n.call(this,e)||this,o._markerCoord=new $(i),o}Q(r,n);var t=r.prototype;return t._getClassName=function(){return"UIMarker"},t.setCoordinates=function(e){if(!e)return this;if(!(e instanceof $))try{e=new $(e)}catch(o){return console.error(o),this}return this._markerCoord=e,this.fire("positionchange"),this.isVisible()&&(this._onlyUpdatePosition=!0,this._coordinate=this._markerCoord,this._setPosition(),this._collides(),this._onlyUpdatePosition=!1),this},t.getCoordinates=function(){return this._markerCoord},t.getCenter=function(){return this.getCoordinates()},t.getAltitude=function(){var e=this.getCoordinates()||{};return X(e.z)?e.z:this.options.altitude||0},t.setAltitude=function(e){return X(e)&&this._markerCoord&&(this._markerCoord.z=e,this._updatePosition&&(this._updatePosition(),this._collides())),this},t.setContent=function(e){var o=this.options.content;return this.options.content=e,this.fire("contentchange",{old:o,new:e}),this.isVisible()&&this.show(),this},t.getContent=function(){return this.options.content},t.onAdd=function(){if(this._owner&&!this._owner.isMap){var e=this._owner;throw new Error("UIMarker Can only be added to the map, but owner is:"+e.getJSONType&&e.getJSONType())}return this.show(),this},t.show=function(){return n.prototype.show.call(this,this._markerCoord)},t.flash=function(e,o,s,a){return Nf.call(this,e,o,s,a)},t.buildOn=function(){var e=this.getDOM();this._bindDomEvents(e,"off");var o,s=this.options.content,a=Ee(s);return a||Oe(s)?(o=we("div"),a?o.innerHTML=this.options.content:s.bind(this)(o)):o=this.options.content,this.options.containerClass&&(o.className=this.options.containerClass),this._registerDOMEvents(o),this._bindDomEvents(o,"on"),this._appendCustomClass(o),o},t.getOffset=function(){var e=this.getSize(),o=-e.width/2,s=-e.height/2,{horizontalAlignment:a,verticalAlignment:l}=this.options;return a==="left"?o=-e.width:a==="right"&&(o=0),l==="top"?s=-e.height:l==="bottom"&&(s=0),new z(o,s)},t.getTransformOrigin=function(){return"center center"},t.onDomRemove=function(){var e=this.getDOM();this._removeDOMEvents(e)},t.isDragging=function(){return this.draggable?this.draggable.isDragging():!1},t._registerDOMEvents=function(e){vt(e,Jv,this._onDomEvents,this)},t._onDomEvents=function(e,o){var s=this.getMap()._parseEvent(e,e.type);if(o=o||e.type,o==="mousedown"&&(this._mousedownEvent=e),o==="mouseup"&&(this._mouseupEvent=e),!(o==="click"&&this._mouseClickPositionIsChange())&&(o==="touchstart"&&(this._touchstartTime=He()),this.fire(o,s),o==="touchend"&&Ce.touch)){var a=this.getMap().options.clickTimeThreshold||280;He()-this._touchstartTime<a&&this._onDomEvents(e,"click")}},t._removeDOMEvents=function(e){yt(e,Jv,this._onDomEvents)},t._mouseClickPositionIsChange=function(){var{x:e,y:o}=this._mousedownEvent||{},{x:s,y:a}=this._mouseupEvent||{};return e!==s||o!==a},t._getConnectPoints=function(){var e=this.getMap(),o=e.coordToContainerPoint(this.getCoordinates()),s=this.getSize(),a=s.width,l=s.height,h=[e.containerPointToCoordinate(o.add(-a/2,0)),e.containerPointToCoordinate(o.add(a/2,0)),e.containerPointToCoordinate(o.add(0,l/2)),e.containerPointToCoordinate(o.add(0,-l/2))];return h},t._getViewPoint=function(){var e=0;if(this._owner){var o=this.getAltitude();o>0&&(e=this._meterToPoint(this._coordinate,o))}return this.getMap().coordToViewPoint(this._coordinate,void 0,e)._add(this.options.dx,this.options.dy)},t._getDefaultEvents=function(){return oe({},n.prototype._getDefaultEvents.call(this),{"zooming zoomend":this.onZoomFilter})},t._setPosition=function(){this.onZoomFilter(),n.prototype._setPosition.call(this)},t.onZoomFilter=function(){var e=this.getDOM();e&&(!this.isVisible()&&e.style.display!=="none"?e.style.display="none":this.isVisible()&&e.style.display==="none"&&(e.style.display=""))},t.isVisible=function(){var e=this.getMap();if(!e||!this.options.visible)return!1;var o=dt[e.id],s=o?o.zoom:e.getZoom(),{minZoom:a,maxZoom:l}=this.options;if(!O(a)&&s<a||!O(l)&&s>l)return!1;var h=this.getDOM();return h&&!0},t.isSupportZoomFilter=function(){return!0},r}(od(an));Wh.mergeOptions(mS);var Xv=Ce.touch?"touchstart mousedown":"mousedown",_S=function(n){function r(i){return n.call(this,i)||this}Q(r,n);var t=r.prototype;return t.addHooks=function(){this.target.on(Xv,this._startDrag,this)},t.removeHooks=function(){this.target.off(Xv,this._startDrag,this)},t._startDrag=function(e){var o=e.domEvent;o.touches&&o.touches.length>1||o.button===2||this.isDragging()||(this.target.on("click",this._endDrag,this),this._lastCoord=e.coordinate,this._lastPoint=e.containerPoint,this._prepareDragHandler(),this._dragHandler.onMouseDown(e.domEvent),this.target.fire("dragstart",e))},t._prepareDragHandler=function(){this._dragHandler=new Ea(this.target.getDOM(),{cancelOn:this._cancelOn.bind(this),ignoreMouseleave:!0}),this._dragHandler.on("mousedown",this._onMouseDown,this),this._dragHandler.on("dragging",this._dragging,this),this._dragHandler.on("mouseup",this._endDrag,this),this._dragHandler.enable()},t._cancelOn=function(e){var o=e.srcElement||e.target,s=o.tagName.toLowerCase();return s==="button"||s==="input"||s==="select"||s==="option"||s==="textarea"},t._onMouseDown=function(e){nr(e.domEvent)},t._dragging=function(e){var o=this.target,s=o.getMap(),a=s._parseEvent(e.domEvent),l=a.domEvent,h=l;if(!(h.touches&&h.touches.length>1)){if(!this._isDragging){this._isDragging=!0;return}var u=a.coordinate,c=a.containerPoint;this._lastCoord||(this._lastCoord=u),this._lastPoint||(this._lastPoint=c);var f=u.sub(this._lastCoord),d=c.sub(this._lastPoint);this._lastCoord=u,this._lastPoint=c,this.target.setCoordinates(this.target.getCoordinates().add(f)),a.coordOffset=f,a.pointOffset=d,o.fire("dragging",a)}},t._endDrag=function(e){var o=this.target,s=o.getMap();if(this._dragHandler&&(o.off("click",this._endDrag,this),this._dragHandler.disable(),delete this._dragHandler),delete this._lastCoord,delete this._lastPoint,this._isDragging=!1,!!s){var a=s._parseEvent(e.domEvent);o&&o._mouseClickPositionIsChange&&o._mouseClickPositionIsChange()&&o.fire("dragend",a)}},t.isDragging=function(){return!!this._isDragging},r}(Pa);Wh.addInitHook("addHandler","draggable",_S);var yS=/\{ *([\w_]+) *\}/g,q0={containerClass:"maptalks-msgBox",autoPan:!0,autoCloseOn:null,autoOpenOn:"click",width:"auto",minHeight:120,custom:!1,title:null,content:null,enableTemplate:!1},wS=new ft(0,0),eh=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t._getClassName=function(){return"InfoWindow"},t.addTo=function(e){return e instanceof je&&(e.getInfoWindow()&&e.getInfoWindow()!==this&&e.removeInfoWindow(),e._infoWindow=this),n.prototype.addTo.call(this,e)},t.setContent=function(e){var o=this.options.content;return this.options.content=e,this.fire("contentchange",{old:o,new:e}),this.isVisible()&&this.show(this._coordinate),this},t.getContent=function(){return this.options.content},t.setTitle=function(e){var o=e;return this.options.title=e,this.fire("contentchange",{old:o,new:e}),this.isVisible()&&this.show(this._coordinate),this},t.getTitle=function(){return this.options.title},t.buildOn=function(){var e=this,o=Oe(this.options.content),s=Ee(this.options.content);if(this.options.custom){var a=this.getDOM(),l;if(this._bindDomEvents(a,"off"),s||o){var h=we("div");s?(h.innerHTML=this.options.content,this._replaceTemplate(h)):this.options.content.bind(this)(h),l=h}else this._replaceTemplate(this.options.content),l=this.options.content;return this._bindDomEvents(l,"on"),this._appendCustomClass(l),l}this._bindDomEvents(this.getDOM(),"off");var u=we("div");this.options.containerClass&&(u.className=this.options.containerClass);var c=this._getWindowWidth();u.style.width=X(c)?c+"px":"auto",u.style.bottom="0px";var f='<em class="maptalks-ico"></em>';this.options.title&&(f+="<h2>"+this.options.title+"</h2>"),f+='<a href="javascript:void(0);" class="maptalks-close">×</a><div class="maptalks-msgContent"></div>',u.innerHTML=f,this._replaceTemplate(u);var d=u.querySelector(".maptalks-msgContent");s||o?s?d.innerHTML=this.options.content:this.options.content.bind(this)(d):d.appendChild(this.options.content),this._onCloseBtnClick=function(p){e.options.eventsPropagation||(hi(p),nr(p)),e.hide()};var g=u.querySelector(".maptalks-close");return Jr(g,"click touchend",this._onCloseBtnClick),o||this._replaceTemplate(d),this._bindDomEvents(u,"on"),this._appendCustomClass(u),u},t._replaceTemplate=function(e){var o=this._owner;if(this.options.enableTemplate&&o&&o.getProperties&&e&&e.innerHTML){var s=o.getProperties()||{};if(Xt(s)){var a=e.innerHTML;e.innerHTML=a.replace(yS,function(l,h){return s[h]})}}return this},t.getTransformOrigin=function(){var e=this.getSize();return e.width/2+"px bottom"},t.getOffset=function(){var e=this.getSize(),o=new z(-e.width/2,0);this.options.custom?o._sub(0,e.height):o._sub(4,12);var s=this.getOwner();if(s instanceof et||s instanceof Po){var a,l;if(s instanceof et)a=s._getPainter(),l=s.getSize();else{var h=s.getGeometries();if(!h||!h.length)return o;a=h[0]._getPainter(),l=h[0].getSize()}if(l||(l=wS),a){var u=a.getFixedExtent();o._add(u.xmax-l.width/2,u.ymin)}else o._add(0,-l.height)}return o},t.show=function(e){return this.getMap()?this.getMap().options.enableInfoWindow?n.prototype.show.call(this,e):this:this},t.getEvents=function(){if(!this.options.autoCloseOn)return null;var e={};return e[this.options.autoCloseOn]=this.hide,e},t.getOwnerEvents=function(){var e=this.getOwner();if(!this.options.autoOpenOn||!e)return null;var o={};return o[this.options.autoOpenOn]=this._onAutoOpen,o},t.onRemove=function(){this._onDomMouseout(),this.onDomRemove()},t.onDomRemove=function(){if(this._onCloseBtnClick){var e=this.getDOM(),o=e.childNodes[2];In(o,"click touchend",this._onCloseBtnClick),delete this._onCloseBtnClick}},t._onAutoOpen=function(e){var o=this,s=this.getOwner();setTimeout(function(){s instanceof et||s instanceof an?o.show(s.getCoordinates()):s instanceof Po?o.show(s.findClosest(e.coordinate)):((s instanceof pt||s instanceof Eo)&&o.getMap().getScale()>=8&&(e.coordinate=o._rectifyMouseCoordinte(s,e.coordinate)),o.show(e.coordinate))},1)},t._rectifyMouseCoordinte=function(e,o){var s=this;return e instanceof pt?this._rectifyLineStringMouseCoordinate(e,o).coordinate:e instanceof Eo?e.getGeometries().map(function(a){return s._rectifyLineStringMouseCoordinate(a,o)}).sort(function(a,l){return a.dis-l.dis})[0].coordinate:o},t._rectifyLineStringMouseCoordinate=function(e,o){for(var s=this.getMap(),a=e.getCoordinates()||[],l=s.getGLRes(),h=a.map(function(Re){var ct=s.coordToPointAtRes(Re,l),Qe=Re.z||0;return s._pointAtResToContainerPoint(ct,l,Qe)}),u=s.coordToContainerPoint(o),c=1/0,f=-1,d=0,g=h.length;d<g;d++){var p=h[d],m=u.distanceTo(p);m<c&&(c=m,f=d)}for(var v=[f-1,f,f+1].filter(function(Re){return Re>=0&&Re<=h.length-1}),_=v.map(function(Re){return h[Re]}),y=[],{width:w,height:x}=s.getSize(),C=0,b=_.length-1;C<b;C++){var E=C,T=_[C],S=_[C+1];if(T.x===S.x)for(var B=Math.max(0,Math.min(T.y,S.y)),L=Math.min(x,Math.max(T.y,S.y)),D=B;D<=L;D++)y.push({point:new z(T.x,D),coordinateIndex:E});else for(var N=(S.y-T.y)/(S.x-T.x),G=Math.max(0,Math.min(T.x,S.x)),I=Math.min(w,Math.max(T.x,S.x)),A=G;A<=I;A++){var k=N*(A-T.x)+T.y;y.push({point:new z(A,k),coordinateIndex:E})}}for(var Z=1/0,W=-1,re=-1,se,me=0,ge=y.length;me<ge;me++){var{point:de,coordinateIndex:_e}=y[me],Te=u.distanceTo(de);Te<Z&&(Z=Te,W=me,re=_e,se=de)}if(W<0)return{dis:Z,coordinate:o};var Ge=_[re],Me=_[re+1],Be=Ge.distanceTo(Me),lt=se.distanceTo(Ge),M=lt/Be,R=v.map(function(Re){return a[Re]}),V=R[re],q=R[re+1],U=V.x,K=V.y,ie=V.z||0,ne=q.x,le=q.y,ee=q.z||0,ye=ne-U,ce=le-K,ve=ee-ie,be=U+ye*M,Ie=K+ce*M,Fe=ie+ve*M;return{dis:Z,coordinate:new $(be,Ie,Fe)}},t._getWindowWidth=function(){var e=q0.width,o=this.options.width;return o||(o=e),o},r}(an);eh.mergeOptions(q0);var Yv="remove hide shapechange positionchange dragend animatestart",xS={width:0,height:0,animation:"fade",containerClass:"maptalks-tooltip",showTimeout:400},K0=function(n){function r(i,e={}){var o;return o=n.call(this,e)||this,o._content=i,o}Q(r,n);var t=r.prototype;return t._getClassName=function(){return"ToolTip"},t.addTo=function(e){if(r.isSupport(e))return e.on("mousemove",this.onMouseMove,this),e.on("mouseout",this.onMouseOut,this),e.on(Yv,this.hideDom,this),n.prototype.addTo.call(this,e);throw new Error("Invalid geometry or UIMarker the tooltip is added to.")},t.setStyle=function(e){return this.options.containerClass=e,this},t.getStyle=function(){return this.options.containerClass},t.getContent=function(){return this._content},t.buildOn=function(){var e=we("div"),o=this.options||{};o.height&&(e.style.height=o.height+"px"),o.width&&(e.style.width=o.width+"px");var s=o.containerClass||o.cssName;return!s&&o.height&&(e.style.lineHeight=o.height+"px"),Oe(this._content)?this._content.bind(this)(e):e.innerHTML='<div class="'+s+'">'+this._content+"</div>",this._appendCustomClass(e),e},t.onMouseOut=function(){clearTimeout(this._timeout),this.isVisible()&&this._removePrevDOM(),this._switchMapEvents("off")},t.onMouseMove=function(e){var o=this;clearTimeout(this._timeout);var s=this.getMap();if(s){var a=s.locateByPoint(e.coordinate,-5,25);this.options.showTimeout===0?this.show(a):this._timeout=setTimeout(function(){s&&o.show(a)},this.options.showTimeout)}},t.onRemove=function(){clearTimeout(this._timeout),this._owner&&(this._owner.off("mousemove",this.onMouseMove,this),this._owner.off("mouseout",this.onMouseOut,this),this._owner.off(Yv,this.hideDom,this))},t.hideDom=function(){this.hide()},t.onEvent=function(){return n.prototype.onEvent.call(this),this.hideDom(),this},t._getViewPoint=function(){return this.getMap().coordToViewPoint(this._coordinate,void 0,0)._add(this.options.dx,this.options.dy)},r}(an);K0.mergeOptions(xS);var CS={containerClass:"maptalks-menu",animation:null,animationDelay:10,animationOnHide:!1,autoPan:!1,width:160,maxHeight:0,custom:!1,items:[]},yd=function(n){function r(i){return n.call(this,i)||this}Q(r,n);var t=r.prototype;return t._getClassName=function(){return"Menu"},t.addTo=function(e){return e._menu&&e._menu!==this&&e.removeMenu(),e._menu=this,this._owner=e,an.prototype.addTo.apply(this,[e])},t.setItems=function(e){return this.options.items=e,this},t.getItems=function(){return this.options.items||[]},t.buildOn=function(){var e;if(this.options.custom)if(Ee(this.options.items)){var o=we("div");o.innerHTML=this.options.items,this._appendCustomClass(o),e=o}else e=this.options.items;else{e=we("div"),this.options.containerClass&&mo(e,this.options.containerClass),e.style.width=this._getMenuWidth()+"px";var s=this._createMenuItemDom();e.appendChild(s),vt(e,"contextmenu",hi),this._appendCustomClass(e)}return e&&(this._bindDomEvents(e,"off"),this._bindDomEvents(e,"on")),e},t.getOffset=function(){if(!this.getMap())return null;var e=this.getMap().getSize(),o=this.getMap().viewPointToContainerPoint(this._getViewPoint()),s=this.getSize(),a=0,l=0;return o.x+s.width>e.width&&(a=-s.width),o.y+s.height>e.height&&(l=-s.height),new z(a,l)},t.getTransformOrigin=function(){var e=this.getOffset()._multi(-1);return e.x+"px "+e.y+"px"},t.getEvents=function(){return{"_zoomstart _zoomend _movestart _dblclick _click":this._removePrevDOM}},t._createMenuItemDom=function(){var e=this,o=this.getMap(),s=we("ul");mo(s,"maptalks-menu-items");var a=this.getItems();function l(p){return function(m){var v=o._parseEvent(m,"click");v.target=e,v.owner=e._owner,v.index=p;var _=this._callback(v);_!==!1&&(e.hide(),e._owner&&e._owner.fire("closemenu"))}}for(var h,u,c=0,f=a.length;c<f;c++){if(h=a[c],h==="-"||h==="_")u=we("li"),mo(u,"maptalks-menu-splitter");else{u=we("li");var d=h.item;Oe(d)&&(d=d({owner:this._owner,index:c})),u.innerHTML=d,u._callback=h.click,vt(u,"click",l(c))}s.appendChild(u)}var g=this.options.maxHeight||0;return g>0&&Ih(s,"max-height: "+g+"px; overflow-y: auto;"),s},t._getMenuWidth=function(){var e=160,o=this.options.width||e;return o},r}(an);yd.mergeOptions(CS);var wd={setMenu:function(r){return this._menuOptions=r,this._menu?this._menu._setOptions(r):(this.off("contextmenu",this._defaultOpenMenu,this),this.on("contextmenu",this._defaultOpenMenu,this)),this},getMenu:function(){return this._menu},openMenu:function(r){var t=this instanceof Se?this:this.getMap();return r||(r=this.getCenter()),this._menu?this._menu.show(r):this._menuOptions&&t&&(this._bindMenu(),this._menu.show(r)),this.fire("openmenu",{coordinate:r}),this},setMenuItems:function(r){return this._menuOptions||(this._menuOptions={}),Array.isArray(r)&&(this._menuOptions.custom=!1),this._menuOptions.items=r,this.setMenu(this._menuOptions),this},getMenuItems:function(){return this._menu?this._menu.getItems():this._menuOptions?this._menuOptions.items||[]:[]},closeMenu:function(){return this._menu&&this._menu.hide(),this.fire("closemenu",{}),this},removeMenu:function(){return this.off("contextmenu",this._defaultOpenMenu,this),this._unbindMenu(),delete this._menuOptions,this.fire("removemenu",{}),this},_bindMenu:function(){return this._menuOptions?(this._menu=new yd(this._menuOptions),this._menu.addTo(this),this):this},_unbindMenu:function(){return this._menu&&(this.closeMenu(),this._menu.remove(),delete this._menu),this},_defaultOpenMenu:function(r){return this.openMenu(r.coordinate),!1}};Se.include(wd);je.include(wd);var Oo=Object.freeze({__proto__:null,InfoWindow:eh,Menu:yd,Menuable:wd,ToolTip:K0,UIComponent:an,UIMarker:Wh}),Br=function(n){function r(i){return i&&i.position&&!Ee(i.position)&&(i.position=oe({},i.position)),n.call(this,i)||this}Q(r,n);var t=r.prototype;return t._appendCustomClass=function(e){if(!e)return console.warn("dom is null:",e),this;if(this.options.cssName){var o=this.options.cssName;Array.isArray(o)||(o=[o]),o.forEach(function(s){e.classList.add(s)})}return this},t.onAdd=function(){},t.onRemove=function(){},t.addTo=function(e){if(this.remove(),!e.options.control)return this;this._map=e;var o=e.getPanels().control;return this.__ctrlContainer=we("div"),Ih(this.__ctrlContainer,"position:absolute;overflow:visible;"),this.update(),o.appendChild(this.__ctrlContainer),this.onAdd&&this.onAdd(),this.fire("add",{dom:o}),this},t.update=function(){return this.__ctrlContainer.innerHTML="",this._controlDom=this.buildOn(this.getMap()),this._controlDom&&(this._updatePosition(),this.__ctrlContainer.appendChild(this._controlDom)),this},t.getMap=function(){return this._map},t.getPosition=function(){return oe({},this._parse(this.options.position))},t.setPosition=function(e){return Ee(e)?this.options.position=e:this.options.position=oe({},e),this._updatePosition(),this},t.getContainerPoint=function(){var e=this.getPosition(),o=this.getMap().getSize(),s,a;return O(e.left)?O(e.right)||(s=o.width-parseInt(e.right+"")):s=parseInt(e.left+""),O(e.top)?O(e.bottom)||(a=o.height-parseInt(e.bottom+"")):a=parseInt(e.top+""),new z(s,a)},t.getContainer=function(){return this.__ctrlContainer},t.getDOM=function(){return this._controlDom},t.show=function(){return this.__ctrlContainer.style.display="",this},t.hide=function(){return this.__ctrlContainer.style.display="none",this},t.isVisible=function(){return this.__ctrlContainer&&this.__ctrlContainer.style.display===""},t.remove=function(){return this._map?(Ln(this.__ctrlContainer),this.onRemove&&this.onRemove(),delete this._map,delete this.__ctrlContainer,delete this._controlDom,this.fire("remove"),this):this},t._parse=function(e){var o=e;return Ee(e)&&(o=r.positions[o]),o},t._updatePosition=function(){var e=this.getPosition();e||(e={top:20,left:20}),this.__ctrlContainer&&Object.assign(this.__ctrlContainer.style,{top:null,bottom:null,right:null,left:null});for(var o in e)if(e.hasOwnProperty(o)){var s=e[o]||0;X(s)&&(s+="px"),this.__ctrlContainer.style[o]=s}this.fire("positionchange",{position:oe({},e)})},t.onConfig=function(e){e&&"position"in e&&this._updatePosition()},r}(ci(br));Br.positions={"top-left":{top:20,left:20},"top-right":{top:20,right:20},"bottom-left":{bottom:20,left:20},"bottom-right":{bottom:20,right:20}};Se.mergeOptions({control:!0});Se.include({addControl:function(r){return this._containerDOM.getContext?this:(r.addTo(this),this)},removeControl:function(r){return!r||r.getMap()!==this?this:(r.remove(),this)}});var TS={position:{bottom:0,left:0},content:'<a href="http://maptalks.org" target="_blank">maptalks</a>',custom:!1},qv="addlayer removelayer setbaselayer baselayerremove",xd=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.buildOn=function(){return this._attributionContainer=we("div"),this._attributionContainer.className="maptalks-attribution",this._appendCustomClass(this._attributionContainer),this._update(),this._attributionContainer},t.getContent=function(){return this.options.content},t.setContent=function(e){return this.options.content=e,this._update(),this},t.onAdd=function(){this.getMap().on(qv,this._update,this)},t.onRemove=function(){this.getMap().off(qv,this._update,this)},t._updateContent=function(){var e=this._attributionContainer,o=this.options.content||"";return e&&(e.innerHTML="",Ee(o)?e.innerHTML=o:o instanceof HTMLElement&&e.appendChild(e)),this},t._update=function(){if(this.options.custom){this._updateContent();return}var e=this.getMap();if(e){var o=e._getLayers(function(a){return!!a.options.attribution}).reverse().map(function(a){return a.options.attribution}),s=this.options.content+(o.length>0?" - "+o.join(", "):"");this._attributionContainer.innerHTML='<span style="padding:0px 4px">'+s+"</span>"}},r}(Br);xd.mergeOptions(TS);Se.mergeOptions({attribution:!0});Se.addOnLoadHook(function(){var n=this.options.attribution||this.options.attributionControl;n&&(this.attributionControl=new xd(n),this.addControl(this.attributionControl))});var bS={position:{top:120,left:20}},Cd=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.buildOn=function(e){var o=this._getCompass();return this._appendCustomClass(o),this._compass=o,this._registerDomEvents(),e.on("resize moving moveend zooming zoomend rotate rotateend dragrotating dragrotateend viewchange",this._rotateCompass,this),o},t.onAdd=function(){this._rotateCompass()},t._getCompass=function(){var e=we("div","maptalks-compass");return e},t._registerDomEvents=function(){vt(this._compass,"click",this._resetView,this)},t._rotateCompass=function(){var e=this.getMap().getBearing().toFixed(1),o=parseFloat(e);o<=180&&(o*=-1),o!==this._bearing&&(this._bearing=o,Ih(this._compass,"transform: rotate("+this._bearing+"deg);"))},t.onRemove=function(){this.getMap().off("resize moving moveend zooming zoomend rotate rotateend dragrotating dragrotateend viewchange",this._rotateCompass,this),delete this._compass,delete this._bearing},t._resetView=function(){var e={bearing:0};this.getMap().animateTo(e)},r}(Br);Cd.mergeOptions(bS);Se.mergeOptions({compassControl:!1});Se.addOnLoadHook(function(){this.options.compassControl&&(this.compassControl=new Cd(this.options.compassControl),this.addControl(this.compassControl))});var MS={position:"top-right",baseTitle:"Base Layers",overlayTitle:"Layers",excludeLayers:[],containerClass:"maptalks-layer-switcher"},Td=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.buildOn=function(){var e=this.container=we("div",this.options.containerClass),o=this.panel=we("div","panel"),s=this.button=we("button");return e.appendChild(s),e.appendChild(o),this._appendCustomClass(e),e},t.onAdd=function(){vt(this.button,"mouseover",this._show,this),vt(this.panel,"mouseleave",this._hide,this)},t.onRemove=function(){this.panel&&(yt(this.button,"mouseover",this._show),yt(this.panel,"mouseleave",this._hide),Ln(this.panel),Ln(this.button),delete this.panel,delete this.button,delete this.container)},t._show=function(){gy(this.container,"shown")||(mo(this.container,"shown"),this._createPanel())},t._hide=function(e){this.panel.contains(e.toElement||e.relatedTarget)||Uf(this.container,this.options.containerClass)},t._createPanel=function(){this.panel.innerHTML="";var e=we("ul");this.panel.appendChild(e),this._renderLayers(this.getMap(),e)},t._renderLayers=function(e,o){var s=this,a=e.getBaseLayer(),l=e.getLayers(),h=l.length;if(a){var u=a.layers||[a],c=we("li","group"),f=we("ul"),d=we("label");d.innerHTML=this.options.baseTitle,c.appendChild(d);for(var g=0,p=u.length;g<p;g++){var m=u[g];this._isExcluded(m)&&(f.appendChild(this._renderLayer(u[g],!0)),c.appendChild(f),o.appendChild(c))}}if(h){var v=we("li","group"),_=we("ul"),y=we("label"),w=we("input");w.type="checkbox",w.checked=!0,y.innerHTML=this.options.overlayTitle,v.appendChild(w),v.appendChild(y);for(var x=function(T){var S=T.target.checked,B=T.target.parentNode;if(B){var L=B.getElementsByTagName("ul")[0];if(L){var D=function(I){var A=I._layer;A&&A[S?"show":"hide"]()},N=function(I){var A=I._layer,k=I.childNodes[0];k&&(k.checked=S),A&&A[S?"show":"hide"]()};D(B),L.childNodes.forEach(function(G){N(G);var I=G.getElementsByTagName("ul")[0];I&&(D(G),I.childNodes.forEach(function(A){N(A)}))})}}},C=function(){var T=l[b];if(s._isExcluded(T)){if(T.getLayers){var S=we("li","group"),B=we("ul"),L=we("label"),D=we("input");L.innerHTML=T.getId(),D.type="checkbox",D.checked=T.isVisible(),D.onchange=x,S.appendChild(D),S.appendChild(L),S.appendChild(B),S._layer=T,_.appendChild(S);var N=T.getLayers()||[];N.forEach(function(G){B.appendChild(s._renderLayer(G,!1,D.checked))})}else _.appendChild(s._renderLayer(T));T&&!T.isVisible()&&(w.checked=!1)}},b=0;b<h;b++)C();v.appendChild(_),o.appendChild(v),w.onchange=x}},t._isExcluded=function(e){var o=e.getId(),s=this.options.excludeLayers;return!(s.length&&s.indexOf(o)>=0)},t._renderLayer=function(e,o,s=!0){var a=this,l=we("li","layer"),h=we("label"),u=we("input"),c=this.getMap(),f=e.options.visible;e.options.visible=!0;var d=e.isVisible();e.options.visible=f,l.className="layer";var g=u;return o?(g.type="radio",g.name="base"):g.type="checkbox",g.checked=f&&d,s||(g.checked=!1),d||g.setAttribute("disabled","disabled"),g.onchange=function(p){if(p.target.type==="radio"){var m=c.getBaseLayer(),v=m.layers;if(v)for(var _=0,y=v.length;_<y;_++){var w=v[_];w[w===e?"show":"hide"]()}else m.isVisible()||m.show();c._fireEvent("setbaselayer")}else e[p.target.checked?"show":"hide"]();a.fire("layerchange",{target:e})},l.appendChild(u),h.innerHTML=e.getId(),l.appendChild(h),l._layer=e,l},r}(Br);Td.mergeOptions(MS);Se.mergeOptions({layerSwitcherControl:!1});Se.addOnLoadHook(function(){this.options.layerSwitcherControl&&(this.layerSwitcherControl=new Td(this.options.layerSwitcherControl),this.addControl(this.layerSwitcherControl))});var PS={level:4,position:{right:1,bottom:1},size:[300,200],maximize:!0,symbol:{lineWidth:3,lineColor:"#1bbc9b",polygonFill:"#1bbc9b",polygonOpacity:.4},containerClass:"maptalks-overview",buttonClass:"maptalks-overview-button"},bd=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.buildOn=function(){var e=this.options.size;this.options.maximize||(e=[0,0]);var o=we("div");this._appendCustomClass(o);var s=this.mapContainer=we("div");s.style.width=e[0]+"px",s.style.height=e[1]+"px",s.className=this.options.containerClass;var a=this.button=we("div");return a.className=this.options.buttonClass,o.appendChild(s),o.appendChild(a),o},t.onAdd=function(){this.options.maximize&&this._createOverview(),this.getMap().on("resize moving zooming rotate dragrotating viewchange",this._update,this).on("setbaselayer",this._updateBaseLayer,this).on("spatialreferencechange",this._updateSpatialReference,this),vt(this.button,"click",this._onButtonClick,this),this._updateButtonText()},t.onRemove=function(){this.getMap().off("resize moving zooming rotate dragrotating viewchange",this._update,this).off("setbaselayer",this._updateBaseLayer,this).off("spatialreferencechange",this._updateSpatialReference,this),this._overview&&(this._overview.remove(),delete this._overview,delete this._perspective),yt(this.button,"click",this._onButtonClick)},t.maxmize=function(){var e=this.options.size,o=this.mapContainer;return o.style.width=e[0]+"px",o.style.height=e[1]+"px",this._createOverview(),this},t.minimize=function(){this._overview&&this._overview.remove(),delete this._overview,delete this._perspective;var e=this.mapContainer;return e.style.width="0px",e.style.height="0px",this},t.getOverviewMap=function(){return this._overview},t._onButtonClick=function(){this._overview?this.minimize():this.maxmize(),this._updateButtonText()},t._updateButtonText=function(){this._overview?this.button.innerHTML="-":this.button.innerHTML="+"},t._createOverview=function(){var e=this.getMap(),o=this.mapContainer,s=e.config();oe(s,{center:e.getCenter(),zoom:this._getOverviewZoom(),zoomAnimationDuration:150,pitch:0,bearing:0,scrollWheelZoom:!1,checkSize:!1,doubleClickZoom:!1,touchZoom:!1,control:!1,draggable:!1,maxExtent:null}),this._overview=new Se(o,s),this._updateBaseLayer(),this._perspective=new it(this._getPerspectiveCoords(),{draggable:!0,cursor:"move",symbol:this.options.symbol}).on("dragend",this._onDragEnd,this),new So("perspective_layer",this._perspective).addTo(this._overview),this.fire("load")},t._getOverviewZoom=function(){var e=this.getMap(),o=e.getZoom(),s=e.getMinZoom(),a=this.options.level;if(a>0){for(var l=a;l>0;l--)if(o-l>=s)return o-l}else for(var h=a;h<0;h++)if(o-h>=s)return o-h;return o},t._onDragEnd=function(){var e=this._perspective.getCenter();this._overview.setCenter(e),this.getMap().panTo(e)},t._getPerspectiveCoords=function(){var e=this.getMap(),o=e.getProjection();return e.getContainerExtent().toArray().map(function(s){if(o){var a=e._containerPointToPrj(s);return e._fixPrjOnWorldWide(a),o.unproject(a)}return e.containerPointToCoordinate(s)})},t._update=function(){if(this._overview){Lh(this._overview.getContainer());var e=this._getPerspectiveCoords();this._perspective.setCoordinates(e),this._overview.setCenterAndZoom(this.getMap().getCenter(),this._getOverviewZoom())}},t._updateSpatialReference=function(){if(this._overview){var e=this.getMap(),o=e.options.spatialReference;this._overview.setSpatialReference(o)}},t._updateBaseLayer=function(){if(this._overview){var e=this.getMap(),o=e.getBaseLayer();if(!o){this._overview.setBaseLayer(null);return}var s=o.layers,a=0;if(s)for(var l=0,h=s.length;l<h;l++){var u=s[l];if(u.isVisible()){a=l;break}}var c=o.toJSON(),f=null;s?(f=c.layers[a].options,f.visible=!0):f=c.options,this._overview.setMinZoom(f.minZoom||null).setMaxZoom(f.maxZoom||null),delete f.minZoom,delete f.maxZoom,delete c.options.canvas,c.options.visible=!0,c.options.renderer="canvas";var d=hr.fromJSON(c);for(var g in o)Oe(o[g])&&o.hasOwnProperty(g)&&o[g]!==o.constructor.prototype[g]&&(d[g]=o[g]);this._overview.setBaseLayer(d)}},r}(Br);bd.mergeOptions(PS);Se.mergeOptions({overviewControl:!1});Se.addOnLoadHook(function(){this.options.overviewControl&&(this.overviewControl=new bd(this.options.overviewControl),this.addControl(this.overviewControl))});var ES={position:"top-right",draggable:!0,custom:!1,content:"",closeButton:!0},Q0=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.buildOn=function(){var e=this,o;if(this.options.custom)Ee(this.options.content)?(o=we("div"),o.innerHTML=this.options.content,this._appendCustomClass(o)):o=this.options.content;else{if(o=we("div","maptalks-panel"),this._appendCustomClass(o),this.options.closeButton){var s=we("a","maptalks-close");s.innerText="×",s.href="javascript:;",s.onclick=function(){o.style.display="none",e.fire("close")},o.appendChild(s)}var a=we("div","maptalks-panel-content");Ee(this.options.content)?a.innerHTML=this.options.content:a.appendChild(this.options.content),o.appendChild(a)}return this.draggable=new Ea(o,{cancelOn:this._cancelOn.bind(this),ignoreMouseleave:!0}),this.draggable.on("dragstart",this._onDragStart,this).on("dragging",this._onDragging,this).on("dragend",this._onDragEnd,this),this.options.draggable&&this.draggable.enable(),o},t.update=function(){return this.draggable&&(this.draggable.disable(),delete this.draggable),Br.prototype.update.call(this)},t.setContent=function(e){var o=this.options.content;return this.options.content=e,this.fire("contentchange",{old:o,new:e}),this.isVisible()&&this.update(),this},t.getContent=function(){return this.options.content},t._cancelOn=function(e){var o=e.srcElement||e.target,s=o.tagName.toLowerCase();return s==="button"||s==="input"||s==="select"||s==="option"||s==="textarea"},t._onDragStart=function(e){this._startPos=e.mousePos,this._startPosition=oe({},this.getPosition()),this.fire("dragstart",e)},t._onDragging=function(e){var o=e.mousePos,s=o.sub(this._startPos),a=this._startPosition,l=this.getPosition();O(l.top)||(l.top=parseInt(a.top)+s.y),O(l.bottom)||(l.bottom=parseInt(a.bottom)-s.y),O(l.left)||(l.left=parseInt(a.left)+s.x),O(l.right)||(l.right=parseInt(a.right)-s.x),this.setPosition(l),this.fire("dragging",e)},t._onDragEnd=function(e){delete this._startPos,delete this._startPosition,this.fire("dragend",e)},t._getConnectPoints=function(){var e=this.getMap(),o=this.getContainerPoint(),s=this.getDOM(),a=parseInt(s.clientWidth+""),l=parseInt(s.clientHeight+""),h=[e.containerPointToCoordinate(o.add(a/2,0)),e.containerPointToCoordinate(o.add(a,l/2)),e.containerPointToCoordinate(o.add(a/2,l)),e.containerPointToCoordinate(o.add(0,l/2))];return h},r}(Br);Q0.mergeOptions(ES);var SS={position:{top:156,left:20},view:null},Md=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.buildOn=function(){var e=this._getReset();return this._appendCustomClass(e),this._reset=e,this._registerDomEvents(),e},t.onAdd=function(){this._view=this.options.view?this.options.view:this.getMap().getView()},t.setView=function(e){this._view=e},t._getReset=function(){var e=we("div","maptalks-reset");return e},t._registerDomEvents=function(){vt(this._reset,"click",this._resetView,this)},t.onRemove=function(){delete this._reset,delete this._view},t._resetView=function(){this.getMap().setView(this._view)},r}(Br);Md.mergeOptions(SS);Se.mergeOptions({resetControl:!1});Se.addOnLoadHook(function(){this.options.resetControl&&(this.resetControl=new Md(this.options.resetControl),this.addControl(this.resetControl))});var OS={position:"bottom-left",maxWidth:100,metric:!0,imperial:!1,containerClass:null},Kv="zoomend moving moveend",Pd=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.buildOn=function(e){return this._map=e,this._scaleContainer=we("div",this.options.containerClass),this._addScales(),e.on(Kv,this._update,this),this._map.isLoaded()&&this._update(),this._appendCustomClass(this._scaleContainer),this._scaleContainer},t.onRemove=function(){this.getMap().off(Kv,this._update,this)},t._addScales=function(){var e="border: 2px solid #000000;border-top: none;line-height: 1.1;padding: 0px;color: #000000;font-size: 11px;text-align:center;white-space: nowrap;overflow: hidden;-moz-box-sizing: content-box;box-sizing: content-box;background: #fff; background: rgba(255, 255, 255, 0);";this.options.metric&&(this._mScale=Ap("div",this.options.containerClass?null:e,this._scaleContainer)),this.options.imperial&&(this._iScale=Ap("div",this.options.containerClass?null:e,this._scaleContainer))},t._update=function(){var e=this._map,o=e.pixelToDistance(this.options.maxWidth,0);this._updateScales(o)},t._updateScales=function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},t._updateMetric=function(e){var o=this._getRoundNum(e),s=o<1e3?o+" m":o/1e3+" km";this._updateScale(this._mScale,s,o/e)},t._updateImperial=function(e){var o=e*3.2808399,s,a,l;o>5280?(s=o/5280,a=this._getRoundNum(s),this._updateScale(this._iScale,a+" mile",a/s)):(l=this._getRoundNum(o),this._updateScale(this._iScale,l+" feet",l/o))},t._updateScale=function(e,o,s){e.style.width=Math.round(this.options.maxWidth*s)+"px",e.innerHTML=o},t._getRoundNum=function(e){var o=Math.pow(10,(Math.floor(e)+"").length-1),s=e/o;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,o*s},r}(Br);Pd.mergeOptions(OS);Se.mergeOptions({scaleControl:!1});Se.addOnLoadHook(function(){this.options.scaleControl&&(this.scaleControl=new Pd(this.options.scaleControl),this.addControl(this.scaleControl))});var kS={height:28,vertical:!1,position:"top-right",reverseMenu:!1,items:[]},ew=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.buildOn=function(e){this._map=e;var o=we("div"),s=we("ul","maptalks-toolbar-hx");o.appendChild(s),this.options.vertical?mo(o,"maptalks-toolbar-vertical"):mo(o,"maptalks-toolbar-horizonal");var a=this;function l(m,v,_,y){var w=a._getItems()[v];return function(x){return nr(x),m({target:w,index:v,childIndex:_,dom:y})}}var h=this.options.items;if($e(h))for(var u=0,c=h.length;u<c;u++){var f=h[u],d=we("li");if(this.options.height!==28&&(d.style.lineHeight=this.options.height+"px"),d.style.height=this.options.height+"px",d.style.cursor="pointer",ib(f.item)){d.style.textAlign="center";var g=nb("div",f.item);d.innerHTML='<div style="margin-top:'+(this.options.height-g.height)/2+'px;">'+f.item+"</div>"}else d.innerHTML=f.item;if(f.click&&vt(d,"click",l(f.click,u,null,d)),$e(f.children)){var p=this._createDropMenu(u);d.appendChild(p),d._menu=p,vt(d,"mouseover",function(){this._menu.style.display=""}),vt(d,"mouseout",function(){this._menu.style.display="none"})}s.appendChild(d)}return this._appendCustomClass(o),o},t._createDropMenu=function(e){var o=this;function s(x,C,b){var E=o._getItems()[C].children[b];return function(T){return nr(T),x({target:E,index:C,childIndex:b})}}var a=we("div","maptalks-dropMenu"),l=this._getItems(),h=l.length,u=we("ul"),c=l[e].children;e===h-1&&c&&(a.style.cssText="right: 0px;",u.style.cssText="right: 0px;position: absolute;",this.options.reverseMenu&&(u.style.bottom="0")),a.appendChild(we("em","maptalks-ico"));for(var f=0,d=0,g=c.length;d<g;d++){var p=Oh(c[d].item,"12px");p.width>f&&(f=p.width)}for(var m=0,v=c.length;m<v;m++){var _=c[m],y=we("li");y.innerHTML='<a href="javascript:;">'+_.item+"</a>",y.style.cursor="pointer",y.style.width=f+24+"px",vt(y.childNodes[0],"click",s(_.click,e,m)),u.appendChild(y)}if(this.options.vertical){var w=f<95?95:f;this.options.reverseMenu?a.style.right=-(w+10*2+2)+"px":a.style.left=-(w+10*2+2)+"px"}else this.options.reverseMenu?a.style.bottom="28px":a.style.top="29px";return a.appendChild(u),a.style.display="none",a},t._getItems=function(){return this.options.items||[]},r}(Br);ew.mergeOptions(kS);var RS={position:"top-left",zoomLevel:!0,seamless:!1},Ed=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.buildOn=function(e){var o=this.options,s=we("div","maptalks-zoom");if(this._appendCustomClass(s),o.zoomLevel){var a=we("span","maptalks-zoom-zoomlevel"),l=we("span","maptalks-zoom-zoomlevel-text");a.appendChild(l),s.appendChild(a),this._levelDOM=l}var h=we("div","maptalks-zoom-slider"),u=we("a","maptalks-zoom-zoomin");u.href="javascript:;",h.appendChild(u),this._zoomInButton=u;var c=we("a","maptalks-zoom-zoomout");return c.href="javascript:;",h.appendChild(c),this._zoomOutButton=c,s.appendChild(h),e.on("_zoomend _zooming _zoomstart _spatialreferencechange",this._update,this),this._update(),this._registerDomEvents(),s},t.onRemove=function(){this.getMap().off("_zoomend _zooming _zoomstart _spatialreferencechange",this._update,this)},t._update=function(){this._updateText()},t._updateText=function(){if(this._levelDOM){var e=this.getMap(),o=e.getZoom();Tn(o)||(o=Math.floor(o*10)/10),this._levelDOM.innerHTML=o+""}},t._registerDomEvents=function(){this._zoomInButton&&vt(this._zoomInButton,"click",this._onZoomInClick,this),this._zoomOutButton&&vt(this._zoomOutButton,"click",this._onZoomOutClick,this)},t._onZoomInClick=function(e){hi(e),this.getMap().zoomIn()},t._onZoomOutClick=function(e){hi(e),this.getMap().zoomOut()},r}(Br);Ed.mergeOptions(RS);Se.mergeOptions({zoomControl:!1});Se.addOnLoadHook(function(){this.options.zoomControl&&(this.zoomControl=new Ed(this.options.zoomControl),this.addControl(this.zoomControl))});var tw=Object.freeze({__proto__:null,Attribution:xd,Compass:Cd,Control:Br,LayerSwitcher:Td,Overview:bd,Panel:Q0,Reset:Md,Scale:Pd,Toolbar:ew,Zoom:Ed}),Xi=function(){function n(r,t,i,e){Array.isArray(r)?(this.scale={x:r[0],y:r[1]},this.origin={x:r[2],y:r[3]}):(this.scale={x:r,y:t},this.origin={x:i,y:e})}return n.getDefault=function(t){var i=t.code.toLowerCase();return i==="baidu"?"baidu":i==="EPSG:4326".toLowerCase()||i==="EPSG:4490".toLowerCase()?"tms-global-geodetic":i==="identity"?[1,-1,0,0]:"web-mercator"},n}(),nl=6378137*Math.PI;oe(Xi,{"web-mercator":new Xi([1,-1,-nl,nl]),"tms-global-mercator":new Xi([1,1,-nl,-nl]),"tms-global-geodetic":new Xi([1,1,-180,-90]),baidu:new Xi([1,1,0,0])});var Qv=function(){function n(t,i,e,o){this.map=t,this.tileSize=o,this.fullExtent=e,this.prepareTileInfo(i,e),this._xScale=e.right>=e.left?1:-1,this._yScale=e.top>=e.bottom?1:-1;var s=t.getGLRes();this._pointOrigin=t._prjToPointAtRes(new z(this.tileSystem.origin),s),this._glRes=s}var r=n.prototype;return r.prepareTileInfo=function(i,e){if(Ee(i)?i=Xi[i.toLowerCase()]:Array.isArray(i)&&(i=new Xi(i)),!i)throw new Error("Invalid TileSystem");this.tileSystem=i;var o=e.right>e.left?1:-1,s=e.top>e.bottom?-1:1,a=i.origin.x,l=i.origin.y;this.transformation=new r0([o,s,a,l])},r._getTileNum=function(i,e){var o=this.tileSystem,s=this.tileSize,a=1e-7,l=Math.floor(a*o.scale.x+i.x/(s.width*e)),h=Math.ceil(a*o.scale.y+i.y/(s.height*e));return{x:o.scale.x*l,y:o.scale.y*h}},r.getTileIndex=function(i,e,o){var s=this.tileSystem,a=this.transformation.transform(i,1),l=this._getTileNum(a,e);return s.scale.x<0&&(l.x-=1),s.scale.y>0&&(l.y-=1),this.getNeighorTileIndex(l.x,l.y,0,0,e,o)},r.getNeighorTileIndex=function(i,e,o,s,a,l){var h=this.tileSystem,u=i+h.scale.x*o,c=e-h.scale.y*s,f=!1,d=u,g=c,p=this._getTileFullIndex(a);return l&&((l===!0||l==="x")&&(p.xmax===p.xmin?u=p.xmin:u<p.xmin?(u=p.xmax-(p.xmin-u)%(p.xmax-p.xmin),u===p.xmax&&(u=p.xmin)):u>=p.xmax&&(u=p.xmin+(u-p.xmin)%(p.xmax-p.xmin))),(l===!0||l==="y")&&(p.ymax===p.ymin?c=p.ymin:c>=p.ymax?c=p.ymin+(c-p.ymin)%(p.ymax-p.ymin):c<p.ymin&&(c=p.ymax-(p.ymin-c)%(p.ymax-p.ymin),c===p.ymax&&(c=p.ymin)))),(u<p.xmin||u>p.xmax||c>p.ymax||c<p.ymin)&&(f=!0),{x:u,y:c,idx:d,idy:g,out:f}},r._getTileFullIndex=function(i){if(this._tileFullIndex||(this._tileFullIndex={}),this._tileFullIndex[i])return this._tileFullIndex[i];var e=this.fullExtent,o=this.transformation,s=this._getTileNum(o.transform(new $(e.left,e.top),1),i),a=this._getTileNum(o.transform(new $(e.right,e.bottom),1),i),l=this.tileSystem;return l.scale.x<0&&(s.x-=1,a.x-=1),l.scale.y>0&&(s.y-=1,a.y-=1),this._tileFullIndex[i]=new Je(s,a,null),this._tileFullIndex[i]},r.getTilePrjNW=function(i,e,o,s){var a=this.tileSystem,l=this.tileSize,h=a.origin.y+this._yScale*a.scale.y*(e+(a.scale.y===1?1:0))*o*l.height,u=a.origin.x+this._xScale*a.scale.x*(i+(a.scale.x===1?0:1))*o*l.width;return s?(s.set(u,h),s):new $(u,h)},r.getTilePointNW=function(i,e,o,s){var a=this._glRes/o,l=this.tileSystem,h=this.tileSize,u=this._pointOrigin.y*a+this._yScale*l.scale.y*(e+(l.scale.y===1?1:0))*h.height,c=this._pointOrigin.x*a+this._xScale*l.scale.x*(i+(l.scale.x===1?0:1))*h.width;return s?(s.set(c,u),s):new z(c,u)},r.getTilePrjSE=function(i,e,o,s){var a=this.tileSystem,l=this.tileSize,h=a.origin.y+this._yScale*a.scale.y*(e+(a.scale.y===1?0:1))*o*l.height,u=a.origin.x+this._xScale*a.scale.x*(i+(a.scale.x===1?1:0))*o*l.width;return s?(s.set(u,h),s):new $(u,h)},r.getTilePointSE=function(i,e,o,s){var a=this._glRes/o,l=this.tileSystem,h=this.tileSize,u=this._pointOrigin.y*a+this._yScale*l.scale.y*(e+(l.scale.y===1?0:1))*h.height,c=this._pointOrigin.x*a+this._xScale*l.scale.x*(i+(l.scale.x===1?1:0))*h.width;return s?(s.set(c,u),s):new z(c,u)},r.getTilePrjExtent=function(i,e,o){var s=this.getTilePrjNW(i,e,o),a=this.getTilePrjSE(i,e,o);return new Je(s,a)},n}();/*!
|
|
277
|
-
* Contains code from THREE.js
|
|
278
|
-
* MIT License
|
|
279
|
-
* https://github.com/mrdoob/three.js
|
|
280
|
-
*/var Ui=[];for(var ac=0;ac<6;ac++)Ui[ac]=[];var ol=[];function lc(n,r,t){AS(n);for(var i=0;i<6;i++){var e=Ui[i];if(ol[0]=e[0]>0?r[1][0]:r[0][0],ol[1]=e[1]>0?r[1][1]:r[0][1],ol[2]=e[2]>0?r[1][2]:r[0][2],LS(e,ol)<0)return!1}return!0}function AS(n){var r=n,t=r[0],i=r[1],e=r[2],o=r[3],s=r[4],a=r[5],l=r[6],h=r[7],u=r[8],c=r[9],f=r[10],d=r[11],g=r[12],p=r[13],m=r[14],v=r[15];Xn(Ui[0],o-t,h-s,d-u,v-g),Xn(Ui[1],o+t,h+s,d+u,v+g),Xn(Ui[2],o+i,h+a,d+c,v+p),Xn(Ui[3],o-i,h-a,d-c,v-p),Xn(Ui[4],o-e,h-l,d-f,v-m),Xn(Ui[5],o+e,h+l,d+f,v+m)}var sl=1/6;function Xn(n,r,t,i,e){return n[0]=r*sl,n[1]=t*sl,n[2]=i*sl,n[3]=e*sl,n}function LS(n,r){return n[0]*r[0]+n[1]*r[1]+n[2]*r[2]+n[3]}var IS=1,rs=new z(0,0),DS=32,al=typeof Set<"u",em=function(){function n(){this._table=al?new Set:{}}var r=n.prototype;return r.add=function(i){al?this._table.add(i):this._table[i]=!0},r.has=function(i){return al?this._table.has(i):this._table[i]},r.reset=function(){al?this._table.clear():this._table={}},n}(),zS={urlTemplate:null,subdomains:null,errorUrl:null,repeatWorld:!0,background:!0,loadingLimitOnInteracting:3,loadingLimit:0,placeholder:!1,crossOrigin:null,tileSize:[256,256],offset:[0,0],tileSystem:null,fadeAnimation:!Ct,fadeDuration:1e3/60*10,debug:!1,spatialReference:null,maxCacheSize:256,renderer:function(){return Ce.webgl?"gl":"canvas"}(),clipByPitch:!0,maxAvailableZoom:null,cascadeTiles:!0,zoomOffset:0,pyramidMode:1,decodeImageInWorker:!1,tileLimitPerFrame:0,tileStackStartDepth:7,tileStackDepth:6,awareOfTerrain:!0,bufferPixel:.5,mipmapTexture:!0,depthMask:!0,currentTilesFirst:!0,forceRenderOnMoving:!0,tileErrorScale:1},BS=/\{ *([\w_]+) *\}/g,tm=new z(0,0),is=new z(0,0),ns=new z(0,0),ji=new z(0,0),GS=new z(0,0),FS=new z(0,0),It=[[0,0,0],[0,0,0]],hc=[0,0,0],uc=[0,0,0],cc=[0,0,0],gt=function(n){function r(i,e){return n.call(this,i,e)||this}Q(r,n),r.fromJSON=function(e){return!e||e.type!=="TileLayer"?null:new r(e.id,e.options)};var t=r.prototype;return t.forceReload=function(){return this.fire("forcereloadstart"),this.clear(),this._renderer&&this._renderer.setToRedraw(),this.fire("forcereloadend"),this},t.getTileSize=function(e){if(this._tileSize)return this._tileSize;var o=this.options.tileSize;return X(o)&&(o=[o,o]),this._tileSize=new ft(o),this._tileSize},t.getTiles=function(e,o){var s=this;this._coordCache={};var a;if(this._isPyramidMode()?a=this._getPyramidTiles(e,o):a=this._getCascadeTiles(e,o),!this._maskGeoJSON)return a;var l=a.tileGrids||[],h=0;return l.forEach(function(u){var c=u.tiles||[];u.tiles=c.filter(function(d){return s._tileInMask(d)}),h+=u.tiles.length;var f=u.tiles.map(function(d){return d.parent});u.parents=(u.parents||[]).filter(function(d){return f.indexOf(d.id)>-1})}),a.count=h,a},t._isPyramidMode=function(){var e=this._spatialRef||this.getSpatialReference();return!this._disablePyramid&&!this._hasOwnSR&&this.options.pyramidMode&&e&&e.isPyramid()},t._getTileFullExtent=function(){if(this._tileFullExtent)return this._tileFullExtent;var e=this.getSpatialReference(),o=e.getFullExtent(),s=e.getResolution(0),a=this.getMap();return this._tileFullExtent=o.convertTo(function(l){return a._prjToPointAtRes(l,s,rs)}),this._tileFullExtent},t._getRootNodes=function(e){var o=this.getMap();if(this._rootNodes){var{tiles:s,mapWidth:a,mapHeight:l}=this._rootNodes;if(o.width!==a||o.height!==l){for(var h=this._getRootError(),u=0;u<s.length;u++)s[u].error=h;this._rootNodes.mapWidth=o.width,this._rootNodes.mapHeight=o.height}for(var c=0;c<s.length;c++)s[c].offset[0]=e[0],s[c].offset[1]=e[1];return this._rootNodes}var f=this._spatialRef||this.getSpatialReference(),d=f.getResolution(0),g=this._getTileConfig(),p=f.getFullExtent(),{origin:m,scale:v}=g.tileSystem,_=g.getTilePrjExtent(0,0,d),y=_.getWidth(),w=_.getHeight(),x=1e-5,C=Math.abs((m.x-p.left)/y);C=Math.ceil(C-x);var b=Math.abs((p.right-m.x)/y);b=Math.ceil(b-x);var E=Math.ceil(Math.abs(p.top-m.y)/w);E=Math.ceil(E-x);var T=Math.ceil(Math.abs(p.bottom-m.y)/w);if(T=Math.ceil(T-x),(b+C)*(T+E)>DS)return{status:0,error:"Too many root nodes"};for(var S=this._getRootError(),B=[],L=0,D=-C;D<b;D++)for(var N=-E;N<T;N++){var G=v.y<0?N:-(N+1);B.push(this.createTileNode(D,G,L,D,G,d,S))}return this._rootNodes={status:1,tiles:B,mapWidth:o.width,mapHeight:o.height},this._getRootNodes(e)},t.createTileNode=function(e,o,s,a,l,h,u,c,f,d){var g=this.map,p=this.options.zoomOffset;if(!f){var m=this._getTileConfig();f=m.getTilePrjExtent(e,o,h).convertTo(function(y){return g._prjToPointAtRes(y,h,rs)})}var v=this._getTileOffset(s),_=this.getTileUrl(e,o,s+p);return{parent:c,layer:this.getId(),x:e,y:o,z:s,idx:a,idy:l,res:h,extent2d:f,id:d||this._getTileId(e,o,s),url:_y(_),offset:v,error:u,children:[]}},t._getRootError=function(){var e=this.getMap(),o=mt(e.getFov()),s=e.width/e.height,a=e.cameraPosition[2],l=a*Math.tan(.5*o),h=l*s,u=Math.sqrt(a*a+l*l+h*h),c=e._getFovZ(0),f=c*(u/a),d=this._spatialRef||this.getSpatialReference(),g=d.getResolution(0);return f*g/e.getResolution(0)},t._getPyramidTiles=function(e,o){var s=this.map;isNaN(+e)&&(e=this._getTileZoom(s.getZoom()));var a=this._spatialRef||this.getSpatialReference(),l=Math.min(e,this.getMaxZoom(),this.getMaxAvailableZoom()||1/0),h=s.projViewMatrix,u=this._getTileFullExtent(),c=this._getTileOffset(0),f;if(this.options.repeatWorld){var d=s.getContainerExtent(),g=this._convertToExtent2d(d),p=a.getResolution(0)/s.getResolution();if(g.within(u.copy()._scale(p))){var C=this._getRootNodes(c);if(C.status!==1)return console.warn(C.error),this._disablePyramid=!0,this.getTiles(e,o);f=[...C.tiles]}else{var m=s.getPitch(),v=s.options.cascadePitches[1],_=Math.floor(s._getVisualHeight(v)),y=m<=v?d:new Le(0,s.height-_,s.width,s.height);this._visitedTiles=new em;var w=this._getTiles(0-this.options.zoomOffset,y,2,o&&o.getRenderer(),!0),x=this._getRootError()*Math.pow(2,this.options.zoomOffset);w.tiles.forEach(function(G){G.error=x}),f=w.tiles}}else{var b=this._getRootNodes(c);if(b.status!==1)return console.warn(b.error),this._disablePyramid=!0,this.getTiles(e,o);f=[...b.tiles]}for(var E=s.getGLRes(),T={0:c},S=new Le,B=[],L=[],D=o&&o.getRenderer();f.length>0;){var N=f.pop();if(N.z===l){S._combine(N.extent2d),B.push(N);continue}T[N.z+1]||(T[N.z+1]=this._getTileOffset(N.z+1)),this._splitNode(N,h,f,B,L,e,S,l,T[N.z+1],D,E)}return L.sort(HS),this._debugTile(B,"_getPyramidTiles"),{tileGrids:[{extent:S,count:B.length,tiles:B,parents:L,offset:[0,0],zoom:e}],count:B.length}},t.isParentTile=function(e,o,s){var a=Math.max(this.getMinZoom(),e-this.options.tileStackStartDepth),l=a+this.options.tileStackDepth;return s.z>=a&&s.z<l&&s.z<o},t._splitNode=function(e,o,s,a,l,h,u,c,f,d,g){var p=e.z+1,m=this._spatialRef||this.getSpatialReference(),{idx:v,idy:_}=e,y=d||this.getRenderer(),w=!1,x=[],C=m.getResolution(p),b=C/g;this.tileInfoCache||(this.tileInfoCache=new id(this.options.maxCacheSize*4));for(var E=0;E<4;E++){var T=E%2,S=E>>1;e.children||(e.children=[]);var B=e.children[E];if(!B){var L=(v<<1)+T,D=(_<<1)+S;B=this._getTileId(L,D,p),e.children[E]=B}var N=y.isTileCachedOrLoading(B),G=N&&N.info;G||(G=this.tileInfoCache.get(B),G||(G=this._createChildNode(e,T,S,f,B))),G.error=e.error/2,G.offset[0]=f[0],G.offset[1]=f[1];var I=this._isTileVisible(G,o,b,c,f);if(I===wi.VISIBLE)w=!0;else{if(I===wi.OUT_OF_FRUSTUM)continue;if(I===wi.SCREEN_ERROR_TOO_SMALL&&p!==c){a.push(e),u._combine(e.extent2d);return}}x.push(G)}p===c?w?Yt(s,x):(a.push(e),u._combine(e.extent2d)):Yt(s,x),this.isParentTile(h,c,e)&&l.push(e)},t._createChildNode=function(e,o,s,a,l){var{x:h,y:u,idx:c,idy:f,extent2d:d}=e,g=e.z+1,p=(h<<1)+o,m=(u<<1)+s,v=(c<<1)+o,_=(f<<1)+s,y=2,w=d.getWidth()/2*y,x=d.getHeight()/2*y,C=d.xmin*y,b=d.ymax*y,E=d.ymin*y,T=this._getTileConfig().tileSystem,S=T.scale.y;l=l||this._getTileId(v,_,g);var B;if(S<0){var L=C+o*w,D=b-s*x;B=new Le(L,D-x,L+w,D)}else{var N=C+o*w,G=E+s*x;B=new Le(N,G,N+w,G+x)}var I=this.createTileNode(p,m,g,v,_,e.res/2,e.error/2,e.id,B,l);return this.tileInfoCache.add(l,I),I},t._isTileVisible=function(e,o,s,a,l){if(e.z===0)return wi.VISIBLE;if(!this._isTileInFrustum(e,o,s,l))return wi.OUT_OF_FRUSTUM;var h=this.options.maxError;O(h)&&(h=IS);var u=this._getScreenSpaceError(e,s,a,l);return u>=h?wi.VISIBLE:wi.SCREEN_ERROR_TOO_SMALL},t._isTileInFrustum=function(e,o,s,a){if(!this._zScale){var l=this.getMap(),h=l.getGLRes();this._zScale=l.altitudeToPoint(100,h)/100}var u=this.getRenderer(),{xmin:c,ymin:f,xmax:d,ymax:g}=e.extent2d;if(e.offset&&e.offset[0]!==0&&e.offset[1]!==0&&!Oe(this.options.offset)){var[p,m]=e.offset;c+=p,d+=p,f+=m,g+=m}It[0][0]=(c-a[0])*s,It[0][1]=(f-a[1])*s;var v=e.minAltitude||u&&u.avgMinAltitude||0;It[0][2]=v*this._zScale,It[1][0]=(d-a[0])*s,It[1][1]=(g-a[1])*s;var _=e.maxAltitude||u&&u.avgMaxAltitude||0;return It[1][2]=_*this._zScale,lc(o,It)},t._getScreenSpaceError=function(e,o,s,a){var l=e.error,h=this.map,{xmin:u,ymin:c,xmax:f,ymax:d}=e.extent2d;hc[0]=(u-a[0])*o,hc[1]=(c-a[1])*o,uc[0]=(f-a[0])*o,uc[1]=(d-a[1])*o;var g=NS(hc,uc,h.cameraPosition),p=Math.max(Math.abs(g),1e-7),m=Math.abs(e.z-s),v;h.height<1e3?v=1:v=m<=1?1:m<=2?.7:.605;var _=l*v/p*this.options.tileErrorScale,y=dt[h.id],w=y?y.pitch:h.getPitch();return w<=60?_*1.45:_},t._getCascadeTiles=function(e,o){var s=this.getMap(),a=s.getPitch(),l=o&&o.getRenderer(),h=s.getContainerExtent(),u=[],c=0,f=this.getMinZoom(),d=s.options.cascadePitches[0],g=s.options.cascadePitches[1],p=Math.floor(s._getVisualHeight(g)),m=O(e)?this._getTileZoom(s.getZoom()):e;if(this._visitedTiles=new em,!O(e)||!this.options.cascadeTiles||a<=d||!O(f)&&m<=f){var v=a<=g?h:new Le(0,s.height-p,s.width,s.height),_=this._getTiles(m,v,2,l);return _&&(c+=_.tiles.length,u.push(_)),{tileGrids:u,count:c}}var y=Math.floor(s._getVisualHeight(d)),w=new Le(0,s.height-y,s.width,s.height),x=this._getTiles(m,w,0,l);c+=x?x.tiles.length:0,u.push(x);var C=w.ymin,b=s.getSpatialReference().getZoomDirection(),E=b,T;if(a>g){m-E<=f&&(E=0);var S=new Le(0,s.height-p,s.width,C);T=this._getTiles(m-E,S,1,l),c+=T?T.tiles.length:0,C=S.ymin,E+=4*b,u.push(T)}var B;if(m-E>=f){var L=new Le(0,h.ymin,s.width,C);B=this._getTiles(m-E,L,2,l),c+=B?B.tiles.length:0,u.push(B)}return T&&B&&(u[1]=B,u[2]=T),{tileGrids:u,count:c}},t.getTileUrl=function(e,o,s){var a=this.options.urlTemplate,l="",h=this.options.subdomains;if(h&&$e(h)){var u=h.length,c=(e+o)%u;c<0&&(c=0),l=h[c]}if(Oe(a))return a(e,o,s,l);var f={x:e,y:o,z:s,s:l};return this.options.token&&(f.token=this.options.token),this.options.customTags&&oe(f,this.options.customTags),a.replace(BS,function(d,g){var p=f[g];if(p===void 0)throw new Error("No value provided for variable "+d);return typeof p=="function"&&(p=p(f)),p})},t.clear=function(){return this._renderer&&this._renderer.clear(),this.tileInfoCache&&this.tileInfoCache.reset(),this.fire("clear"),this},t.toJSON=function(){var e={type:this.getJSONType(),id:this.getId(),options:this.config()};return e},t.getSpatialReference=function(){var e=this.getMap();if(e&&(!this.options.spatialReference||Yi.equals(this.options.spatialReference,e.options.spatialReference)))return e.getSpatialReference();if(this._sr)return this._sr;var o=this.options.spatialReference;if(Ee(o)&&(o=Yi.getPreset(o),!o))throw new Error("Unsupported spatial reference: "+this.options.spatialReference+", possible values: "+Yi.getAllPresets().join());return this._sr=new Yi(o),this._srMinZoom=this._sr.getMinZoom(),this._srMaxZoom=this._sr.getMaxZoom(),this._hasOwnSR=this._sr.toJSON().projection!==e.getSpatialReference().toJSON().projection,this._sr},t.getMinZoom=function(){var e=this.options.minZoom||0,o=this._spatialRef||this.getSpatialReference();return o!==this.getMap().getSpatialReference()?Math.max(e,this._srMinZoom):e},t.getMaxZoom=function(){var e=this._spatialRef||this.getSpatialReference();return e!==this.getMap().getSpatialReference()?Math.min(n.prototype.getMaxZoom.call(this),this._srMaxZoom):n.prototype.getMaxZoom.call(this)},t._getTileZoom=function(e){if(!this._hasOwnSR){var o=this.getMap().getResolution(e),s=this.getSpatialReference().getResolution(e),a=Math.log(s/o)*Math.LOG2E;e+=a}var l=this.getMaxAvailableZoom();return!O(l)&&e>l&&(e=l),Tn(e)||(e=Math.round(e)),e=Math.max(0,e),e},t.getMaxAvailableZoom=function(){var e=this._spatialRef||this.getSpatialReference();return this.options.maxAvailableZoom||e&&e.getMaxZoom()},t._getTiles=function(e,o,s,a,l){var h=this.getMap(),u=e,c=h.projViewMatrix,f=h.getResolution(e)/h.getResolution(e-1)===.5;s<2&&(s===0&&f&&(u-=1),c=s===0?h.cascadeFrustumMatrix0:s===1?h.cascadeFrustumMatrix1:h.projViewMatrix);var d=u+this.options.zoomOffset,g=this._getTileOffset(u),p=g[0]||g[1],m={zoom:u,extent:null,offset:g,tiles:[]};if(d<0||!h||!this.isVisible()||!h.width||!h.height)return m;if(!l){var v=this.getMinZoom(),_=this.getMaxZoom();if(!O(v)&&u<v||!O(_)&&u>_)return m}var y=this._getTileConfig();if(!y)return m;var w={zoom:g},x=this._spatialRef||this.getSpatialReference(),C=x.getResolution(u),b;this._hasOwnSR?b=h.getGLScale(u):b=C/h.getGLRes();var E=!this._hasOwnSR&&this.options.repeatWorld,T=this._convertToExtent2d(o),S=this._getMask2DExtent();if(S){var B=S.intersection(T);if(!B)return m;o=B.convertTo(function(ut){return h._pointToContainerPoint(ut,void 0,0,rs)})}var L=h._containerPointToPrj(o.getCenter(),tm),D=h._prjToPoint(L,u,is),N;p?N=this._project(h._pointToPrj(D._add(g),u,is),is):N=this._project(L,is);var G=h.getGLScale()/h.getGLScale(u);ns.x=T.xmin*G,ns.y=T.ymax*G,ji.x=T.xmax*G,ji.y=T.ymin*G;for(var I=this._project(h._pointToPrj(ns._add(g),u,ns),ns),A=this._project(h._pointToPrj(ji._add(g),u,ji),ji),k=y.getTileIndex(N,C,E),Z=y.getTileIndex(I,C,E),W=y.getTileIndex(A,C,E),re=Math.ceil(Math.abs(k.idy-Z.idy)),se=Math.ceil(Math.abs(k.idx-Z.idx)),me=Math.ceil(Math.abs(k.idy-W.idy)),ge=Math.ceil(Math.abs(k.idx-W.idx)),de=(re+me+1)*(se+ge+1),_e=this.getTileSize(),Te=this.getRenderer()||a,Ge=this._getTileConfig().tileSystem.scale,Me=[],Be=new Le,lt=new z(0,0),M=-re;M<=me;M++)for(var R=-se,V=-1/0,q=!1;R>=V&&R<=ge;){var U=y.getNeighorTileIndex(k.idx,k.idy,R,M,C,E);V===-1/0?R++:R--;var K=this._getTileId(U.idx,U.idy,u);if(!(U.out||this._visitedTiles&&this._visitedTiles.has(K))){var ie=Te&&Te.isTileCachedOrLoading(K);ie&&(ie=ie.info);var ne=void 0;if(ie){var{extent2d:le}=ie;lt.set(le.xmin,le.ymax),ne=lt}else if(!this._hasOwnSR)ne=y.getTilePointNW(U.x,U.y,C);else{var ee=y.getTilePrjNW(U.x,U.y,C);ne=h._prjToPoint(this._unproject(ee,ji),u)}var ye=void 0,ce=void 0;if(!this._hasOwnSR)ye=_e.width,ce=_e.height;else{var ve=void 0;if(!this._hasOwnSR)ve=y.getTilePointSE(U.x,U.y,C);else{var be=y.getTilePrjSE(U.x,U.y,C);ve=h._prjToPoint(this._unproject(be,ji),u,ji)}ye=Math.ceil(Math.abs(ve.x-ne.x)),ce=Math.ceil(Math.abs(ve.y-ne.y))}var Ie=Ge.x*(U.idx-U.x)*ye,Fe=Ge.y*(U.idy-U.y)*ce;!ie&&(Ie||Fe)&&ne._add(Ie,Fe);var Re=ie&&ie.extent2d||new Le(ne.x,ne.y-ce,ne.x+ye,ne.y);if(de<=4||q||this._isTileInExtent(c,Re,g,b)){var ct=this._hasOwnSR?h._getResolution(u):C;this._visitedTiles&&s===0&&this._visitedTiles.add(K),f&&s===0?(this._splitTiles(c,Me,Te,U,u+1,ct,Re,Ie,Fe,w),Be._combine(Re)):(ie?(ie.offset[0]=g[0],ie.offset[1]=g[1]):ie=this.createTileNode(U.x,U.y,u,U.idx,U.idy,ct,0,null,Re,K),Me.push(ie),Be._combine(Re)),V===-1/0?(V=R,R=ge):q||(q=!0)}}}if(Me.length){var Qe=h._containerPointToPoint(o.getCenter(),u,rs)._add(g),Tt=new z(0,0),Lt=new z(0,0);Me.sort(function(ut,sr){return Tt.set((ut.extent2d.xmin+ut.extent2d.xmax)/2,(ut.extent2d.ymin+ut.extent2d.ymax)/2),Lt.set((sr.extent2d.xmin+sr.extent2d.xmax)/2,(sr.extent2d.ymin+sr.extent2d.ymax)/2),Tt.distanceTo(Qe)-Lt.distanceTo(Qe)})}return{offset:g,zoom:e,extent:Be,tiles:Me}},t._convertToExtent2d=function(e){var o=this,s=this.getMap();return e.convertTo(function(a){var l;if(a.y>0&&a.y<s.height){var h=(a.x===0?0:1)+a.y;o._coordCache[h]||(o._coordCache[h]=s._containerPointToPoint(a)),l=o._coordCache[h]}return l=s._containerPointToPoint(a,void 0,rs),l})},t._splitTiles=function(e,o,s,a,l,h,u,c,f,d){var g=this._getTileConfig().tileSystem.scale.y,p=this.getMap().getGLScale(l),m=GS.set(u.xmin*2,g<0?u.ymax*2:u.ymin*2),v=u.getWidth(),_=u.getHeight(),y=a.idx*2,w=a.idy*2,x=a.x*2,C=a.y*2,b=this._checkAndAddTile(e,s,y,w,x,C,l,h,0,0,v,_,m,p,d);b&&o.push(b),b=this._checkAndAddTile(e,s,y,w,x,C,l,h,0,1,v,_,m,p,d),b&&o.push(b),b=this._checkAndAddTile(e,s,y,w,x,C,l,h,1,0,v,_,m,p,d),b&&o.push(b),b=this._checkAndAddTile(e,s,y,w,x,C,l,h,1,1,v,_,m,p,d),b&&o.push(b)},t._checkAndAddTile=function(e,o,s,a,l,h,u,c,f,d,g,p,m,v,_){var y=this._getTileId(s+f,a+d,u);if(this._visitedTiles&&this._visitedTiles.has(y))return null;var w=_[u];w||(w=_[u]=this._getTileOffset(u));var x=this._getTileConfig().tileSystem.scale.y,C=new Le(m.x+f*g,m.y+x*d*p,m.x+(f+1)*g,m.y+x*(d+1)*p);if(!this._isSplittedTileInExtent(e,C,w,v))return null;var b=c/2,E=o&&o.isTileCachedOrLoading(y),T;return E?T=E.info:T=this.createTileNode(l+f,h+d,u,s+f,s+h,b,0,null,C,y),T},t._getTileOffset=function(...e){var o=this.options.offset;return o?(Oe(o)&&(o=o.call(this,...e)),X(o)&&(o=[o,o]),o||[0,0]):[0,0]},t.getTileId=function(e,o,s,a){return this._getTileId(e,o,s,a)},t._getTileId=function(e,o,s,a){return(a||this.getId())+"_"+e+"_"+o+"_"+s},t._project=function(e,o){if(this._hasOwnSR){var s=this.getMap(),a=s.getProjection(),l=this._spatialRef||this.getSpatialReference(),h=l.getProjection();return h.project(a.unproject(e,o),o)}else return e},t._unproject=function(e,o){if(this._hasOwnSR){var s=this.getMap(),a=this._spatialRef||this.getSpatialReference(),l=s.getProjection(),h=a.getProjection();return l.project(h.unproject(e,o),o)}else return e},t._initTileConfig=function(){var e=this.getMap(),o=this.getTileSize(),s=this.getSpatialReference(),a=s.getProjection(),l=s.getFullExtent();this._defaultTileConfig=new Qv(e,Xi.getDefault(a),l,o),this.options.hasOwnProperty("tileSystem")&&(this._tileConfig=new Qv(e,this.options.tileSystem,l,o)),delete this._rootNodes,delete this._tileFullExtent,delete this._disablePyramid},t._getTileConfig=function(){return this._defaultTileConfig||this._initTileConfig(),this._tileConfig||this._defaultTileConfig},t._bindMap=function(e){return this._onSpatialReferenceChange(),n.prototype._bindMap.apply(this,arguments)},t._isTileInExtent=function(e,o,s,a){var l=this.getMap(),h;if(e!==l.projViewMatrix){var u=o.getCenter(FS)._sub(s[0],s[1])._multi(a);jt(cc,u.x,u.y,0);var c=Vb(cc,cc,l.projViewMatrix);h=c[1]<0?l.projViewMatrix:e}else h=l.projViewMatrix;return It[0][0]=(o.xmin-s[0])*a,It[0][1]=(o.ymin-s[1])*a,It[1][0]=(o.xmax-s[0])*a,It[1][1]=(o.ymax-s[1])*a,lc(h,It)},t._isSplittedTileInExtent=function(e,o,s,a){var l=this.getMap();return It[0][0]=(o.xmin-s[0])*a,It[0][1]=(o.ymin-s[1])*a,It[1][0]=(o.xmax-s[0])*a,It[1][1]=(o.ymax-s[1])*a,lc(l.projViewMatrix,It)},t.getEvents=function(){return{spatialreferencechange:this._onSpatialReferenceChange}},t._onSpatialReferenceChange=function(){delete this._tileConfig,delete this._defaultTileConfig,delete this._sr,delete this._srMinZoom,delete this._hasOwnSR,delete this._rootNodes,this.tileInfoCache&&this.tileInfoCache.reset();var e=this.getRenderer();e&&e.clear()},t.getPolygonOffsetCount=function(){return 2},t.getPolygonOffset=function(){return this._polygonOffset||0},t.setPolygonOffset=function(e){return this._polygonOffset=e,this},t.getRenderer=function(){return n.prototype.getRenderer.call(this)},t._getTileBBox=function(e){var o=this.getMap();if(o){var s=e.extent2d,a=e.offset||[0,0];if(s){var l=e.res,[h,u]=a,{xmin:c,ymin:f,xmax:d,ymax:g}=s;c-=h,d-=h,f-=u,g-=u;var p=new z(c,f),m=new z(d,g),v=o.pointAtResToCoordinate(p,l,tm),_=o.pointAtResToCoordinate(m,l,is);return[v.x,v.y,_.x,_.y]}}},t._tileInMask=function(e){var o=this.getMask();if(!o)return!0;var s=o.type;if(!s||s.indexOf("Polygon")===-1)return!0;var a=this._maskGeoJSON;if(!a||!a.geometry)return!0;var{coordinates:l,type:h}=a.geometry;if(!l||!h||h.indexOf("Polygon")===-1)return!0;if(!a.bbox){var u=o.getExtent();if(!u)return!0;a.bbox=[u.xmin,u.ymin,u.xmax,u.ymax]}var c=this._getTileBBox(e);return c?Hb(c,this._maskGeoJSON):!0},t._debugTile=function(e,o,s){if(this.options.debugTile){if(Array.isArray(e)){for(var a=0;a<e.length;a++)e[a]&&this._debugTile(e[a],o+" at "+a,s);return}if(!e)return;var{x:l,y:h,z:u}=this.options.debugTile;if(e.x===l&&e.y===h&&e.z===u&&(console.log("Debug Tile Found in TileLayer."+o+":",e),s))debugger}},r}(hr);gt.registerJSONType("TileLayer");gt.mergeOptions(zS);function NS(n,r,t){var i=Math.max(n[0]-t[0],0,t[0]-r[0]),e=Math.max(n[1]-t[1],0,t[1]-r[1]),o=Math.max(n[2]-t[2],0,t[2]-r[2]);return Math.sqrt(i*i+e*e+o*o)}function HS(n,r){return n.z-r.z}var wi;(function(n){n[n.OUT_OF_FRUSTUM=0]="OUT_OF_FRUSTUM",n[n.SCREEN_ERROR_TOO_SMALL=1]="SCREEN_ERROR_TOO_SMALL",n[n.VISIBLE=2]="VISIBLE"})(wi||(wi={}));var jS={urlTemplate:"",maxCacheSize:1024},ZS=new ft(256,256),Yn="show hide remove setzindex forcereloadstart";function rm(n){return Array.isArray(n)||(n=[n]),n}var Sd=function(n){function r(i,e,o){var s;return s=n.call(this,i,o)||this,s.layers=e||[],s._checkChildren(),s.layerMap={},s._groupChildren=[],s}Q(r,n),r.fromJSON=function(e){if(!e||e.type!=="GroupTileLayer")return null;var o=e.layers.map(function(s){return hr.fromJSON(s)});return new r(e.id,o,e.options)};var t=r.prototype;return t.getLayers=function(){return this.layers},t.addLayer=function(e=[]){var o=this;e=rm(e);var s=this.layers.length;return e.forEach(function(a){a instanceof gt&&o.layers.indexOf(a)===-1&&!o.layerMap[a.getId()]&&o.layers.push(a)}),s!==this.layers.length&&(this._sortLayers(),this._refresh(),this._renderLayers()),this},t.removeLayer=function(e=[]){var o=this;e=rm(e);var s=this.layers.length;return e.forEach(function(a){if(a instanceof gt||(a=o.layerMap[a]),a instanceof gt){var l=o.layers.indexOf(a);l>=0&&(o.layers.splice(l,1),a._doRemove(),a.off(Yn,o._onLayerShowHide,o))}}),s!==this.layers.length&&(this._refresh(),this._renderLayers()),this},t.clearLayers=function(){var e=this;return this.layers.forEach(function(o){o._doRemove(),o.off(Yn,e._onLayerShowHide,e)}),this.layers=[],this._refresh(),this._renderLayers(),this},t.toJSON=function(){var e={type:this.getJSONType(),id:this.getId(),layers:this.layers.map(function(o){return o.toJSON()}),options:this.config()};return e},t.getTileSize=function(e){var o=this.getLayer(e);return o?o.getTileSize():ZS},t.getTiles=function(e,o){for(var s=this.layers,a=[],l=0,h=0,u=s.length;h<u;h++){var c=s[h];if(!(!c||!c.options.visible||!c.isVisible()||!c.getMap())){var f=c.getTiles(e,o||this);!f||f.count===0||(l+=f.count,Yt(a,f.tileGrids))}}return{count:l,tileGrids:a}},t.onAdd=function(){this._sortLayers(),this._refresh(),n.prototype.onAdd.call(this)},t.onRemove=function(){var e=this;this.layers.forEach(function(o){o._doRemove(),o.off(Yn,e._onLayerShowHide,e)}),this.layerMap={},this._groupChildren=[],n.prototype.onRemove.call(this)},t.getLayer=function(e){return this.getChildLayer(e)},t.getChildLayer=function(e){var o=this.layerMap[e];if(o)return o;for(var s=0;s<this._groupChildren.length;s++){var a=this._groupChildren[s].getChildLayer(e);if(a)return a}return null},t._removeChildTileCache=function(e){if(!e)return this;var o=this.getRenderer();if(!o)return this;var s,a=e.getId(),l=function(){return s&&s.info&&s.info.layer===a};if(o.tileCache){var h=o.tileCache.keys();h.forEach(function(g){s=o.tileCache.get(g),l()&&o.tileCache.remove(g)})}var u=o.tilesInView||{};for(var c in u)s=u[c],l()&&delete u[c];var f=o.tilesLoading||{};for(var d in f)s=f[d],l()&&o.abortTileLoading(s.image,s.info);return this},t._onLayerShowHide=function(e){var{type:o,target:s}=e||{};o==="remove"&&s?(this.layers.splice(this.layers.indexOf(s),1),s._doRemove(),s.off(Yn,this._onLayerShowHide,this),this._refresh()):o==="setzindex"?this._sortLayers():o==="forcereloadstart"&&this._removeChildTileCache(s),this._renderLayers()},t._renderLayers=function(){var e=this.getRenderer();return e&&e.setToRedraw(),this},t._refresh=function(){var e=this,o=this.getMap();return this._groupChildren=[],this.layerMap={},this.layers.forEach(function(s){e.layerMap[s.getId()]=s,s.getChildLayer&&e._groupChildren.push(s),s.getMap()||s._bindMap(o),s.off(Yn,e._onLayerShowHide,e),s.on(Yn,e._onLayerShowHide,e)}),this},t.isVisible=function(){if(!n.prototype.isVisible.call(this))return!1;for(var e=this.layers,o=0,s=e.length;o<s;o++)if(e[o].isVisible())return!0;return!1},t._checkChildren=function(){var e=this,o={};this.layers.forEach(function(s){var a=s.getId();if(o[a])throw new Error("Duplicate child layer id ("+a+") in the GroupTileLayer ("+e.getId()+")");o[a]=1})},t._sortLayers=function(){this.layers.sort(function(e,o){return e.options.zIndex-o.options.zIndex})},r}(gt);Sd.registerJSONType("GroupTileLayer");Sd.mergeOptions(jS);var rw={urlTemplate:"",crs:null,uppercase:!1,detectRetina:!1},VS={service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},fc,$h=function(n){function r(i,e){var o;return o=n.call(this,i)||this,fc||(fc=oe({},o.options)),o.wmsParams=oe({},VS),o._setOptions(e),o.setZIndex(e.zIndex),Ce.proxy||o._optionsHook(e),o}Q(r,n);var t=r.prototype;return t._optionsHook=function(e={}){for(var o in e)o==="tileSize"&&(this._tileSize=null),o in fc||(this.wmsParams[o]=e[o]);var s=this.getTileSize();return this.wmsParams.width=s.width,this.wmsParams.height=s.height,this._wmsVersion=parseFloat(this.wmsParams.version),this},t.onAdd=function(){var e=this.getMap().getDevicePixelRatio(),o=rw.detectRetina?e:1;this.wmsParams.width*=o,this.wmsParams.height*=o;var s=this.options.crs||this.getMap().getProjection().code,a=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[a]=s,n.prototype.onAdd.call(this)},t.getTileUrl=function(e,o,s){var a=this.getSpatialReference().getResolution(s),l=this._getTileConfig(),h=l.getTilePrjExtent(e,o,a),u=h.getMax(),c=h.getMin(),f=(this._wmsVersion>=1.3&&(this.wmsParams.crs==="EPSG:4326"||this.wmsParams.crs==="EPSG:4490")?[c.y,c.x,u.y,u.x]:[c.x,c.y,u.x,u.y]).join(","),d=n.prototype.getTileUrl.call(this,e,o,s);return d+WS(this.wmsParams,d,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+f},t.toJSON=function(){return{type:"WMSTileLayer",id:this.getId(),options:this.config()}},r.fromJSON=function(e){return!e||e.type!=="WMSTileLayer"?null:new r(e.id,e.options)},r}(gt);$h.registerJSONType("WMSTileLayer");$h.mergeOptions(rw);function WS(n,r,t){var i=[];for(var e in n)i.push(encodeURIComponent(t?e.toUpperCase():e)+"="+encodeURIComponent(n[e]));return(!r||r.indexOf("?")===-1?"?":"&")+i.join("&")}var Od=function(n){function r(i,e){var o;return o=n.call(this,i,e)||this,o.options.hasOwnProperty("forceRenderOnMoving")||(o.options.forceRenderOnMoving=!1),o}Q(r,n);var t=r.prototype;return t.drawTile=function(){},t.toJSON=function(){return{type:"CanvasTileLayer",id:this.getId(),options:this.config()}},r.fromJSON=function(e){return!e||e.type!=="CanvasTileLayer"?null:new r(e.id,e.options)},r}(gt);Od.registerJSONType("CanvasTileLayer");function $S(n,r){for(var t={alpha:!0,stencil:!0,preserveDrawingBuffer:!0,antialias:!1},i=["webgl","experimental-webgl"],e=null,o=0;o<i.length;++o){try{e=n.getContext(i[o],r||t)}catch{}if(e)break}return e}function im(n,r,t){var i=n.createShader(r);n.shaderSource(i,t),n.compileShader(i);var e=n.getShaderParameter(i,n.COMPILE_STATUS);if(!e){var o=n.getShaderInfoLog(i);throw n.deleteShader(i),new Error("Failed to compile shader: "+o)}return i}function iw(n,r,t){var i=im(n,n.VERTEX_SHADER,r),e=im(n,n.FRAGMENT_SHADER,t);if(!i||!e)return null;var o=n.createProgram();return o?(n.attachShader(o,i),n.attachShader(o,e),n.linkProgram(o),{program:o,vertexShader:i,fragmentShader:e}):null}function nw(n,r,t){if(Array.isArray(t[0])){for(var i=Float32Array.BYTES_PER_ELEMENT,e=0,o=0;o<t.length;o++)e+=t[o][1]||0;for(var s=0,a=0;a<t.length;a++){var l=n.getAttribLocation(r,t[a][0]);if(l<0)throw new Error("Failed to get the storage location of "+t[a][0]);n.vertexAttribPointer(l,t[a][1],n[t[a][2]||"FLOAT"],!1,i*e,i*s),s+=t[a][1]||0,n.enableVertexAttribArray(l)}}else{var h=n.getAttribLocation(r,t[0]);n.vertexAttribPointer(h,t[1],n[t[2]||"FLOAT"],!1,0,0),n.enableVertexAttribArray(h)}}var US={never:512,"<":513,"=":514,"<=":515,">":516,"!=":517,">=":518,always:519};function JS(n){return US[n]}var nm=[1,1,1,1],XS=new Float32Array(8),YS=new Int16Array(8),om={vertexShader:`
|
|
281
|
-
attribute vec2 a_position;
|
|
282
|
-
|
|
283
|
-
attribute vec2 a_texCoord;
|
|
284
|
-
|
|
285
|
-
uniform mat4 u_matrix;
|
|
286
|
-
|
|
287
|
-
varying vec2 v_texCoord;
|
|
288
|
-
|
|
289
|
-
void main() {
|
|
290
|
-
gl_Position = u_matrix * vec4(a_position, 0., 1.);
|
|
291
|
-
|
|
292
|
-
v_texCoord = a_texCoord;
|
|
293
|
-
}
|
|
294
|
-
`,fragmentShader:`
|
|
295
|
-
precision mediump float;
|
|
296
|
-
|
|
297
|
-
uniform sampler2D u_image;
|
|
298
|
-
|
|
299
|
-
uniform float u_opacity;
|
|
300
|
-
uniform float u_debug_line;
|
|
301
|
-
uniform vec4 u_base_color;
|
|
302
|
-
uniform float u_alpha_test;
|
|
303
|
-
varying vec2 v_texCoord;
|
|
304
|
-
|
|
305
|
-
void main() {
|
|
306
|
-
if (u_debug_line == 1.) {
|
|
307
|
-
gl_FragColor = vec4(0., 1., 0., 1.);
|
|
308
|
-
} else {
|
|
309
|
-
gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;
|
|
310
|
-
}
|
|
311
|
-
gl_FragColor *= u_base_color;
|
|
312
|
-
if (gl_FragColor.a < u_alpha_test) {
|
|
313
|
-
discard;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
`},Zi=["",0],os=[0,0,0],qS=new Array(16),KS=new z(20,20),kd=function(r){var t=function(i){function e(){var s;return s=i.apply(this,arguments)||this,s._layerAlt=0,s._layerAltitude=0,s}Q(e,i);var o=e.prototype;return o.drawGLImage=function(a,l,h,u,c,f,d,g,p,m){this.gl.program!==this.program&&this.useProgram(this.program);var v=this.gl;this.loadTexture(a,g);var _=this.canvas.gl&&this.canvas.gl.wrap;if(_){var y=this.layer&&this.layer.options.opacity;O(y)&&(y=1),d*=y}os[0]=l||0,os[1]=h||0,os[2]=0;var w=this.layer,x=this.getMap();if(w){var{altitude:C}=w.options,b=X(C);if(b||(this._layerAlt=0),this._layerAltitude!==C&&b){var E=x.altitudeToPoint(C,x.getGLRes());this._layerAltitude=C,this._layerAlt=E}}os[2]=this._layerAlt||0;var T=Gh(qS);Kf(T,T,os),$l(T,T,[f,f,1]),so(T,x.projViewMatrix,T),v.uniformMatrix4fv(this.program.u_matrix,!1,T),v.uniform1f(this.program.u_opacity,d),v.uniform1f(this.program.u_debug_line,0),v.uniform4fv(this.program.u_base_color,m||nm),v.uniform1f(this.program.u_alpha_test,this.layer.options.alphaTest||0);var{glBuffer:S}=a;S&&(S.width!==u||S.height!==c)&&(this.saveImageBuffer(S),delete a.glBuffer),a.glBuffer?v.bindBuffer(v.ARRAY_BUFFER,S):a.glBuffer=this.bufferTileData(0,0,u,c),Zi[0]="a_position",Zi[1]=2,Zi[2]=a.glBuffer.type,this.enableVertexAttrib(Zi),v.bindBuffer(v.ARRAY_BUFFER,this.texBuffer),Zi[0]="a_texCoord",Zi[1]=2,Zi[2]="UNSIGNED_BYTE",this.enableVertexAttrib(Zi),v.drawArrays(v.TRIANGLE_STRIP,0,4),p&&this.drawDebug(T,0,0,u,c,p)},o.drawDebug=function(a,l,h,u,c,f){var d=this.gl;d.disable(d.DEPTH_TEST),d.bindBuffer(d.ARRAY_BUFFER,this._debugBuffer),this.enableVertexAttrib(["a_position",2,"FLOAT"]),d.bufferData(d.ARRAY_BUFFER,new Float32Array([l,h,l+u,h,l+u,h-c,l,h-c,l,h]),d.DYNAMIC_DRAW),d.uniformMatrix4fv(this.program.u_matrix,!1,a),d.uniform1f(this.program.u_opacity,1),d.uniform1f(this.program.u_debug_line,1),d.uniform4fv(this.program.u_base_color,nm),d.uniform1f(this.program.u_alpha_test,this.layer.options.alphaTest||0),d.drawArrays(d.LINE_STRIP,0,5);var g=this._debugInfoCanvas;if(!g){var p=this.mapDPR||this.getMap().getDevicePixelRatio()>1?2:1;g=this._debugInfoCanvas=document.createElement("canvas"),g.width=256*p,g.height=32*p;var m=g.getContext("2d");m.font="20px monospace",m.scale(p,p)}var v=g.getContext("2d");v.clearRect(0,0,g.width,g.height);var _=this.layer.options.debugOutline;J.fillText(v,f,KS,_),this.loadTexture(g),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,g),u=256;var y=l,w=l+u,x=h-c+32,C=h-c;d.bufferData(d.ARRAY_BUFFER,this.set8(y,x,y,C,w,x,w,C),d.DYNAMIC_DRAW),d.uniform1f(this.program.u_debug_line,0),d.bindBuffer(d.ARRAY_BUFFER,this.texBuffer),this.enableVertexAttrib(["a_texCoord",2,"UNSIGNED_BYTE"]),d.drawArrays(d.TRIANGLE_STRIP,0,4),d.enable(d.DEPTH_TEST)},o.bufferTileData=function(a,l,h,u,c){var f=a,d=a+h,g=l,p=l-u,m;Tn(f)&&Tn(d)&&Tn(g)&&Tn(p)?m=this.set8Int(f,g,f,p,d,g,d,p):m=this.set8(f,g,f,p,d,g,d,p);var v=this.loadImageBuffer(m,c);return v.width=h,v.height=u,v.type=m instanceof Int16Array?"SHORT":"FLOAT",v},o.createCanvas2=function(){this.canvas2=J.createCanvas(this.canvas.width,this.canvas.height)},o.createGLContext=function(){this.canvas.gl&&this.canvas.gl.wrap?this.gl=this.canvas.gl.wrap():this.gl=$S(this.canvas2||this.canvas,this.layer.options.glOptions);var a=this.gl;a.clearColor(0,0,0,0),a.enable(a.DEPTH_TEST),a.enable(a.STENCIL_TEST),a.enable(a.BLEND),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),this.program=this.createProgram(om.vertexShader,this.layer.options.fragmentShader||om.fragmentShader),this._debugBuffer=this.createBuffer(),this.useProgram(this.program),this.texBuffer=this.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,this.texBuffer),this.enableVertexAttrib(["a_texCoord",2,"UNSIGNED_BYTE"]),a.bufferData(a.ARRAY_BUFFER,new Uint8Array([0,0,0,1,1,0,1,1]),a.STATIC_DRAW),this.enableSampler("u_image"),a.activeTexture(a.TEXTURE0),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)},o.resizeGLCanvas=function(){this.gl&&this.gl.viewport(0,0,this.canvas.width,this.canvas.height),this.canvas2&&(this.canvas2.width!==this.canvas.width||this.canvas2.height!==this.canvas.height)&&(this.canvas2.width=this.canvas.width,this.canvas2.height=this.canvas.height)},o.clearGLCanvas=function(){this.gl&&(this.gl.clearStencil(255),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.STENCIL_BUFFER_BIT)),this.gl.wrap||this.gl.clear(this.gl.DEPTH_BUFFER_BIT)},o.disposeImage=function(a){a&&(a.texture&&this.saveTexture(a.texture),a.glBuffer&&this.saveImageBuffer(a.glBuffer),delete a.texture,delete a.glBuffer)},o._createTexture=function(a){var l=this.gl,h=this.getTexture()||l.createTexture();l.bindTexture(l.TEXTURE_2D,h),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE);var u=this.layer.options.mipmapTexture;return u&&(!lo(a.width)||!lo(a.height))&&(a=QS(a)),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,l.RGBA,l.UNSIGNED_BYTE,a),u&&l.generateMipmap(l.TEXTURE_2D),h},o.getTexture=function(){this._textures||(this._textures=[]);var a=this._textures;return a&&a.length>0?a.pop():null},o.saveTexture=function(a){this._textures.push(a)},o.loadTexture=function(a,l=!1){var h=this.gl,u=a.texture;u||(u=this._createTexture(a),a.texture=u),h.bindTexture(h.TEXTURE_2D,u);var c=this.layer.options.mipmapTexture;if(c){var f=this.getMap(),d=this.mapDPR||f.getDevicePixelRatio();f.isMoving()&&f.getRenderer().isViewChanged()?h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,h.LINEAR_MIPMAP_LINEAR):h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,h.LINEAR),d!==1||l?h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,h.LINEAR):h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,h.NEAREST)}return u},o.getImageBuffer=function(){this._imageBuffers||(this._imageBuffers=[]);var a=this._imageBuffers;return a&&a.length>0?a.pop():null},o.saveImageBuffer=function(a){this._imageBuffers||(this._imageBuffers=[]),this._imageBuffers.push(a)},o.loadImageBuffer=function(a,l){var h=this.gl,u=l||this.createImageBuffer();return h.bindBuffer(h.ARRAY_BUFFER,u),h.bufferData(h.ARRAY_BUFFER,a,h.STATIC_DRAW),u},o.createImageBuffer=function(){return this.getImageBuffer()||this.createBuffer()},o.removeGLCanvas=function(){var a=this.gl;if(a){if(this._debugBuffer&&(a.deleteBuffer(this._debugBuffer),delete this._debugBuffer),this._buffers&&(this._buffers.forEach(function(u){a.deleteBuffer(u)}),delete this._buffers),this._textures&&(this._textures.forEach(function(u){return a.deleteTexture(u)}),delete this._textures),this._debugInfoCanvas){var l=this._debugInfoCanvas.texture;l&&a.deleteTexture(l),delete this._debugInfoCanvas.texture,delete this._debugInfoCanvas}var h=a.program;a.deleteShader(h.fragmentShader),a.deleteShader(h.vertexShader),a.deleteProgram(h),delete this.gl,delete this.canvas2}},o.createBuffer=function(){var a=this.gl,l=a.createBuffer();if(!l)throw new Error("Failed to create the buffer object");return this._buffers||(this._buffers=[]),this._buffers.push(l),l},o.enableVertexAttrib=function(a){nw(this.gl,this.gl.program,a)},o.createProgram=function(a,l){for(var h=this.gl,{program:u,vertexShader:c,fragmentShader:f}=iw(h,a,l),d=h.getProgramParameter(u,35718),g=[],p=0;p<d;++p){var m=h.getActiveUniform(u,p);g.push(m.name)}return u.vertexShader=c,u.fragmentShader=f,this._initUniforms(u,g),u},o.useProgram=function(a){var l=this.gl;return l.useProgram(a),l.program=a,this},o.enableSampler=function(a,l){var h=this.gl,u=this._getUniform(h.program,a);return l||(l=0),h.uniform1i(u,l),u},o._initUniforms=function(a,l){for(var h=0;h<l.length;h++){var u=l[h],c=l[h],f=u.indexOf("[");f>=0&&(u=u.substring(0,f),Ct||(c=c.substring(0,f))),a[u]=this._getUniform(a,c)}},o._getUniform=function(a,l){var h=this.gl,u=h.getUniformLocation(a,l);if(!u)throw new Error("Failed to get the storage location of "+l);return u},o.set8=function(a,l,h,u,c,f,d,g){var p=XS;return p[0]=a,p[1]=l,p[2]=h,p[3]=u,p[4]=c,p[5]=f,p[6]=d,p[7]=g,p},o.set8Int=function(a,l,h,u,c,f,d,g){var p=YS;return p[0]=a,p[1]=l,p[2]=h,p[3]=u,p[4]=c,p[5]=f,p[6]=d,p[7]=g,p},e}(r);return t};function QS(n){if(lo(n.width)&&lo(n.height))return n;var r=n.width,t=n.height;lo(r)||(r=sm(r)),lo(t)||(t=sm(t));var i=document.createElement("canvas");i.width=r,i.height=t;var e=i.getContext("2d");return e.imageSmoothingEnabled=!1,e.drawImage(n,0,0,r,t),i}function lo(n){return(n&n-1)===0&&n!==0}function sm(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}var Ra=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.needToRedraw=function(){var e=this.getMap();return e.isInteracting()||e.getRenderer().isViewChanged()?!(!e.getPitch()&&e.isMoving()&&!e.isZooming()&&!e.isRotating()&&!this.layer.options.forceRenderOnMoving):!1},t.createContext=function(){if(!(this.gl&&this.gl.canvas===this.canvas||this.context)&&(this.context=J.getCanvas2DPerformanceContext(this.canvas),!!this.context)){this.context.dpr=1,this.layer.options.globalCompositeOperation&&(this.context.globalCompositeOperation=this.layer.options.globalCompositeOperation);var e=this.getMap().getDevicePixelRatio();e!==1&&this._canvasContextScale(this.context,e)}},t.resetCanvasTransform=function(){if(this.context){var e=this.getMap().getDevicePixelRatio();this.context.setTransform(e,0,0,e,0,0)}},t.clearCanvas=function(){if(this.context){var e=this.getMap();if(e){var o=this.mapDPR||e.getDevicePixelRatio(),s=1/o,a=this.canvas.width*s,l=this.canvas.height*s;J.clearRect(this.context,0,0,Math.max(a,this.canvas.width),Math.max(l,this.canvas.height))}}},t.clear=function(){this.clearCanvas(),this.setToRedraw()},t.prepareCanvas=function(){this.canvas?(this.resetCanvasTransform(),this.clearCanvas(),this.resizeCanvas()):(this.createCanvas(),this.createContext(),this.layer.onCanvasCreate(),this.layer.fire("canvascreate",{context:this.context,gl:this.gl})),delete this._maskExtent;var e=this.layer.getMask();if(!e)return this.layer.fire("renderstart",{context:this.context,gl:this.gl}),null;var o=this._maskExtent=e._getMaskPainter().get2DExtent();return o&&this._extent2D&&!o.intersects(this._extent2D)?(this.layer.fire("renderstart",{context:this.context,gl:this.gl}),o):(this.layer.fire("renderstart",{context:this.context,gl:this.gl}),o)},t.onResize=function(e){delete this._extent2D,this.resizeCanvas(),this.setToRedraw()},r}(jh),eO={renderer:Ce.webgl?"gl":"canvas",crossOrigin:null,alphaTest:!1,depthMask:!0,depthFunc:"<="},tO=new z(0,0),Rd=function(n){function r(i,e,o){var s;return e&&!Array.isArray(e)&&!e.url&&(o=e,e=null),s=n.call(this,i,o)||this,s._images=e,s}Q(r,n);var t=r.prototype;return t.onAdd=function(){this._prepareImages(this._images)},t.setImages=function(e){return this._images=e,this._prepareImages(e),this},t.getImages=function(){return this._images},t._prepareImages=function(e){e=e||[],Array.isArray(e)||(e=[e]);var o=this.getMap(),s=o.getGLRes();this._imageData=e.map(function(l){var h=new Je(l.extent);return oe({},l,{extent:h,extent2d:h.convertTo(function(u){return o.coordToPointAtRes(u,s)})})}),this._images=e;var a=this.getRenderer();a&&a.refreshImages()},t.getRenderer=function(){return n.prototype.getRenderer.call(this)},r}(hr);Rd.mergeOptions(eO);var rO=[],ow=function(r){var t=function(i){function e(){return i.apply(this,arguments)||this}Q(e,i);var o=e.prototype;return o.isDrawable=function(){return!0},o.checkResources=function(){var a=this;if(this._imageLoaded)return rO;var l=this.layer,h=l._imageData.map(function(f){return[f.url,null,null]});if(this.resources){var u=[],c=na();h.forEach(function(f){if(a.resources.isResourceLoaded(f)){var d=a.resources.getImage(f);c.addResource(f,d)}else u.push(f)}),this.resources.forEach(function(f,d){c.isResourceLoaded(f)||a.retireImage(d.image)}),this.resources=c,h=u}return this._imageLoaded=!0,h},o.retireImage=function(a){var l=a;l.close&&l.close()},o.refreshImages=function(){this._imageLoaded=!1,this.setToRedraw()},o.draw=function(a,l){this.isDrawable()&&(this.prepareCanvas(),this._painted=!1,this.drawImages(a,l),this.completeRender())},o.drawImage=function(a,l,h){},o.drawImages=function(a,l){var h=this.layer._imageData,u=this.getMap(),c=u.get2DExtentAtRes(u.getGLRes());if(h&&h.length)for(var f=0;f<h.length;f++){var d=h[f].extent2d,g=this.resources&&this.resources.getImage(h[f].url);if(g&&c.intersects(d)){this._painted=!0;var p=h[f].opacity;X(p)||(p=1),this.drawImage(g,d,p)}}},o.drawOnInteracting=function(a,l,h){this.draw()},e}(r);return t},Ad=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.isDrawable=function(){return this.getMap().getPitch()?(console&&console.warn("ImageLayer with canvas renderer can't be pitched, use gl renderer ('renderer' : 'gl') instead."),!1):!0},t.drawImage=function(e,o,s){var a=0,l=this.context;s<1&&(a=l.globalAlpha,l.globalAlpha=s);var h=this.getMap(),u=tO.set(o.xmin,o.ymax),c=h._pointAtResToContainerPoint(u,h.getGLRes()),f=c.x,d=c.y,g=dt[h.id],p=g?g.bearing:h.getBearing();p&&(l.save(),l.translate(f,d),p&&l.rotate(-p*Math.PI/180),f=d=0);var m=h.getGLScale();l.drawImage(e,f,d,o.getWidth()/m,o.getHeight()/m),p&&l.restore(),a&&(l.globalAlpha=a)},r}(ow(Ra)),sw=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.drawOnInteracting=function(e,o,s){this.draw(o,s)},t._prepareGLContext=function(){var e=this.gl;if(e){e.disable(e.STENCIL_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.enable(e.DEPTH_TEST),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.depthFunc(JS(this.layer.options.depthFunc));var o=!!this.layer.options.depthMask;e.depthMask(o)}},t.drawImages=function(e,o){var s=this.gl;if(o&&o.renderTarget){var a=o.renderTarget.fbo;if(a){var l=o.renderTarget.getFramebuffer(a);s.bindFramebuffer(s.FRAMEBUFFER,l)}}if(this._prepareGLContext(),n.prototype.drawImages.call(this),o&&o.renderTarget){var h=o.renderTarget.fbo;h&&s.bindFramebuffer(s.FRAMEBUFFER,null)}},t.isDrawable=function(){return!0},t.drawImage=function(e,o,s){var a=o.getWidth();this.drawGLImage(e,o.xmin,o.ymax,a,o.getHeight(),1,s,e.width!==a)},t.createContext=function(){this.createGLContext()},t.resizeCanvas=function(e){this.canvas&&(n.prototype.resizeCanvas.call(this,e),this.resizeGLCanvas())},t.clearCanvas=function(){this.canvas&&(n.prototype.clearCanvas.call(this),this.clearGLCanvas())},t.retireImage=function(e){var o=e;o.close&&o.close(),this.disposeImage(e)},t.onRemove=function(){this.removeGLCanvas(),n.prototype.onRemove.call(this)},r}(kd(Ad));Rd.registerRenderer("canvas",Ad);Rd.registerRenderer("gl",sw);var am;(function(n){n[n.never=0]="never",n[n["<"]=1]="<",n[n["="]=2]="=",n[n["<="]=3]="<=",n[n[" >"]=4]=" >",n[n["!="]=5]="!=",n[n[">="]=6]=">=",n[n.always=7]="always"})(am||(am={}));var iO=new Le,nO={debug:!1,enableSimplify:!0,defaultIconSize:[20,20],cacheVectorOnCanvas:!0,cacheSvgOnCanvas:Ce.gecko,enableAltitude:!0,altitudeProperty:"altitude",drawAltitude:!1,sortByDistanceToCamera:!1,roundPoint:!1,altitude:0,clipBBoxBufferSize:3,collision:!1,collisionBufferSize:2,collisionDelay:250,collisionScope:"layer",progressiveRender:!1,progressiveRenderCount:1e3,progressiveRenderDebug:!1},Lr=function(n){function r(i,e,o){var s;return s=n.call(this,i,e,o)||this,s.isVectorLayer=!0,s}Q(r,n);var t=r.prototype;return t.onConfig=function(e){if(n.prototype.onConfig.call(this,e),!O(e.enableAltitude))for(var o=this.getGeometries()||[],s=0,a=o.length;s<a;s++){var l=o[s];l&&(l._clearAltitudeCache(),l.fire("positionchange"))}if(e.enableAltitude||e.drawAltitude||e.altitudeProperty){var h=this.getRenderer();h&&h.setToRedraw&&h.setToRedraw()}},t.identify=function(e,o){o=o||{};var s=this.getRenderer();e instanceof $||(e=new $(e));var a=this.getMap().coordToContainerPoint(e);return o.onlyVisible&&s&&s.identifyAtPoint?s.identifyAtPoint(a,o):this._hitGeos(this._geoList,a,o)},t.identifyAtPoint=function(e,o){o=o||{};var s=this.getRenderer();return e instanceof z||(e=new z(e)),o.onlyVisible&&s&&s.identifyAtPoint?s.identifyAtPoint(e,o):this._hitGeos(this._geoList,e,o)},t._hitGeos=function(e,o,s={}){if(!e||!e.length)return[];for(var a=[],l=0,h=0,u=e.length;h<u;h++){var c=e[h];c.isPoint&&c._collided===!0||(a[l]=c,l++)}e=a;var f=s.filter,d=[],g=s.tolerance,p=this.getMap(),m=this.getRenderer(),v=m&&m.getImageData&&m.getImageData();if(v){var _=0,y=m.maxTolerance;if(X(y))_=y;else for(var w=e.length-1;w>=0;w--){var x=e[w]._hitTestTolerance()+(g||0);x>_&&(_=x)}var C=p.getDevicePixelRatio();v.r=C;for(var b=!1,E=o.x-_,T=o.y-_,S=-_;S<=_;S++){for(var B=-_;B<=_;B++){var L=Math.round((E+S)*C),D=Math.round((T+B)*C),N=D*v.width*4+L*4;if(v.data[N+3]>0){b=!0;break}}if(b)break}if(!b)return d}for(var G=s.onlyVisible,I=e.length-1;I>=0;I--){var A=e[I];if(!(!A||!A.options.interactive)&&!(!G&&!A.isVisible())){var k=A._getPainter();if(k){var Z=k.getRenderBBOX&&k.getRenderBBOX();if(Z){var{x:W,y:re}=o;if(W<Z[0]||re<Z[1]||W>Z[2]||re>Z[3])continue}if(!(A instanceof pt)||!A._getArrowStyle()&&!(A instanceof Oa)){var se=A.getContainerExtent(iO);if(g&&(se=se._expand(g)),!se||!se.contains(o))continue}if(A._containsPoint(o,g)&&(!f||f(A))&&(d.push(A),s.count&&d.length>=s.count))break}}}return d},t.getAltitude=function(){return this.options.altitude||0},t.toJSON=function(e){e||(e={clipExtent:null,geometries:null});var o={type:this.getJSONType(),id:this.getId(),options:this.config()};if(O(e.geometries)||e.geometries){var s;if(e.clipExtent){var a=this.getMap(),l=a?a.getProjection():null;s=new Je(e.clipExtent,l)}for(var h=[],u=this.getGeometries(),c=0,f=u.length;c<f;c++){var d=u[c],g=d.getExtent();if(!(!g||s&&!s.intersects(g))){var p=d.toJSON(e.geometries);h.push(p)}}o.geometries=h}return o},t.getRenderer=function(){return n.prototype.getRenderer.call(this)},r.fromJSON=function(e){if(!e||e.type!=="VectorLayer")return null;for(var o=new r(e.id,e.options),s=e.geometries,a=[],l=0;l<s.length;l++){var h=je.fromJSON(s[l]);h&&a.push(h)}return o.addGeometry(a),o},r.getPainterClass=function(){return pd},r.getCollectionPainterClass=function(){return P0},r}(_d);Lr.mergeOptions(nO);Lr.registerJSONType("VectorLayer");So.setLayerClass(Lr,Lr,Lr);var Ld=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.getPrepareParams=function(){return[]},t.getDrawParams=function(){return[]},t.onCanvasCreate=function(){this.canvas&&this.layer.options.doubleBuffer&&(this.buffer=J.createCanvas(this.canvas.width,this.canvas.height,this.getMap().CanvasClass))},t.needToRedraw=function(){if(this.layer.options.animation)return!0;var e=this.getMap();return e.isInteracting()&&!this.layer.drawOnInteracting?!1:n.prototype.needToRedraw.call(this)},t.draw=function(...e){this.prepareCanvas(),this.prepareDrawContext(),this._drawLayer(...e)},t.drawOnInteracting=function(...e){this._drawLayerOnInteracting(...e)},t.getCanvasImage=function(){var e=n.prototype.getCanvasImage.call(this);if(e&&e.image&&this.layer.options.doubleBuffer){var o=e.image;(this.buffer.width!==o.width||this.buffer.height!==o.height)&&(this.buffer.width=o.width,this.buffer.height=o.height);var s=this.buffer.getContext("2d"),a=this.layer.doubleBuffer(s,this.context);(a===void 0||a)&&(J.image(s,o,0,0),e.image=this.buffer)}return e},t.remove=function(){return delete this._drawContext,n.prototype.remove.call(this)},t.onZoomStart=function(e){this.layer.onZoomStart(e),n.prototype.onZoomStart.call(this,e)},t.onZooming=function(e){this.layer.onZooming(e),n.prototype.onZooming.call(this,e)},t.onZoomEnd=function(e){this.layer.onZoomEnd(e),n.prototype.onZoomEnd.call(this,e)},t.onMoveStart=function(e){this.layer.onMoveStart(e),n.prototype.onMoveStart.call(this,e)},t.onMoving=function(e){this.layer.onMoving(e),n.prototype.onMoving.call(this,e)},t.onMoveEnd=function(e){this.layer.onMoveEnd(e),n.prototype.onMoveEnd.call(this,e)},t.onResize=function(e){this.layer.onResize(e),n.prototype.onResize.call(this,e)},t.prepareDrawContext=function(){if(!this._predrawed){var e=lm(this.getPrepareParams());this._drawContext=this.layer.prepareToDraw(this.context,...e),this._drawContext||(this._drawContext=[]),Array.isArray(this._drawContext)||(this._drawContext=[this._drawContext]),this._predrawed=!0}},t._prepareDrawParams=function(){if(!this.getMap())return null;var e=this.getViewExtent();if(e.maskExtent&&!e.extent.intersects(e.maskExtent))return this.completeRender(),null;var o=[this.context,e],s=lm(this.getDrawParams());return[...o,...s,...this._drawContext]},t._drawLayer=function(...e){var o=this._prepareDrawParams();o&&(this.layer.draw.apply(this.layer,o.concat(e)),this.completeRender())},t._drawLayerOnInteracting=function(...e){if(this.layer.drawOnInteracting){var o=this._prepareDrawParams();o&&(this.layer.drawOnInteracting(...o,...e),this.completeRender())}},r}(Ra);function lm(n){return n||(n=[]),Array.isArray(n)||(n=[n]),n}var oO={doubleBuffer:!1,animation:!1},Id=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.isCanvasRender=function(){return!0},t.prepareToDraw=function(){},t.draw=function(...e){},t.redraw=function(){return this._getRenderer()&&this._getRenderer().setToRedraw(),this},t.play=function(){return this.config("animation",!0),this},t.pause=function(){return this.config("animation",!1),this},t.isPlaying=function(){return this.options.animation},t.clearCanvas=function(){return this._getRenderer()&&this._getRenderer().clearCanvas(),this},t.requestMapToRender=function(){var e=this._getRenderer();return e&&e.requestMapToRender&&e.requestMapToRender(),this},t.completeRender=function(){return this._getRenderer()&&this._getRenderer().completeRender(),this},t.onCanvasCreate=function(){return this},t.onZoomStart=function(){},t.onZooming=function(){},t.onZoomEnd=function(){},t.onMoveStart=function(){},t.onMoving=function(){},t.onMoveEnd=function(){},t.onResize=function(){},t.doubleBuffer=function(e){return e.clearRect(0,0,e.canvas.width,e.canvas.height),this},t._getRenderer=function(){return n.prototype._getRenderer.call(this)},r}(hr);Id.mergeOptions(oO);Id.registerRenderer("canvas",Ld);var sO=new z(0,0),aO={animation:!0},aw=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.getParticles=function(e){},t.draw=function(e,o){var s=this.getParticles(He());if(!s||s.length===0){var a=this._getRenderer();a&&(this._getRenderer()._shouldClear=!0);return}var l=this.getMap(),h=o.extent;o.maskExtent&&(h=o.extent.intersection(o.maskExtent)),h=h.convertTo(function(m){return l._pointToContainerPoint(m,void 0,0,sO)});for(var u=2*Math.PI,c=0,f=s.length;c<f;c++){var d=s[c].point;if(h.contains(d)){var g=s[c].color||this.options.lineColor||"#fff",p=s[c].r;e.fillStyle!==g&&(e.fillStyle=g),p<=2?e.fillRect(d.x-p/2,d.y-p/2,p,p):(e.beginPath(),e.arc(d.x,d.y,p/2,0,u),e.fill())}}this._fillCanvas(e)},t._fillCanvas=function(e){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out";var s=this.options.trail||30;e.fillStyle="rgba(0, 0, 0, "+1/s+")",e.fillRect(0,0,e.canvas.width,e.canvas.height),e.globalCompositeOperation=o},r}(Id);aw.mergeOptions(aO);aw.registerRenderer("canvas",function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.draw=function(){(!this.canvas||!this.layer.options.animation||this._shouldClear)&&(this.prepareCanvas(),this._shouldClear=!1),this.prepareDrawContext(),this._drawLayer()},t.drawOnInteracting=function(){this.draw(),this._shouldClear=!1},t.onSkipDrawOnInteracting=function(){this._shouldClear=!0},r}(Ld));var ss=na(),as,ls,lO=function(n){function r(i,e,o){var s;s=n.call(this,o||{})||this,s.target=i,i.once("remove",s.delete,s);var a=s.options.symbol,l=a.markerLineWidth||1;return s.w=a.markerWidth+l,s.h=a.markerHeight+l,s.opacity=O(a.opacity)?1:a.opacity,s.map=e,s.events=o.events,s._fetchImage(),s.addTo(e),s}Q(r,n);var t=r.prototype;return t.getCursor=function(){return this.options.cursor||"default"},t._fetchImage=function(){var e=this.map,o=this.options.symbol,{markerFile:s}=o;this.url=s||Ma(o);var a=ss.getImage(this.url);if(!a){var l=this.w,h=this.h;if(s)a=new Image,a.onload=function(){var f=e.getRenderer();f&&f.setToRedraw()},a.src=this.url;else{var u=document.createElement("canvas");u.width=l,u.height=h;var c=u.getContext("2d");a=_0(c,{x:l/2,y:h/2},o,ss)}ss.addResource([this.url,l,h],a)}ss.login(this.url),this._img=a},t.setContainerPoint=function(e){this._point=e,this._point._sub(this.w/2,this.h/2)},t.getContainerPoint=function(){return this._point.add(this.w/2,this.h/2)},t.offset=function(e){this._point._add(e)},t.render=function(e){if(!this._img)return!1;var o=this.options.symbol,s=o.markerDx||0,a=o.markerDy||0,l=this.map,{x:h,y:u}=this._point,c=this.w,f=this.h;if(h+c>0&&h<l.width&&u+f>0&&u<l.height){var d=dt[l.id],g=d?d.devicePixelRatio:l.getDevicePixelRatio();return e.globalAlpha=this.opacity,e.drawImage(this._img,Math.round((h+s)*g),Math.round((u+a)*g),Math.round(c*g),Math.round(f*g)),!0}return!1},t.delete=function(){if(this.map){var e=this.map.getRenderer();e&&e.removeTopElement(this)}ss.logout(this.url),this._dragger&&(this._dragger.disable(),delete this._dragger),delete this.map},t.hitTest=function(e){var o=this.options.symbol,s=o.markerDx||0,a=o.markerDy||0,l=this.w,h=this.h,u=this._point.x+s,c=this._point.y+a;return e.x>=u&&e.x<=u+l&&e.y>=c&&e.y<=c+h},t.addTo=function(e){this.map=e;var o=e.getRenderer();o.addTopElement(this)},t.onEvent=function(e){this.fire(e.type,e)},t.mousedown=function(e){var o=e.target,s=this.options.cursor;s&&o.setCursor(s),this.onDragstart(e)},t.onDragstart=function(e){var{containerPoint:o,target:s}=e,a=s.getPanels().mapWrapper||s.getContainer(),l=this._dragger=new Ea(a);l.on("dragging",this.onDragging,this).on("mouseup",this.onDragend,this).enable(),l.onMouseDown(e.domEvent),as=o.x,ls=o.y,this.fire("dragstart",{containerPoint:o})},t.onDragging=function(e){if(this._dragger){var o=this.map,s=yr(e.domEvent,o.getContainer()),a={x:s.x-as,y:s.y-ls},l=o.containerPointToCoord(new z(as,ls)),h=o.containerPointToCoord(s);as=s.x,ls=s.y,this.offset(a),this.fire("dragging",{containerPoint:s,coordOffset:h._sub(l)})}},t.onDragend=function(e){if(this._dragger){var o=this.map;o.resetCursor();var s=yr(e.domEvent,o.getContainer()),a={x:s.x-as,y:s.y-ls};this.offset(a),this._dragger.disable(),delete this._dragger,this.fire("dragend",{containerPoint:s})}},t.needCollision=function(){var{target:e}=this;return this.options.ignoreCollision?!1:e&&e.options&&e.options.collision},t.getRenderBBOX=function(e){var{target:o,map:s}=this;if(!o||!o.options||!s)return null;var a=this.options.symbol,l=a.markerDx||0,h=a.markerDy||0,{x:u,y:c}=this._point,f=this.w,d=this.h,g=dt[s.id];e=e||g?g.devicePixelRatio:s.getDevicePixelRatio(),this.bbox=this.bbox||ur();var p=Math.round((u+l)*e),m=Math.round((c+h)*e),v=Math.round(f*e),_=Math.round(d*e);this.bbox[0]=p,this.bbox[1]=m,this.bbox[2]=p+v,this.bbox[3]=m+_;var{options:y}=o,w=y.collisionBufferSize||0;return Hy(this.bbox,w),this.bbox},t.setZIndex=function(e){this.options.zIndex=e},r}(ci(br)),hO=function(){function n(t,i,e){this.target=t,t.once("remove",this.delete,this),this.map=i,this.options=e||{},this.addTo(i)}var r=n.prototype;return r.setPoints=function(i){this.points=i;var e=i.map(function(s){return s.x}),o=i.map(function(s){return s.y});this.xmin=Math.min(...e),this.xmax=Math.max(...e),this.ymin=Math.min(...o),this.ymax=Math.max(...o)},r.hitTest=function(){return!1},r.render=function(i){var e=this.map;if(this.xmax<=0||this.xmin>=e.width||this.ymax<=0||this.ymin>=e.height)return;var o=dt[e.id],s=o?o.devicePixelRatio:e.getDevicePixelRatio(),a=.5;function l(c){return Math.round(c)*s+a}i.lineWidth=1,i.strokeStyle="#000",i.globalAlpha=1,i.beginPath();var h=this.points;i.moveTo(l(h[0].x),l(h[0].y));for(var u=1;u<this.points.length;u++)i.lineTo(l(h[u].x),l(h[u].y));i.closePath(),i.stroke()},r.addTo=function(i){this.map=i;var e=i.getRenderer();e.addTopElement(this)},r.delete=function(){if(this.map){var i=this.map.getRenderer();i&&i.removeTopElement(this)}},n}(),uO=xa+"_edit_stage_",dc="dragend dragstart";function gc(n,r){return{markerType:n,markerFill:"#fff",markerLineColor:"#000",markerLineWidth:2,markerWidth:10,markerHeight:10,opacity:r}}function mi(n,r){var t=n.getGLRes(),i=n.coordToPointAtRes(r,t),e=r.z||0,o=n._pointAtResToContainerPoint(i,t,e);return o}function ll(n,r,t){var i=n.getMap();if(!r||r.z===0)return i.containerPointToCoord(t);var e=r.z,o=i.getGLRes(),s=i.coordToPointAtRes(r,o),a=i._pointAtResToContainerPoint(s,o,0),l=i._pointAtResToContainerPoint(s,o,e),h=l.sub(a),u=t.sub(h),c=i.containerPointToCoord(u);c.z=0;var f=!n.getGeometries&&n.isPoint;return f&&(c.z=e),c}function cO(n){var r=this.target,t=this.paramOptions;return r._updating=!0,t.onDown&&(t.onDown.call(r,n.containerPoint,n),r._geometry.fire("handledragstart")),!1}function fO(n){var r=this.target,t=this.paramOptions;return r._hideContext(),t.onMove&&(t.onMove.call(r,n),r._geometry.fire("handledragging")),!1}function dO(n){var r=this.target,t=this.paramOptions;return t.onUp&&(t.onUp.call(r,n),r._geometry.fire("handledragend")),r._updating=!1,!1}var gO={fixAspectRatio:!1,symbol:null,removeVertexOn:"contextmenu",centerHandleSymbol:gc("ellipse",1),vertexHandleSymbol:gc("square",1),newVertexHandleSymbol:gc("square",.4),collision:!1,collisionBufferSize:0,vertexZIndex:0,newVertexZIndex:0,shadowDraggable:!1},lw=function(n){function r(i,e){var o;return o=n.call(this,e)||this,o._geometry=i,o._geometry?o:Gf(o)}Q(r,n);var t=r.prototype;return t.getMap=function(){return this._geometry.getMap()},t.prepare=function(){var e=this.getMap();e&&(e.on("drawtopstart",this._refresh,this),this.options.symbol&&(this._originalSymbol=this._geometry.getSymbol(),this._geometry.setSymbol(this.options.symbol)),this._prepareEditStageLayer())},t._prepareEditStageLayer=function(){var e=this._geometry.getLayer();if(e.options.renderer==="canvas"){var o=this.getMap(),s=ui(),a=uO+s+"_shadow";if(this._shadowLayer=o.getLayer(a),!this._shadowLayer){var l=e.constructor;this._shadowLayer=new l(a),o.addLayer(this._shadowLayer)}}},t.start=function(){if(!(!this._geometry||!this._geometry.getMap()||this._geometry.editing)){this.editing=!0,this.prepare();var e=this._geometry,o,s=this._geometry.getLayer(),a=s.options.renderer==="canvas";this._geometryDraggble=e.options.draggable,a?(e.config("draggable",!1),o=e.copy(),o.setSymbol(e._getInternalSymbol()),o.copyEventListeners(e),e._getParent()&&o.copyEventListeners(e._getParent()),o._setEventTarget(e),o.setId(null).config({draggable:this.options.shadowDraggable}),this._shadow=o,e.hide()):e instanceof et&&e.config("draggable",!0),this._switchGeometryEvents("on"),(e instanceof et||e instanceof zr||e instanceof Sn||e instanceof Di)&&this._createOrRefreshOutline(),this._shadowLayer&&this._shadowLayer.bringToFront().addGeometry(o),e instanceof et?o&&(o.config("draggable",!0),o.on("dragend",this._onMarkerDragEnd,this)):this._createCenterHandle(),e instanceof et&&this.options.resize!==!1?this.createMarkerEditor():e instanceof zr?this.createCircleEditor():e instanceof Sn?this.createEllipseOrRectEditor():e instanceof Di?this.createEllipseOrRectEditor():e instanceof No||(e instanceof it||e instanceof pt)&&this.createPolygonEditor()}},t.stop=function(){delete this._history,delete this._historyPointer,delete this._editOutline,this._switchGeometryEvents("off");var e=this.getMap();if(!e){this.fire("remove");return}this._geometry.config("draggable",this._geometryDraggble),this._shadow&&(this._shadow.off(dc,this._shadowDragEvent,this),delete this._shadow,delete this._geometryDraggble,this._geometry.show()),this._shadowLayer&&(this._shadowLayer.remove(),delete this._shadowLayer),this._refreshHooks=[],this.options.symbol&&(this._geometry.setSymbol(this._originalSymbol),delete this._originalSymbol),this.editing=!1,this.fire("remove")},t.isEditing=function(){return O(this.editing)?!1:this.editing},t._getGeometryEvents=function(){return{symbolchange:this._onGeoSymbolChange,dragstart:this._onDragStart,dragend:this._onDragEnd,"positionchange shapechange":this._exeAndReset}},t._switchGeometryEvents=function(e){if(this._geometry){var o=this._getGeometryEvents();for(var s in o)this._geometry[e](s,o[s],this)}},t._onGeoSymbolChange=function(e){this._shadow&&this._shadow.setSymbol(e.target._getInternalSymbol())},t._onMarkerDragEnd=function(){this._update("setCoordinates",this._shadow.getCoordinates().toArray())},t._createOrRefreshOutline=function(){var e=this._geometry,o=this._editOutline;o||(this._editOutline=new hO(this,this.getMap()),this._addRefreshHook(this._createOrRefreshOutline));var s=this._editOutline.points;if(e instanceof et)this._editOutline.setPoints(e.getContainerExtent().toArray(s));else{var a=e.getShell(),l=e._getEditCenter(),h=ur();Ii(a,h);var u=new Je(h[0],h[1],h[2],h[3]),c=this.getMap(),f=u.toArray().map(function(d){return d.z=l.z,mi(c,d)});this._editOutline.setPoints(f)}return o},t._shadowDragEvent=function(e){var o=e.type;o==="dragend"&&this._updateCoordFromShadow()},t._createCenterHandle=function(){var e=this,o=this.getMap(),s=this.options.centerHandleSymbol,a;this._shadow&&this._shadow.off(dc,this._shadowDragEvent,this),this.options.shadowDraggable&&this._shadow&&this._shadow.on(dc,this._shadowDragEvent,this);var l=mi(o,this._geometry._getEditCenter()),h=this.createHandle(l,{ignoreCollision:!0,symbol:s,cursor:"move",onDown:function(){if(e._shadow){a=e._shadow.copy();var c=Wl(a._getInternalSymbol(),.5);a.setSymbol(c).addTo(e._geometry.getLayer())}},onMove:function(c){var f=c.coordOffset;a?a.translate(f):e._geometry.translate(f)},onUp:function(){if(a){var c=a.getFirstCoordinate(),f=e._geometry.getFirstCoordinate(),d=c.sub(f);e._update("translate",d),a.remove()}}});this._addRefreshHook(function(){var u=e._geometry._getEditCenter();h.setContainerPoint(mi(o,u))})},t._createHandleInstance=function(e,o){o=o||{};var s=this.getMap(),a=Dh(o.symbol,function(){var u=dt[s.id],c=u?u.zoom:s.getZoom(),f=u?u.pitch:s.getPitch(),d=u?u.bearing:s.getBearing();return[c,{"{bearing}":d,"{pitch}":f,"{zoom}":c}]}),l=this.options.removeVertexOn,h=new lO(this,s,{symbol:a,cursor:o.cursor,events:l,ignoreCollision:o.ignoreCollision});return h.setContainerPoint(e),h},t.createHandle=function(e,o){o||(o={});var s=this._createHandleInstance(e,o);return s.paramOptions=o,s.on("dragstart",cO),s.on("dragging",fO),s.on("dragend",dO),o.onRefresh&&(s.refresh=o.onRefresh),s},t._createResizeHandles=function(e,o,s){var a=this,l=["nw-resize","n-resize","ne-resize","w-resize","e-resize","sw-resize","s-resize","se-resize"],h=[null,"y",null,"x","x",null,"y",null],u=this._geometry,c=u instanceof et,f=[];function d(){if(c){var w=u.getContainerExtent();return[new z(w.xmin,w.ymin),new z((w.xmax+w.xmin)/2,w.ymin),new z(w.xmax,w.ymin),new z(w.xmin,(w.ymin+w.ymax)/2),new z(w.xmax,(w.ymin+w.ymax)/2),new z(w.xmin,w.ymax),new z((w.xmax+w.xmin)/2,w.ymax),new z(w.xmax,w.ymax)]}var x=u.getShell(),C=u._getEditCenter(),b=ur();Ii(x,b);var E=new Je(b[0],b[1],b[2],b[3]);return f=[new $(E.xmin,E.ymax),new $((E.xmax+E.xmin)/2,E.ymax),new $(E.xmax,E.ymax),new $(E.xmin,(E.ymax+E.ymin)/2),new $(E.xmax,(E.ymax+E.ymin)/2),new $(E.xmin,E.ymin),new $((E.xmax+E.xmin)/2,E.ymin),new $(E.xmax,E.ymin)],f.map(function(T){return T.z=C.z,mi(v,T)})}e||(e=[]);var g=this,p=[],m={},v=this.getMap(),_=this.options.vertexHandleSymbol,y=function(){for(var x=d(),C=function(T){if(Array.isArray(e)){var S=e.some(function(G){return G===T});if(S)return 1}var B=x[T],L=B,D=f[T];if(p.length<x.length-e.length){var N=a.createHandle(L,{symbol:_,cursor:l[T],axis:h[T],onMove:function(G){return function(I){g._updating=!0,o(I.containerPoint,G),u.fire("resizing")}}(T),onUp:function(){g._updating=!1,s()}});m[T]=p.length,p.push(N),N.coord=D}else p[m[T]].coord=D,p[m[T]].setContainerPoint(L)},b=0;b<x.length;b++)C(b)};return y(),this._addRefreshHook(y),p},t.createMarkerEditor=function(){var e=this,o=this._shadow||this._geometry,s=this.getMap();if(!o._canEdit()){console&&console.warn("A marker can't be resized with symbol:",o.getSymbol());return}this._history||this._recordHistory(v());var a=o._getInternalSymbol(),l=new z(0,0);X(a.markerDx)&&(l.x=a.markerDx),X(a.markerDy)&&(l.y=a.markerDy);var h=null,u="middle",c="middle";if(C0.test(a)){var f=a.markerType;f==="pin"||f==="pie"||f==="bar"?(h=[5,6,7],u="bottom"):f==="rectangle"&&(h=[0,1,2,3,5],u="top",c="left")}else(dd.test(a)||T0.test(a))&&(u="bottom",h=[5,6,7]);var d=[2,1,2,0,0,2,1,2],g;if(this.options.fixAspectRatio){var p=o.getSize();g=p.width/p.height}var m=this._createResizeHandles(h,function(_,y){if(h&&h.indexOf(y)>=0){var w=s.containerPointToCoordinate(_.sub(l)),x=o.getCoordinates();w.x=x.x,o.setCoordinates(w),e._updateCoordFromShadow(!0);var C=m[m.length-1-y],b=C.getContainerPoint();_=b}var E=mi(s,o._getEditCenter()).add(l),T=o._getInternalSymbol(),S=_.sub(E);u==="bottom"&&_.y>E.y&&(S.y=0);var B=u==="middle"?2:1,L=c==="left"?1:2,D=Math.abs(S.x)*L,N=Math.abs(S.y)*B;g&&(D=Math.max(D,N*g),N=D/g);var G=d[y];o instanceof Kl?((g||G===0||G===2)&&(o.setWidth(D),o!==e._geometry&&e._geometry.setWidth(D)),(g||G===1||G===2)&&(o.setHeight(N),o!==e._geometry&&e._geometry.setHeight(N))):((g||G===0||G===2)&&(T.markerWidth=Math.min(D,e._geometry.options.maxMarkerWidth||1/0)),(g||G===1||G===2)&&(T.markerHeight=Math.min(N,e._geometry.options.maxMarkerHeight||1/0)),o.setSymbol(T),o!==e._geometry&&e._geometry.setSymbol(T))},function(){e._update(v())});function v(){var _=[["setCoordinates",o.getCoordinates().toArray()]];return o instanceof Kl?(_.push(["setWidth",o.getWidth()]),_.push(["setHeight",o.getHeight()])):_.push(["setSymbol",o.getSymbol()]),_}},t.createCircleEditor=function(){var e=this,o=this._shadow||this._geometry,s=this.getMap();this._history||this._recordHistory([["setCoordinates",o.getCoordinates().toArray()],["setRadius",o.getRadius()]]),this._createResizeHandles(null,function(a){var l=o.getCenter(),h=ll(o,l,a),u=new pt([[l.x,l.y],[h.x,l.y]]),c=new pt([[l.x,l.y],[l.x,h.y]]),f=Math.max(s.computeGeometryLength(u),s.computeGeometryLength(c));o.setRadius(f),o!==e._geometry&&e._geometry.setRadius(f)},function(){e._update("setRadius",o.getRadius())})},t.createEllipseOrRectEditor=function(){var e=this,o=[2,1,2,0,0,2,1,2],s=this._shadow||this._geometry;this._history||this._recordHistory(c());var a=this.getMap(),l=this._geometry instanceof Sn,h;this.options.fixAspectRatio&&(h=s.getWidth()/s.getHeight());var u=this._createResizeHandles(null,function(f,d){var g=l?1:2,p,m,v,_=u[d],y=_.getContainerPoint(),w=o[d];if(l){var x=u[7-d],C=x.getContainerPoint();p=y.sub(C);var b=p.abs();m=a.pixelToDistance(b.x,0),v=a.pixelToDistance(0,b.y);var E=s.getSize(),T=s.getCoordinates(),S=s.getWidth(),B=s.getHeight(),L=x.coord,D=ll(s,T,f),N=new pt([[L.x,L.y],[D.x,L.y]]),G=new pt([[L.x,L.y],[L.x,D.y]]);if(m=a.computeGeometryLength(N),v=a.computeGeometryLength(G),w===0)if(h&&(b.y=b.x/h,E.height=Math.abs(b.y),v=m/h),y.y=C.y-E.height/2,D.y=T.y,d===4)D.x=Math.min(D.x,T.x);else{var I=a.locate(T,S,0);D.x=a.locate(new $(I.x,D.y),-m,0).x}else if(w===1)h&&(b.x=b.y*h,E.width=Math.abs(b.x),m=v*h),y.x=C.x-E.width/2,D.x=T.x,D.y=Math.max(D.y,L.y);else{if(h&&(m>v*h?(v=m/h,y.y=C.y+b.x*ir(p.y)/h):(m=v*h,y.x=C.x+b.y*ir(p.x)*h)),d===0||d===5){var A=d===0?a.locate(T,S,0):a.locate(T,S,-B);D.x=a.locate(new $(A.x,D.y),-m,0).x}else D.x=Math.min(D.x,L.x);D.y=Math.max(D.y,L.y)}D.z=T.z,s.setCoordinates(D),e._updateCoordFromShadow(!0)}else{var k=s.getCenter(),Z=ll(s,k,f),W=new pt([[k.x,k.y],[Z.x,k.y]]),re=new pt([[k.x,k.y],[k.x,Z.y]]);m=a.computeGeometryLength(W),v=a.computeGeometryLength(re),h&&(m=Math.max(m,v*h),v=m/h)}(h||w===0||w===2)&&(s.setWidth(m*g),s!==e._geometry&&e._geometry.setWidth(m*g)),(h||w===1||w===2)&&(s.setHeight(v*g),s!==e._geometry&&e._geometry.setHeight(v*g))},function(){e._update(c())});function c(){return[["setCoordinates",s.getCoordinates().toArray()],["setWidth",s.getWidth()],["setHeight",s.getHeight()]]}},t.createPolygonEditor=function(){var e=this.getMap(),o=this._shadow||this._geometry,s=this;this._history||this._recordHistory("setCoordinates",$.toNumberArrays(o.getCoordinates()));var a=o instanceof it?3:2,l="maptalks--editor-vertex-index",{vertexZIndex:h,newVertexZIndex:u}=this.options,c={0:[]},f={0:[]};function d(k,Z){if(o instanceof it){var W=o.getCoordinates();W[Z]=k,o.setCoordinates(W)}else o.setCoordinates(k)}function g(k=0){if(o instanceof it){var Z=o.getCoordinates()[k]||[];return Z.slice(0,Z.length-1)}else return o.getCoordinates()}function p(){for(var k in c){for(var Z=c[k].length-1;Z>=0;Z--)c[k][Z][l]=Z;for(var W=f[k].length-1;W>=0;W--)f[k][W][l]=W}s._updateCoordFromShadow()}function m(k){s._updating=!0;var Z=k.target,W=Z[l],re=X(Z._ringIndex)?Z._ringIndex:0,se=g(re);if(se.length<=a){console.warn(" Geometry."+o.type+" Require at least "+a+" vertices,Geometry: ",o);return}if(se.splice(W,1),d(se,re),W===0)f[re][0].delete(),f[re].splice(0,1);else if(W===c[re].length-1){var me=f[re].length;f[re][me-1].delete(),f[re].splice(me-1,1)}else f[re][W-1].delete(),f[re].splice(W-1,1),f[re][W-1].delete(),f[re].splice(W-1,1),f[re].splice(W-1,0,b.call(s,W-1,re));if(c[re].splice(W,1)[0].delete(),re>0){var ge=o.getCoordinates(),de=ge[re];de&&Array.isArray(de)&&de.length>1&&o!==this._geometry&&o.setCoordinates(ge)}p(),s._updating=!1,s._geometry.fire("handleremove",Object.assign({},k,{coordinate:e.containerPointToCoordinate(k.containerPoint),vertex:k.target}))}function v(k,Z,W=0){var re=s._geometry.snapTo;re&&Oe(re)&&(k=s._geometry.snapTo(k)||k);var se=g(W),me=k.sub(y()),ge=ll(s._geometry,se[Z],me),de=se[Z];de.x=ge.x,de.y=ge.y,o.setCoordinates(o.getCoordinates()),s._updateCoordFromShadow(!0);var _e;Z===0?_e=f[W].length-1:_e=Z-1,f[W][Z]&&f[W][Z].refresh(),f[W][_e]&&f[W][_e].refresh()}var _=new z(0,0);function y(){var k=o._getCompiledSymbol();return _.x=k.lineDx||0,_.y=k.lineDy||0,_}function w(k,Z=0,W){var re=(W||g(Z))[k],se=mi(e,re)._add(y()),me=s.createHandle(se,{symbol:s.options.vertexHandleSymbol,cursor:"pointer",axis:null,onMove:function(){v(me.getContainerPoint(),me[l],Z)},onRefresh:function(de,_e){if(re=(_e||g(Z))[me[l]],re){var Te=mi(e,re);me.setContainerPoint(Te._add(y()))}},onUp:function(){s._updateCoordFromShadow()},onDown:function(de,_e){_e&&_e.domEvent&&_e.domEvent.button}});return me[l]=k,me._ringIndex=Z,me.on(s.options.removeVertexOn,m),me.setZIndex(h),me}var x=!1,C=!1;function b(k,Z=0,W){var re=W||g(Z),se;k+1>=re.length?se=re[0]:se=re[k+1];var me=re[k].add(se).multi(1/2);C&&(me=mi(e,me));var ge=s.createHandle(me,{symbol:s.options.newVertexHandleSymbol,cursor:"pointer",axis:null,onDown:function(_e,Te){if(!(Te&&Te.domEvent&&Te.domEvent.button===2)){var Ge=g(Z),Me=ge[l],Be=Ge[Me],lt=Ge[Me+1]||Ge[0],M=Be.add(lt).multi(1/2);Ge.splice(Me+1,0,M),d(Ge,Z),ge.opacity=1,C=!0,f[Z].splice(Me,0,b.call(s,Me,Z),b.call(s,Me+1,Z)),C=!1,x=!0}},onMove:function(){v(ge.getContainerPoint(),ge[l]+1,Z)},onUp:function(_e){if(_e&&_e.domEvent&&_e.domEvent.button===2){x=!1;return}var Te=ge[l];Dl(ge,f[Z]),ge.delete(),c[Z].splice(Te,0,w.call(s,Te,Z)),p(),s._updateCoordFromShadow(),x=!1},onRefresh:function(_e,Te){re=Te||g(_e);var Ge=ge[l],Me;if(Ge===re.length-1?Me=0:Me=Ge+1,re[Ge]&&re[Me]){var Be=re[Ge].add(re[Me]).multi(.5),lt=mi(e,Be);ge.setContainerPoint(lt._add(y()))}}});return ge[l]=k,ge.setZIndex(u),ge}if(o instanceof it)for(var E=o.getHoles().length+1,T=0;T<E;T++){c[T]=[],f[T]=[];for(var S=g(T),B=0,L=S.length;B<L;B++)c[T].push(w.call(this,B,T,S)),B<L-1&&f[T].push(b.call(this,B,T,S));f[T].push(b.call(this,S.length-1,T,S))}else{for(var D=0,N=g(D),G=0,I=N.length;G<I;G++)c[D].push(w.call(this,G,D,N)),G<I-1&&f[D].push(b.call(this,G,D,N));f[D].length&&o.getCoordinates().length===2&&(f[D][0].options.symbol.markerDx=12)}var A=e.getRenderer();A&&A.sortTopElements(),this._addRefreshHook(function(){if(!x){for(var k in f)for(var Z=g(k),W=f[k].length-1;W>=0;W--)f[k][W].refresh(k,Z);f[0].length&&o instanceof pt&&(o.getCoordinates().length===2?f[0][0].options.symbol.markerDx=12:o.getCoordinates().length>2&&(f[0][0].options.symbol.markerDx=0));for(var re in c)for(var se=g(re),me=c[re].length-1;me>=0;me--)c[re][me].refresh(re,se)}})},t._refresh=function(){if(this._refreshHooks)for(var e=this._refreshHooks.length-1;e>=0;e--)this._refreshHooks[e].call(this)},t._hideContext=function(){this._geometry&&(this._geometry.closeMenu(),this._geometry.closeInfoWindow())},t._addRefreshHook=function(e){e&&(this._refreshHooks||(this._refreshHooks=[]),this._refreshHooks.push(e))},t._update=function(e,...o){this._exeHistory([e,o]),this._recordHistory(e,...o)},t._updateCoordFromShadow=function(e){var o=this._shadow||this._geometry,s=o.getCoordinates(),a=this._geometry,l=this._updating;this._updating=!0,a.setCoordinates(s),e||this._recordHistory("setCoordinates",$.toNumberArrays(a.getCoordinates())),this._updating=l},t._recordHistory=function(e,...o){if(this._history||(this._history=[],this._historyPointer=0),this._history.length){var s=this._history[this._history.length-1];if(s[0]===e&&JSON.stringify(s[1])===JSON.stringify(o))return}this._historyPointer<this._history.length-1&&this._history.splice(this._historyPointer+1),this._history.push([e,o]),this._historyPointer=this._history.length-1,this._geometry.fire("editrecord")},t.cancel=function(){if(!this._history||this._historyPointer===0)return this;this._historyPointer=0;var e=this._history[0];return this._exeAndReset(e),this},t.undo=function(){if(this._isundoEdit())return this;var e=this._history[--this._historyPointer];return this._exeAndReset(e),this},t.redo=function(){if(this._isRedoEdit())return this;var e=this._history[++this._historyPointer];return this._exeAndReset(e),this},t._exeAndReset=function(e){if(!this._updating){this._exeHistory(e);var o=this._history,s=this._historyPointer;this.stop(),this._history=o,this._historyPointer=s,this.start()}},t._onDragStart=function(){this._updating=!0},t._onDragEnd=function(){this._updating=!1},t._exeHistory=function(e){if(Array.isArray(e)){var o=this._updating;this._updating=!0;var s=this._shadow||this._geometry,a=this._geometry;Array.isArray(e[0])?e[0].forEach(function(l){var h=l[0],u=l.slice(1);s[h].call(s,...u),s!==a&&a[h].call(a,...u)}):(s[e[0]].call(s,...e[1]),s!==a&&a[e[0]].call(a,...e[1])),this._updating=o}},t._isRedoEdit=function(){return!this._history||this._historyPointer===this._history.length-1},t._isundoEdit=function(){return!this._history||this._historyPointer===0},r}(ci(br));lw.mergeOptions(gO);var pO={startEditText:function(){return this.getMap()?(this._recordVisible(),this.hide(),this.endEditText(),this._prepareEditor(),this._fireEvent("edittextstart"),this):this},endEditText:function(){if(this._textEditor){var r=this._textEditor.innerHTML;r=r.replace(/<p>/ig,"").replace(/<\/p>/ig,"<br/>"),this._textEditor.innerHTML=r;var t=this._textEditor.innerText.replace(/[\r\n]+$/gi,"");this.setContent(t),yt(this._textEditor,"mousedown dblclick",nr),this.getMap().off("mousedown",this.endEditText,this),this._editUIMarker.remove(),delete this._editUIMarker,this._textEditor.onkeyup=null,delete this._textEditor,this._recoveryVisible(),this.show(),this._fireEvent("edittextend")}return this},isEditingText:function(){return!!this._textEditor},getTextEditor:function(){return this._editUIMarker},_prepareEditor:function(){var r=this.getMap(),t=this._createEditor();this._textEditor=t,r.on("mousedown",this.endEditText,this);var i=this._getEditorOffset();this._editUIMarker=new Wh(this.getCoordinates(),{animation:null,content:t,dx:i.dx,dy:i.dy}).addTo(r),this._setCursorToLast(this._textEditor)},_getEditorOffset:function(){var r=this._getInternalSymbol()||{},t=0,i=0,e=r.textHorizontalAlignment;return e==="middle"||O(e)?(t=(r.textDx||0)-2,i=(r.textDy||0)-2):(t=(r.markerDx||0)-2,i=(r.markerDy||0)-2),{dx:t,dy:i}},_createEditor:function(){var r=this.getContent(),t=this.getSize(),i=this._getInternalSymbol()||{},e=t.width,o=i.textFill||"#000000",s=i.textSize||12,a=t.height,l=i.markerLineColor||"#000",h=i.markerFill||"#3398CC",u=i.textLineSpacing||0,c=we("div");return c.contentEditable=!0,c.style.cssText="background:"+h+"; border:1px solid "+l+`;
|
|
317
|
-
color:`+o+";font-size:"+s+"px;width:"+(e-2)+"px;height:"+(a-2)+`px;margin: auto;
|
|
318
|
-
line-height:`+(s+u)+`px;outline: 0; padding:0; margin:0;word-wrap: break-word;
|
|
319
|
-
overflow: hidden;-webkit-user-modify: read-write-plaintext-only;`,c.innerText=r,vt(c,"mousedown dblclick",nr),c.onkeyup=function(f){var d=c.style.height||0;f.keyCode===13&&(c.style.height=parseInt(d)+s/2+"px")},c},_setCursorToLast:function(r){var t;window.getSelection?(r.focus(),t=window.getSelection(),t.selectAllChildren(r),t.collapseToEnd()):document.selection&&(t=document.selection.createRange(),t.moveToElementText(r),t.collapse(!1),t.select())}};md.include(pO);je.include({animate:function(r,t,i){var e=this;this._animPlayer&&this._animPlayer.finish(),Oe(t)&&(i=t),t||(t={});var o=this.getMap(),s=this._getProjection(),a=this._prepareAnimationStyles(r),l,h=t.focus;if(delete this._animationStarted,o){var u=o._getRenderer(),c=function(g){u.callInNextFrame(g)};t.framer=c}if(!s&&h){console.error(D0);return}var f=Mt.animate(a,t,function(d){if(o&&o.isRemoved()){f.finish();return}o&&!e._animationStarted&&h&&o.onMoveStart();var g=d.styles;for(var p in g)if(p!=="symbol"&&p!=="translate"&&g.hasOwnProperty(p)){var m="set"+p[0].toUpperCase()+p.slice(1);e[m](g[p])}var v=g.translate;if(v){var _=v;l&&(_=v.sub(l)),l=v,e.translate(_)}var y=g.symbol;if(y){var w=e.getSymbol()||{};e.setSymbol(Zr(w,y))}if(o&&h){var x=s.project(e.getCenter());o._setPrjCenter(x);var C=o._parseEventFromCoord(s.unproject(x));f.playState!=="running"?o.onMoveEnd(C):o.onMoving(C)}e._fireAnimateEvent(f.playState),i&&i(d)},this);return this._animPlayer=f,this._animPlayer.play()},_prepareAnimationStyles:function(r){var t=this._getInternalSymbol(),i={};for(var e in r)if(r.hasOwnProperty(e)){var o=r[e];if(e!=="translate"&&e!=="symbol"){var s="get"+e[0].toUpperCase()+e.substring(1),a=this[s]();i[e]=[a,o]}else if(e==="symbol"){var l=void 0;if(Array.isArray(r.symbol)){if(!Array.isArray(t))throw new Error("geometry'symbol isn't a composite symbol, while the symbol in styles is.");l=[];for(var h=r.symbol,u=0;u<h.length;u++){if(!h[u]){l.push(null);continue}var c={};for(var f in h[u])h[u].hasOwnProperty(f)&&(c[f]=[t[u][f],h[u][f]]);l.push(c)}}else{if(Array.isArray(t))throw new Error("geometry'symbol is a composite symbol, while the symbol in styles isn't.");l={};for(var d in o)o.hasOwnProperty(d)&&(l[d]=[t[d],o[d]])}i.symbol=l}else e==="translate"&&(i.translate=new $(o))}return i},_fireAnimateEvent:function(r){r==="finished"?(delete this._animationStarted,this._fireEvent("animateend")):r==="running"&&(this._animationStarted?this._fireEvent("animating"):(this._fireEvent("animatestart"),this._animationStarted=!0))}});var pc=xa+"_drag_stage",hm=Ce.touch?"touchstart mousedown":"mousedown";function vO(n,r,t){var i=n._getEditCenter(),e=n.getMap();if(!i||i.z===0)return t||e.containerPointToCoord(r);var o=i.z;return e.containerPointToCoordinate3(r,o)}var mO=function(n){function r(i){return n.call(this,i)||this}Q(r,n);var t=r.prototype;return t.addHooks=function(){this.target.on(hm,this._startDrag,this)},t.removeHooks=function(){this._endDrag(),this.target.off(hm,this._startDrag,this),delete this.container},t._prepareDragHandler=function(){this._dragHandler=new Ea(this.container),this._dragHandler.on("dragging",this._dragging,this).on("mouseup",this._endDrag,this).enable()},t._prepareShadow=function(){var e=this,o=this.target,s=o.getLayer().options.renderer==="canvas";if(s&&o.options.dragShadow){this._prepareDragStageLayer(),this._shadow&&this._shadow.remove();var a=this._shadow=o.copy();if(a.getGeometries){var l=a.getGeometries(),h=o.getGeometries();l.forEach(function(u,c){e._updateShadowSymbol(u,h[c])})}else this._updateShadowSymbol(a,o);a.setId(null),this._prepareShadowConnectors()}},t._updateShadowSymbol=function(e,o){if(e.setSymbol(o._getInternalSymbol()),o.options.dragShadow){var s=Wl(e._getInternalSymbol(),.5);e.setSymbol(s)}},t._prepareShadowConnectors=function(){var e=this.target,o=this._shadow,s=this._dragStageLayer._getRenderer().resources,a=[];if(Ql._hasConnectors(e))for(var l=Ql._getConnectors(e),h=0,u=l.length;h<u;h++){var c=l[h],f=c.config(),d=c._getInternalSymbol();f.symbol=Wl(d,.5);var g=void 0;c.getConnectSource()===e?g=new c.constructor(o,c.getConnectTarget(),f):g=new c.constructor(c.getConnectSource(),o,f),a.push(g),c.getLayer()&&c.getLayer()._getRenderer()&&s.merge(c.getLayer()._getRenderer().resources)}this._shadowConnectors=a,a.push(o),this._dragStageLayer.bringToFront().addGeometry(a)},t._onTargetUpdated=function(){this._shadow&&this._shadow.setSymbol(this.target._getSymbol())},t._prepareDragStageLayer=function(){var e=this.target.getMap(),o=this.target.getLayer(),s=e.getLayer(pc);s&&s.remove();var a=o.constructor;this._dragStageLayer=new a(pc,{enableAltitude:o.options.enableAltitude,altitudeProperty:o.options.altitudeProperty}),e.addLayer(this._dragStageLayer);var l=na();l.merge(o._getRenderer().resources),this._dragStageLayer._getRenderer().resources=l},t._startDrag=function(e){var o=this.target.getMap();if(o){var s=this.target._getParent();if(!s&&!this.isDragging()){var a=e.domEvent;if(!(a.touches&&a.touches.length>1||a.button===2)){this.container=o.getPanels().mapWrapper||o.getContainer(),this.target.on("click",this._endDrag,this);var l=this._correctCoord(e.coordinate);this._lastCoord=vO(this.target,e.containerPoint,l),this._lastPoint=e.containerPoint,this._prepareDragHandler(),this._dragHandler.onMouseDown(e.domEvent),vt(this.container,"mouseleave",this._endDrag,this),this._startParam=e,this._moved=!1}}}},t._dragging=function(e){var o=this.target,s=o.getMap();if(!(!this._lastCoord.z&&s._isEventOutMap(e.domEvent))){var a=s._parseEvent(e.domEvent),l=a.domEvent;if(!(l.touches&&l.touches.length>1)&&!(!this._lastCoord.z&&s._isContainerPointOutOfMap(a.containerPoint))){if(!this._moved){this._moved=!0,o.on("symbolchange",this._onTargetUpdated,this),this._isDragging=!0,this._prepareShadow(),this._shadow&&(o.options.dragShadow||o.hide(),this._shadow._fireEvent("dragstart",a)),this.target._fireEvent("dragstart",this._startParam||a),delete this._startParam;return}var h=this._shadow||o,u=h.options.dragOnAxis,c=h.options.dragOnScreenAxis,f=a.containerPoint,d=a.coordinate;this._lastPoint=this._lastPoint||f,this._lastCoord=this._lastCoord||d,c&&(u==="x"?f.y=this._lastPoint.y:u==="y"&&(f.x=this._lastPoint.x));var g=this._lastCoord.z;d=s.containerPointToCoordinate3(f,g);var p=f.sub(this._lastPoint),m=d.sub(this._lastCoord);c||(u==="x"?p.y=m.y=0:u==="y"&&(p.x=m.x=0)),this._lastPoint=f,this._lastCoord=d;var v=!h.getGeometries&&h.isPoint;v?h.setCoordinates(d):h.translate(m),h!==o&&!o.options.dragShadow&&(v?o.setCoordinates(d):o.translate(m)),a.coordOffset=m,a.pointOffset=p,h._fireEvent("dragging",a),h!==o&&o._fireEvent("dragging",a)}}},t._endDrag=function(e){if(this._dragHandler&&(this._dragHandler.disable(),delete this._dragHandler),this.container&&yt(this.container,"mouseleave",this._endDrag),!!this.target){var o=this.target;o.off("click",this._endDrag,this),o.off("symbolchange",this._onTargetUpdated,this),delete this._lastCoord,delete this._lastPoint,this._isDragging=!1;var s=o.getMap();if(this.enabled()&&s){var a=s._parseEvent(e?e.domEvent:null);this._updateTargetAndRemoveShadow(a),this._moved&&o._fireEvent("dragend",a)}}},t.isDragging=function(){return!!this._isDragging},t._updateTargetAndRemoveShadow=function(e){if(this._shadow){var o=this.target,s=o.getMap();o.options.dragShadow||o.show();var a=this._shadow;if(a){if(o.options.dragShadow){var l=a.getFirstCoordinate(),h=o.getFirstCoordinate(),u=l.sub(h);o.translate(u)}a._fireEvent("dragend",e),a.remove(),delete this._shadow}this._shadowConnectors&&(s.getLayer(pc).removeGeometry(this._shadowConnectors),delete this._shadowConnectors),this._dragStageLayer&&(this._dragStageLayer._getRenderer().resources=na(),this._dragStageLayer.remove())}},t._correctCoord=function(e){var o=this.target.getMap(),s=dt[o.id],a=s?s.pitch:o.getPitch();if(!a)return e;var l=this.target;if(!l.getMinAltitude())return e;var h=(l.getMinAltitude()+l.getMaxAltitude())/2;return o.locateByPoint(e,0,-h)},r}(Pa);je.mergeOptions({draggable:!1,dragShadow:!0,dragOnAxis:null,dragOnScreenAxis:!1});je.addInitHook("addHandler","draggable",mO);je.include({isDragging:function(){return this._getParent()?this._getParent().isDragging():this.draggable?this.draggable.isDragging():!1}});je.include({startEdit:function(r){var t=this.getMap();return!t||!this.options.editable?this:(this._editor&&this.endEdit(),this._recordVisible(),this._editor=new lw(this,r),this._editor.start(),this._getParent()||this.fire("editstart"),t.getRenderer().setToRedraw(),this)},endEdit:function(){if(this._editor){this._editor.stop(),delete this._editor,this._recoveryVisible(),this._getParent()||this.fire("editend");var r=this.getMap();r&&r.getRenderer().setToRedraw()}return this},redoEdit:function(){return this.isEditing()?(this._editor.redo(),this._getParent()||this.fire("redoedit"),this):this},undoEdit:function(){return this.isEditing()?(this._editor.undo(),this._getParent()||this.fire("undoedit"),this):this},cancelEdit:function(){return this.isEditing()?(this._recoveryVisible(),this._editor.cancel(),this._getParent()||this.fire("canceledit"),this):this},isEditing:function(){return this._editor?this._editor.isEditing():!1},undoEditcheck:function(){if(this.isEditing())return this._editor._isundoEdit()},redoEditcheck:function(){if(this.isEditing())return this._editor._isRedoEdit()}});je.include({_onEvent:function(r,t){var i=this.getMap();if(i){var e=t||this._getEventTypeToFire(r);e==="contextmenu"&&this.listens("contextmenu")&&(nr(r),hi(r));var o=i._getEventParams(r);X(this._pickGeometryIndex)&&(o.pickGeometryIndex=this._pickGeometryIndex),this._fireEvent(e,o)}},_getEventTypeToFire:function(r){return r.type}});je.include({setInfoWindow:function(r){return this.removeInfoWindow(),r instanceof eh?(this._infoWindow=r,this._infoWinOptions=oe({},this._infoWindow.options),this._infoWindow.addTo(this),this):(this._infoWinOptions=oe({},r),this._infoWindow?this._infoWindow._setOptions(r):this.getMap()&&this._bindInfoWindow(),this)},getInfoWindow:function(){return this._infoWindow?this._infoWindow:null},openInfoWindow:function(r){return this.getMap()?(r||(r=this.getCenter()),this._infoWindow?this._infoWindow.show(r):this._infoWinOptions&&this.getMap()&&(this._bindInfoWindow(),this._infoWindow.show(r)),this):this},closeInfoWindow:function(){return this._infoWindow&&this._infoWindow.hide(),this},removeInfoWindow:function(){return this._unbindInfoWindow(),delete this._infoWinOptions,delete this._infoWindow,this},_bindInfoWindow:function(){var r=this._infoWinOptions;return r?(this._infoWindow=new eh(r),this._infoWindow.addTo(this),this):this},_unbindInfoWindow:function(){return this._infoWindow&&(this.closeInfoWindow(),this._infoWindow.remove(),delete this._infoWindow),this}});je.fromJSON=function(n){if(Array.isArray(n)){for(var r=[],t=0,i=n.length;t<i;t++){var e=je.fromJSON(n[t]);Array.isArray(n)?r=r.concat(e):r.push(e)}return r}if(n&&!n.feature)return Or.toGeometry(n);var o;return n.subType?(o=je.getJSONClass(n.subType).fromJSON(n),O(n.feature.id)||o.setId(n.feature.id)):(o=Or.toGeometry(n.feature),n.options&&o.config(n.options)),n.symbol&&o.setSymbol(n.symbol),n.infoWindow&&o.setInfoWindow(n.infoWindow),o};var um=new z(0,0),cm=new z(0,0),cf=[],_O=function(n){function r(){return n.call(this,td)||this}Q(r,n);var t=r.prototype;return t.checkUrl=function(e){return!e||!Ee(e)?e:Ph(e)},t.fetchImage=function(e,o,s,a){e=this.checkUrl(e);var l={url:e,fetchOptions:a};this.send(l,cf,s,o)},r}(Hh),hw=function(r){var t=function(i){function e(){return i.apply(this,arguments)||this}Q(e,i);var o=e.prototype;return o.init=function(){var a=this;this.tilesInView={},this.tilesLoading={},this._parentTiles=[],this._childTiles=[],this._tileQueue=[],this._tileQueueIds=new Set;var l=this.layer.getTileSize().width;this.tileCache=new id(this.layer.options.maxCacheSize*l/512*l/512,function(h){a.deleteTile(h)}),Ce.decodeImageInWorker&&this.layer.options.decodeImageInWorker&&(this.layer.options.renderer==="gl"||!Ce.safari&&!Ce.iosWeixin)&&(this._tileImageWorkerConn=new _O),this._compareTiles=wO.bind(this)},o.getCurrentTileZoom=function(){return this._tileZoom},o.draw=function(a,l){var h=this.getMap();if(!(this.isDrawable&&!this.isDrawable())){var u=this.prepareCanvas();if(u){var c=this.layer||{},f=c.parent||{};if(f.isMap&&!u.intersects(this.canvasExtent2D)){this.completeRender();return}}this._renderTimestamp!==a&&(this._consumeTileQueue(),this._computeAvgTileAltitude(),this._renderTimestamp=a);var d,g=!1,p=this._frameTiles;if(p&&a===p.timestamp){if(p.empty)return;d=p}else{if(d=this._getTilesInCurrentFrame(),!d){this._frameTiles={empty:!0,timestamp:a},this.completeRender();return}g=!0,this._frameTiles=d,this._frameTiles.timestamp=a,d.loadingCount&&this.loadTileQueue(d.tileQueue)}var{tiles:m,childTiles:v,parentTiles:_,placeholders:y,loading:w,loadingCount:x,missedTiles:C,incompleteTiles:b}=d;this._drawTiles(m,_,v,y,l,C,b),x||w||(!h.isAnimating()&&(this._parentTiles.length||this._childTiles.length)&&(this._parentTiles=[],this._childTiles=[],this.setToRedraw()),this.completeRender()),g&&this.retireTiles()}},o.getTileGridsInCurrentFrame=function(){return this._frameTileGrids},o.getCurrentTimestamp=function(){return this._renderTimestamp||0},o._getTilesInCurrentFrame=function(){var a=this.getMap();this.map=a;var l=this.layer;l._spatialRef=l.getSpatialReference();var h=l._isPyramidMode()&&l.options.terrainTileMode,u=l.getTiles();if(this._frameTileGrids=u,u=u.tileGrids,!u||!u.length)return l._spatialRef=null,this.map=null,null;var c=u.reduce(function(ie,ne){return ie+(ne&&ne.tiles&&ne.tiles.length||0)},0);c>=this.tileCache.max/2&&this.tileCache.setMaxSize(c*2+1);var f=0,d=!1,g={},p=[],m=[],v={},_=[],y={},w=[],x={},C={},b=this.markTiles(),E=this._getLoadLimit(),T=u.length,S=this._tileZoom===void 0&&l.options.currentTilesFirst&&!this._terrainHelper;this._tileZoom=u[0].zoom;var B=null,L=null;h&&(B=[],L=new Map);for(var D=0;D<T;D++){var N=u[D],G=N.tiles,I=N.parents||cf,A=I.length,k=S?G:ry(I,G),Z=void 0;k.length&&(Z=this._generatePlaceHolder(k[0].res));for(var W=0,re=k.length;W<re;W++){var se=k[W];l._debugTile(se,"_getTilesInCurrentFrame");var me=se.id,ge=!S&&W<A,de=!1,_e=p.length;if(this._isLoadingTile(me))de=d=!0,this.markCurrent(this.tilesLoading[me],!0);else{var Te=this.getCachedTile(se,ge);if(Te)ge||(Te.image&&this.isTileFadingIn(Te.image)&&(de=d=!0,this.setToRedraw()),this.isTileComplete(Te)?p.push(Te):(de=!0,h&&L.set(me,Te)));else{de=d=!0;var Ge=E&&f+b[0]>E;if(!this._tileQueueIds.has(se.id)&&!Ge&&(!a.isInteracting()||a.isMoving()||a.isRotating())){f++;var Me=me;C[Me]=se}}}if(h&&!ge&&(p.length===_e?B.push(se):g[se.id]=1),!h&&!ge&&de&&!g[me]){g[me]=1,Z&&!x[me]&&(se.cache=!1,w.push({image:Z,info:se}),x[me]=1);var Be=this._findChildTiles(se);if(Be.length&&Be.forEach(function(ie){y[ie.info.id]||(_.push(ie),y[ie.info.id]=1)}),!Be.length||Be.length!==4){var lt=this._findParentTile(se);if(lt){var M=lt.info.id;v[M]===void 0&&(v[M]=m.length,m.push(lt))}}}}}var R=[];if(h)for(var V=0;V<B.length;V++){var q=B[V].info?B[V].info:B[V];if(!(!q.parent||g[q.id])){var{tiles:U,missedTiles:K}=this._findChildTiles(q);if(U.length){Yt(p,U),Yt(R,K);continue}else if(L.has(q.id)){p.push(L.get(q.id)),L.delete(q.id);continue}g[q.id]=1,R.push(q)}}return this.tileCache.shrink(),l._spatialRef=null,this.map=null,{childTiles:_,missedTiles:R,parentTiles:m,tiles:p,incompleteTiles:L&&Array.from(L.values()),placeholders:w,loading:d,loadingCount:f,tileQueue:C}},o.removeTileCache=function(a){delete this.tilesInView[a],this.tileCache.remove(a)},o.isTileCachedOrLoading=function(a){return this.tileCache.get(a)||this.tilesInView[a]||this.tilesLoading[a]},o.isTileCached=function(a){return!!(this.tileCache.get(a)||this.tilesInView[a])},o.isTileFadingIn=function(a){return this.getTileFadingOpacity(a)<1},o._drawTiles=function(a,l,h,u,c,f,d){l.length&&(l.sort(this._compareTiles),this._parentTiles=l),h.length&&(this._childTiles=h,this._childTiles.sort(this._compareTiles));var g=this.getMap(),p=g.getRenderer().canvas,m=!0,v=p._frameTileState;v||(v=p._frameTileState={timestamp:0,count:0}),(this.layer.constructor===gt||this.layer.constructor===$h)&&(this._renderTimestamp===v.timestamp&&v.count>g.options.tileBackgroundLimitPerFrame?m=!1:this._renderTimestamp!==v.timestamp?(v.timestamp=this._renderTimestamp,v.count=1):v.count++);var _={tiles:a,parentTiles:this._parentTiles,childTiles:this._childTiles,parentContext:c};if(this.onDrawTileStart(_,c),m&&this.layer.options.opacity===1){this.layer._silentConfig=!0;var y=this.layer.options.fadeAnimation;this.layer.options.fadeAnimation=!1,this._drawChildTiles(h,c),this._drawParentTiles(this._parentTiles,c),this.layer.options.fadeAnimation=y,this.layer._silentConfig=!1}this.drawingCurrentTiles=!0,a.sort(this._compareTiles);for(var w=0,x=a.length;w<x;w++)this._drawTileAndCache(a[w],c);if(delete this.drawingCurrentTiles,m&&this.layer.options.opacity<1){this.layer._silentConfig=!0;var C=this.layer.options.fadeAnimation;this.layer.options.fadeAnimation=!1,this._drawChildTiles(h,c),this._drawParentTiles(this._parentTiles,c),this.layer.options.fadeAnimation=C,this.layer._silentConfig=!1}this.onDrawTileEnd(_,c)},o._drawChildTiles=function(a,l){var h=this;this.drawingChildTiles=!0,a.forEach(function(u){return h._drawTile(u.info,u.image,l)}),delete this.drawingChildTiles},o._drawParentTiles=function(a,l){var h=this;this.drawingParentTiles=!0,a.forEach(function(u){return h._drawTile(u.info,u.image,l)}),delete this.drawingParentTiles},o.onDrawTileStart=function(a,l){},o.onDrawTileEnd=function(a,l){},o._drawTile=function(a,l,h){l&&this.drawTile(a,l,h)},o.drawTile=function(a,l,h){},o._drawTileAndCache=function(a,l){this.isValidCachedTile(a)&&(this.tilesInView[a.info.id]=a),this._drawTile(a.info,a.image,l)},o.drawOnInteracting=function(a,l,h){this.draw(l,h)},o.checkIfNeedRedraw=function(){return!!this._tileQueue.length},o.hitDetect=function(){return!1},o._getLoadLimit=function(){var a=this.map||this.getMap();return a.isInteracting()?this.layer.options.loadingLimitOnInteracting:this.layer.options.loadingLimit||0},o._isLoadingTile=function(a){return!!this.tilesLoading[a]},o.loadTileQueue=function(a){for(var l in a)if(a.hasOwnProperty(l)){var h=a[l],u=this.loadTile(h);u.loadTime===void 0&&(this.tilesLoading[h.id]={image:u,current:!0,info:h})}},o.loadTile=function(a){var l=this,h={};if(this.loadTileBitmap&&Oe(this.loadTileBitmap)){var u=function(g){l.onTileLoad(g,a)},c=function(g,p){l.onTileError(p,a,g)};this.loadTileBitmap(a.url,a,u,c)}else if(this._tileImageWorkerConn&&this.loadTileImage===this.constructor.prototype.loadTileImage)this._fetchImage(h,a);else{var f=this.layer.getTileSize(a.layer);h=new Image,h.width=f.width,h.height=f.height,h.onload=function(){Ce.decodeImageInWorker?createImageBitmap(h).then(function(d){l.onTileLoad(d,a)}).catch(function(d){console.error(d),l.onTileLoad(h,a)}):l.onTileLoad(h,a)},h.onerror=this.onTileError.bind(this,h,a),this.loadTileImage(h,a.url,a)}return h},o._fetchImage=function(a,l){var h=this;if(a instanceof Image)a.src=l.url;else{var{x:u,y:c}=l,f=Math.abs(u+c)%this._tileImageWorkerConn.workers.length;this._tileImageWorkerConn.fetchImage(l.url,f,function(d,g){d?h.onTileError(a,l,d):Hf(g,function(p){h.onTileLoad(p,l)})},this.layer.options.fetchOptions||{referrer:document.location.href,headers:{accept:"image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"}})}},o.loadTileImage=function(a,l,h){var u=this.layer.options.crossOrigin;return O(u)||(a.crossOrigin=u),Us(a,[l])},o.abortTileLoading=function(a,l){if(l&&l.id!==void 0&&this.removeTileLoading(l),!!a&&(a instanceof Image&&(a.onload=fm,a.onerror=fm,a.src=Ff),this.loadTileBitmap&&Oe(this.loadTileBitmap))){var h=l.url;this.loadTileBitmap(h,l,function(){},{command:"abortTile"})}},o.onTileLoad=function(a,l){this.removeTileLoading(l),this._tileQueue.push({tileInfo:l,tileData:a}),this._tileQueueIds.add(l.id),this.setToRedraw()},o.removeTileLoading=function(a){delete this.tilesLoading[a.id],this.setToRedraw()},o._consumeTileQueue=function(){for(var a=0,l=this.layer.options.tileLimitPerFrame,h=this._tileQueue;h.length&&(l<=0||a<l);){var{tileData:u,tileInfo:c}=h.shift();this._tileQueueIds.has(c.id)&&(this._tileQueueIds.delete(c.id),this.checkTileInQueue(u,c)&&(this.consumeTile(u,c),a++))}},o._computeAvgTileAltitude=function(){var a=0,l=0,h=0;for(var u in this.tilesInView){var c=this.tilesInView[u]&&this.tilesInView[u].info;c&&(a+=c.minAltitude||0,l+=c.maxAltitude||0,h++)}this.avgMinAltitude=a/h,this.avgMaxAltitude=l/h},o.checkTileInQueue=function(a,l){return!0},o.consumeTile=function(a,l){if(this.layer&&this.tilesInView){var h={tile:l,tileImage:a};a=h.tileImage,this.resetTileLoadTime(a),this.removeTileLoading(l),this._addTileToCache(l,a),this.layer.fire("tileload",h),this.setToRedraw()}},o.resetTileLoadTime=function(a){a.loadTime!==0&&(a.loadTime=He())},o.onTileError=function(a,l,h){if(this.layer){var u=this.layer.options.reloadErrorTileFunction;if(u){u.call(this,this.layer,this,l,a);return}var c=this.layer.options.errorUrl,f=!(a instanceof Image);if(c)if(a instanceof Image&&a.src!==c){a.src=c,this.removeTileLoading(l);return}else a=new Image,a.src=c;this.abortTileLoading(a,l),a.loadTime=0,f&&(a.fetchErrorTime=He()),this.removeTileLoading(l),this._addTileToCache(l,a),this.setToRedraw(),this.layer.fire("tileerror",{tile:l})}},o.getDebugInfo=function(a){var l=a.split("_"),h=l.length;return l[h-3]+"/"+l[h-2]+"/"+l[h-1]},o.findChildTiles=function(a){return this._findChildTiles(a)},o._findChildTiles=function(a){var l=this._getLayerOfTile(a.layer),h=l._isPyramidMode(),u=l&&l.options.terrainTileMode&&h;if(!l||!l.options.background&&!u||a.z>this.layer.getMaxZoom())return cf;var c=this.map||this.getMap(),f=[];if(h){if(!u){for(var d=2,g=a.x*2,p=a.y*2,m=a.z+1,v=[],_=0;_<2;_++)for(var y=0;y<2;y++)v.push(g+_,p+y,m);for(;v.length;){var w=v.pop(),x=v.pop(),C=v.pop(),b=l._getTileId(C,x,w,a.layer),E=w+1<=a.z+d,T=this.tileCache.getAndRemove(b);if(T){if(this.isValidCachedTile(T))f.push(T),this.tileCache.add(b,T);else if(E)for(var S=0;S<2;S++)for(var B=0;B<2;B++)v.push(C*2+S,x*2+B,w+1)}else if(E)for(var L=0;L<2;L++)for(var D=0;D<2;D++)v.push(C*2+L,x*2+D,w+1)}return f}var N;u&&(N=[]);for(var G=a.x*2,I=a.y*2,A=a.z+1,k=[],Z=0;Z<2;Z++)for(var W=0;W<2;W++){var re=G+Z,se=I+W,me=A,ge=l._getTileId(re,se,me,a.layer),de=this.tileCache.getAndRemove(ge);de&&this.isValidCachedTile(de)?(f.push(de),this.tileCache.add(ge,de),k.push(null)):k.push(ge)}if(f.length<4)for(var _e=0,Te=0;Te<2;Te++)for(var Ge=0;Ge<2;Ge++){var Me=k[_e++];if(Me){for(var Be=G+Te,lt=I+Ge,M=A,R=f.length,V=[],q=0;q<2;q++)for(var U=0;U<2;U++){var K=Be*2+q,ie=lt*2+U,ne=M+1,le=l._getTileId(K,ie,ne,a.layer),ee=this.tileCache.getAndRemove(le);ee&&this.isValidCachedTile(ee)?(f.push(ee),this.tileCache.add(le,ee),V.push(null)):V.push(le)}if(u&&f.length-R<4){var ye=l.tileInfoCache.get(Me)||l._createChildNode(a,Te,Ge,[0,0],Me);if(f.length-R===0)N.push(ye);else for(var ce=0,ve=0;ve<2;ve++)for(var be=0;be<2;be++){var Ie=V[ce++];if(Ie){var Fe=this.layer.tileInfoCache.get(Ie)||l._createChildNode(ye,ve,be,[0,0],Ie);N.push(Fe)}}}}}return u?{tiles:f,missedTiles:N}:f}for(var Re=1,ct=a.res,Qe=a.extent2d.getMin(),Tt=a.extent2d.getMax(),Lt=l._project(c._pointToPrjAtRes(Qe,ct,um),um),ut=l._project(c._pointToPrjAtRes(Tt,ct,cm),cm),sr=1;sr<Re;sr++)this._findChildTilesAt(f,Lt,ut,l,a.z+sr);return f},o._findChildTilesAt=function(a,l,h,u,c){var f=u._spatialRef||u.getSpatialReference(),d=u.getId(),g=f.getResolution(c);if(g)for(var p=u._getTileConfig(),m=p.getTileIndex(l,g),v=p.getTileIndex(h,g),_=Math.min(m.idx,v.idx),y=Math.max(m.idx,v.idx),w=Math.min(m.idy,v.idy),x=Math.max(m.idy,v.idy),C,b,E=_;E<y;E++)for(var T=w;T<x;T++)C=u._getTileId(E,T,c,d),b=this.tileCache.getAndRemove(C),b&&this.isValidCachedTile(b)&&(a.push(b),this.tileCache.add(C,b))},o.findParentTile=function(a,l){return this._findParentTile(a,l)},o._findParentTile=function(a,l){var h=this.map||this.getMap(),u=this._getLayerOfTile(a.layer);if(!u||!u.options.background&&!u.options.terrainTileMode)return null;var c=u.getMinZoom(),f=l||a.z-c;if(u._isPyramidMode()){for(var d=a.z-f,g=a.z-1;g>=d;g--){var p=a.z-g,m=Math.pow(2,p),v=Math.floor(a.x/m),_=Math.floor(a.y/m),y=void 0;g===a.z-1?y=a.parent:y=u._getTileId(v,_,g,a.layer);var w=this.tileCache.getAndRemove(y);if(w&&this.isValidCachedTile(w))return this.tileCache.add(y,w),w}return null}for(var x=u.getSpatialReference(),C=x.getZoomDirection(),b=a.res,E=a.extent2d.getCenter(),T=u._project(h._pointToPrjAtRes(E,b)),S=1;S<=f;S++){var B=a.z-C*S,L=x.getResolution(B);if(L){var D=u._getTileConfig().getTileIndex(T,L),N=u._getTileId(D.x,D.y,B,a.layer),G=this.tileCache.getAndRemove(N);if(G)return this.tileCache.add(N,G),G}}return null},o.isValidCachedTile=function(a){return!!a.image},o.isTileComplete=function(a){return!0},o._getLayerOfTile=function(a){return this.layer.getChildLayer?this.layer.getChildLayer(a):this.layer},o.getCachedTile=function(a,l){var h=a.id,u=this.tilesInView,c=this.tileCache.getAndRemove(h);if(c){l||(u[h]=c);var f=this.tilesLoading;if(f&&f[h]){this.markCurrent(f[h],!1);var{image:d,info:g}=f[h];this.abortTileLoading(d,g),delete f[h]}}else c=u[h];return c&&(c.current=!0,this.isValidCachedTile(c)&&this.tileCache.add(h,c)),c},o._addTileToCache=function(a,l){if(this.isValidCachedTile({info:a,image:l})){var h={image:l,info:a};this.tileCache.add(a.id,h)}},o.getTileOpacity=function(a,l){var h=this.getTileFadingOpacity(a);if(this.layer.getChildLayer){var u=this.layer.getLayer(l.layer);u&&(h*=u.options.opacity)}return h},o.getTileFadingOpacity=function(a){return!this.layer.options.fadeAnimation||!a.loadTime?1:Math.min(1,(He()-a.loadTime)/this.layer.options.fadeDuration)},o.clearTileCaches=function(){this.retireTiles(!0),this.tileCache.reset(),this.tilesInView={},this.tilesLoading={},this._tileQueue=[],this._tileQueueIds.clear(),this._parentTiles=[],this._childTiles=[]},o.removeTileCaches=function(){delete this.tileCache,delete this._tilePlaceHolder,delete this._tileZoom},o.markCurrent=function(a,l){a.current=l},o.markTiles=function(){var a=0,l=0;if(this.tilesLoading)for(var h in this.tilesLoading)this.markCurrent(this.tilesLoading[h],!1),a++;if(this.tilesInView)for(var u in this.tilesInView)this.markCurrent(this.tilesInView[u],!1),l++;return[a,l]},o.retireTiles=function(a){for(var l in this.tilesLoading){var h=this.tilesLoading[l];(a||!h.current)&&(h.image&&this.abortTileLoading(h.image,h.info),this.deleteTile(h),this.removeTileLoading(h.info))}for(var u in this.tilesInView){var c=this.tilesInView[u];c.current||(delete this.tilesInView[u],this.tileCache.has(u)||this.deleteTile(c))}},o.deleteTile=function(a){if(!(!a||!a.image)){var l=a.info.id;this._tileQueueIds.has(l)&&this._tileQueueIds.delete(l),a.image.close&&a.image.close(),a.image instanceof Image&&(a.image.onload=null,a.image.onerror=null);var h=this.layer;h&&h.fire("tiledelete",{tile:a.info,tileImage:a.image})}},o._generatePlaceHolder=function(a){var l=this.map||this.getMap(),h=this.layer.options.placeholder;if(!h||l.getPitch())return null;var u=this.layer.getTileSize(),c=a/l._getResolution(),f=this._tilePlaceHolder=this._tilePlaceHolder||J.createCanvas(1,1,l.CanvasClass);return f.width=u.width*c,f.height=u.height*c,Oe(h)?h(f):yO(f),f},o.setTerrainHelper=function(a){this._terrainHelper=a},o._validateTileImage=function(a){if(a)return!a.fetchErrorTime},e}(r);return t};function fm(){return!1}function yO(n){var r=n.getContext("2d"),t=n.width,i=n.height,e=t/16,o=i/16;r.beginPath();for(var s=0;s<16;s++)r.moveTo(0,s*o),r.lineTo(t,s*o),r.moveTo(s*e,0),r.lineTo(s*e,i);r.strokeStyle="rgba(180, 180, 180, 0.1)",r.lineWidth=1,r.stroke(),r.beginPath();for(var a=[[0,0],[t,0],[0,i],[t,i],[0,0],[0,i],[t,0],[t,i],[0,i/2],[t,i/2],[t/2,0],[t/2,i]],l=1;l<a.length;l+=2)r.moveTo(a[l-1][0],a[l-1][1]),r.lineTo(a[l][0],a[l][1]);r.lineWidth=1*4,r.stroke()}function wO(n,r){return Math.abs(this._tileZoom-n.info.z)-Math.abs(this._tileZoom-r.info.z)}var xO=new z(0,0),CO=new z(0,0),Uh=function(n){function r(i){var e;return e=n.call(this,i)||this,e.init(),e}Q(r,n);var t=r.prototype;return t._drawTiles=function(e,o,s,a,l,h,u){var c=this;o.length&&(o.sort(this._compareTiles),this._parentTiles=o),s.length&&(this._childTiles=s,this._childTiles.sort(this._compareTiles));var f=!0,d=this.canvas._parentTileTimestamp;(this.layer.constructor===gt||this.layer.constructor===$h)&&(this._renderTimestamp===d?f=!1:this.canvas._parentTileTimestamp=this._renderTimestamp);var g=this.layer.options.renderer==="gl"&&(!this.isGL||this.isGL()),p={tiles:e,parentTiles:this._parentTiles,childTiles:this._childTiles,parentContext:l};if(this.onDrawTileStart(p,l),f&&this.layer.options.opacity===1){this.layer._silentConfig=!0;var m=this.layer.options.fadeAnimation;this.layer.options.fadeAnimation=!1,g?(this._drawChildTiles(s,l),this._drawParentTiles(this._parentTiles,l)):(this._drawParentTiles(this._parentTiles,l),this._drawChildTiles(s,l)),this.layer.options.fadeAnimation=m,this.layer._silentConfig=!1}this.drawingCurrentTiles=!0,e.sort(this._compareTiles);for(var v=0,_=e.length;v<_;v++)this._drawTileAndCache(e[v],l);if(delete this.drawingCurrentTiles,f&&this.layer.options.opacity<1){this.layer._silentConfig=!0;var y=this.layer.options.fadeAnimation;this.layer.options.fadeAnimation=!1,g?(this._drawChildTiles(s,l),this._drawParentTiles(this._parentTiles,l)):(this._drawParentTiles(this._parentTiles,l),this._drawChildTiles(s,l)),this.layer.options.fadeAnimation=y,this.layer._silentConfig=!1}a.forEach(function(w){return c._drawTile(w.info,w.image,l)}),this.onDrawTileEnd(p,l)},t.needToRedraw=function(){var e=this.getMap();return this.checkIfNeedRedraw()?!0:e.getPitch()?n.prototype.needToRedraw.call(this):e.isRotating()||e.isZooming()?!0:e.isMoving()?!!this.layer.options.forceRenderOnMoving:n.prototype.needToRedraw.call(this)},t.isDrawable=function(){return this.getMap().getPitch()?(console&&console.warn("TileLayer with canvas renderer can't be pitched, use gl renderer ('renderer' : 'gl') instead."),this.clear(),!1):!0},t.clipCanvas=function(e){return n.prototype.clipCanvas.call(this,e)},t.clear=function(){this.clearTileCaches(),n.prototype.clear.call(this)},t.onRemove=function(){this.clear(),this.removeTileCaches(),n.prototype.onRemove.call(this)},t.drawTile=function(e,o,s){if(this._validateTileImage(o)){var a=this.getMap();if(a){var{extent2d:l,offset:h}=e,u=xO.set(l.xmin-h[0],l.ymax-h[1]),c=e.z,f=e.id,d=dt[a.id],g=d?d.zoom:a.getZoom(),p=this.context,m=a._pointAtResToContainerPoint(u,e.res,0,CO),v=d?d.bearing:a.getBearing(),_=v||g!==c,y=this.getTileOpacity(o,e),w=p.globalAlpha;y<1&&(p.globalAlpha=y),_||m._round();var x=m.x,C=m.y,b=e.extent2d.xmax-e.extent2d.xmin,E=e.extent2d.ymax-e.extent2d.ymin,T=this.layer,S=T?T.options.bufferPixel:0;if(_){p.save(),p.translate(x,C),v&&p.rotate(-v*Math.PI/180),b+=S,E+=S;var B=a._getResolution();if(B!==e.res){var L=e.res/B;p.scale(L,L)}x=C=0}if(J.image(p,o,x,C,b,E),this.layer.options.debug){var D=this.layer.options.debugOutline;p.save(),p.strokeStyle=D,p.fillStyle=D,p.font="20px monospace";var N=new z(x,C);J.rectangle(p,N,{width:b,height:E},1,0),J.fillText(p,this.getDebugInfo(f),N._add(32,E-14),D),J.drawCross(p,x+b/2,C+E/2,2,D),p.restore()}_&&p.restore(),p.globalAlpha!==w&&(p.globalAlpha=w),this.setCanvasUpdated()}}},r}(hw(Ra));gt.registerRenderer("canvas",Uh);var TO=new z(0,0),bO={properties:{}},Dd=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.isDrawable=function(){return!0},t.needToRedraw=function(){var e=this.getMap();return this.isGL()&&!e.getPitch()&&e.isZooming()&&!e.isMoving()&&!e.isRotating()?!0:n.prototype.needToRedraw.call(this)},t.onDrawTileStart=function(e,o){var s=this.gl;s.enable(s.DEPTH_TEST),s.depthFunc(s.LEQUAL),s.enable(s.POLYGON_OFFSET_FILL),s.enable(s.STENCIL_TEST),s.stencilOp(s.KEEP,s.KEEP,s.REPLACE);var a=!!this.layer.options.depthMask;if(s.depthMask(a),o&&o.renderTarget){var l=o.renderTarget.fbo;if(l){var h=o.renderTarget.getFramebuffer(l);s.bindFramebuffer(s.FRAMEBUFFER,h)}}},t.onDrawTileEnd=function(e,o){var s=this.gl;if(o&&o.renderTarget){var a=o.renderTarget.fbo;a&&s.bindFramebuffer(s.FRAMEBUFFER,null)}},t.drawTile=function(e,o,s){if(this._validateTileImage(o)&&!(s&&s.sceneFilter&&!s.sceneFilter(bO))){var a=this.getMap();if(!(!e||!a||!o)){var l=e._glScale=e._glScale||e.res/a.getGLRes(),h=e.extent2d.xmax-e.extent2d.xmin,u=e.extent2d.ymax-e.extent2d.ymin;if(e.cache!==!1&&this._bindGLBuffer(o,h,u),!this.isGL()){n.prototype.drawTile.call(this,e,o);return}var{extent2d:c,offset:f}=e,d=TO.set(c.xmin-f[0],e.extent2d.ymax-f[1]),g=d.x*l,p=d.y*l,m=this.layer.options.opacity;m=O(m)?1:m;var v=this.getTileOpacity(o,e)*m,_=null;this.layer.options.debug&&(_=this.getDebugInfo(e.id));var y=this.gl;y.stencilFunc(y.LEQUAL,Math.abs(this.getCurrentTileZoom()-e.z),255);var w=this.layer.getPolygonOffset(),x=this.drawingCurrentTiles?w:w+1;y.polygonOffset(x,x),this.drawGLImage(o,g,p,h,u,l,v,a._getResolution()!==e.res,_),this.getTileFadingOpacity(o)<1?this.setToRedraw():this.setCanvasUpdated()}}},t._bindGLBuffer=function(e,o,s){e.glBuffer||(e.glBuffer=this.bufferTileData(0,0,o,s))},t.loadTileImage=function(e,o){var s=this.layer.options.crossOrigin;e.crossOrigin=s!==null?s:"",e.src=o},t.onCanvasCreate=function(){(!this.canvas.gl||!this.canvas.gl.wrap)&&this.createCanvas2()},t.createContext=function(){n.prototype.createContext.call(this),this.createGLContext()},t.resizeCanvas=function(e){this.canvas&&(n.prototype.resizeCanvas.call(this,e),this.resizeGLCanvas())},t.clearCanvas=function(){this.canvas&&(n.prototype.clearCanvas.call(this),this.clearGLCanvas())},t.getCanvasImage=function(){if(!this.isGL()||!this.canvas2)return n.prototype.getCanvasImage.call(this);var e=n.prototype.getCanvasImage.call(this);return e&&(e.image=this.canvas2),e},t.isGL=function(){return!0},t.deleteTile=function(e){n.prototype.deleteTile.call(this,e),e&&e.image&&this.disposeImage(e.image),delete e.image},t.onRemove=function(){n.prototype.onRemove.call(this),this.removeGLCanvas()},r}(kd(Uh));gt.registerRenderer("gl",Dd);function uw(n){var r=this,t=this.layer.getTileSize(),i=this.canvas.constructor,e=this.getMap(),o=e.getDevicePixelRatio(),s=J.createCanvas(t.width*o,t.height*o,i);s.layer=this.layer;var a=new z(n.extent2d.xmin,n.extent2d.ymax),l=new Je(e.pointToCoordinate(a),e.pointToCoordinate(a.add(t.width,t.height)),e.getProjection());return this.layer.drawTile(s,{url:n.url,point:a,center:e.pointToCoordinate(a.add(t.width/2,t.height/2)),extent:l,z:n.z,x:n.x,y:n.y},function(h){if(h){r.onTileError(s,n);return}r.onTileLoad(s,n)}),s}var cw=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.loadTile=function(...e){return uw.apply(this,e)},r}(Uh),fw=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.loadTile=function(...e){return uw.apply(this,e)},r}(Dd);Od.registerRenderer("canvas",cw);Od.registerRenderer("gl",fw);var MO=typeof Int8Array<"u"?new Int8Array([-1,1,0,-1,-1,0,1,1,0,1,-1,0]):[],PO=`
|
|
320
|
-
attribute vec3 a_position;
|
|
321
|
-
uniform mat4 transform;
|
|
322
|
-
|
|
323
|
-
void main()
|
|
324
|
-
{
|
|
325
|
-
gl_Position = transform * vec4(a_position, 1.0);
|
|
326
|
-
}
|
|
327
|
-
`,EO=`
|
|
328
|
-
precision mediump float;
|
|
329
|
-
uniform vec3 color;
|
|
330
|
-
void main()
|
|
331
|
-
{
|
|
332
|
-
gl_FragColor = vec4(color, 1.0);
|
|
333
|
-
}
|
|
334
|
-
`,SO=function(){function n(t,i,e){this.gl=t,this.quadVertices=i||MO,this.attributes=["a_position",3,OO(i)],this.debug=e}var r=n.prototype;return r.start=function(){var i=this.gl;i.enable(i.STENCIL_TEST),i.stencilMask(255),i.stencilOp(i.KEEP,i.REPLACE,i.REPLACE),i.depthMask(!1),this._save(),this.buffer||(this._createBuffer(),this._createProgram()),i.useProgram(this.program),i.bindBuffer(i.ARRAY_BUFFER,this.buffer),nw(i,this.program,this.attributes),this.transformLoc||(this.transformLoc=i.getUniformLocation(this.program,"transform")),this.colorLoc||(this.colorLoc=i.getUniformLocation(this.program,"color")),!this.debug&&i.colorMask(!1,!1,!1,!1)},r.end=function(){var i=this.gl;i.depthMask(!0),this._restore(),!this.debug&&i.colorMask(!0,!0,!0,!0)},r.draw=function(i){var e=this.gl;e.uniformMatrix4fv(this.transformLoc,!1,i),e.uniform3fv(this.colorLoc,[Math.random(),Math.random(),Math.random()]),e.drawArrays(e.TRIANGLE_STRIP,0,4)},r.remove=function(){var i=this.gl;return this.buffer&&i.deleteBuffer(this.buffer),this.program&&(i.deleteShader(this.program.fragmentShader),i.deleteShader(this.program.vertexShader),i.deleteProgram(this.program)),delete this.transformLoc,delete this.gl,this},r.stencilMask=function(i){return this.gl.stencilMask(i),this},r.stencilFunc=function(i,e,o){return this.ref=e,this.gl.stencilFunc(i,e,o),this},r.stencilOp=function(i,e,o){return this.gl.stencilOp(i,e,o),this},r.resetFunc=function(){return this.ref=1,this.gl.stencilFunc(this.gl.ALWAYS,1,255),this},r._save=function(){var i=this.gl;this._savedProgram=i.program},r._restore=function(){var i=this.gl;i.program=this._savedProgram,i.program&&i.useProgram(i.program)},r._createBuffer=function(){var i=this.gl;if(this.buffer=i.createBuffer(),!this.buffer)throw new Error("Failed to create the buffer object");i.bindBuffer(i.ARRAY_BUFFER,this.buffer),i.bufferData(i.ARRAY_BUFFER,this.quadVertices,i.STATIC_DRAW)},r._createProgram=function(){var{program:i,vertexShader:e,fragmentShader:o}=iw(this.gl,PO,EO);i.vertexShader=e,i.fragmentShader=o,this.program=i},n}();function OO(n){return n instanceof Float32Array?"FLOAT":n instanceof Int16Array?"SHORT":n instanceof Uint16Array?"UNSIGNED_SHORT":n instanceof Int8Array?"BYTE":n instanceof Uint8Array||n instanceof Uint8ClampedArray?"UNSIGNED_BYTE":"FLOAT"}var dw=function(r){var t=function(i){function e(){return i.apply(this,arguments)||this}Q(e,i);var o=e.prototype;return o.checkResources=function(){var a=this._geosToCheck||[];if(!this._resourceChecked&&this.layer._geoList&&Yt(a,this.layer._geoList),!$e(a))return[];for(var l=[],h={},u=a.length-1;u>=0;u--){var c=a[u],f=c._getExternalResources();if(f.length)if(!this.resources)l.push(...f);else for(var d=0;d<f.length;d++){var g=f[d][0];!this.resources.isResourceLoaded(f[d])&&!h[g]&&(l.push(f[d]),h[g]=1)}}return this._resourceChecked=!0,delete this._geosToCheck,l},o._addGeoToCheckRes=function(a){a&&(Array.isArray(a)||(a=[a]),this._geosToCheck||(this._geosToCheck=[]),Yt(this._geosToCheck,a))},o.onGeometryAdd=function(a){this._addGeoToCheckRes(a),_i(this)},o.onGeometryRemove=function(a){this.layer.fire("removegeo",{type:"removegeo",target:this,geometries:a}),_i(this)},o.onGeometrySymbolChange=function(a){this._addGeoToCheckRes(a.target),_i(this)},o.onGeometryShapeChange=function(a){_i(this)},o.onGeometryPositionChange=function(a){_i(this)},o.onGeometryZIndexChange=function(a){_i(this)},o.onGeometryShow=function(a){_i(this)},o.onGeometryHide=function(a){_i(this)},o.onGeometryPropertiesChange=function(a){_i(this)},e}(r);return t},zd=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.render=function(...e){return this.layer._sortGeometries(),n.prototype.render.apply(this,e)},r}(dw(Ra)),kO=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.render=function(...e){return this.layer._sortGeometries(),n.prototype.render.apply(this,e)},r}(dw(jh));function _i(n){n instanceof zd&&n.layer.options.drawImmediate&&n.render(),n.setToRedraw()}var RO=new Le,hl=[],vc=new Le,AO="center";function dm(n){if(!n)return null;var r=n.getContext("2d");return r.clearRect(0,0,n.width,n.height),r}function hs(n){return n&&n.options.progressiveRender&&n.options.progressiveRenderDebug}var gw=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.setToRedraw=function(){return n.prototype.setToRedraw.call(this),this._resetProgressiveRender(),this},t._geoIsCollision=function(e,o){if(!e)return!1;var s=e.options.collision;if(!s)return!1;if(e.isPoint&&e.getContainerExtent){e.bbox||(e.bbox=[0,0,0,0]);var a=this.layer.options.collisionBufferSize,l=e.getContainerExtent();if(!l)return!1;if(e.bbox[0]=l.xmin-a,e.bbox[1]=l.ymin-a,e.bbox[2]=l.xmax+a,e.bbox[3]=l.ymax+a,o.collides(e.bbox))return e._collided=!0,!0;o.insertBox(e.bbox)}return!1},t.getImageData=function(){if(!this._lastRenderTime||He()-this._lastRenderTime<32||!this.context||!this.context.canvas)return null;if(!this._imageData){var{width:e,height:o}=this.context.canvas;try{var s=this.screenshotRenderResult(0,0,e,o);s&&(this._imageData=s.getImageData(0,0,e,o))}catch(a){console.warn(`hit detect failed with tainted canvas, some geometries have external resources in another domain:
|
|
335
|
-
`,a)}}return this._imageData},t.clearImageData=function(){this._imageData=null,delete this._imageData,this._lastRenderTime=He()},t.checkResources=function(...e){var o=this,s=n.prototype.checkResources.apply(this,e),a=this.layer.getStyle();return a&&(Array.isArray(a)||(a=[a]),a.forEach(function(l){for(var h=ba(l.symbol,!0),u=0,c=h.length;u<c;u++)o.resources.isResourceLoaded(h[u])||s.push(h[u])})),s},t.needToRedraw=function(){if(this.isProgressiveRender()&&!this.renderEnd)return!0;var e=this.getMap();return e.isInteracting()&&this.layer.options.enableAltitude?!0:e.isZooming()&&!e.isRotating()&&!e.getPitch()&&!this._hasPoint&&this.layer.constructor===Lr?!1:n.prototype.needToRedraw.call(this)},t.draw=function(){if(this.getMap()){if(!this.layer.isVisible()||this.layer.isEmpty()){this.clearCanvas(),this.completeRender();return}this.prepareCanvas(),this.drawGeos(),this.completeRender()}},t.isBlank=function(){return!this.context||this.isProgressiveRender()?!1:!this.context.canvas._drawn},t.drawOnInteracting=function(){if(this._geosToDraw){this._updateMapStateCache(),this._updateDisplayExtent();var e=this.getMap(),o=this.layer.getCount(),s=this.mapStateCache.resolution;(e.isZooming()&&e.options.seamlessZoom&&this._drawnRes!==void 0&&s>this._drawnRes*1.5&&this._geosToDraw.length<o||e.isMoving()||e.isInteracting())&&(this.prepareToDraw(),this._batchConversionMarkers(this.mapStateCache.glRes),this._onlyHasPoint||this._checkGeos(),this._drawnRes=s),this._sortByDistanceToCamera(e.cameraPosition);var{collision:a,collisionDelay:l}=this.layer.options;if(a){var h=He();this._lastCollisionTime||(this._lastCollisionTime=h),h-this._lastCollisionTime<=l?this._geosToDraw=this._lastGeosToDraw||this._geosToDraw:(this._collidesGeos(),this._lastCollisionTime=h)}for(var u=0,c=this._geosToDraw.length;u<c;u++){var f=this._geosToDraw[u];if(!f._isCheck&&!f.isVisible()){delete f._cPoint,delete f._inCurrentView;continue}f._paint(this._displayExtent),this._geosToDraw[u]._cPoint=void 0,this._geosToDraw[u]._inCurrentView=void 0}this.clearImageData(),this._lastGeosToDraw=this._geosToDraw,hs(this.layer)&&console.log("progressiveRender on drawOnInteracting page:",this.page)}},t.show=function(...e){this.layer.forEach(function(o){o._repaint()}),n.prototype.show.apply(this,e)},t.forEachGeo=function(e,o){this.layer.forEach(e,o)},t._checkGeos=function(){for(var e=this.getCurrentNeedRenderGeos(),o=0,s=e.length;o<s;o++)this.checkGeo(e[o]);return this},t.drawGeos=function(){this._drawSnapshot(),this._updateMapStateCache(),this._drawnRes=this.mapStateCache.resolution,this._updateDisplayExtent(),this.prepareToDraw(),this._batchConversionMarkers(this.mapStateCache.glRes),this._onlyHasPoint||this._checkGeos(),this._sortByDistanceToCamera(this.getMap().cameraPosition),this._collidesGeos();for(var e=0,o=this._geosToDraw.length;e<o;e++)this._geosToDraw[e]._paint(),this._geosToDraw[e]._cPoint=void 0,this._geosToDraw[e]._inCurrentView=void 0;this.clearImageData(),this._lastGeosToDraw=this._geosToDraw,hs(this.layer)&&console.log("progressiveRender drawGeos page:",this.page),this._snapshot(),this._setDrawGeosDrawTime()},t.prepareToDraw=function(){return this.layer._drawTime=He(),this._hasPoint=!1,this._geosToDraw=[],this},t._setDrawGeosDrawTime=function(){for(var e=He(),o=this.layer._drawTime,s=this.getGeoPainterList(),a=0,l=s.length;a<l;a++){var h=s[a];h&&h._setDrawTime&&h._setDrawTime(o)}return hs(this.layer)&&console.log("_setDrawGeosDrawTime time:",He()-e+"ms"),this},t.checkGeo=function(e){if(e.isPoint&&this._onlyHasPoint!==void 0){(e._inCurrentView||e.hasAltitude())&&(this._hasPoint=!0,e._isCheck=!0,this._geosToDraw.push(e));return}if(e._isCheck=!1,!(!e||!e.isVisible()||!e.getMap()||!e.getLayer()||!e.getLayer().isCanvasRender())){var o=e._getPainter();if(o){var s=!0;if(e._inCurrentView||!O(e.options.arcDegree)||e.hasAltitude())s=!0;else if(e._inCurrentView===!1)s=!1;else{var a=o.get2DExtent(this.resources,RO);(!a||!a.intersects(this._displayExtent))&&(s=!1)}s&&(o.hasPoint()&&(this._hasPoint=!0),e._isCheck=!0,this._geosToDraw.push(e))}}},t._collidesGeos=function(){var e=this._geosToDraw,o=this.layer.options.collision;if(!o){for(var s=0,a=e.length;s<a;s++){var l=e[s];l.isPoint&&(l._collided=!1)}return this}var h=this.layer.options.collisionScope,u=this.layer.getCollisionIndex();h==="layer"&&u.clear(),this._geosToDraw=[];for(var c=0,f=e.length;c<f;c++){var d=e[c];if(d.isPoint&&(d._collided=!1,this._geoIsCollision(d,u))){d._collided=!0;continue}this._geosToDraw.push(e[c])}return this},t.onZoomEnd=function(...e){delete this.canvasExtent2D,n.prototype.onZoomEnd.apply(this,e)},t.onRemove=function(){this.forEachGeo(function(e){e.onHide()}),delete this._geosToDraw,delete this.snapshotCanvas,delete this.pageGeos,delete this.geoPainterList},t.onGeometryPropertiesChange=function(e){e&&this.layer._styleGeometry(e.target),n.prototype.onGeometryPropertiesChange.call(this,e)},t._updateDisplayExtent=function(){var e=this.canvasExtent2D;if(this._maskExtent){if(!this._maskExtent.intersects(e)){this.completeRender();return}e=e.intersection(this._maskExtent)}this._displayExtent=e},t.identifyAtPoint=function(e,o={}){var s=this.getGeosForIdentify();return s?this.layer._hitGeos(s,e,o):[]},t._updateMapStateCache=function(){var e=this.getMap(),o=e._pointToContainerPoint(this.middleWest)._add(0,-e.height/2),s=e.getResolution(),a=e.getPitch(),l=e.getBearing(),h=e.getGLScale(),u=e.getGLRes(),c=e.getContainerExtent(),f=e.get2DExtent(),d=e.get2DExtentAtRes(u);return this.mapStateCache={resolution:s,pitch:a,bearing:l,glScale:h,glRes:u,_2DExtent:f,glExtent:d,containerExtent:c,offset:o},this},t._batchConversionMarkers=function(e){if(this._onlyHasPoint=void 0,!this._constructorIsThis())return[];var o=[],s=[],a=[],l={},h=this.layer,u=h.options,c=h.getAltitude?h.getAltitude():0,f=h.isCanvasRender();this._onlyHasPoint=!0;for(var d=0,g=this.getCurrentNeedRenderGeos(),p=0,m=g.length;p<m;p++){var v=g[p];if(v.isPoint){var _=v._painter;_||(_=v._getPainter());var y=_.getRenderPoints(AO)[0][0],w=u.enableAltitude?v._getAltitude():c;l[w]===void 0&&(l[w]=_.getAltitude()),o[d]=y,a[d]=l[w],s[d]=v,d++}else this._onlyHasPoint=!1}if(d===0)return[];var x=this.getMap(),C=Xs(o,"_pt");C=x._pointsAtResToContainerPoints(o,e,a,C);for(var b=x.getContainerExtent(),{xmax:E,ymax:T,xmin:S,ymin:B}=b,L={},D=0,N=s.length;D<N;D++){var G=s[D];if(G._cPoint=C[D],!G._cPoint){G._inCurrentView=!1;continue}var{x:I,y:A}=C[D];if(G._inCurrentView=I>=S&&A>=B&&I<=E&&A<=T||G.hasAltitude(),!G._inCurrentView){var k=G.getSymbolHash(),Z=void 0;k?Z=L[k]=L[k]||G._painter.getFixedExtent():Z=G._painter.getFixedExtent(),vc.set(Z.xmin,Z.ymin,Z.xmax,Z.ymax),vc._add(C[D]),G._inCurrentView=vc.intersects(b)}G._inCurrentView&&((!G.isVisible()||!f)&&(G._inCurrentView=!1),this._onlyHasPoint&&G._inCurrentView&&(this._hasPoint=!0,G._isCheck=!0,this._geosToDraw.push(G)))}return C},t._sortByDistanceToCamera=function(e){if(this.layer.options.sortByDistanceToCamera&&this._geosToDraw.length){var o=this.getMap(),s=o.distanceToPoint(1e3,0,o.getGLScale()).x,a=s/1e3,l="center";this._geosToDraw.sort(function(h,u){if(!h.isPoint||!u.isPoint)return 0;var c=h._painter,f=u._painter;if(!c||!f)return 0;var d=c.getRenderPoints(l)[0][0],g=f.getRenderPoints(l)[0][0],p=c.getAltitude()*a,m=f.getAltitude()*a;jt(hl,d.x,d.y,p);var v=Xc(hl,e);jt(hl,g.x,g.y,m);var _=Xc(hl,e);return _-v})}},t._constructorIsThis=function(){return this.constructor===r},t.isProgressiveRender=function(){var e=this.layer;if(!e)return!1;var{progressiveRender:o,collision:s}=e.options||{};return s?!1:o},t.getGeosForIdentify=function(){return this.isProgressiveRender()?this.pageGeos||[]:this._geosToDraw||[]},t.getGeoPainterList=function(){if(!this.isProgressiveRender()){for(var e=[],o=this._geosToDraw||[],s=0,a=o.length;s<a;s++)e.push(o[s]._painter);return e}return this.geoPainterList||[]},t._checkSnapshotCanvas=function(){if(!this.isProgressiveRender())return delete this.snapshotCanvas,null;var e=this.canvas;if(!e)return delete this.snapshotCanvas,null;this.snapshotCanvas||(this.snapshotCanvas=J.createCanvas(1,1));var o=this.snapshotCanvas,{width:s,height:a,style:l}=e;return(o.width!==s||o.height!==a)&&(o.width=s,o.height=a),(o.style.width!==l.width||o.style.height!==l.height)&&(o.style.width=l.width,o.style.height=l.height),o},t._getCurrentNeedRenderGeos=function(){var e=this.layer._geoList||[];if(!this.isProgressiveRender())return e;var o=this.layer,{progressiveRenderCount:s}=o.options,a=s,l=this.page,h=(l-1)*a,u=l*a,c=e.slice(h,u);return c},t.getCurrentNeedRenderGeos=function(){return this._getCurrentNeedRenderGeos()},t._resetProgressiveRender=function(){hs(this.layer)&&console.log("progressiveRender resetProgressiveRender"),this.renderEnd=!1,this.page=1,this.pageGeos=[],this.geoPainterList=[],this.maxTolerance=0,this._clearSnapshotCanvas()},t._clearSnapshotCanvas=function(){var e=this._checkSnapshotCanvas();e&&dm(e)},t._snapshot=function(){for(var e=this.isProgressiveRender(),o=this._geosToDraw||[],s=0,a=o.length;s<a;s++){var l=o[s],h=l._hitTestTolerance()||0;if(this.maxTolerance=Math.max(this.maxTolerance,h),e){this.pageGeos.push(l);var u=l._painter;this.geoPainterList.push(u)}}if(!e)return this;var c=He(),f=this._checkSnapshotCanvas();if(f&&this.canvas){var d=dm(f);d.drawImage(this.canvas,0,0)}var g=this.layer,{progressiveRenderCount:p}=g.options,m=g._geoList||[],v=Math.ceil(m.length/p);return this.renderEnd=this.page>=v,this.renderEnd&&this._setDrawGeosDrawTime(),hs(this.layer)&&console.log("snapshot time:",He()-c+"ms"),this.renderEnd||this.page++,this},t._drawSnapshot=function(){if(!this.isProgressiveRender())return this;var{snapshotCanvas:e,context:o}=this;if(!e||!o)return this;var s=this.getMap();if(!s)return this;var a=this.mapDPR||s.getDevicePixelRatio()||1,l=1/a;return this._canvasContextScale(o,l),o.drawImage(e,0,0),this._canvasContextScale(o,a),this},r}(zd);Lr.registerRenderer("canvas",gw);var pw=function(n){function r(i){var e;return e=n.call(this)||this,e.map=i,e._handlerQueue=[],e._thisDocVisibilitychange=e._onDocVisibilitychange.bind(e),e._thisDocDragStart=e._onDocDragStart.bind(e),e._thisDocDragEnd=e._onDocDragEnd.bind(e),e._thisDocDPRChange=e._onDocDPRChange.bind(e),e}Q(r,n);var t=r.prototype;return t._getAllLayerToRender=function(){return this.map._getLayers()},t.setToRedraw=function(){for(var e=this._getAllLayerToRender(),o=0,s=e.length;o<s;o++){var a=e[o].getRenderer();a&&a.canvas&&a.setToRedraw&&a.setToRedraw()}},t.callInNextFrame=function(e){this._handlerQueue.push(e)},t.executeFrameCallbacks=function(){var e=this._handlerQueue;this._handlerQueue=[];for(var o=0,s=e.length;o<s;o++)e[o]()},t.offsetPlatform=function(e,o){if(!this.map.getPanels().front)return this;if(!o&&e.x===0&&e.y===0)return this;var s=this.map.getPanels(),a=this._frontCount=s.back.layerDOM.childElementCount,l=this._backCount=s.front.layerDOM.childElementCount,h=this._uiCount=s.front.uiDOM.childElementCount;if(a||l||h){var u=this.map.offsetPlatform();e?u=u.add(e)._round():u=u.round(),l&&ja(s.back,u),(a||h)&&ja(s.front,u)}return this},t.domChanged=function(){var e=this.map.getPanels();if(!e.front)return!1;var o=e.back.layerDOM.childElementCount;if(this._frontCount===void 0||this._frontCount!==o)return!0;var s=e.front.layerDOM.childElementCount;if(this._backCount===void 0||this._backCount!==s)return!0;var a=e.front.uiDOM.childElementCount;return this._uiCount===void 0||this._uiCount!==a},t.resetContainer=function(){if(this.map&&(this.map._resetMapViewPoint(),this.map.getPanels().front)){var e=new z(0,0);ja(this.map.getPanels().back,e),ja(this.map.getPanels().front,e)}},t.onZoomEnd=function(){this.resetContainer()},t._onDocVisibilitychange=function(){document.visibilityState==="visible"&&this.setToRedraw()},t._getWrapPanel=function(){if(!this.map)return null;var e=this.map.getPanels();return e&&e.mapWrapper},t._onDocDragStart=function(){var e=this._getWrapPanel();e&&(e.style.overflow="visible")},t._onDocDragEnd=function(){var e=this._getWrapPanel();e&&(e.style.overflow="hidden")},t._onDocDPRChange=function(){var e=this.map;if(!(!e||!e.options||e.options.devicePixelRatio||!e.checkSize||!e.getRenderer)){var o=e.getRenderer();o&&e.checkSize(!0)}},t._containerIsOffscreen=function(){var e=this,o=this.map.getContainer();if(!o)return!0;if(!o._resizeObserver){var s=new ResizeObserver(function(l){var{clientWidth:h,clientHeight:u}=l[0].target;e._containerClientWidth=h,e._containerClientHeight=u});s.observe(o),o._resizeObserver=s}if(!o.style||o.style.display==="none")return!0;var a=Math.min(this._containerClientWidth,this._containerClientHeight);return a<=0},r}(br);function LO(n,r,t,i){function e(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{h(i.next(u))}catch(c){s(c)}}function l(u){try{h(i.throw(u))}catch(c){s(c)}}function h(u){u.done?o(u.value):e(u.value).then(a,l)}h((i=i.apply(n,[])).next())})}var IO=new Go,vw=function(n){function r(i){var e;return e=n.call(this,i)||this,e.ready=!1,e._containerIsCanvas=!!i.getContainer().getContext,e._registerEvents(),e._loopTime=0,e._resizeEventList=[],e._resizeTime=-1/0,e._frameCycleRenderCount=0,e}Q(r,n);var t=r.prototype;return t.load=function(){this.initContainer()},t._updateMapCurrentViewGLInfo=function(){var e=this.map;if(!e)return this;e._currentViewGLInfo=null;var o=e.getContainerExtent();if(!o)return this;var s=100,{xmin:a,ymin:l,xmax:h,ymax:u}=o,c=new z(a,l),f=new z(h,l),d=new z(h+s,u+s),g=new z(a-s,u+s),p=e._getResolution()/e.getGLRes(),m=[c,f,d,g].map(function(A){return e._containerPointToPoint(A)._multi(p)}),v=m[2],_=m[3];m=m.sort(function(A,k){return k.y-A.y});var[y,w,x,C]=m,b,E,T,S;y.x<w.x?(b=y,T=w):(b=w,T=y),x.x<C.x?(E=x,S=C):(E=C,S=x);var B=ur();Ii(m,B);var[L,D,N,G]=B,I=new z((L+N)/2,(D+G)/2);e._currentViewGLInfo={lt:b,rt:T,rb:S,lb:E,center:I,RB:v,LB:_}},t._updateMapStateCache=function(){var e=this.map;return e?(kb(e),this):this},t.renderFrame=function(e){this._updateMapStateCache(),this._updateMapCurrentViewGLInfo();var o=this.map;if(!o||!o.options.renderable||(this._handleResizeEventList(e),o.options.stopRenderOnOffscreen&&this._containerIsOffscreen()))return!1;this._updateDomPosition(e),delete this._isViewChanged,o._fireEvent("framestart"),this.updateMapDOM(),o.clearCollisionIndex();var s=this._getAllLayerToRender(),a=this.drawLayers(s,e);return a&&this.drawTops(),o._fireEvent("frameend"),this._recordView(),this._mapview=this._getMapView(),delete this._spatialRefChanged,this._fireLayerLoadEvents(s),this.executeFrameCallbacks(),o.uiCollides(),!0},t.getFrameTimestamp=function(){return this._frameTimestamp||0},t.updateMapDOM=function(){var e=this.map;if(!e.isZooming()){var o=e.getViewPointFrameOffset();o?e.offsetPlatform(o):this.domChanged()&&this.offsetPlatform(null,!0)}},t.checkIfNeedToRedrawLayers=function(e){if(this.isSpatialReferenceChanged())return!0;for(var o=0,s=e.length;o<s;o++)if(this._checkLayerRedraw(e[o]))return!0;return!1},t.drawLayers=function(e,o){var s=this.checkIfNeedToRedrawLayers(e);if(!s&&!this.map.options.forceRedrawPerFrame)return!1;this.clearCanvas();for(var a=this.map,l=a.isInteracting(),h=e.length,u=0;u<h;u++){var c=e[u];if(c.isVisible()){var f=c.isCanvasRender(),d=c._getRenderer();d&&(f&&this.clearLayerCanvasContext(c),l&&f?this._drawCanvasLayerOnInteracting(c,0,0,o):l&&d.drawOnInteracting?(d.prepareRender&&d.prepareRender(),d.checkAndDraw?d.checkAndDraw(d.drawOnInteracting,this._eventParam,o):d.drawOnInteracting(this._eventParam,o)):d.render(o))}}return a._fireEvent("renderend",{context:this.context}),!0},t._checkLayerRedraw=function(e){if(this.isSpatialReferenceChanged())return!0;var o=this.map,s=e._getRenderer();return s?e.isCanvasRender()?s.testIfNeedRedraw():s.needToRedraw&&s.needToRedraw()?!0:o.isInteracting()||this.isViewChanged():!1},t._drawCanvasLayerOnInteracting=function(e,o,s,a){var l=e._getRenderer();if(l.mustRenderOnInteracting&&l.mustRenderOnInteracting())l.render(a);else if(l.drawOnInteracting){l.prepareRender();var h=l.prepareCanvas();return l.checkAndDraw?l.checkAndDraw(l.drawOnInteracting,this._eventParam,a):l.drawOnInteracting(this._eventParam,a),h}return null},t._fireLayerLoadEvents=function(e){for(var o=e.length-1;o>=0;o--){var s=e[o],a=s._getRenderer();!a||a.isRenderComplete&&!a.isRenderComplete()||s.fire("layerload")}},t.updateMapSize=function(e){if(!(!e||this._containerIsCanvas)){var o=e.width+"px",s=e.height+"px",a=this.map.getPanels();a.mapWrapper.style.width=o,a.mapWrapper.style.height=s,this._updateCanvasSize()}},t.getMainPanel=function(){return this.map?this._containerIsCanvas?this.map.getContainer():this.map.getPanels()?this.map.getPanels().mapWrapper:null:null},t.toDataURL=function(e,o){return this.canvas?this.canvas.toDataURL(e,o):null},t.remove=function(){Ce.webgl&&typeof document<"u"&&(Sr.off(ef,this._thisDocDPRChange,this),Sr.off(tf,this._thisDocVisibilitychange,this),Sr.off(rf,this._thisDocDragStart,this),Sr.off(nf,this._thisDocDragEnd,this)),this._resizeInterval&&clearInterval(this._resizeInterval),this._resizeObserver&&this._resizeObserver.disconnect(),delete this.canvas,delete this.map,delete this._spatialRefChanged,this._cancelFrameLoop()},t.hitDetect=function(e){var o=this.map;if(!(!o||!o.options.hitDetect||o.isInteracting())){var s=o._getLayers(),a="default",l=o.options.hitDetectLimit||0,h=0;e&&e._round&&e._round();for(var u=s.length-1;u>=0;u--){var c=s[u];if(!(!c.options.hitDetect||c.isEmpty&&c.isEmpty()||!c.options.geometryEvents)){var f=c._getRenderer();if(!(!f||!f.hitDetect)&&!(f.isBlank&&f.isBlank())){if(c.options.cursor!=="default"&&f.hitDetect(e)){a=c.options.cursor||"pointer";break}if(h++,l>0&&h>l)break}}}o._trySetCursor(a)}},t.initContainer=function(){var e=this.map.getPanels();function o(w,x,C,b){var E=we("div",x);return C&&(E.style.cssText=C),e[w]=E,b||eb(E),E}var s=this.map.getContainer();if(this._containerIsCanvas){this.createCanvas();return}s.innerHTML="";var a="position:absolute;top:0px;left:0px;",l=o("mapWrapper","maptalks-wrapper","position:absolute;overflow:hidden;",!0),h=o("allLayers","maptalks-all-layers",a+"padding:0px;margin:0px;z-index:0;overflow:visible;",!0),u=o("backStatic","maptalks-back-static",a+"z-index:0;",!0),c=o("back","maptalks-back",a+"z-index:1;"),f=o("backLayer","maptalks-back-layer",a),d=o("canvasContainer","maptalks-canvas-layer",a+"border:none;z-index:2;"),g=o("frontStatic","maptalks-front-static",a+"z-index:3;",!0),p=o("front","maptalks-front",a+"z-index:4;",!0),m=o("frontLayer","maptalks-front-layer",a+"z-index:0;"),v=o("ui","maptalks-ui",a+"border:none;z-index:1;",!0),_=o("control","maptalks-control","z-index:1",!0);s.appendChild(l),h.appendChild(u),c.appendChild(f),c.layerDOM=f,h.appendChild(c),h.appendChild(d),p.appendChild(m),p.layerDOM=m,p.uiDOM=v,h.appendChild(g),h.appendChild(p),p.appendChild(v),l.appendChild(h),l.appendChild(_),this.createCanvas(),this.resetContainer();var y=this.map._getContainerDomSize();this.updateMapSize(y)},t.isViewChanged=function(){if(this._isViewChanged!==void 0)return this._isViewChanged;var e=this._mapview,o=this._getMapView();return this._isViewChanged=!e||!Fl(e,o),this._isViewChanged},t._recordView=function(){var e=this.map;!e._onViewChange||e.isInteracting()||e.isAnimating()||Fl(e.getView(),e._getCurrentView())||e._onViewChange(e.getView())},t.isSpatialReferenceChanged=function(){return this._spatialRefChanged},t._getMapView=function(){var e=this.map,o=e._getPrjCenter();return{x:o.x,y:o.y,zoom:e.getZoom(),pitch:e.getPitch(),bearing:e.getBearing(),width:e.width,height:e.height}},t._lockFrameRenderEnable=function(){var{maxFPS:e}=this.map.options||{};if(e<=0||wr.maxFPS<=e)return!0;var o=Math.ceil(wr.maxFPS/e);return this._frameCycleRenderCount>=o},t.onLoad=function(){this._frameLoop(0)},t._frameLoop=function(e){if(!this.map){this._cancelFrameLoop();return}if(this._bindFrameLoop||(this._bindFrameLoop=this._frameLoop.bind(this)),!this.ready){this._animationFrame=ai(this._bindFrameLoop);return}this._frameCycleRenderCount++,this._lockFrameRenderEnable()?(e=e||0,this._frameTimestamp=e,this._resizeCount=0,this.renderFrame(e),this._frameCycleRenderCount=0):this.map.options.debug&&console.log("skip framing, frameCycleRenderCount:",this._frameCycleRenderCount),this._animationFrame=ai(this._bindFrameLoop)},t._cancelFrameLoop=function(){delete this._bindFrameLoop,this._animationFrame&&$s(this._animationFrame)},t._updateCanvasSize=function(){if(!(!this.canvas||this._containerIsCanvas)){var e=this.map,o=e.getSize(),s=this.canvas,a=e.getDevicePixelRatio(),{width:l,height:h,cssWidth:u,cssHeight:c}=Eh(o,a);s.style&&(s.style.width!==u||s.style.height!==c)&&(s.style.width=u,s.style.height=c),(l!==s.width||h!==s.height)&&(s.width=l,s.height=h);var f=this.topLayer;f&&(l!==f.width||h!==f.height)&&(f.width=l,f.height=h,f.style.width=u,f.style.height=c)}},t.createCanvas=function(){var e=this;if(this._containerIsCanvas)this.canvas=this.map.getContainer();else{this.canvas=we("canvas");var o=this.map.getPanels(),s=o.canvasContainer;s.appendChild(this.canvas),this._updateCanvasSize()}this.createContext().then(function(){e.ready=!0})},t.createContext=function(){return LO(this,void 0,void 0,Gc().mark(function e(){return Gc().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:case"end":return s.stop()}},e)}))},t.clearLayerCanvasContext=function(e){},t.clearCanvas=function(){},t.createTopCanvas=function(){var e=we("canvas");this.topLayer=e,e.width=this.canvas.width,e.height=this.canvas.height,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.width=this.canvas.style.width,e.style.height=this.canvas.style.height;var o=this.map.getPanels(),s=o.canvasContainer;s.insertBefore(e,this.canvas),this.topCtx=e.getContext("2d")},t.removeTopCanvas=function(){Ln(this.topLayer),delete this.topLayer,delete this.topCtx},t._updateDomPosition=function(e){this._checkPositionTime===void 0&&(this._checkPositionTime=0);var o=Math.abs(e-this._checkPositionTime);return o>=500&&(Lh(this.map.getContainer()),this._checkPositionTime=e),this},t._handleResizeEventList=function(e){if(!this._resizeEventList)return this;var o=this._resizeEventList.length;if(o===0)return this;if(this._resizeTime&&e-this._resizeTime<60)return this;var s=this._resizeEventList[o-1].contentRect;return this.map.setContainerDomRect(s),this._resizeEventList=[],this._checkSize(),this._resizeCount=this._resizeCount||0,this.renderFrame((this._frameTimestamp||0)+ ++this._resizeCount/100),this._resizeTime=e,this},t._checkSize=function(){this.map&&this.map.checkSize()},t._setCheckSizeInterval=function(e){var o=this;Ce.resizeObserver?(this._resizeObserver&&this._resizeObserver.disconnect(),this.map&&(this._resizeObserver=new ResizeObserver(function(s){!o.map||o.map.isRemoved()?o._resizeObserver.disconnect():s.length&&(o._resizeEventList=o._resizeEventList||[],o._resizeEventList.push(s[0]))}),this._resizeObserver.observe(this.map.getContainer()))):(clearInterval(this._resizeInterval),this._checkSizeInterval=e,this._resizeInterval=setInterval(function(){!o.map||o.map.isRemoved()?clearInterval(o._resizeInterval):o._checkSize()},this._checkSizeInterval))},t._registerEvents=function(){var e=this,o=this.map;o.options.checkSize&&!Ct&&typeof window<"u"&&this._setCheckSizeInterval(o.options.checkSizeInterval),Ce.mobile||o.on("_mousemove",this._onMapMouseMove,this),o.on("_dragrotatestart _dragrotating _dragrotateend _movestart _moving _moveend _zoomstart",function(s){e._eventParam=s}),o.on("_zooming",function(s){o.getPitch()||(e._zoomMatrix=s.matrix.container),e._eventParam=s}),o.on("_zoomend",function(s){e._eventParam=s,delete e._zoomMatrix}),o.on("_spatialreferencechange",function(){e._spatialRefChanged=!0}),Ce.webgl&&typeof document<"u"&&(Sr.on(ef,this._thisDocDPRChange,this),Sr.on(tf,this._thisDocVisibilitychange,this),Sr.on(rf,this._thisDocDragStart,this),Sr.on(nf,this._thisDocDragEnd,this))},t._onMapMouseMove=function(e){var o=this,s=this.map;s.isInteracting()||!s.options.hitDetect||(this._hitDetectFrame&&$s(this._hitDetectFrame),this._hitDetectFrame=ai(function(){o.hitDetect(e.containerPoint)}))},t._getCanvasLayers=function(){return this.map._getLayers(function(e){return e.isCanvasRender()})},t.addTopElement=function(e){this._tops||(this._tops=[]),this._tops.push(e)},t.removeTopElement=function(e){if(this._tops){var o=this._tops.indexOf(e);o>=0&&this._tops.splice(o,1)}},t.getTopElements=function(){return this._tops||[]},t.sortTopElements=function(){this._tops=this._tops.sort(function(e,o){var s=(e.options||{}).zIndex||0,a=(o.options||{}).zIndex||0;return a-s})},t.drawTops=function(){var e=this.getTopElements();if(e.length)this.topCtx||this.createTopCanvas();else{this.topCtx&&this.removeTopCanvas();return}this.drawTopElements()},t.drawTopElements=function(){var e=this.getTopElements();this.topCtx.clearRect(0,0,this.topLayer.width,this.topLayer.height);var o=IO;o.clear(),this.map.fire("drawtopstart"),this.map.fire("drawtops");for(var s=!1,a=this.map.getDevicePixelRatio(),l=[],h=0;h<e.length;h++){var u=e[h];if(u.needCollision&&u.needCollision()){var c=u.getRenderBBOX(a);if(c)if(o.collides(c)){var f=u.target&&u.target._geometry;f&&l.indexOf(f)===-1&&(l.push(f),f.fire("handlecollision"));continue}else o.insertBox(c)}u.render(this.topCtx)&&(s=!0)}s&&this.context&&this.context.drawImage&&this.context.drawImage(this.topLayer,0,0),this.map.fire("drawtopsend")},t.isWebGL=function(){return!1},t.isWebGPU=function(){return!1},r}(pw),mw=function(n){function r(){return n.apply(this,arguments)||this}Q(r,n);var t=r.prototype;return t.renderFrame=function(e){this._updateMapStateCache(),this._updateMapCurrentViewGLInfo();var o=this.map;if(!o||!o.options.renderable)return!1;if(this._handleResizeEventList(e),o.options.stopRenderOnOffscreen&&this._containerIsOffscreen())return!0;this._updateDomPosition(e),delete this._isViewChanged,o._fireEvent("framestart"),this.updateMapDOM(),o.clearCollisionIndex();var s=this._getAllLayerToRender();this.drawLayers(s,e);var a=this.drawLayerCanvas(s);return a&&(this.drawTops(),this._drawCenterCross(),o.options.debugSky&&this._debugSky()),this._needClear=!1,o._fireEvent("frameend"),this._recordView(),this._mapview=this._getMapView(),delete this._spatialRefChanged,this._fireLayerLoadEvents(),this.executeFrameCallbacks(),this._canvasUpdated=!1,o.uiCollides(),!0},t._needRedrawAllLayers=function(e){var o=this;if(this.isSpatialReferenceChanged())return!0;var s=[];e.forEach(function(c){if(c){var f=c._toRedraw=o._checkLayerRedraw(c);if(f){s.push(c);var d=c.getLayers&&c.getLayers();d&&Array.isArray(d)&&Yt(s,d)}}});for(var a=0,l=s.length;a<l;a++){var h=s[a],u=h&&h.options;if(u&&u.collision&&u.collisionScope==="map")return!0}return!1},t.drawLayers=function(e,o){for(var s=this._needRedrawAllLayers(e),a=this.map,l=a.isInteracting(),h=[],u=[],c=a.options.fpsOnInteracting||0,f=c===0?0:1e3/c,d=this.map.options.layerCanvasLimitOnInteracting,g=e.length,p=a.getBaseLayer(),m=0,v=0;v<g;v++){var _=e[v];if(_.isVisible()){var y=_.isCanvasRender();y&&h.push(_.getId());var w=_._getRenderer();if(w){var x=s||_._toRedraw;y&&w.isCanvasUpdated()&&(x||u.push(_.getId()),this.setLayerCanvasUpdated());var C=w.__zoomTransformMatrix;if(delete w.__zoomTransformMatrix,!x){y&&l&&(a.isZooming()&&!a.getPitch()?(w.prepareRender(),w.__zoomTransformMatrix=this._zoomMatrix):(a.getPitch()||a.isRotating())&&w.clearCanvas());continue}if(l&&y){if(d>0&&g-1-v>d&&_!==p){_._getRenderer().clearCanvas();continue}m+=this._drawCanvasLayerOnInteracting(_,m,f,o)}else l&&w.drawOnInteracting?(w.prepareRender&&w.prepareRender(),w.checkAndDraw?w.checkAndDraw(w.drawOnInteracting,this._eventParam,o):w.drawOnInteracting(this._eventParam,o)):(w.render(o),y&&C&&w.isLoadingResource()&&(w.__zoomTransformMatrix=C));y&&(u.push(_.getId()),this.setLayerCanvasUpdated())}}}var b=this._canvasIds||[],E=this._updatedIds||[];if(this._canvasIds=h,this._updatedIds=u,!this.isLayerCanvasUpdated()){var T="---";(b.join(T)!==h.join(T)||E.join(T)!==u.join(T))&&this.setLayerCanvasUpdated()}return!0},t._drawCanvasLayerOnInteracting=function(e,o,s,a){var l=this.map,h=e._getRenderer(),u=h.getDrawTime(),c=s===0||s>0&&o+u<=s;if(h.mustRenderOnInteracting&&h.mustRenderOnInteracting())h.render(a);else{if(h.drawOnInteracting&&(e===l.getBaseLayer()||c||l.isZooming()&&e.options.forceRenderOnZooming||l.isMoving()&&e.options.forceRenderOnMoving||l.isRotating()&&e.options.forceRenderOnRotating))return h.prepareRender(),h.prepareCanvas(),h.checkAndDraw?h.checkAndDraw(h.drawOnInteracting,this._eventParam,a):h.drawOnInteracting(this._eventParam,a),u;l.isZooming()&&!l.getPitch()&&!l.isRotating()?(h.prepareRender(),h.__zoomTransformMatrix=this._zoomMatrix):(l.getPitch()||l.isRotating())&&h.clearCanvas()}return h.drawOnInteracting&&!c&&h.onSkipDrawOnInteracting(this._eventParam,a),0},t._fireLayerLoadEvents=function(){if(this._updatedIds&&this._updatedIds.length>0){var e=this.map;this._updatedIds.reverse().forEach(function(o){var s=e.getLayer(o);if(s){var a=s._getRenderer();!a||a.isRenderComplete&&!a.isRenderComplete()||s.fire("layerload")}})}},t.isLayerCanvasUpdated=function(){return this._canvasUpdated},t.setLayerCanvasUpdated=function(){this._canvasUpdated=!0},t.drawLayerCanvas=function(e){var o=this.map;if(!o||!this.isLayerCanvasUpdated()&&!this.isViewChanged()&&this._needClear===!1)return!1;this.canvas||this.createCanvas(),o._fireEvent("renderstart",{context:this.context}),this._updateCanvasSize()||this.clearCanvas();for(var s=o.isInteracting(),a=o.options.layerCanvasLimitOnInteracting,l=e.length,h,u=[],c=0;c<l;c++)if(!(!e[c].isVisible()||!e[c].isCanvasRender())){var f=e[c]._getRenderer();if(f){var d=this._getLayerImage(e[c]);d&&d.image&&(e[c]===o.getBaseLayer()?h=[e[c],d]:u.push([e[c],d]))}}var g=this.canvas.width,p=this.canvas.height;h&&(this._drawLayerCanvasImage(h[0],h[1],g,p),this._drawFog()),l=u.length;for(var m=s&&a>=0&&l>a?l-a:0,v=m;v<l;v++)this._drawLayerCanvasImage(u[v][0],u[v][1],g,p);return o._fireEvent("renderend",{context:this.context}),!0},t.setToRedraw=function(){var e=this._getAllLayerToRender();this._needClear=!0;for(var o=0,s=e.length;o<s;o++){var a=e[o].getRenderer();a&&a.canvas&&a.setToRedraw&&a.setToRedraw()}},t.remove=function(){delete this.context,n.prototype.remove.call(this)},t.hitDetect=function(e){var o=this.map;if(!(!o||!o.options.hitDetect||o.isInteracting())){var s=o._getLayers(),a="default",l=o.options.hitDetectLimit||0,h=0;e&&e._round&&e._round();for(var u=s.length-1;u>=0;u--){var c=s[u];if(!(!c.options.hitDetect||c.isEmpty&&c.isEmpty()||!c.options.geometryEvents)){var f=c._getRenderer();if(!(!f||!f.hitDetect)&&!(f.isBlank&&f.isBlank())){if(c.options.cursor!=="default"&&f.hitDetect(e)){a=c.options.cursor||"pointer";break}if(h++,l>0&&h>l)break}}}o._trySetCursor(a)}},t._getLayerImage=function(e){var o=e._getRenderer();return o.getCanvasImage?o.getCanvasImage():null},t._drawLayerCanvasImage=function(e,o,s,a){var l=this.context,h=o.point.round(),u=this.map.getDevicePixelRatio();u!==1&&h._multi(u);var c=o.image,f=c.width,d=c.height;if(!(h.x+f<=0||h.y+d<=0)){var g=e.options.opacity;if(X(g)||(g=1),!(g<=0)){var p=o.opacity;if(X(p)||(p=1),!(p<=0)){var m=l.globalAlpha;e.options.renderer==="canvas"&&(g<1&&(l.globalAlpha*=g),p<1&&(l.globalAlpha*=p)),e.options.cssFilter&&(l.filter=e.options.cssFilter);var v=e.getRenderer(),_=v.__zoomTransformMatrix,y=v.clipCanvas(this.context);_&&(l.save(),l.setTransform(..._)),l.drawImage(c,0,0,f,d,h.x,h.y,s,a),_&&l.restore(),y&&l.restore(),l.filter!=="none"&&(l.filter="none"),l.globalAlpha=m}}}},t._drawCenterCross=function(){var e=this.map.options.centerCross;if(e){var o=this.context,s=new z(this.canvas.width/2,this.canvas.height/2);Oe(e)?e(o,s):J.drawCross(this.context,s.x,s.y,2,"#f00")}},t._drawContainerExtent=function(){var{cascadePitches:e}=this.map.options,o=this.map.height-this.map._getVisualHeight(e[0]),s=this.map.height-this.map._getVisualHeight(e[1]),a=this.map.getContainerExtent(),l=this.context;l.beginPath(),l.moveTo(0,a.ymin),l.lineTo(a.xmax,a.ymin),l.stroke(),l.beginPath(),l.moveTo(0,o),l.lineTo(a.xmax,o),l.stroke(),l.beginPath(),l.moveTo(0,s),l.lineTo(a.xmax,s),l.stroke()},t._drawFog=function(){var e=this.map;if(!(e.getPitch()<=e.options.maxVisualPitch||!e.options.fog)){var o=30,s=e.getDevicePixelRatio(),a=this.context,l=e.getContainerExtent(),h=(e.height-e._getVisualHeight(75))*s;h<0&&(h=0);var u=l.ymin*s,c=Math.ceil(u-h),f=e.options.fogColor.join(),d=a.createLinearGradient(0,h,0,u+o),g=1-o/(c+o);d.addColorStop(0,"rgba("+f+", 0)"),d.addColorStop(.3,"rgba("+f+", 0.3)"),d.addColorStop(g,"rgba("+f+", 1)"),d.addColorStop(1,"rgba("+f+", 0)"),a.beginPath(),a.fillStyle=d,a.fillRect(0,h,Math.ceil(l.getWidth())*s,Math.ceil(c+o))}},t._debugSky=function(){var e=this.map;if(!e)return this;var o=e.getContainerExtent().ymin;if(o<=0)return this;var s=this.context;return s.strokeStyle="red",s.strokeRect(0,0,e.width,o),this},t.clearCanvas=function(){this.canvas&&J.clearRect(this.context,0,0,this.canvas.width,this.canvas.height)},t._updateCanvasSize=function(){if(!this.canvas||this._containerIsCanvas)return!1;var e=this.map,o=e.getSize(),s=this.canvas,a=e.getDevicePixelRatio(),{width:l,height:h,cssWidth:u,cssHeight:c}=Eh(o,a);return s.style&&(s.style.width!==u||s.style.height!==c)&&(s.style.width=u,s.style.height=c),l===s.width&&h===s.height?!1:(s.height=h,s.width=l,this.topLayer.width=s.width,this.topLayer.height=s.height,!0)},t.createCanvas=function(){this.topLayer=we("canvas"),this.topCtx=this.topLayer.getContext("2d"),this._containerIsCanvas?this.canvas=this.map.getContainer():(this.canvas=we("canvas"),this._updateCanvasSize(),this.map.getPanels().canvasContainer.appendChild(this.canvas)),this.context=this.canvas.getContext("2d"),this.ready=!0},t.drawTops=function(){n.prototype.drawTopElements.call(this)},r}(vw);Se.registerRenderer("canvas",mw);Se.mergeOptions({fog:!1,fogColor:[233,233,233]});var DO=Object.freeze({__proto__:null,CanvasLayerRenderer:Ld,CanvasRenderer:Ra,CanvasTileLayerCanvasRenderer:cw,CanvasTileLayerGLRenderer:fw,ImageGLRenderable:kd,ImageLayerCanvasRenderer:Ad,ImageLayerGLRenderer:sw,ImageLayerRenderable:ow,LayerAbstractRenderer:jh,MapAbstractRenderer:vw,MapCanvasRenderer:mw,MapRenderer:pw,OverlayLayerCanvasRenderer:zd,OverlayLayerGLRenderer:kO,QuadStencil:SO,Renderable:ld,ResourceCache:ed,TileLayerCanvasRenderer:Uh,TileLayerGLRenderer:Dd,TileLayerRendererable:hw,VectorLayerCanvasRenderer:gw}),Jh={_getRenderPoints:function(){return[[this._getCenter2DPoint(this.getMap().getGLRes())],null]}};et.include(Jh);Di.include(Jh);zr.include(Jh);No.include(Jh);Sn.include({_getRenderPoints:function(r){var t=this.getMap(),i=t.getGLRes();if(r==="vertex"){for(var e=this._trimRing(this.getShell()),o=[],s=0,a=e.length;s<a;s++)o.push(t.coordToPointAtRes(e[s],i));return[o,null]}else{var l=t.coordToPointAtRes(this.getCenter(),i);return[[l],null]}}});var _w={_getRenderPoints:function(r){var t=this.getMap(),i=t.getGLRes(),e,o=null;if(r==="point")e=this._getPath2DPoints(this._getPrjCoordinates(),!1,i),e&&e.length>0&&Array.isArray(e[0])&&(e=e[0].concat(e[1]));else if(r==="vertex")if(e=this._getPath2DPoints(this._getPrjCoordinates(),!1,i),o=[],e&&e.length>0&&Array.isArray(e[0])){for(var s=0,a=e.length;s<a;s++)for(var l=0,h=e[s].length;l<h;l++)l===0?o.push([e[s][l],e[s][l+1]]):o.push([e[s][l-1],e[s][l]]);e=e[0].concat(e[1])}else for(var u=0,c=e.length;u<c;u++)u===0?o.push([e[u],e[u+1]]):o.push([e[u-1],e[u]]);else if(r==="line"){e=[],o=[];var f=this._getPath2DPoints(this._getPrjCoordinates(),!1,i),d=f.length>0&&Array.isArray(f[0]);if(d)for(var g,p=1,m=f.length;p<m;p++){g=f[p],this instanceof it&&g.length>0&&!g[0].equals(g[g.length-1])&&g.push(g[0]);for(var v=1,_=g.length;v<_;v++)e.push(g[v].add(g[v-1])._multi(.5)),o.push([g[v-1],g[v]])}else{this instanceof it&&f.length>0&&!f[0].equals(f[f.length-1])&&f.push(f[0]);for(var y=1,w=f.length;y<w;y++)e.push(f[y].add(f[y-1])._multi(.5)),o.push([f[y-1],f[y]])}}else if(r==="vertex-first"){var x=this._getPrjCoordinates(),C=x.length,b=C?t._prjToPointAtRes(x[0],i):null;e=C?[b]:[],o=C?[[b,x[1]?t._prjToPointAtRes(x[1],i):b]]:[]}else if(r==="vertex-last"){var E=this._getPrjCoordinates(),T=E.length,S=T?t._prjToPointAtRes(E[T-1],i):null;e=T?[S]:[];var B=T>1?T-2:T-1;o=T?[[E[B]?t._prjToPointAtRes(E[B],i):S,S]]:[]}else if(r==="vertex-firstlast"){e=[],o=[];var L=this._getPrjCoordinates(),D=L.length;if(D){var N=t._prjToPointAtRes(L[0],i);if(e=[N],D>1){o=[[N,t._prjToPointAtRes(L[1],i)]];var G=t._prjToPointAtRes(L[D-1],i);e.push(G);var I=D>1?D-2:D-1;o.push([t._prjToPointAtRes(L[I],i),G])}}}else{var A=this.getCenter();if(!A)e=[];else{var k=this._getProjection().project(A);e=[t._prjToPointAtRes(k,i)]}}return[e,o]}};pt.include(_w);it.include(_w);var qn={within:!1,center:[0,0]};function yw(n){if(!n||!n._containerBbox)qn.within=!1;else{qn.within=!1;var{minx:r,miny:t,maxx:i,maxy:e}=n._containerBbox,o=Math.abs(i-r),s=Math.abs(e-t);o<=1&&s<=1&&(qn.within=!0,qn.center[0]=(r+i)/2,qn.center[1]=(t+e)/2),delete n._containerBbox}return qn}var zO={_redrawWhenPitch:function(){return!1},_redrawWhenRotate:function(){return!1},_getRenderBBOX:function(r,t){return r.isHitTesting?null:(Mo(yo),Ii(t,yo),yo)}};je.include(zO);function ww(){var n=this._getPrjShell(),r=ur();Ii(n,r);var[t,i,e,o]=r;return new Je(t,i,e,o)}function xw(){var n=this._getPrjShell();if(!n||!Array.isArray(n))return[];var r=this._getProjection(),t=this.getCoordinates()||{};return n.map(function(i){var e=r.unproject(i);return e.z=t.z||0,e})}var Bd={_redrawWhenPitch:function(){return!0},_redrawWhenRotate:function(){return this instanceof Di||this instanceof No},_computeRotatedPrjExtent:ww,getRotatedShell:xw,_paintAsPath:function(){if(this.isRotated())return!0;var r=this.getMap(),t=this._getAltitude(),i=dt[r.id],e=i?i.pitch:r.getPitch(),o=i?i.bearing:r.getBearing();return t>0||e||this instanceof Di&&o},_getPaintParams:function(){var r=this.getMap();if(this._paintAsPath())return it.prototype._getPaintParams.call(this,!0);var t=this._getPrjCoordinates(),i=r._prjToPointAtRes(t,r.getGLRes()),e=this._getRenderSize(i);return[i,...e]},_paintOn:function(...r){return this._paintAsPath()?J.polygon(...r):J.ellipse(...r)},_getRenderSize:function(r){var t=this.getMap(),i=t.getGLRes(),e=this._getPrjExtent(),o=t._prjToPointAtRes(e.getMin(),i),s=t._prjToPointAtRes(e.getMax(),i);return[Math.abs(s.x-o.x)/2,Math.abs(s.y-r.y),Math.abs(r.y-o.y)]}};Di.include(Bd);zr.include(Bd);var BO={_getPaintParams:function(){var r=this.getMap(),t=this._getPrjShell(),i=this._getPath2DPoints(t,!1,r.getGLRes());return[i]},_paintOn:J.polygon,_computeRotatedPrjExtent:ww,getRotatedShell:xw};Sn.include(BO);var GO={_redrawWhenPitch:function(){return!0},_getPaintParams:function(){if(this._paintAsPath())return it.prototype._getPaintParams.call(this,!0);var r=this.getMap(),t=r._prjToPointAtRes(this._getPrjCoordinates(),r.getGLRes()),i=this._getRenderSize(t),[e,o]=this._correctAngles();return[t,i[0],[e,o]]},_paintOn:function(...r){if(this._paintAsPath())return J.polygon(...r);var t=this.getMap(),i=dt[t.id],e=i?i.bearing:t.getBearing();return e&&(r[3]=r[3].slice(0),r[3][0]+=e,r[3][1]+=e),J.sector(...r)}};No.include(Bd,GO);Zh.include({_paintAsPath:function(){return!0}});var FO={arrowStyles:{classic:[3,4]},_getArrowShape:function(r,t,i,e,o){if(!r||!t||r.equals(t))return null;o||(o=0);var s=i*e[0],a=i*e[1]+o,l=s/2+o,h;t.nextCtrlPoint||t.prevCtrlPoint?t.prevCtrlPoint?h=t.sub(new z(t.prevCtrlPoint)):h=t.sub(new z(t.nextCtrlPoint)):h=t.sub(r),h._unit();var u=t.sub(h.multi(a));h._perp();var c=u.add(h.multi(l));h._multi(-1);var f=u.add(h.multi(l));return[c,t,f,c]},_getPaintParams:function(){var r=this._getPrjCoordinates(),t=this._getPath2DPoints(r,!1,this.getMap().getGLRes());return[t]},_paintOn:function(r,t,i,e,o,s){var a=yw(this._painter);return a.within?J.pixelRect(r,a.center,i,e):this.options.smoothness?J.paintSmoothLine(r,t,i,this.options.smoothness,!1,this._animIdx,this._animTailRatio):(r.lineColorIn=s,J.path(r,t,i,null,o)),this._paintArrow(r,t,i),this._getRenderBBOX(r,t)},_getArrowPlacement:function(){return this.options.arrowPlacement},_getArrowStyle:function(){var r=this.options.arrowStyle;return r?Array.isArray(r)?r:this.arrowStyles[r]:null},_getArrows:function(r,t,i){var e=this,o=this._getArrowStyle();if(!o||r.length<2)return[];for(var s=r.length>0&&Array.isArray(r[0]),a=s?r:[r],l=this._getArrowPlacement(),h=[],u,c,f=function(){if(u&&c){var y=e._getArrowShape(u,c,t,o,i);y&&h.push(y)}},d=a.length-1;d>=0;d--){var g=a[d],p=g.length,m=g[0],v=g[p-1];l==="vertex-first"?(u=m.arrowNextPoint||g[1],c=m):l==="vertex-last"&&(u=v.arrowPrePoint||g[p-2],c=v),f(),l==="vertex-firstlast"&&(u=m.arrowNextPoint||g[1],c=m,f(),u=v.arrowPrePoint||g[p-2],c=v,f()),l==="point"&&this._getArrowPoints(h,g,t,o,i)}return h},_getArrowPoints:function(r,t,i,e,o){for(var s=0,a=t.length-1;s<a;s++){var l=t[s],h=t[s+1],u=this._getArrowShape(h.arrowPrePoint||l,h,i,e,o);u&&r.push(u)}},_paintArrow:function(r,t,i){var e=this._getInternalSymbol().lineWidth;(!X(e)||e<3)&&(e=3);var o=this._getArrows(t,e);if(o.length){r.setLineDash&&r.setLineDash([]);for(var s=o.length-1;s>=0;s--)r.fillStyle=r.strokeStyle,J.polygon(r,o[s],i,i)}}};pt.include(FO);var NO={_getPaintParams:function(r){var t=this.getMap().getGLRes(),i=this._getPrjShell(),e=this._getPath2DPoints(i,r,t),o=e.length>0&&Array.isArray(e[0]);o&&(e=[[e[0]],[e[1]]]);var s=this._getPrjHoles(),a=[];if(s&&s.length>0){for(var l=this._simplified,h=0;h<s.length;h++){var u=this._getPath2DPoints(s[h],r,t);Array.isArray(u)&&o?Array.isArray(u[0])?(e[0].push(u[0]),e[1].push(u[1])):e[0].push(u):a.push(u)}l&&(this._simplified=l)}return o||(e=[e],Yt(e,a)),[e]},_paintOn:function(r,t,i,e,o,s){var a=yw(this._painter);return a.within?J.pixelRect(r,a.center,i,e):(r.lineColorIn=s,J.polygon(r,t,i,e,o,this.options.smoothness)),this._getRenderBBOX(r,t)}};it.include(NO);Se.VERSION=Y_;q_(Y_);function Cw(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var yl={exports:{}},HO=yl.exports,gm;function jO(){return gm||(gm=1,function(n){(function(r,t){n.exports?n.exports=t():r.coordtransform=t()})(HO,function(){var r=52.35987755982988,t=3.141592653589793,i=6378245,e=.006693421622965943;function o(v,_,y,w){this.west=Math.min(v,y),this.north=Math.max(_,w),this.east=Math.max(v,y),this.south=Math.min(_,w)}o.prototype.contain=function(v,_){return this.west<=v&&this.east>=v&&this.north>=_&&this.south<=_};var s=[new o(79.4462,49.2204,96.33,42.8899),new o(109.6872,54.1415,135.0002,39.3742),new o(73.1246,42.8899,124.143255,29.5297),new o(82.9684,29.5297,97.0352,26.7186),new o(97.0253,29.5297,124.367395,20.414096),new o(107.975793,20.414096,111.744104,17.871542)],a=[new o(119.921265,25.398623,122.497559,21.785006),new o(101.8652,22.284,106.665,20.0988),new o(106.4525,21.5422,108.051,20.4878),new o(109.0323,55.8175,119.127,50.3257),new o(127.4568,55.8175,137.0227,49.5574),new o(131.2662,44.8922,137.0227,42.5692),new o(73.1246,35.398637,77.948114,29.5297)],l=[new o(114.505238,22.138258,113.845,22.428903),new o(113.97,22.507833,114.45,22.428903)];function h(v,_,y=!0){for(var w=0;w<s.length;w++)if(s[w].contain(v,_)){for(var x=0;x<a.length;x++)if(a[x].contain(v,_))return!1;if(y){for(var x=0;x<l.length;x++)if(l[x].contain(v,_))return!1}return!0}return!1}function u(v,_){var y=v-.0065,w=_-.006,x=Math.sqrt(y*y+w*w)-2e-5*Math.sin(w*r),C=Math.atan2(w,y)-3e-6*Math.cos(y*r),b=x*Math.cos(C),E=x*Math.sin(C);return[b,E]}function c(v,_){var y=Math.sqrt(v*v+_*_)+2e-5*Math.sin(_*r),w=Math.atan2(_,v)+3e-6*Math.cos(v*r),x=y*Math.cos(w)+.0065,C=y*Math.sin(w)+.006;return[x,C]}function f(v,_){return g(v,_)}function d(v,_){var y=g(v,_);return[v*2-y[0],_*2-y[1]]}function g(v,_){var y=p(v-105,_-35),w=m(v-105,_-35),x=_/180*t,C=Math.sin(x);C=1-e*C*C;var b=Math.sqrt(C);y=y*180/(i*(1-e)/(C*b)*t),w=w*180/(i/b*Math.cos(x)*t);var E=_+y,T=v+w;return[T,E]}function p(v,_){var y=-100+2*v+3*_+.2*_*_+.1*v*_+.2*Math.sqrt(Math.abs(v));return y+=(20*Math.sin(6*v*t)+20*Math.sin(2*v*t))*2/3,y+=(20*Math.sin(_*t)+40*Math.sin(_/3*t))*2/3,y+=(160*Math.sin(_/12*t)+320*Math.sin(_*t/30))*2/3,y}function m(v,_){var y=300+v+2*_+.1*v*v+.1*v*_+.1*Math.sqrt(Math.abs(v));return y+=(20*Math.sin(6*v*t)+20*Math.sin(2*v*t))*2/3,y+=(20*Math.sin(v*t)+40*Math.sin(v/3*t))*2/3,y+=(150*Math.sin(v/12*t)+300*Math.sin(v/30*t))*2/3,y}return{rawBd09ToGcj02:u,rawGcj02ToBd09:c,rawWgs84ToGcj02:f,rawGcj02ToWgs84:d,bd09ToGcj02:u,gcj02ToBd09:c,wgs84ToGcj02:function(v,_){return h(v,_)?f(v,_):[v,_]},gcj02ToWgs84:function(v,_){return h(v,_)?d(v,_):[v,_]},bd09ToWgs84:function(v,_){if(!h(v,_,!1))return[v,_];var y=u(v,_);return d(y[0],y[1])},wgs84ToBd09:function(v,_){if(!h(v,_,!1))return[v,_];var y=f(v,_);return c(y[0],y[1])}}})}(yl)),yl.exports}var ZO=jO();const Kn=Cw(ZO);var mc,pm;function VO(){if(pm)return mc;pm=1;var n=function(_){return r(_)&&!t(_)};function r(v){return!!v&&typeof v=="object"}function t(v){var _=Object.prototype.toString.call(v);return _==="[object RegExp]"||_==="[object Date]"||o(v)}var i=typeof Symbol=="function"&&Symbol.for,e=i?Symbol.for("react.element"):60103;function o(v){return v.$$typeof===e}function s(v){return Array.isArray(v)?[]:{}}function a(v,_){return _.clone!==!1&&_.isMergeableObject(v)?p(s(v),v,_):v}function l(v,_,y){return v.concat(_).map(function(w){return a(w,y)})}function h(v,_){if(!_.customMerge)return p;var y=_.customMerge(v);return typeof y=="function"?y:p}function u(v){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(v).filter(function(_){return Object.propertyIsEnumerable.call(v,_)}):[]}function c(v){return Object.keys(v).concat(u(v))}function f(v,_){try{return _ in v}catch{return!1}}function d(v,_){return f(v,_)&&!(Object.hasOwnProperty.call(v,_)&&Object.propertyIsEnumerable.call(v,_))}function g(v,_,y){var w={};return y.isMergeableObject(v)&&c(v).forEach(function(x){w[x]=a(v[x],y)}),c(_).forEach(function(x){d(v,x)||(f(v,x)&&y.isMergeableObject(_[x])?w[x]=h(x,y)(v[x],_[x],y):w[x]=a(_[x],y))}),w}function p(v,_,y){y=y||{},y.arrayMerge=y.arrayMerge||l,y.isMergeableObject=y.isMergeableObject||n,y.cloneUnlessOtherwiseSpecified=a;var w=Array.isArray(_),x=Array.isArray(v),C=w===x;return C?w?y.arrayMerge(v,_,y):g(v,_,y):a(_,y)}p.all=function(_,y){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(w,x){return p(w,x,y)},{})};var m=p;return mc=m,mc}var WO=VO();const Tw=Cw(WO);/*!
|
|
336
|
-
* maptalks.markercluster v0.8.8
|
|
337
|
-
* LICENSE : MIT
|
|
338
|
-
* (c) 2016-2024 maptalks.org
|
|
339
|
-
*/function $O(n,r){for(var t=Object.getOwnPropertyNames(r),i=0;i<t.length;i++){var e=t[i],o=Object.getOwnPropertyDescriptor(r,e);o&&o.configurable&&n[e]===void 0&&Object.defineProperty(n,e,o)}return n}function bw(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function Mw(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function Pw(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):$O(n,r))}var UO={maxClusterRadius:160,textSumProperty:null,symbol:null,drawClusterText:!0,textSymbol:null,animation:!0,animationDuration:450,maxClusterZoom:null,noClusterWithOneMarker:!0,forceRenderOnZooming:!0},Xh=function(n){Pw(r,n);function r(){return bw(this,r),Mw(this,n.apply(this,arguments))}return r.fromJSON=function(i){if(!i||i.type!=="ClusterLayer")return null;for(var e=new r(i.id,i.options),o=i.geometries,s=[],a=0;a<o.length;a++){var l=je.fromJSON(o[a]);l&&s.push(l)}return e.addGeometry(s),e},r.prototype.addMarker=function(i){return this.addGeometry(i)},r.prototype.addGeometry=function(i){for(var e=0,o=i.length;e<=o;e++)if(!i[e]instanceof et)throw new Error("Only a point(Marker) can be added into a ClusterLayer");return n.prototype.addGeometry.apply(this,arguments)},r.prototype.onConfig=function(i){if(n.prototype.onConfig.call(this,i),i.maxClusterRadius||i.symbol||i.drawClusterText||i.textSymbol||i.maxClusterZoom){var e=this._getRenderer();e&&e.render()}return this},r.prototype.identify=function(i,e){var o=this.getMap(),s=this.options.maxClusterZoom;return s&&o&&o.getZoom()>s?n.prototype.identify.call(this,i,e):this._getRenderer()?this._getRenderer().identify(i,e):null},r.prototype.toJSON=function(){var i=n.prototype.toJSON.call(this);return i.type="ClusterLayer",i},r.prototype.getClusters=function(){var i=this._getRenderer();return i?i._currentClusters||[]:[]},r}(Lr);Xh.mergeOptions(UO);Xh.registerJSONType("ClusterLayer");var JO={textFaceName:'"microsoft yahei"',textSize:16,textDx:0,textDy:0},vm={markerType:"ellipse",markerFill:{property:"count",type:"interval",stops:[[0,"rgb(135, 196, 240)"],[9,"#1bbc9b"],[99,"rgb(216, 115, 149)"]]},markerFillOpacity:.7,markerLineOpacity:1,markerLineWidth:3,markerLineColor:"#fff",markerWidth:{property:"count",type:"interval",stops:[[0,40],[9,60],[99,80]]},markerHeight:{property:"count",type:"interval",stops:[[0,40],[9,60],[99,80]]}};Xh.registerRenderer("canvas",function(n){Pw(r,n);function r(t){bw(this,r);var i=Mw(this,n.call(this,t));return i._animated=!0,i._refreshStyle(),i._clusterNeedRedraw=!0,i}return r.prototype.checkResources=function(){var i=this.layer.options.symbol||vm,e=n.prototype.checkResources.apply(this,arguments);if(i!==this._symbolResourceChecked){var o=Np.getExternalResources(i,!0);o&&e.push.apply(e,o),this._symbolResourceChecked=i}return e},r.prototype.draw=function(){this.canvas||this.prepareCanvas();var i=this.getMap(),e=i.getZoom(),o=this.layer.options.maxClusterZoom;if(o&&e>o){delete this._currentClusters,this._markersToDraw=this.layer._geoList,n.prototype.draw.apply(this,arguments);return}this._clusterNeedRedraw&&(this._clearDataCache(),this._computeGrid(),this._clusterNeedRedraw=!1);var s=this._clusterCache[e]?this._clusterCache[e].clusters:null,a=this._getClustersToDraw(s);a.zoom=e,this._drawLayer(a)},r.prototype._getClustersToDraw=function(i){this._markersToDraw=[];var e=this.getMap(),o=Rp.getFont(this._textSymbol),s=Rp.stringLength("9",o).toPoint(),a=e.getContainerExtent(),l=[],h=void 0,u=void 0,c=void 0,f=void 0,d=void 0;for(var g in i){if(this._currentGrid=i[g],i[g].count===1&&this.layer.options.noClusterWithOneMarker){var p=i[g].children[0];p._cluster=i[g],this._markersToDraw.push(p);continue}if(c=this._getSprite(),f=c.canvas.width,d=c.canvas.height,h=e._prjToContainerPoint(i[g].center),u=new Le(h.sub(f,d),h.add(f,d)),!!a.intersects(u)){if(!i[g].textSize){var m=this._getClusterText(i[g]);i[g].textSize=new z(s.x*m.length,s.y)._multi(1/2)}l.push(i[g])}}return l},r.prototype.drawOnInteracting=function(){this._currentClusters&&this._drawClusters(this._currentClusters,1),n.prototype.drawOnInteracting.apply(this,arguments)},r.prototype._getCurrentNeedRenderGeos=function(){return this._markersToDraw?this._markersToDraw:[]},r.prototype.forEachGeo=function(i,e){this._markersToDraw&&this._markersToDraw.forEach(function(o){e?i.call(e,o):i(o)})},r.prototype.onGeometryShow=function(){this._clusterNeedRedraw=!0,n.prototype.onGeometryShow.apply(this,arguments)},r.prototype.onGeometryHide=function(){this._clusterNeedRedraw=!0,n.prototype.onGeometryHide.apply(this,arguments)},r.prototype.onGeometryAdd=function(){this._clusterNeedRedraw=!0,n.prototype.onGeometryAdd.apply(this,arguments)},r.prototype.onGeometryRemove=function(){this._clusterNeedRedraw=!0,n.prototype.onGeometryRemove.apply(this,arguments)},r.prototype.onGeometryPositionChange=function(){this._clusterNeedRedraw=!0,n.prototype.onGeometryPositionChange.apply(this,arguments)},r.prototype.onRemove=function(){this._clearDataCache()},r.prototype.identify=function(i,e){var o=this.getMap(),s=this.layer.options.maxClusterZoom;if(s&&o.getZoom()>s)return n.prototype.identify.call(this,i,e);if(this._currentClusters){for(var a=o.coordinateToContainerPoint(i),l=this._currentGrid,h=0;h<this._currentClusters.length;h++){var u=this._currentClusters[h],c=o._prjToContainerPoint(u.center);this._currentGrid=u;var f=this._getSprite().canvas.width;if(a.distanceTo(c)<=f)return{center:o.getProjection().unproject(u.center.copy()),children:u.children.slice(0)}}this._currentGrid=l}if(this._markersToDraw&&this._markersToDraw[0]){var d=o.coordinateToContainerPoint(i);return this.layer._hitGeos(this._markersToDraw,d,e)}return null},r.prototype.onSymbolChanged=function(){this._refreshStyle(),this._computeGrid(),this._stopAnim(),this.setToRedraw()},r.prototype._refreshStyle=function(){var i=this,e=this.layer.options.symbol||vm,o=this.layer.options.textSymbol||JO,s=function(){return[i.getMap().getZoom(),i._currentGrid]};this._symbol=Fp.loadFunctionTypes(e,s),this._textSymbol=Fp.loadFunctionTypes(o,s)},r.prototype._drawLayer=function(i){var e=this,o=this._currentClusters||i;this._currentClusters=i,delete this._clusterMaskExtent;var s=this.layer;if(s.options.animation&&this._animated&&this._inout){var a=[0,1];this._inout==="in"&&(a=[1,0]),this._player=wE.Animation.animate({d:a},{speed:s.options.animationDuration,easing:"inAndOut"},function(l){l.state.playState==="finished"?(e._animated=!1,e._drawClusters(i,1),e._drawMarkers(),e.completeRender()):(e._inout==="in"?e._drawClustersFrame(i,o,l.styles.d):e._drawClustersFrame(o,i,l.styles.d),e.setCanvasUpdated())}).play()}else this._animated=!1,this._drawClusters(i,1),this._drawMarkers(),this.completeRender()},r.prototype._drawMarkers=function(){n.prototype.drawGeos.call(this,this._clusterMaskExtent)},r.prototype._drawClustersFrame=function(i,e,o){var s=this;this._clusterMaskExtent=this.prepareCanvas();var a=this.getMap(),l={};if(i&&i.forEach(function(f){var d=a._prjToContainerPoint(f.center);l[f.key]||(l[f.key]=1,s._drawCluster(d,f,1-o))}),!(o===0||!e)){var h=i.zoom,u=a._getResolution(h)*this.layer.options.maxClusterRadius,c=this._markerExtent.getMin();e.forEach(function(f){var d=a._prjToContainerPoint(f.center),g=f.center,p=Math.floor((g.x-c.x)/u),m=Math.floor((g.y-c.y)/u),v=p+"_"+m,_=s._clusterCache[h]?s._clusterCache[h].clusterMap[v]:null;if(_){var y=a._prjToContainerPoint(_.center);d=y.add(d.sub(y)._multi(o))}s._drawCluster(d,f,o>.5?1:o)})}},r.prototype._drawClusters=function(i,e){var o=this;if(i){this._clusterMaskExtent=this.prepareCanvas();var s=this.getMap();i.forEach(function(a){var l=s._prjToContainerPoint(a.center);o._drawCluster(l,a,e>.5?1:e)})}},r.prototype._drawCluster=function(i,e,o){this._currentGrid=e;var s=this.context,a=this._getSprite(),l=s.globalAlpha;if(l*o!==0){if(s.globalAlpha=l*o,a){var h=i.add(a.offset)._sub(a.canvas.width/2,a.canvas.height/2);s.drawImage(a.canvas,h.x,h.y)}if(this.layer.options.drawClusterText&&e.textSize){J.prepareCanvasFont(s,this._textSymbol),s.textBaseline="middle";var u=this._textSymbol.textDx||0,c=this._textSymbol.textDy||0,f=this._getClusterText(e);J.fillText(s,f,i.sub(e.textSize.x,0)._add(u,c))}s.globalAlpha=l}},r.prototype._getClusterText=function(i){var e=this.layer.options.textSumProperty?i.textSumProperty:i.count;return e+""},r.prototype._getSprite=function(){this._spriteCache||(this._spriteCache={});var i=Np.getSymbolStamp(this._symbol);return this._spriteCache[i]||(this._spriteCache[i]=new et([0,0],{symbol:this._symbol})._getSprite(this.resources,this.getMap().CanvasClass)),this._spriteCache[i]},r.prototype._initGridSystem=function(){var i=[],e=void 0,o=void 0;this.layer.forEach(function(s){s.isVisible()&&(o=s._getPrjCoordinates(),e?e=e._combine(s._getPrjExtent()):e=s._getPrjExtent(),i.push({x:o.x,y:o.y,id:s._getInternalId(),geometry:s}))}),this._markerExtent=e,this._markerPoints=i},r.prototype._computeGrid=function(){var i=this.getMap(),e=i.getZoom();this._markerExtent||this._initGridSystem(),this._clusterCache||(this._clusterCache={});var o=i._getResolution(i.getMinZoom())>i._getResolution(i.getMaxZoom())?e-1:e+1;this._clusterCache[o]&&this._clusterCache[o].length===this.layer.getCount()&&(this._clusterCache[e]=this._clusterCache[o]),this._clusterCache[e]||(this._clusterCache[e]=this._computeZoomGrid(e))},r.prototype._computeZoomGrid=function(i){if(!this._markerExtent)return null;var e=this.getMap(),o=e._getResolution(i)*this.layer.options.maxClusterRadius,s=e._getResolution(i-1)?e._getResolution(i-1)*this.layer.options.maxClusterRadius:null,a=this._clusterCache[i-1];!a&&i-1>=e.getMinZoom()&&(this._clusterCache[i-1]=a=this._computeZoomGrid(i-1));for(var l=this._markerPoints,h=this.layer.options.textSumProperty,u={},c=this._markerExtent.getMin(),f=void 0,d=void 0,g=void 0,p=void 0,m=void 0,v=void 0,_=0,y=l.length;_<y;_++){var w=l[_].geometry,x=0;h&&w.getProperties()&&w.getProperties()[h]&&(x=w.getProperties()[h]),f=Math.floor((l[_].x-c.x)/o),d=Math.floor((l[_].y-c.y)/o),g=f+"_"+d,u[g]?(u[g].sum._add(new $(l[_].x,l[_].y)),u[g].count++,u[g].center=u[g].sum.multi(1/u[g].count),u[g].children.push(w),u[g].textSumProperty+=x):(u[g]={sum:new $(l[_].x,l[_].y),center:new $(l[_].x,l[_].y),count:1,textSumProperty:x,children:[w],key:g+""},s&&a&&(p=Math.floor((l[_].x-c.x)/s),m=Math.floor((l[_].y-c.y)/s),v=p+"_"+m,u[g].parent=a.clusterMap[v]))}return this._mergeClusters(u,o/2)},r.prototype._mergeClusters=function(i,e){var o={};for(var s in i)o[s]=i[s];var a={},l={},h=void 0,u=void 0;for(var c in i)if(h=i[c],!l[h.key]){for(var f=h.key.split("_"),d=+f[0],g=+f[1],p=-1;p<=1;p++)for(var m=-1;m<=1;m++)if(!(p===0&&m===0)){var v=d+p+"_"+(g+m);u=i[v],u&&this._distanceTo(h.center,u.center)<=e&&(a[h.key]||(a[h.key]=[]),a[h.key].push(u),l[u.key]=1)}}for(var _ in a){var y=i[_];if(y){for(var w=a[_],x=0;x<w.length;x++)i[w[x].key]&&(y.sum._add(w[x].sum),y.count+=w[x].count,y.textSumProperty+=w[x].textSumProperty,y.children=y.children.concat(w[x].children),o[w[x].key]=y,delete i[w[x].key]);y.center=y.sum.multi(1/y.count)}}return{clusters:i,clusterMap:o}},r.prototype._distanceTo=function(i,e){var o=i.x-e.x,s=i.y-e.y;return Math.sqrt(o*o+s*s)},r.prototype._stopAnim=function(){this._player&&this._player.playState!=="finished"&&this._player.finish()},r.prototype.onZoomStart=function(i){this._stopAnim(),n.prototype.onZoomStart.call(this,i)},r.prototype.onZoomEnd=function(i){if(this.layer.isEmpty()||!this.layer.isVisible()){n.prototype.onZoomEnd.apply(this,arguments);return}this._inout=i.from>i.to?"in":"out",this._animated=!0,this._computeGrid(),n.prototype.onZoomEnd.apply(this,arguments)},r.prototype._clearDataCache=function(){this._stopAnim(),delete this._markerExtent,delete this._markerPoints,delete this._clusterCache,delete this._zoomInClusters},r}(DO.VectorLayerCanvasRenderer));typeof console<"u"&&console.log("maptalks.markercluster v0.8.8");/*!
|
|
340
|
-
* isobject <https://github.com/jonschlinkert/isobject>
|
|
341
|
-
*
|
|
342
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
343
|
-
* Released under the MIT License.
|
|
344
|
-
*/function XO(n){return n!=null&&typeof n=="object"&&Array.isArray(n)===!1}/*!
|
|
345
|
-
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
346
|
-
*
|
|
347
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
348
|
-
* Released under the MIT License.
|
|
349
|
-
*/function mm(n){return XO(n)===!0&&Object.prototype.toString.call(n)==="[object Object]"}function Ew(n){var r,t;return!(mm(n)===!1||(r=n.constructor,typeof r!="function")||(t=r.prototype,mm(t)===!1)||t.hasOwnProperty("isPrototypeOf")===!1)}function fi(n,r,t){Object.keys(n).forEach(i=>{i.startsWith("update:")||t!=null&&t.includes(i)||r.addEventListener(i,n[i])})}let YO=1;function qO(){return YO++}function ko(n,r){return r.__id__||(r.__id__=qO()),`${n}::${r.__id__}`}var vr;(function(n){function r(o,s){for(const a of o)if(a instanceof s)return a}n.findByType=r;function t(o,s){return o.includes(s)}n.includesTyped=t;function i(o,s,a){const l=s>=0?s:o.length+s;if(a===void 0)return o[l];o[l]=a}n.at=i;function e(o,s,a,l=1){const h=[];for(let u=0;u<a;u++){const c=(s+u*l)%o.length;h.push(o[c>=0?c:o.length+c])}return h}n.subarray=e})(vr||(vr={}));var Ro;(function(n){function r(e,o){const s=e.getLength();for(let a=0;a<s;a++)if(e.getAt(a)===o)return a;return-1}n.indexOf=r;function t(e,o){const s=r(e,o);if(s!==-1)return e.removeAt(s)}n.remove=t;function i(e,o){return[e.addListener("insert_at",o),e.addListener("remove_at",o),e.addListener("set_at",o)]}n.listenChanged=i})(Ro||(Ro={}));var Gr;(function(n){function r(i,e){i.isVisible()!==e&&(e?i.show():i.hide())}n.setVisible=r,n.tempCoordinate=new $(0,0),n.tempPoint=new z(0,0);function t(i,e){const o=new Je(e);for(const s of i)o._combine(s);return o}n.extentFromCoordinates=t})(Gr||(Gr={}));const Ao={FILL_COLOR_TG:"white",FILL_OPACITY_TG:.5},KO=6371009;function _m(n){const r=Math.sin(n*.5);return r*r}function QO(n){return 2*Math.asin(Math.sqrt(n))}function ek(n,r,t){return _m(n-r)+_m(t)*Math.cos(n)*Math.cos(r)}function ul(n){return n*Math.PI/180}function tk(n,r,t,i){return QO(ek(n,t,r-i))}function rk(n,r){return tk(ul(n.lat),ul(n.lng),ul(r.lat),ul(r.lng))}function ym(n,r){return rk(n,r)*KO}var De;(function(n){n.wgs84="wgs84",n.gcj02="gcj02",n.bd09="bd09"})(De||(De={}));const _c=De.wgs84,Qt=class Qt{constructor(r,t,i){P(this,"lat");P(this,"lng");P(this,"coord");this.lat=r,this.lng=t,this.coord=i,Dr()}static _normalize(r,t){const i=t>90?90:t<-90?-90:t;return[r>180?(r+180)%360-180:r<-180?(r-180)%360+180:r,i]}static fromBaidu(r,t){return new Qt(r.lat,r.lng,t)}static fromGoogle(r,t){return new Qt(r.lat(),r.lng(),t)}static fromHere(r,t){return new Qt(r.lat,r.lng,t)}static fromTalks(r,t){return new Qt(r.y,r.x,t)}static fromLiteral(r){return new Qt(r.lat,r.lng,r.coord||_c)}static fromLngLat(r,t,i=_c){return new Qt(t,r,i)}static create(r,t,i=_c){return new Qt(r,t,i)}to(r){const t=r;if(this.coord===t)return this;const[i,e]=this._convert(t);return new Qt(e,i,t)}toBaidu(r,t=!1){let i=this.lat,e=this.lng;return this.coord!==r&&([e,i]=this._convert(r)),t&&([e,i]=Qt._normalize(e,i)),new BMap.Point(e,i)}toGoogle(r){let t=this.lat,i=this.lng;return this.coord!==r&&([i,t]=this._convert(r)),new google.maps.LatLng(t,i)}toHere(r){let t=this.lat,i=this.lng;return this.coord!==r&&([i,t]=this._convert(r)),new H.geo.Point(t,i)}toTalks(r){let t=this.lat,i=this.lng;return this.coord!==r&&([i,t]=this._convert(r)),new $(i,t)}_convert(r){switch(this.coord){case De.bd09:return r===De.gcj02?Kn.bd09ToGcj02(this.lng,this.lat):Kn.bd09ToWgs84(this.lng,this.lat);case De.gcj02:return r===De.wgs84?Kn.gcj02ToWgs84(this.lng,this.lat):Kn.gcj02ToBd09(this.lng,this.lat);case De.wgs84:return r===De.bd09?Kn.wgs84ToBd09(this.lng,this.lat):Kn.wgs84ToGcj02(this.lng,this.lat)}throw new Error(`不支持的坐标转换: ${this.coord}=>${r}`)}normalize(){const[r,t]=Qt._normalize(this.lng,this.lat);return t===this.lat&&r===this.lng?this:new Qt(t,r,this.coord)}equals(r){return this===r?!0:this.lat===r.lat&&this.lng===r.lng&&this.coord===r.coord}toString(){return JSON.stringify(this)}};P(Qt,"ZERO",Qt.create(0,0));let te=Qt;const xi=class xi{constructor(r,t){P(this,"sw");P(this,"ne");P(this,"coord");this.sw=r,this.ne=t,Ps(r.coord===t.coord,"sw和ne的coord应该相同"),Ps(Number.isFinite(r.lat)&&Number.isFinite(r.lng)&&Number.isFinite(t.lat)&&Number.isFinite(t.lng),`sw(${r})和ne(${t})不能包含NaN或Infinite`),Ps(r.lat<=t.lat,`sw.lat(${r.lat})应该比ne.lat(${t.lat})小`),this.coord=r.coord}static isBetweenLng(r,t,i){return r<=t?r<=i&&i<=t:r<=i||i<=t}static fromArray(r){if(r.length===0)return;const t=new xi.Builder(r[0]);for(let i=1;i<r.length;i++)t.include(r[i]);return t.build()}static from(...r){return this.fromArray(r)??Pt("positions中没有点")}static fromGoogle(r,t){return new xi(te.fromGoogle(r.getSouthWest(),t),te.fromGoogle(r.getNorthEast(),t))}static fromBaidu(r,t){return new xi(te.fromBaidu(r.getSouthWest(),t),te.fromBaidu(r.getNorthEast(),t))}static fromTalks(r,t){return new xi(te.fromTalks(r.getMin(Gr.tempCoordinate),t),te.fromTalks(r.getMax(Gr.tempCoordinate),t))}static create(r,t){return this.from(r,t)}isEmpty(){return this.sw.equals(this.ne)}contains(r){const{lat:t,lng:i}=r.to(this.coord);return this.sw.lat<=t&&t<=this.ne.lat&&xi.isBetweenLng(this.sw.lng,this.ne.lng,i)}getCenter(){if(this.sw.equals(this.ne))return this.sw;const r=(this.sw.lat+this.ne.lat)/2,t=(this.sw.lng+this.ne.lng+(this.sw.lng<this.ne.lng?0:360))/2;return te.create(r,t,this.coord)}toString(){return JSON.stringify(this)}equals(r){return this.sw.equals(r.sw)&&this.ne.equals(r.ne)}toRectArray(){const r=this.sw.coord;return[this.sw,te.fromLngLat(this.sw.lng,this.ne.lat,r),this.ne,te.fromLngLat(this.ne.lng,this.sw.lat,r)]}toGoogle(r){return new google.maps.LatLngBounds(this.sw.toGoogle(r),this.ne.toGoogle(r))}toBaidu(r){return new BMap.Bounds(this.sw.toBaidu(r),this.ne.toBaidu(r))}toBaiduArray(r){return[this.sw.toBaidu(r),this.ne.toBaidu(r)]}toTalks(r){return new Je(this.sw.toTalks(r),this.ne.toTalks(r))}};P(xi,"EMPTY",new xi(te.ZERO,te.ZERO));let Rt=xi;(function(n){class r{constructor(i){P(this,"coord");P(this,"minLat");P(this,"minLng");P(this,"maxLat");P(this,"maxLng");this.coord=i.coord,this.minLat=this.maxLat=i.lat,this.minLng=this.maxLng=i.lng}build(){return new n(te.create(this.minLat,this.minLng,this.coord),te.create(this.maxLat,this.maxLng,this.coord))}include(i){const{lat:e,lng:o}=i.to(this.coord);return this.minLat=Math.min(this.minLat,e),this.maxLat=Math.max(this.maxLat,e),n.isBetweenLng(this.minLng,this.maxLng,o)||(this.delta(this.minLng,o)<this.delta(o,this.maxLng)?this.minLng=o:this.maxLng=o),this}delta(i,e){return(i-e+360)%360}}n.Builder=r})(Rt||(Rt={}));var Ei;(function(n){function r(i,e){if(i==null)return;if(typeof i=="string")return i;const o=i.to(e);return`${o.lat},${o.lng}`}n.toString=r;function t(i){return typeof i=="string"||i==null?void 0:i.coord}n.getCoordType=t})(Ei||(Ei={}));function Sw(n,r,t){return n.addListener(r,t).remove}function ik(n,r,t){return n.addEventListener(r,t),()=>n.removeEventListener(r,t)}function nk(n,r,t,i){return n.addEventListener(r,t,i),()=>n.removeEventListener(r,t,i)}function wm(n,r,t){return n.addEventListener(r,t),()=>n.removeEventListener(r,t)}class Gd{constructor(r,t){P(this,"inner");P(this,"coordTypeSupplier");P(this,"eventMap",new Map);P(this,"target",void 0);this.inner=r,this.coordTypeSupplier=t,this.addEventListener=this.addEventListener.bind(this),this.removeEventListener=this.removeEventListener.bind(this)}setTarget(r){return this.target=r,this}}class Yh{constructor(r,t){P(this,"delegate");P(this,"options");P(this,"eventHub",new Ow);this.delegate=r,this.options=t}notify(r){this.eventHub.notify(r)}hasListener(r){return this.eventHub.hasListener(r)}setTarget(r){return this.delegate.setTarget(r),this}addEventListener(r,t){if(vr.includesTyped(this.options.types,r)){this.eventHub.hasListener(r)||this.options.onListen(r),this.eventHub.addEventListener(r,t);return}this.delegate.addEventListener(r,t)}removeEventListener(r,t){if(vr.includesTyped(this.options.types,r)){this.eventHub.removeEventListener(r,t),this.eventHub.hasListener(r)||this.options.onCancel(r);return}this.delegate.removeEventListener(r,t)}}const lh=class lh extends Gd{addEventListener(r,t){const i=ko(r,t);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,t);return}const e=this.inner.addListener(lh.EVENT_TYPE_MAP[r]||r,o=>{const s={type:r,target:this.target,originalEvent:o};o!=null&&o.latLng&&(s.position=te.fromGoogle(o.latLng,this.coordTypeSupplier.coordType)),t.call(this.target,s)});this.eventMap.set(i,e)}removeEventListener(r,t){const i=ko(r,t),e=this.eventMap.get(i);e?(e.remove(),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,t)}};P(lh,"EVENT_TYPE_MAP",{"center-changed":"center_changed","zoom-changed":"zoom_changed","radius-changed":"radius_changed","bounds-changed":"bounds_changed","map-type-changed":"maptypeid_changed","map-mousedown":"mousedown","map-mousemove":"mousemove","map-mouseup":"mouseup","map-dblclick":"dblclick"});let Lo=lh;const Ls=class Ls extends Gd{addEventListener(r,t){const i=ko(r,t);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,t);return}const e=o=>{const s={type:r,target:this.target,originalEvent:o};o.point&&(s.position=te.fromBaidu(o.point,this.coordTypeSupplier.coordType)),t.call(this.target,s)};this.inner.addEventListener(Ls.EVENT_TYPE_MAP[r]||r,e),this.eventMap.set(i,e)}removeEventListener(r,t){const i=ko(r,t),e=this.eventMap.get(i);e?(this.inner.removeEventListener(Ls.EVENT_TYPE_MAP[r]||r,e),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,t)}};P(Ls,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose",contextmenu:"rightclick","zoom-changed":"zoomend","map-type-changed":"maptypechange"});let la=Ls;const Is=class Is extends Gd{addEventListener(r,t){const i=ko(r,t);if(this.eventMap.has(i)){console.warn("listener已经添加过了",i,t);return}const e=o=>{const s={type:r,target:this.target,originalEvent:o};o!=null&&o.coordinate&&(s.position=te.fromTalks(o.coordinate,this.coordTypeSupplier.coordType)),t.call(this.target,s)};this.inner.on(Is.EVENT_TYPE_MAP[r]??r,e),this.eventMap.set(i,e)}removeEventListener(r,t){const i=ko(r,t),e=this.eventMap.get(i);e?(this.inner.off(Is.EVENT_TYPE_MAP[r]??r,e),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,t)}};P(Is,"EVENT_TYPE_MAP",{"center-changed":"movestart moving moveend zoomend","zoom-changed":"zoomend"});let zi=Is;class Ow{constructor(){P(this,"typeMap",new Map)}addEventListener(r,t){let i=this.typeMap.get(r);i||(i=[],this.typeMap.set(r,i)),!i.includes(t)&&i.push(t)}removeEventListener(r,t){const i=this.typeMap.get(r);i&&X_.remove(i,t)}hasListener(r){const t=this.typeMap.get(r);return t!=null&&t.length>0}notify(r){const t=this.typeMap.get(r.type);t&&t.forEach(i=>i.call(r.target,r))}}const th=["3.0"],ok={baidu:{version:"3.0",key:""},google:{version:"quarterly",key:"",language:"en-us",libraries:["places","visualization"]},here:{version:th[0],key:""},baiduFree:{},googleFree:{},amap:{},yandex:{},osm:{},talks:{}};let kw;function qh(){return kw||Pt("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})")}function sk(n){n!=null&&(kw=Tw(ok,n))}function Rw(){BMap.OverlayV3||(BMap.OverlayV3=BMap.Overlay)}function ak(){const n=window;n.BMap||(console.warn("尝试兼容Baidu地图GL版, 仅用与测试, 不要用于生产环境!!"),window.BMap=n.BMapGL,n.BMap_Symbol_SHAPE_CIRCLE=BMapGL.SymbolShapeType.BMap_Symbol_SHAPE_CIRCLE,n.BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW=BMapGL.SymbolShapeType.BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW,n.BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW=BMapGL.SymbolShapeType.BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW,n.BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW=BMapGL.SymbolShapeType.BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW,n.BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW=BMapGL.SymbolShapeType.BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW,n.BMAP_PERSPECTIVE_MAP=BMAP_EARTH_MAP)}function xm(){return!!window.BMapGL}const Aw={create:(n,r)=>new(xm()?BMapGL.SVGSymbol:BMap.Symbol)(n,r),is:n=>n instanceof(xm()?BMapGL.SVGSymbol:BMap.Symbol)};function lk(){const n=window.$BAIDU$;!n||"kT"in n||Object.defineProperty(n,"kT",{get:()=>n._instances,enumerable:!0,configurable:!0})}function hk(){const n=i=>{var e;return i&&i.error===503&&i.popup===1&&((e=i.error_msg)!=null&&e.includes("检测到当前产品使用的地图服务未完成商用授权"))?(i.error=0,i.popup=0,i.error_msg="",!0):!1};let r,t;Object.defineProperty(window,"BMap",{configurable:!0,enumerable:!0,get:()=>r,set:i=>{r=i,t=i.bmapVerifyCbk,r.bmapVerifyCbk=e=>(n(e)&&console.debug("bmapVerifyCbk","==>",e),t(e)),r._rd=new Proxy(r._rd??{},{get:(e,o)=>typeof e[o]=="function"?(...s)=>{var a,l;if(s.length===1){const h=s[0];n(h)||n(h.result)?console.debug(o,"==>",h):h.error===0&&((a=h.content)==null?void 0:a.business)===0&&((l=h.content)==null?void 0:l.unauth)===1&&(h.content.unauth=0,console.debug(o,"==>",h))}return e[o](...s)}:e[o]})}})}const Cm={equals(n,r){return n.lat===r.lat&&n.lng===r.lng}};var rh;(function(n){function r(t){return t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight}n.isScrollable=r})(rh||(rh={}));class yc{constructor(r,t){P(this,"keyToValue",new Map);P(this,"valueToKey",new Map);Ps(r.length===t.length);for(let i=r.length-1;i>=0;i--)this.keyToValue.set(r[i],t[i]),this.valueToKey.set(t[i],r[i])}toKey(r){return this.valueToKey.get(r)??Pt()}toValue(r){return this.keyToValue.get(r)??Pt()}findKey(r,t=Th){for(const[i,e]of this.keyToValue.entries())if(t(r,e))return i}}class uk{constructor(r,t=10){P(this,"values");P(this,"maxSize4Debug");P(this,"map",new Map);this.values=r,this.maxSize4Debug=t,Dr()}getValueMap(r){let t=this.map.get(r);if(!t){t=new Map;for(let i=this.values.length-1;i>=0;i--){const e=this.values[i];t.set(r.call(e),e)}this.map.set(r,t)}return t}getOrNull(r,t){return this.getValueMap(r).get(t)}get(r,t){return this.getOrNull(r,t)??Pt(`key(${t})不存在与valueMap(${this.getValueMap(r)})中`)}}class Ss{constructor(r){P(this,"creator");P(this,"value");this.creator=r,Dr()}get(){return this.value===void 0&&(this.value=this.creator()),this.value}}var Ze;(function(n){n.TOP_LEFT="top-left",n.TOP_CENTER="top-center",n.TOP_RIGHT="top-right",n.BOTTOM_LEFT="bottom-left",n.BOTTOM_CENTER="bottom-center",n.BOTTOM_RIGHT="bottom-right",n.LEFT_TOP="left-top",n.LEFT_CENTER="left-center",n.LEFT_BOTTOM="left-bottom",n.RIGHT_TOP="right-top",n.RIGHT_CENTER="right-center",n.RIGHT_BOTTOM="right-bottom"})(Ze||(Ze={}));var fr;(function(n){let r,t,i;const e=[Ze.TOP_LEFT,Ze.TOP_CENTER,Ze.TOP_RIGHT,Ze.BOTTOM_LEFT,Ze.BOTTOM_CENTER,Ze.BOTTOM_RIGHT,Ze.LEFT_TOP,Ze.LEFT_CENTER,Ze.LEFT_BOTTOM,Ze.RIGHT_TOP,Ze.RIGHT_CENTER,Ze.RIGHT_BOTTOM];function o(){return r||(r=new yc(e,[BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT])),r}n.getBaidu=o;function s(){return t||(t=new yc(e,[google.maps.ControlPosition.TOP_LEFT,google.maps.ControlPosition.TOP_CENTER,google.maps.ControlPosition.TOP_RIGHT,google.maps.ControlPosition.BOTTOM_LEFT,google.maps.ControlPosition.BOTTOM_CENTER,google.maps.ControlPosition.BOTTOM_RIGHT,google.maps.ControlPosition.LEFT_TOP,google.maps.ControlPosition.LEFT_CENTER,google.maps.ControlPosition.LEFT_BOTTOM,google.maps.ControlPosition.RIGHT_TOP,google.maps.ControlPosition.RIGHT_CENTER,google.maps.ControlPosition.RIGHT_BOTTOM])),t}n.getGoogle=s;function a(){return i||(i=new yc(e,[{top:12,left:12},{top:12,left:"50%",transform:"translateX(-50%)"},{top:12,right:12},{bottom:12,left:12},{bottom:12,left:"50%",transform:"translateX(-50%)"},{bottom:12,right:12},{left:12,top:12},{left:12,top:"50%",transform:"translateY(-50%)"},{left:12,bottom:12},{right:12,top:12},{right:12,top:"50%",transform:"translateY(-50%)"},{right:12,bottom:12}])),i}n.getTalks=a})(fr||(fr={}));class Lw{constructor(r){P(this,"position");P(this,"inner");this.position=r,Dr()}}class Kh{}class Fd extends Kh{constructor(t,i){super();P(this,"visible");P(this,"position");this.visible=t,this.position=i}isVisible(){return this.visible}setVisible(t){this.visible=t}getPosition(){return this.position}setPosition(t){this.position=t}addTo(t){}removeFrom(t){}}class Nd extends Kh{constructor(t,i){super();P(this,"inner");P(this,"position");this.inner=t,this.position=i}isVisible(){return this.inner.isVisible()}setVisible(t){t?this.inner.show():this.inner.hide()}getPosition(){return this.position??fr.getBaidu().toKey(this.inner.getAnchor())}setPosition(t){this.position=t,this.inner.setAnchor(fr.getBaidu().toValue(t))}addTo(t){t.innerMap.addControl(this.inner)}removeFrom(t){t.innerMap.removeControl(this.inner)}}class Qh extends Kh{constructor(t,i){super();P(this,"_type");P(this,"position");P(this,"visible",!1);P(this,"map");this._type=t,this.position=i}isVisible(){return this.visible}setVisible(t){this.visible=t,this.tryUpdateOptions()}getPosition(){return this.position}setPosition(t){this.position=t,this.tryUpdateOptions()}addTo(t){this.map||(this.map=t,this.setVisible(!0))}removeFrom(){this.map&&(this.setVisible(!1),this.map=void 0)}onCreateOptions(){return{position:fr.getGoogle().toValue(this.position)}}tryUpdateOptions(){this.map&&this.map.innerMap.setOptions({[`${this._type}Control`]:this.visible,[`${this._type}ControlOptions`]:this.onCreateOptions()})}}class Iw extends Kh{constructor(t,i){super();P(this,"inner");P(this,"position");this.inner=t,this.position=i}isVisible(){return this.inner.isVisible()}setVisible(t){Gr.setVisible(this.inner,t)}getPosition(){return this.position}setPosition(t){this.inner.setPosition(fr.getTalks().toValue(t)),this.position=t}addTo(t){t.innerMap.addControl(this.inner)}removeFrom(){this.inner.remove()}}var tn;(function(n){n.normal="normal",n.satellite="satellite",n.hybrid="hybrid"})(tn||(tn={}));class Vr{constructor(r,t,i,e){P(this,"id");P(this,"baidu");P(this,"google");P(this,"googleCoordType");this.id=r,this.baidu=t,this.google=i,this.googleCoordType=e,Dr()}getId(){return this.id}getBaiduCoordType(){return De.bd09}asBaiduMapType(){return this.baidu()}getGoogleCoordType(){return this.googleCoordType}getGoogleMapTypeId(){return this.google()}asGoogleMapType(){zf("google的内置地图没有对应的实例")}}class ck{constructor(r,t){P(this,"coordType");P(this,"options");P(this,"baiduLayerCached",new Ss(()=>{const r=new BMap.TileLayer({});return r.getTilesUrl=(t,i)=>{const e=Math.pow(2,i-1),o=t.x+e,s=e-1-t.y;return this.options.getTileUrl({x:o,y:s},i)},r}));P(this,"baiduMapTypeCached",new Ss(()=>{const r=new BMap.MapType(this.options.name,this.baiduLayerCached.get(),{maxZoom:this.options.maxZoom,minZoom:this.options.minZoom,tips:this.options.describe});return r.__baidu_map_type__=this,r}));P(this,"googleCached",new Ss(()=>{const r=new google.maps.ImageMapType({getTileUrl:(t,i)=>this.options.getTileUrl(t,i),tileSize:new google.maps.Size(256,256),name:this.options.name,alt:this.options.describe,maxZoom:this.options.maxZoom,minZoom:this.options.minZoom});return r.__google_map_type__=this,r}));this.coordType=r,this.options=t,Dr()}get id(){return this.options.id}getBaiduCoordType(){return this.coordType}asBaiduMapType(){return this.baiduMapTypeCached.get()}asBaiduLayer(){return this.baiduLayerCached.get()}getGoogleCoordType(){return this.coordType}asGoogleMapType(){return this.googleCached.get()}asGoogleLayer(){zf("这个方法不会被调用")}}class fk{constructor(){P(this,"baiduCache",new Ss(()=>new BMap.TrafficLayer));P(this,"googleCache",new Ss(()=>new google.maps.TrafficLayer))}asBaiduLayer(){return this.baiduCache.get()}asGoogleLayer(){return this.googleCache.get()}}var or;(function(n){n.NORMAL=new Vr(tn.normal,()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,De.gcj02),n.SATELLITE=new Vr(tn.satellite,()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,De.wgs84),n.HYBRID=new Vr(tn.hybrid,()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,De.gcj02),n.TERRAIN=new Vr("terrain",()=>BMAP_PERSPECTIVE_MAP,()=>google.maps.MapTypeId.TERRAIN,De.wgs84),n.BUILD_IN_MAP_TYPES=new uk([n.NORMAL,n.SATELLITE,n.HYBRID,n.TERRAIN])})(or||(or={}));var oi;(function(n){n.DEFAULT="default",n.HORIZONTAL="horizontal",n.DROPDOWN="dropdown"})(oi||(oi={}));const Dw=[or.NORMAL,or.SATELLITE,or.HYBRID];class Hd extends Nd{static create(r){const t=r.mapTypes??Dw,i={[oi.DEFAULT]:BMAP_MAPTYPE_CONTROL_HORIZONTAL,[oi.HORIZONTAL]:BMAP_MAPTYPE_CONTROL_HORIZONTAL,[oi.DROPDOWN]:BMAP_MAPTYPE_CONTROL_DROPDOWN},e=new BMap.MapTypeControl({type:r.type&&i[r.type],mapTypes:t.map(o=>o.asBaiduMapType())});return r.position&&e.setAnchor(fr.getBaidu().toValue(r.position)),new Hd(e,r.position)}}const Cn=class Cn extends Qh{constructor(t=oi.DEFAULT,i=Ze.TOP_LEFT,e=Dw){super("mapType",i);P(this,"type");P(this,"mapTypes");this.type=t,this.mapTypes=e,Cn.type2google||(Cn.type2google={[oi.DEFAULT]:google.maps.MapTypeControlStyle.DEFAULT,[oi.HORIZONTAL]:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,[oi.DROPDOWN]:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(t){return new Cn(t.type,t.position,t.mapTypes)}onCreateOptions(){const t=super.onCreateOptions();return t.style=Cn.type2google[this.type],t.mapTypeIds=this.mapTypes.map(i=>i instanceof Vr?i.getGoogleMapTypeId():i.id),t}addTo(t){super.addTo(t),this.mapTypes.forEach(i=>{i instanceof Vr||t.innerMap.mapTypes.set(i.id,i.asGoogleMapType())})}};P(Cn,"type2google");let ff=Cn;class jd extends Fd{static create(r){return new jd(!0,r.position??Ze.TOP_LEFT)}}class Zd extends Nd{static create(r){const t=new BMap.ScaleControl({anchor:r.position&&fr.getBaidu().toValue(r.position)});return new Zd(t,r.position)}}class Vd extends Qh{static create(r){return new Vd(r.position)}constructor(r=Ze.BOTTOM_RIGHT){super("scale",r)}}class Wd extends Iw{static create(r){const t=r.position??Ze.BOTTOM_RIGHT,i=new tw.Scale({position:fr.getTalks().toValue(t)});return new Wd(i,t)}}class $d extends Fd{static create(r){return new $d(!0,r.position??Ze.RIGHT_BOTTOM)}}class Ud extends Qh{static create(r){return new Ud(r.position)}constructor(r=Ze.RIGHT_BOTTOM){super("streetView",r)}}class Jd extends Fd{static create(r){return new Jd(!0,r.position??Ze.RIGHT_BOTTOM)}}class Xd extends Nd{static create(r){const t=new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM,anchor:r.position&&fr.getBaidu().toValue(r.position)});return new Xd(t,r.position)}setShowZoomLevel(r){}}class Yd extends Qh{static create(r){return new Yd(r.position)}constructor(r=Ze.RIGHT_BOTTOM){super("zoom",r)}setShowZoomLevel(r){}}class qd extends Iw{static create(r){const t=r.position??Ze.RIGHT_BOTTOM,i=new tw.Zoom({position:fr.getTalks().toValue(t),zoomLevel:r.showZoomLevel??!0});return new qd(i,t)}setShowZoomLevel(r){this.inner.config({zoomLevel:r})}}let dk,gk;const ln={get LATLNG_ZERO(){return dk??(dk=new google.maps.LatLng({lat:0,lng:0}))},get BOUNDS_ZERO(){return gk??(gk=new google.maps.LatLngBounds(this.LATLNG_ZERO,this.LATLNG_ZERO))}};function zw(n,r={country:"",province:"",city:"",district:"",street:"",streetNumber:""}){for(const t of n)for(const i of t.types)switch(i){case"street_number":r.streetNumber=t.long_name;break;case"route":r.street=t.long_name;break;case"locality":r.city=t.long_name;break;case"sublocality":r.district=t.long_name;break;case"administrative_area_level_1":r.province=t.long_name;break;case"country":r.country=t.long_name;break}return r}function Bw(n,r){var i;const t=n.address_components&&zw(n.address_components);return{country:(t==null?void 0:t.country)??"",province:(t==null?void 0:t.province)??"",city:(t==null?void 0:t.city)??"",id:n.place_id??"",address:n.formatted_address??"",position:te.fromGoogle(((i=n.geometry)==null?void 0:i.location)??ln.LATLNG_ZERO,r.coordType),title:n.name??""}}class Gw{}class pk extends Gw{constructor(t,i){super();P(this,"map");P(this,"inner");this.map=t,this.inner=new google.maps.places.Autocomplete(i.input,{fields:["address_components","name"]}),i.bindToMap&&this.inner.bindTo("bounds",t.innerMap)}setBounds(t){this.inner.setBounds(t.toGoogle(this.map.coordType))}addResultListener(t){return Sw(this.inner,"place_changed",()=>{const i=this.inner.getPlace(),e={title:i.name??"",province:"",city:"",district:"",street:"",streetNumber:"",country:""};i.address_components&&zw(i.address_components,e),t(e)})}}class vk extends Gw{constructor(t,i){super();P(this,"map");P(this,"inner");P(this,"input");P(this,"removeableArray",[]);if(this.map=t,this.input=i.input,this.inner=new BMap.Autocomplete({input:i.input,location:i.bindToMap?t.innerMap:void 0}),i.bindToMap){const e=()=>{this.inner.setLocation(this.map.innerMap)};this.removeableArray.push(wm(this.map,"center-changed",e)),this.removeableArray.push(wm(this.map,"zoom-changed",e))}}setBounds(t){this.inner.setLocation(t.getCenter().toBaidu(this.map.coordType))}addResultListener(t){let i=0;const e=ik(this.inner,"confirm",s=>{const a=s.item.value;i=Date.now(),t(Object.assign({title:a.business,country:""},a))}),o=nk(this.input,"keyup",s=>{s.key==="Enter"&&Date.now()-i>100&&t({title:this.input.value,country:"",city:"",district:"",province:"",street:"",streetNumber:""})});return()=>{o(),e()}}}function Fw(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wl={exports:{}},mk=wl.exports,Tm;function _k(){return Tm||(Tm=1,function(n,r){(function(t,i){n.exports=i()})(mk,function(){const t=function(){var o={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},s=function(){var d=function(m){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=m.xField||m.defaultXField,this._yField=m.yField||m.defaultYField,this._valueField=m.valueField||m.defaultValueField,m.radius&&(this._cfgRadius=m.radius)},g=o.defaultRadius;return d.prototype={_organiseData:function(p,m){var v=p[this._xField],_=p[this._yField],y=this._radi,w=this._data,x=this._max,C=this._min,b=p[this._valueField]||1,E=p.radius||this._cfgRadius||g;return w[v]||(w[v]=[],y[v]=[]),w[v][_]?w[v][_]+=b:(w[v][_]=b,y[v][_]=E),w[v][_]>x?(m?this.setDataMax(w[v][_]):this._max=w[v][_],!1):{x:v,y:_,value:b,radius:E,min:C,max:x}},_unOrganizeData:function(){var p=[],m=this._data,v=this._radi;for(var _ in m)for(var y in m[_])p.push({x:_,y,radius:v[_][y],value:m[_][y]});return{min:this._min,max:this._max,data:p}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var p=arguments[0],m=p.length;m--;)this.addData.call(this,p[m]);else{var v=this._organiseData(arguments[0],!0);v&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[v]})}return this},setData:function(p){var m=p.data,v=m.length;this._data=[],this._radi=[];for(var _=0;_<v;_++)this._organiseData(m[_],!1);return this._max=p.max,this._min=p.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(p){return this._max=p,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(p){return this._min=p,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(p){this._coordinator=p},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},d}(),a=function(){var d=function(v){var _=v.gradient||v.defaultGradient,y=document.createElement("canvas"),w=y.getContext("2d");y.width=256,y.height=1;var x=w.createLinearGradient(0,0,256,1);for(var C in _)x.addColorStop(C,_[C]);return w.fillStyle=x,w.fillRect(0,0,256,1),w.getImageData(0,0,256,1).data},g=function(v,_){var y=document.createElement("canvas"),w=y.getContext("2d"),x=v,C=v;if(y.width=y.height=v*2,_==1)w.beginPath(),w.arc(x,C,v,0,2*Math.PI,!1),w.fillStyle="rgba(0,0,0,1)",w.fill();else{var b=w.createRadialGradient(x,C,v*_,x,C,v);b.addColorStop(0,"rgba(0,0,0,1)"),b.addColorStop(1,"rgba(0,0,0,0)"),w.fillStyle=b,w.fillRect(0,0,2*v,2*v)}return y},p=function(C){for(var _=[],y=C.min,w=C.max,x=C.radi,C=C.data,b=Object.keys(C),E=b.length;E--;)for(var T=b[E],S=Object.keys(C[T]),B=S.length;B--;){var L=S[B],D=C[T][L],N=x[T][L];_.push({x:T,y:L,value:D,radius:N})}return{min:y,max:w,data:_}};function m(v){var _=v.element,y=this.shadowCanvas=document.createElement("canvas"),w=this.canvas=v.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var x=getComputedStyle(v.element)||{};w.className="heatmap-canvas",this._width=w.width=y.width=+x.width.replace(/px/,""),this._height=w.height=y.height=+x.height.replace(/px/,""),this.shadowCtx=y.getContext("2d"),this.ctx=w.getContext("2d"),w.style.cssText=y.style.cssText="position:absolute;left:0;top:0;",_.style.position="relative",_.appendChild(w),this._palette=d(v),this._templates={},this._setStyles(v)}return m.prototype={renderPartial:function(v){this._drawAlpha(v),this._colorize()},renderAll:function(v){this._clear(),this._drawAlpha(p(v)),this._colorize()},_updateGradient:function(v){this._palette=d(v)},updateConfig:function(v,_){v.gradient!==_.gradient&&this._updateGradient(v),this._setStyles(v)},setDimensions:function(v,_){this._width=v,this._height=_,this.canvas.width=this.shadowCanvas.width=v,this.canvas.height=this.shadowCanvas.height=_},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(v){this._blur=v.blur==0?0:v.blur||v.defaultBlur,v.backgroundColor&&(this.canvas.style.backgroundColor=v.backgroundColor),this._opacity=(v.opacity||0)*255,this._maxOpacity=(v.maxOpacity||v.defaultMaxOpacity)*255,this._minOpacity=(v.minOpacity||v.defaultMinOpacity)*255,this._useGradientOpacity=!!v.useGradientOpacity},_drawAlpha:function(w){for(var _=this._min=w.min,y=this._max=w.max,w=w.data||[],x=w.length,C=1-this._blur;x--;){var b=w[x],E=b.x,T=b.y,S=b.radius,B=Math.min(b.value,y),L=E-S,D=T-S,N=this.shadowCtx,G;this._templates[S]?G=this._templates[S]:this._templates[S]=G=g(S,C),N.globalAlpha=(B-_)/(y-_),N.drawImage(G,L,D),L<this._renderBoundaries[0]&&(this._renderBoundaries[0]=L),D<this._renderBoundaries[1]&&(this._renderBoundaries[1]=D),L+2*S>this._renderBoundaries[2]&&(this._renderBoundaries[2]=L+2*S),D+2*S>this._renderBoundaries[3]&&(this._renderBoundaries[3]=D+2*S)}},_colorize:function(){var v=this._renderBoundaries[0],_=this._renderBoundaries[1],y=this._renderBoundaries[2]-v,w=this._renderBoundaries[3]-_,x=this._width,C=this._height,b=this._opacity,E=this._maxOpacity,T=this._minOpacity,S=this._useGradientOpacity;v<0&&(v=0),_<0&&(_=0),v+y>x&&(y=x-v),_+w>C&&(w=C-_);for(var B=this.shadowCtx.getImageData(v,_,y,w),L=B.data,D=L.length,N=this._palette,G=3;G<D;G+=4){var I=L[G],A=I*4;if(A){var k;b>0?k=b:I<E?I<T?k=T:k=I:k=E,L[G-3]=N[A],L[G-2]=N[A+1],L[G-1]=N[A+2],L[G]=S?N[A+3]:k}}this.ctx.putImageData(B,v,_),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(v){var _,y=this.shadowCtx,w=y.getImageData(v.x,v.y,1,1),x=w.data[3],C=this._max,b=this._min;return _=Math.abs(C-b)*(x/255)>>0,_},getDataURL:function(){return this.canvas.toDataURL()}},m}(),l=function(){var d=!1;return o.defaultRenderer==="canvas2d"&&(d=a),d}(),h={merge:function(){for(var f={},d=arguments.length,g=0;g<d;g++){var p=arguments[g];for(var m in p)f[m]=p[m]}return f}},u=function(){var d=function(){function v(){this.cStore={}}return v.prototype={on:function(_,y,w){var x=this.cStore;x[_]||(x[_]=[]),x[_].push(function(C){return y.call(w,C)})},emit:function(_,y){var w=this.cStore;if(w[_])for(var x=w[_].length,C=0;C<x;C++){var b=w[_][C];b(y)}}},v}(),g=function(m){var v=m._renderer,_=m._coordinator,y=m._store;_.on("renderpartial",v.renderPartial,v),_.on("renderall",v.renderAll,v),_.on("extremachange",function(w){m._config.onExtremaChange&&m._config.onExtremaChange({min:w.min,max:w.max,gradient:m._config.gradient||m._config.defaultGradient})}),y.setCoordinator(_)};function p(){var m=this._config=h.merge(o,arguments[0]||{});if(this._coordinator=new d,m.plugin){var v=m.plugin;if(o.plugins[v]){var _=o.plugins[v];this._renderer=new _.renderer(m),this._store=new _.store(m)}else throw new Error("Plugin '"+v+"' not found. Maybe it was not registered.")}else this._renderer=new l(m),this._store=new s(m);g(this)}return p.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(m){const v=this._config;return this._config=h.merge(this._config,m),this._renderer.updateConfig(this._config,v),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(m){return this._store.getValueAt?this._store.getValueAt(m):this._renderer.getValueAt?this._renderer.getValueAt(m):null}},p}(),c={create:function(f){return new u(f)},register:function(f,d){o.plugins[f]=d}};return c}();var i=function(o){Reflect.getPrototypeOf(i.prototype)!==BMap.Overlay.prototype&&Reflect.setPrototypeOf(i.prototype,BMap.Overlay.prototype),this.conf=o,this.conf.visible=o.visible===void 0?!0:o.visible,this.heatmap=null,this.latlngs=[],this.bounds=null};i.prototype=Object.create(typeof BMap>"u"?null:BMap.Overlay.prototype),i.prototype.initialize=function(o){this._map=o;var s=document.createElement("div");if(s.style.position="absolute",s.style.top=0,s.style.left=0,s.style.border=0,s.style.width=this._map.getSize().width+"px",s.style.height=this._map.getSize().height+"px",this.conf.element=s,!e())return s;o.getPanes().mapPane.appendChild(s),this.conf.valueField=this.conf.valueField||"count",this.heatmap=t.create(this.conf);var a=this;return o.addEventListener("resize",function(l){var h=l.size;s.style.width=h.width+"px",s.style.height=h.height+"px",a.heatmap._renderer.setDimensions(h.width,h.height),a.draw()}),this._div=s,s},i.prototype.draw=function(){if(e()){var o=this._map.getBounds();if(!o.equals(this.bounds)){this.bounds=o;var s=this._map.pointToOverlayPixel(o.getNorthEast()),a=this._map.pointToOverlayPixel(o.getSouthWest()),l=s.y,h=a.x,u=a.y-s.y,c=s.x-a.x;if(this.conf.element.style.left=h+"px",this.conf.element.style.top=l+"px",this.conf.element.style.width=c+"px",this.conf.element.style.height=u+"px",this.latlngs.length>0){this.heatmap.removeData();var f=this.latlngs.length;const v={max:this.heatmap._store.getData().max,data:[]};for(;f--;){var d=this.latlngs[f].latlng;if(o.containsPoint(d)){var g=this._map.pointToOverlayPixel(d),h=this._map.pointToOverlayPixel(o.getSouthWest()).x,l=this._map.pointToOverlayPixel(o.getNorthEast()).y,p=new BMap.Pixel(g.x-h,g.y-l),m=this.pixelTransform(p);v.data.push({x:m.x,y:m.y,count:this.latlngs[f].c})}}this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom())),this.heatmap.setData(v)}}}},i.prototype.pixelTransform=function(o){for(var s=this.heatmap.width,a=this.heatmap.height;o.x<0;)o.x+=s;for(;o.x>s;)o.x-=s;for(;o.y<0;)o.y+=a;for(;o.y>a;)o.y-=a;return o.x=o.x>>0,o.y=o.y>>0,o},i.prototype.setDataSet=function(o){if(this.data=o,!!e()){var s=this._map.getBounds(),a={max:o.max,data:[]},l=o.data,h=l.length;for(this.latlngs=[],this.heatmap.removeData(),this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom()));h--;){var u=new BMap.Point(l[h].lng,l[h].lat);if(this.latlngs.push({latlng:u,c:l[h].count}),!!s.containsPoint(u)){var c=this._map.pointToOverlayPixel(u),f=this._map.pointToOverlayPixel(s.getSouthWest()).x,d=this._map.pointToOverlayPixel(s.getNorthEast()).y,g=new BMap.Pixel(c.x-f,c.y-d),p=this.pixelTransform(g);a.data.push({x:p.x,y:p.y,count:l[h].count})}}this.heatmap.setData(a)}},i.prototype.addDataPoint=function(o,s,a){if(e()){this.data&&this.data.data&&this.data.data.push({lng:o,lat:s,count:a});var l=new BMap.Point(o,s),h=this.pixelTransform(this._map.pointToOverlayPixel(l));this.heatmap.store.addDataPoint(h.x,h.y,a),this.latlngs.push({latlng:l,c:a})}},i.prototype.toggle=function(){e()&&(this.conf.visible===!0?this.conf.visible=!1:this.conf.visible=!0,this.conf.visible?this.conf.element.style.display="block":this.conf.element.style.display="none")},i.prototype.setOptions=function(o){if(e()){for(var s in o)s=="radius"&&(this.heatmap._store._cfgRadius=o[s]);this.heatmap.configure(o),this.data&&this.setDataSet(this.data)}};function e(){var o=document.createElement("canvas");return!!(o.getContext&&o.getContext("2d"))}return i})}(wl)),wl.exports}var yk=_k(),wk=Fw(yk);const bm=10,ih={toGoogle:(n,r)=>({opacity:n.opacity,radius:n.radius??bm,gradient:n.gradient&&Object.entries(n.gradient).sort(([t],[i])=>+t-+i).map(([t,i])=>i),maxIntensity:n.maxIntensity,data:nh.toGoogle(n.data,r)}),toBaidu:(n,r,t)=>({opacity:n.opacity,radius:n.radius??bm,gradient:n.gradient,data:nh.toBaidu(n.data,r,t)})},nh={toGoogle:(n,r)=>n.map(t=>"weight"in t?{weight:t.weight,location:t.position.toGoogle(r)}:t.toGoogle(r)),toBaidu:(n,r,t)=>{let i=1;return{data:n.map(o=>{let s,a;return"weight"in o?(s=o.position.to(r),a=o.weight):(s=o.to(r),a=1),i<a&&(i=a),{lng:s.lng,lat:s.lat,count:a}}),max:t??i}}};class Nw{}class xk extends Nw{constructor(t,i){super();P(this,"map");P(this,"inner");this.map=t,this.inner=new google.maps.visualization.HeatmapLayer(ih.toGoogle(i,this.map.coordType)),this.inner.setMap(t.innerMap)}setData(t){this.inner.setData(nh.toGoogle(t,this.map.coordType))}setOptions(t){this.inner.setOptions(ih.toGoogle(t,this.map.coordType))}remove(){this.inner.setMap(null)}}class Ck extends Nw{constructor(t,i){super();P(this,"map");P(this,"inner");this.map=t;const e=ih.toBaidu(i,this.map.coordType,i.maxIntensity);this.inner=new wk(e),t.innerMap.addOverlay(this.inner),this.inner.setDataSet(e.data)}get innerDataMax(){var t;return(t=this.inner.data)==null?void 0:t.max}set innerDataMax(t){var i;((i=this.inner).data??(i.data={})).max=t}setData(t){this.inner.setDataSet(nh.toBaidu(t,this.map.coordType,this.innerDataMax))}setOptions(t){const i=ih.toBaidu(t,this.map.coordType,t.maxIntensity??this.innerDataMax);t.data!==this.inner.data?this.inner.setDataSet(i.data):t.maxIntensity&&(this.innerDataMax=t.maxIntensity),this.inner.setOptions(i)}remove(){this.map.innerMap.removeOverlay(this.inner)}}var ha;(function(n){function r(o,s){if(o!==void 0)return Object.values(s).includes(o)?o:void 0}n.toEnumOrNull=r;function t(o){return o.split(`
|
|
350
|
-
`).map(s=>s.trim()).join(`
|
|
351
|
-
`)}n.trimIndent=t;function i(o){return o.replace(/([^A-Z]?)([A-Z])/g,(s,a,l)=>a?`${a}-${l.toLowerCase()}`:l.toLowerCase())}n.pascal2kebab=i;function e(o){return/^-?\d+$/.test(o)}n.isInt=e})(ha||(ha={}));function Tk(n){return n[1]!=null}function bk(n){let r=null;return()=>r??(r=n().catch(t=>(r=null,Promise.reject(t))))}function Mk(n,r=300){let t;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{n(...i)},r)}}class Hw{constructor(r){P(this,"options");this.options=r}}function Os(n,r,t){const i=new URL(r,n),e=new URLSearchParams(Object.entries(t).filter(Tk));return i.search="?"+e.toString(),i}function wc(){const n=window.location.hostname.split(".").filter(r=>!ha.isInt(r));return n.length===3?n.join("."):[...n,"tg","map","urls"].slice(0,3).join(".")}const Ds=class Ds extends Hw{directions(r,t,i){return Os(Ds.BASE_URL,"dir/",{api:"1",origin:Ei.toString(r,De.gcj02),destination:Ei.toString(t,De.gcj02),travelmode:i})}search(r){return Os(Ds.BASE_URL,"search/",{api:"1",query:Ei.toString(r,De.gcj02)})}};P(Ds,"BASE_URL","https://www.google.com/maps/");let df=Ds;const ho=class ho extends Hw{directions(r,t,i="driving"){const e=Ei.getCoordType(t)??Ei.getCoordType(r)??De.bd09,o=Ei.toString(t,e);return Os(ho.BASE_URL,"direction",{origin:Ei.toString(r,e)??(typeof t!="string"?`name:请选择起点|latlng:${o}`:o),destination:o,coord_type:e===De.bd09?void 0:e,mode:i,output:"html",region:"中国",src:wc()})}search(r){return typeof r=="string"?this.geocoderApi(r):this.latlngApi(r)}latlngApi(r){const t=r.to(De.bd09);return new URL(`https://map.baidu.com/?latlng=${t.lat},${t.lng}`)}markerApi(r,t,i){return Os(ho.BASE_URL,"marker",{location:`${r.lat},${r.lng}`,coord_type:r.coord===De.bd09?void 0:r.coord,title:t,content:i,output:"html",src:wc()})}geocoderApi(r){return Os(ho.BASE_URL,"geocoder",{...typeof r=="string"?{address:r}:{location:`${r.lat},${r.lng}`,coord_type:r.coord===De.bd09?void 0:r.coord},output:"html",src:wc()})}};P(ho,"BASE_URL","https://api.map.baidu.com/");let gf=ho,Pk=class jw{constructor(r,t,i){this.extend(jw,google.maps.OverlayView),this.map_=r,this.MARKER_CLUSTER_IMAGE_PATH_="../images/m",this.MARKER_CLUSTER_IMAGE_EXTENSION_="png",this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var e=i||{};this.zIndex_=e.zIndex||google.maps.Marker.MAX_ZINDEX+1,this.gridSize_=e.gridSize||60,this.minClusterSize_=e.minimumClusterSize||2,this.maxZoom_=e.maxZoom||null,this.styles_=e.styles||[],this.imagePath_=e.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=e.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,e.zoomOnClick!=null&&(this.zoomOnClick_=e.zoomOnClick),this.averageCenter_=!1,e.averageCenter!=null&&(this.averageCenter_=e.averageCenter),this.setupStyles_(),this.setMap(r),this.prevZoom_=this.map_.getZoom();var o=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var s=o.map_.getZoom(),a=o.map_.minZoom||0,l=Math.min(o.map_.maxZoom||100,o.map_.mapTypes[o.map_.getMapTypeId()].maxZoom);s=Math.min(Math.max(s,a),l),o.prevZoom_!=s&&(o.prevZoom_=s,o.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){o.redraw()}),t&&(t.length||Object.keys(t).length)&&this.addMarkers(t,!1)}extend(r,t){return(function(i){for(var e in i.prototype)this.prototype[e]=i.prototype[e];return this}).apply(r,[t])}onAdd(){this.setReady_(!0)}draw(){}setupStyles_(){if(!this.styles_.length)for(var r=0,t;t=this.sizes[r];r++)this.styles_.push({url:this.imagePath_+(r+1)+"."+this.imageExtension_,height:t,width:t})}fitMapToMarkers(){for(var r=this.getMarkers(),t=new google.maps.LatLngBounds,i=0,e;e=r[i];i++)t.extend(e.getPosition());this.map_.fitBounds(t)}setZIndex(r){this.zIndex_=r}getZIndex(){return this.zIndex_}setStyles(r){this.styles_=r}getStyles(){return this.styles_}isZoomOnClick(){return this.zoomOnClick_}isAverageCenter(){return this.averageCenter_}getMarkers(){return this.markers_}getTotalMarkers(){return this.markers_.length}setMaxZoom(r){this.maxZoom_=r}getMaxZoom(){return this.maxZoom_}calculator_(r,t){for(var i=0,e=r.length,o=e;o!==0;)o=parseInt(o/10,10),i++;return i=Math.min(i,t),{text:e,index:i}}setCalculator(r){this.calculator_=r}getCalculator(){return this.calculator_}addMarkers(r,t){if(r.length)for(let i=0,e;e=r[i];i++)this.pushMarkerTo_(e);else if(Object.keys(r).length)for(let i in r)this.pushMarkerTo_(r[i]);t||this.redraw()}pushMarkerTo_(r){if(r.isAdded=!1,r.draggable){var t=this;google.maps.event.addListener(r,"dragend",function(){r.isAdded=!1,t.repaint()})}this.markers_.push(r)}addMarker(r,t){this.pushMarkerTo_(r),t||this.redraw()}removeMarker_(r){var t=-1;if(this.markers_.indexOf)t=this.markers_.indexOf(r);else for(var i=0,e;e=this.markers_[i];i++)if(e==r){t=i;break}return t==-1?!1:(r.setMap(null),this.markers_.splice(t,1),!0)}removeMarker(r,t){var i=this.removeMarker_(r);return!t&&i?(this.resetViewport(),this.redraw(),!0):!1}removeMarkers(r,t){for(var i=r===this.getMarkers()?r.slice():r,e=!1,o=0,s;s=i[o];o++){var a=this.removeMarker_(s);e=e||a}if(!t&&e)return this.resetViewport(),this.redraw(),!0}setReady_(r){this.ready_||(this.ready_=r,this.createClusters_())}getTotalClusters(){return this.clusters_.length}getMap(){return this.map_}setMap(r){this.map_=r}getGridSize(){return this.gridSize_}setGridSize(r){this.gridSize_=r}getMinClusterSize(){return this.minClusterSize_}setMinClusterSize(r){this.minClusterSize_=r}getExtendedBounds(r){var t=this.getProjection(),i=new google.maps.LatLng(r.getNorthEast().lat(),r.getNorthEast().lng()),e=new google.maps.LatLng(r.getSouthWest().lat(),r.getSouthWest().lng()),o=t.fromLatLngToDivPixel(i);o.x+=this.gridSize_,o.y-=this.gridSize_;var s=t.fromLatLngToDivPixel(e);s.x-=this.gridSize_,s.y+=this.gridSize_;var a=t.fromDivPixelToLatLng(o),l=t.fromDivPixelToLatLng(s);return r.extend(a),r.extend(l),r}isMarkerInBounds_(r,t){return t.contains(r.getPosition())}clearMarkers(){this.resetViewport(!0),this.markers_=[]}resetViewport(r){for(let t=0,i;i=this.clusters_[t];t++)i.remove();for(let t=0,i;i=this.markers_[t];t++)i.isAdded=!1,r&&i.setMap(null);this.clusters_=[]}repaint(){var r=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),setTimeout(function(){for(var t=0,i;i=r[t];t++)i.remove()},0)}redraw(){this.createClusters_()}distanceBetweenPoints_(r,t){if(!r||!t)return 0;var i=6371,e=(t.lat()-r.lat())*Math.PI/180,o=(t.lng()-r.lng())*Math.PI/180,s=Math.sin(e/2)*Math.sin(e/2)+Math.cos(r.lat()*Math.PI/180)*Math.cos(t.lat()*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2),a=2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)),l=i*a;return l}addToClosestCluster_(r){for(var t=4e4,i=null,e=0,o;o=this.clusters_[e];e++){var s=o.getCenter();if(s){var a=this.distanceBetweenPoints_(s,r.getPosition());a<t&&(t=a,i=o)}}if(i&&i.isMarkerInClusterBounds(r))i.addMarker(r);else{var l=new Ek(this);l.addMarker(r),this.clusters_.push(l)}}createClusters_(){if(this.ready_)for(var r=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),t=this.getExtendedBounds(r),i=0,e;e=this.markers_[i];i++)!e.isAdded&&this.isMarkerInBounds_(e,t)&&this.addToClosestCluster_(e)}},Ek=class{constructor(r){this.markerClusterer_=r,this.map_=r.getMap(),this.gridSize_=r.getGridSize(),this.minClusterSize_=r.getMinClusterSize(),this.averageCenter_=r.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new Kd(this,r.getStyles(),r.getGridSize())}isMarkerAlreadyAdded(r){if(this.markers_.indexOf)return this.markers_.indexOf(r)!=-1;for(var t=0,i;i=this.markers_[t];t++)if(i==r)return!0;return!1}addMarker(r){if(this.isMarkerAlreadyAdded(r))return!1;if(!this.center_)this.center_=r.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var t=this.markers_.length+1,i=(this.center_.lat()*(t-1)+r.getPosition().lat())/t,e=(this.center_.lng()*(t-1)+r.getPosition().lng())/t;this.center_=new google.maps.LatLng(i,e),this.calculateBounds_()}r.isAdded=!0,this.markers_.push(r);var o=this.markers_.length;if(o<this.minClusterSize_&&r.getMap()!=this.map_&&r.setMap(this.map_),o==this.minClusterSize_)for(var s=0;s<o;s++)this.markers_[s].setMap(null);return o>=this.minClusterSize_&&r.setMap(null),this.updateIcon(),!0}getMarkerClusterer(){return this.markerClusterer_}getBounds(){for(var r=new google.maps.LatLngBounds(this.center_,this.center_),t=this.getMarkers(),i=0,e;e=t[i];i++)r.extend(e.getPosition());return r}remove(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_}getSize(){return this.markers_.length}getMarkers(){return this.markers_}getCenter(){return this.center_}calculateBounds_(){var r=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(r)}isMarkerInClusterBounds(r){return this.bounds_.contains(r.getPosition())}getMap(){return this.map_}updateIcon(){var r=this.map_.getZoom(),t=this.markerClusterer_.getMaxZoom();if(t&&r>t){for(var i=0,e;e=this.markers_[i];i++)e.setMap(this.map_);return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}var o=this.markerClusterer_.getStyles().length,s=this.markerClusterer_.getCalculator()(this.markers_,o);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(s),this.clusterIcon_.show()}};class Kd{constructor(r,t,i){r.getMarkerClusterer().extend(Kd,google.maps.OverlayView),this.styles_=t,this.padding_=i||0,this.cluster_=r,this.center_=null,this.map_=r.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}triggerClusterClick(){var r=this.cluster_.getBounds(),t=this.cluster_.getMarkerClusterer();google.maps.event.trigger(t.map_,"clusterclick",this.cluster_),t.isZoomOnClick()&&(this.map_.fitBounds(r),this.map_.setCenter(r.getCenter()))}onAdd(){if(this.div_=document.createElement("DIV"),this.visible_){var r=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(r),this.div_.innerHTML=this.sums_.text}var t=this.getPanes();t.overlayMouseTarget.appendChild(this.div_);var i=this;google.maps.event.addDomListener(this.div_,"click",function(){i.triggerClusterClick()})}getPosFromLatLng_(r){var t=this.getProjection().fromLatLngToDivPixel(r);return t.x-=parseInt(this.width_/2,10),t.y-=parseInt(this.height_/2,10),t}draw(){if(this.visible_){var r=this.getPosFromLatLng_(this.center_);this.div_.style.top=r.y+"px",this.div_.style.left=r.x+"px"}}hide(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}show(){if(this.div_){var r=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(r),this.div_.style.display=""}this.visible_=!0}remove(){this.setMap(null)}onRemove(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)}setSums(r){this.sums_=r,this.text_=r.text,this.index_=r.index,this.div_&&(this.div_.innerHTML=r.text),this.useStyle()}useStyle(){var r=Math.max(0,this.sums_.index-1);r=Math.min(this.styles_.length-1,r);var t=this.styles_[r];this.url_=t.url,this.height_=t.height,this.width_=t.width,this.textColor_=t.textColor,this.anchor_=t.anchor,this.textSize_=t.textSize,this.backgroundPosition_=t.backgroundPosition}setCenter(r){this.center_=r}createCss(r){var t=[];t.push("z-index:"+this.cluster_.markerClusterer_.getZIndex()+";"),t.push("background-image:url("+this.url_+");");var i=this.backgroundPosition_?this.backgroundPosition_:"0 0";t.push("background-position:"+i+";"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?t.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):t.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?t.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):t.push("width:"+this.width_+"px; text-align:center;")):t.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;");var e=this.textColor_?this.textColor_:"black",o=this.textSize_?this.textSize_:11;return t.push("cursor:pointer; top:"+r.y+"px; left:"+r.x+"px; color:"+e+"; position:absolute; font-size:"+o+"px; font-family:Arial,sans-serif; font-weight:bold"),t.join("")}}var xl={exports:{}},Sk=xl.exports,Mm;function Ok(){return Mm||(Mm=1,function(n,r){(function(t,i){n.exports=i()})(Sk,function(){var t,i=t=i||{version:"1.3.8"},e={};i.guid="$BAIDU$",e[i.guid]=e[i.guid]||{},i.dom=i.dom||{},i.dom.g=function(l){return typeof l=="string"||l instanceof String?document.getElementById(l):l&&l.nodeName&&(l.nodeType==1||l.nodeType==9)?l:null},i.g=i.G=i.dom.g,i.dom.getDocument=function(l){return l=i.dom.g(l),l.nodeType==9?l:l.ownerDocument||l.document},i.lang=i.lang||{},i.lang.isString=function(l){return Object.prototype.toString.call(l)=="[object String]"},i.isString=i.lang.isString,i.dom._g=function(l){return i.lang.isString(l)?document.getElementById(l):l},i._g=i.dom._g,i.browser=i.browser||{},/msie (\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.ie=i.ie=document.documentMode||+RegExp.$1),i.dom.getComputedStyle=function(l,h){l=i.dom._g(l);var u=i.dom.getDocument(l),c;return u.defaultView&&u.defaultView.getComputedStyle&&(c=u.defaultView.getComputedStyle(l,null),c)?c[h]||c.getPropertyValue(h):""},i.dom._styleFixer=i.dom._styleFixer||{},i.dom._styleFilter=i.dom._styleFilter||[],i.dom._styleFilter.filter=function(l,h,u){for(var c=0,f=i.dom._styleFilter,d;d=f[c];c++)(d=d[u])&&(h=d(l,h));return h},i.string=i.string||{},i.string.toCamelCase=function(l){return l.indexOf("-")<0&&l.indexOf("_")<0?l:l.replace(/[-_][^-_]/g,function(h){return h.charAt(1).toUpperCase()})},i.dom.getStyle=function(l,h){var u=i.dom;l=u.g(l),h=i.string.toCamelCase(h);var c=l.style[h]||(l.currentStyle?l.currentStyle[h]:"")||u.getComputedStyle(l,h);if(!c){var f=u._styleFixer[h];f&&(c=f.get?f.get(l):i.dom.getStyle(l,f))}return(f=u._styleFilter)&&(c=f.filter(h,c,"get")),c},i.getStyle=i.dom.getStyle,/opera\/(\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.opera=+RegExp.$1),i.browser.isWebkit=/webkit/i.test(navigator.userAgent),i.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent),i.browser.isStrict=document.compatMode=="CSS1Compat",i.dom.getPosition=function(l){l=i.dom.g(l);var h=i.dom.getDocument(l),u=i.browser,c=i.dom.getStyle;u.isGecko>0&&h.getBoxObjectFor&&c(l,"position")=="absolute"&&(l.style.top===""||l.style.left);var f={left:0,top:0},d=u.ie&&!u.isStrict?h.body:h.documentElement,g,p;if(l==d)return f;if(l.getBoundingClientRect){p=l.getBoundingClientRect(),f.left=Math.floor(p.left)+Math.max(h.documentElement.scrollLeft,h.body.scrollLeft),f.top=Math.floor(p.top)+Math.max(h.documentElement.scrollTop,h.body.scrollTop),f.left-=h.documentElement.clientLeft,f.top-=h.documentElement.clientTop;var m=h.body,v=parseInt(c(m,"borderLeftWidth")),_=parseInt(c(m,"borderTopWidth"));u.ie&&!u.isStrict&&(f.left-=isNaN(v)?2:v,f.top-=isNaN(_)?2:_)}else{g=l;do{if(f.left+=g.offsetLeft,f.top+=g.offsetTop,u.isWebkit>0&&c(g,"position")=="fixed"){f.left+=h.body.scrollLeft,f.top+=h.body.scrollTop;break}g=g.offsetParent}while(g&&g!=l);for((u.opera>0||u.isWebkit>0&&c(l,"position")=="absolute")&&(f.top-=h.body.offsetTop),g=l.offsetParent;g&&g!=h.body;)f.left-=g.scrollLeft,(!u.opera||g.tagName!="TR")&&(f.top-=g.scrollTop),g=g.offsetParent}return f},i.event=i.event||{},i.event._listeners=i.event._listeners||[],i.event.on=function(l,h,u){h=h.replace(/^on/i,""),l=i.dom._g(l);var c=function(m){u.call(l,m)},f=i.event._listeners,d=i.event._eventFilter,g,p=h;return h=h.toLowerCase(),d&&d[h]&&(g=d[h](l,h,c),p=g.type,c=g.listener),l.addEventListener?l.addEventListener(p,c,!1):l.attachEvent&&l.attachEvent("on"+p,c),f[f.length]=[l,h,u,c,p],l},i.on=i.event.on,function(){var l=e[i.guid];i.lang.guid=function(){return"TANGRAM__"+(l._counter++).toString(36)},l._counter=l._counter||1}(),e[i.guid]._instances=e[i.guid]._instances||{},i.lang.isFunction=function(l){return Object.prototype.toString.call(l)=="[object Function]"},i.lang.Class=function(l){this.guid=l||i.lang.guid(),e[i.guid]._instances[this.guid]=this},e[i.guid]._instances=e[i.guid]._instances||{},i.lang.Class.prototype.dispose=function(){delete e[i.guid]._instances[this.guid];for(var l in this)i.lang.isFunction(this[l])||delete this[l];this.disposed=!0},i.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"},i.lang.Event=function(l,h){this.type=l,this.returnValue=!0,this.target=h||null,this.currentTarget=null},i.lang.Class.prototype.addEventListener=function(l,h,u){if(i.lang.isFunction(h)){!this.__listeners&&(this.__listeners={});var c=this.__listeners,f;if(typeof u=="string"&&u){if(/[^\w\-]/.test(u))throw"nonstandard key:"+u;h.hashCode=u,f=u}l.indexOf("on")!=0&&(l="on"+l),typeof c[l]!="object"&&(c[l]={}),f=f||i.lang.guid(),h.hashCode=f,c[l][f]=h}},i.lang.Class.prototype.removeEventListener=function(l,h){if(!(typeof h<"u"&&(i.lang.isFunction(h)&&!(h=h.hashCode)||!i.lang.isString(h)))){!this.__listeners&&(this.__listeners={}),l.indexOf("on")!=0&&(l="on"+l);var u=this.__listeners;if(u[l])if(typeof h<"u")u[l][h]&&delete u[l][h];else for(var c in u[l])delete u[l][c]}},i.lang.Class.prototype.dispatchEvent=function(l,h){i.lang.isString(l)&&(l=new i.lang.Event(l)),!this.__listeners&&(this.__listeners={}),h=h||{};for(var u in h)l[u]=h[u];var u,c=this.__listeners,f=l.type;if(l.target=l.target||this,l.currentTarget=this,f.indexOf("on")!=0&&(f="on"+f),i.lang.isFunction(this[f])&&this[f].apply(this,arguments),typeof c[f]=="object")for(u in c[f])c[f][u].apply(this,arguments);return l.returnValue},i.lang.inherits=function(l,h,u){var c,f,d=l.prototype,g=new Function;g.prototype=h.prototype,f=l.prototype=new g;for(c in d)f[c]=d[c];l.prototype.constructor=l,l.superClass=h.prototype,typeof u=="string"&&(f._className=u)},i.inherits=i.lang.inherits;var o="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m",s="png",a=function(l,h,u){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}t.lang.inherits(a,BMap.Overlay,"TextIconOverlay"),this._position=l,this._text=h,this._options=u||{},this._styles=this._options.styles||[],this._zIndex=this._options.zIndex,!this._styles.length&&this._setupDefaultStyles()};return a.prototype._setupDefaultStyles=function(){for(var l=[53,56,66,78,90],h=0,u;u=l[h];h++)this._styles.push({url:o+h+"."+s,size:new BMap.Size(u,u)})},a.prototype.initialize=function(l){return this._map=l,this._domElement=document.createElement("div"),this._updateCss(),this._updateText(),this._updatePosition(),this._bind(),this._map.getPanes().markerMouseTarget.appendChild(this._domElement),this._domElement},a.prototype.draw=function(){this._map&&this._updatePosition()},a.prototype.getText=function(){return this._text},a.prototype.setText=function(l){l&&(!this._text||this._text.toString()!=l.toString())&&(this._text=l,this._updateText(),this._updateCss(),this._updatePosition())},a.prototype.getPosition=function(){return this._position},a.prototype.setPosition=function(l){l&&(!this._position||!this._position.equals(l))&&(this._position=l,this._updatePosition())},a.prototype.getStyleByText=function(l,h){var u=parseInt(l),c=parseInt(u/10);return c=Math.max(0,c),c=Math.min(c,h.length-1),h[c]},a.prototype._updateCss=function(){if(this._domElement){var l=this.getStyleByText(this._text,this._styles);this._domElement.style.cssText=this._buildCssText(l)}},a.prototype._updateText=function(){this._domElement&&(this._domElement.innerHTML=this._text)},a.prototype._updatePosition=function(){if(this._domElement&&this._position){var l=this._domElement.style,h=this._map.pointToOverlayPixel(this._position);h.x-=Math.ceil(parseInt(l.width)/2),h.y-=Math.ceil(parseInt(l.height)/2),l.left=h.x+"px",l.top=h.y+"px"}},a.prototype._buildCssText=function(l){var h=l.url,u=l.size,c=l.anchor,f=l.offset,d=l.textColor||"black",g=l.textSize||10,p=[];if(this._zIndex&&p.push("z-index:"+this._zIndex+";"),t.browser.ie<7)p.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+h+'");');else{p.push("background-image:url("+h+");");var m="0 0";f instanceof BMap.Size&&(m=f.width+"px "+f.height+"px"),p.push("background-position:"+m+";")}return u instanceof BMap.Size&&(c instanceof BMap.Size?(c.height>0&&c.height<u.height&&p.push("height:"+(u.height-c.height)+"px; padding-top:"+c.height+"px;"),c.width>0&&c.width<u.width&&p.push("width:"+(u.width-c.width)+"px; padding-left:"+c.width+"px;")):(p.push("height:"+u.height+"px; line-height:"+u.height+"px;"),p.push("width:"+u.width+"px; text-align:center;"))),p.push("cursor:pointer; color:"+d+"; position:absolute; font-size:"+g+"px; font-family:Arial,sans-serif; font-weight:bold"),p.join("")},a.prototype._bind=function(){if(!this._domElement)return;var l=this,h=this._map,u=t.lang.Event;function c(f,d){var g=f.srcElement||f.target,p=f.clientX||f.pageX,m=f.clientY||f.pageY;if(f&&d&&p&&m&&g){var v=t.dom.getPosition(h.getContainer());d.pixel=new BMap.Pixel(p-v.left,m-v.top),d.point=h.pixelToPoint(d.pixel)}return d}t.event.on(this._domElement,"mouseover",function(f){l.dispatchEvent(c(f,new u("onmouseover")))}),t.event.on(this._domElement,"mouseout",function(f){l.dispatchEvent(c(f,new u("onmouseout")))}),t.event.on(this._domElement,"click",function(f){l.dispatchEvent(c(f,new u("onclick")))})},a})}(xl)),xl.exports}var kk=Ok(),Pm=Fw(kk),Zw=function(n,r,t){r=Rk(r);var i=n.pointToPixel(r.getNorthEast()),e=n.pointToPixel(r.getSouthWest());i.x+=t,i.y-=t,e.x-=t,e.y+=t;var o=n.pixelToPoint(i),s=n.pixelToPoint(e);return new BMap.Bounds(s,o)},Rk=function(n){var r=cl(n.getNorthEast().lng,-180,180),t=cl(n.getSouthWest().lng,-180,180),i=cl(n.getNorthEast().lat,-74,74),e=cl(n.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(t,e),new BMap.Point(r,i))},cl=function(n,r,t){return r&&(n=Math.max(n,r)),t&&(n=Math.min(n,t)),n},Vw=function(n){return Object.prototype.toString.call(n)==="[object Array]"},Ww=function(n,r){var t=-1;if(Vw(r)){if(r.indexOf)t=r.indexOf(n);else for(var i=0,e;e=r[i];i++)if(e===n){t=i;break}}return t},Xe=function(n,r){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}if(n){this._map=n,this._markers=[],this._clusters=[];var t=r||{};this._zIndex=t.zIndex,this._gridSize=t.gridSize||60,this._maxZoom=t.maxZoom||18,this._minClusterSize=t.minClusterSize||2,this._isAverageCenter=!1,t.isAverageCenter!=null&&(this._isAverageCenter=t.isAverageCenter),this._styles=t.styles||[];var i=this;this._map.addEventListener("zoomend",function(){i._redraw()}),this._map.addEventListener("moveend",function(){i._redraw()});var e=t.markers;Vw(e)&&this.addMarkers(e)}};Xe.prototype.addMarkers=function(n){if(n.length){for(var r=0,t=n.length;r<t;r++)this._pushMarkerTo(n[r]);this._createClusters()}};Xe.prototype._pushMarkerTo=function(n){var r=Ww(n,this._markers);r===-1&&(n.isInCluster=!1,this._markers.push(n))};Xe.prototype.addMarker=function(n){this._pushMarkerTo(n),this._createClusters()};Xe.prototype._createClusters=function(){var n=this._map.getBounds();if(n.getCenter()){for(var r=Zw(this._map,n,this._gridSize),t=0,i;i=this._markers[t];t++)!i.isInCluster&&r.containsPoint(i.getPosition())&&this._addToClosestCluster(i);for(var e=this._markers.length,t=0;t<e;t++)this._clusters[t]&&this._clusters[t].render()}};Xe.prototype._addToClosestCluster=function(n){var r=4e6,t=null;n.getPosition();for(var i=0,e;e=this._clusters[i];i++){var o=e.getCenter();if(o){var s=this._map.getDistance(o,n.getPosition());s<r&&(r=s,t=e)}}if(t&&t.isMarkerInClusterBounds(n))t.addMarker(n);else{var e=new ei(this);e.addMarker(n),this._clusters.push(e)}};Xe.prototype._clearLastClusters=function(){for(var n=0,r;r=this._clusters[n];n++)r.remove();this._clusters=[],this._removeMarkersFromCluster()};Xe.prototype._removeMarkersFromCluster=function(){for(var n=0,r;r=this._markers[n];n++)r.isInCluster=!1};Xe.prototype._removeMarkersFromMap=function(){for(var n=0,r;r=this._markers[n];n++){r.isInCluster=!1;var t=r.getLabel();this._map.removeOverlay(r),r.setLabel(t)}};Xe.prototype._removeMarker=function(n){var r=Ww(n,this._markers);return r===-1?!1:(this._map.removeOverlay(n),this._markers.splice(r,1),!0)};Xe.prototype.removeMarker=function(n){var r=this._removeMarker(n);return r&&(this._clearLastClusters(),this._createClusters()),r};Xe.prototype.removeMarkers=function(n){for(var r=!1,t=0;t<n.length;t++){var i=this._removeMarker(n[t]);r=r||i}return r&&(this._clearLastClusters(),this._createClusters()),r};Xe.prototype.clearMarkers=function(){this._clearLastClusters(),this._removeMarkersFromMap(),this._markers=[]};Xe.prototype._redraw=function(){this._clearLastClusters(),this._createClusters()};Xe.prototype.getGridSize=function(){return this._gridSize};Xe.prototype.setGridSize=function(n){this._gridSize=n,this._redraw()};Xe.prototype.getMaxZoom=function(){return this._maxZoom};Xe.prototype.setMaxZoom=function(n){this._maxZoom=n,this._redraw()};Xe.prototype.getZIndex=function(){return this._zIndex};Xe.prototype.setZIndex=function(n){this._zIndex!=n&&(this.zIndex=n,this._redraw())};Xe.prototype.getStyles=function(){return this._styles};Xe.prototype.setStyles=function(n){this._styles=n,this._redraw()};Xe.prototype.getMinClusterSize=function(){return this._minClusterSize};Xe.prototype.setMinClusterSize=function(n){this._minClusterSize=n,this._redraw()};Xe.prototype.isAverageCenter=function(){return this._isAverageCenter};Xe.prototype.getMap=function(){return this._map};Xe.prototype.getMarkers=function(){return this._markers};Xe.prototype.getClustersCount=function(){for(var n=0,r=0,t;t=this._clusters[r];r++)t.isReal()&&n++;return n};Xe.prototype._textCalculator=function(n){return n.length.toString()};Xe.prototype._stylesIndexCalculator=null;Xe.prototype.setTextCalculator=function(n){this._textCalculator=n};Xe.prototype.setStylesIndexCalculator=function(n){this._stylesIndexCalculator=n};function ei(n){var r=this;this._markerClusterer=n,this._map=n.getMap(),this._minClusterSize=n.getMinClusterSize(),this._isAverageCenter=n.isAverageCenter(),this._center=null,this._markers=[],this._gridBounds=null,this._isReal=!1,this._clusterMarker=new Pm(this._center,this._markers.length,{styles:this._markerClusterer.getStyles(),zIndex:n._zIndex}),this._clusterMarker.getStyleByText=function(t,i){if(r._markerClusterer._stylesIndexCalculator){var e=r._markerClusterer._stylesIndexCalculator(r._markers,i.length);return i[e]}return Pm.prototype.getStyleByText.call(this,t,i)},this._clusterMarker.addEventListener&&this._clusterMarker.addEventListener("click",function(t){r._map.setViewport(r.getBounds())})}ei.prototype.addMarker=function(n){if(this.isMarkerInCluster(n))return!1;if(!this._center)this._center=n.getPosition(),this.updateGridBounds();else if(this._isAverageCenter){var r=this._markers.length+1,t=(this._center.lat*(r-1)+n.getPosition().lat)/r,i=(this._center.lng*(r-1)+n.getPosition().lng)/r;this._center=new BMap.Point(i,t),this.updateGridBounds()}return n.isInCluster=!0,this._markers.push(n),!0};ei.prototype.render=function(){var n=this._markers.length;if(n<this._minClusterSize)for(var r=0;r<n;r++)this._map.addOverlay(this._markers[r]);else this._map.addOverlay(this._clusterMarker),this._isReal=!0,this.updateClusterMarker()};ei.prototype.isMarkerInCluster=function(n){if(this._markers.indexOf)return this._markers.indexOf(n)!=-1;for(var r=0,t;t=this._markers[r];r++)if(t===n)return!0;return!1};ei.prototype.isMarkerInClusterBounds=function(n){return this._gridBounds.containsPoint(n.getPosition())};ei.prototype.isReal=function(n){return this._isReal};ei.prototype.updateGridBounds=function(){var n=new BMap.Bounds(this._center,this._center);this._gridBounds=Zw(this._map,n,this._markerClusterer.getGridSize())};ei.prototype.updateClusterMarker=function(){if(this._map.getZoom()>this._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var n=0,r;r=this._markers[n];n++)this._map.addOverlay(r);return}if(this._markers.length<this._minClusterSize){this._clusterMarker.hide();return}this._clusterMarker.setPosition(this._center),this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers))};ei.prototype.remove=function(){for(var n=0,r;r=this._markers[n];n++){var t=this._markers[n].getLabel();this._markers[n].getMap()&&this._map.removeOverlay(this._markers[n]),this._markers[n].setLabel(t)}this._map.removeOverlay(this._clusterMarker),this._markers.length=0,delete this._markers};ei.prototype.getBounds=function(){for(var n=new BMap.Bounds(this._center,this._center),r=0,t;t=this._markers[r];r++)n.extend(t.getPosition());return n};ei.prototype.getCenter=function(){return this._center};var Cr;(function(n){function r(u,c){return u.reduce((f,d)=>(f[c(d)]=d,f),{})}n.fromArray=r;function t(u){return u.reduce((c,f)=>(c[f[0]]=f[1],c),{})}n.fromEntries=t;function i(u){return JSON.stringify(u,(c,f)=>typeof f=="object"&&Object.getPrototypeOf(f)!==Object.prototype?f.toString!==Object.prototype.toString?f.toString():`[object ${Object.getPrototypeOf(f).constructor.name}]`:f)}n.toJsonSafely=i;function e(u){const c=u;return Ew(c)&&Object.keys(c).forEach(f=>{c[f]===void 0?delete c[f]:e(c[f])}),u}n.deleteUndefinedPropertyOnPlainObjectDeeply=e;function o(u,c,f){let d=u[c];return d===void 0&&(d=f(),u[c]=d),d}n.putIfAbsent=o;function s(u,...c){const f=Em(c),d={};for(const g in u)f(g)||(d[g]=u[g]);return d}n.omit=s;function a(u,...c){const f=Em(c),d={};for(const g in u)f(g)&&(d[g]=u[g]);return d}n.pick=a;function l(u,c){const f=typeof c=="string"?c.split("."):c;let d=u;for(const g of f){if(d==null)return;d=d[g]}return d}n.get=l;function h(u,c){const f=typeof c=="string"?c.split("."):c,d=l(u,f.slice(0,-1)),g=f[f.length-1];d!=null&&delete d[g]}n.del=h})(Cr||(Cr={}));function Em(n){if(n.length<=4)return n.includes.bind(n);{const r=new Set(n);return r.has.bind(r)}}Cr.toJsonSafely;const $w=n=>{var t;if(((t=n==null?void 0:n[0])==null?void 0:t.minMarkersLength)==null)return;const r=n;return i=>{let e;for(e=0;e<r.length&&!(i<(r[e].minMarkersLength??0));e++);return Math.max(0,e-1)}};var ua;(function(n){function r(e){return{url:e.url,size:new BMap.Size(e.size.width,e.size.height),anchor:e.anchor&&new BMap.Size(e.anchor.x,e.anchor.y),offset:e.offset&&new BMap.Size(e.offset.x,e.offset.y),textColor:e.textColor,textSize:e.textSize}}n.toBaidu=r;function t(e){return{url:e.url,width:e.size.width,height:e.size.height,anchor:e.anchor&&[e.anchor.y,e.anchor.x],backgroundPosition:e.offset&&`${e.offset.x} ${e.offset.y}`,textColor:e.textColor,textSize:e.textSize}}n.toGoogle=t;function i(e){if(!(e!=null&&e.length))return;const o={...e[0]};for(let u=1;u<e.length;u++){const c=e[u];for(const f of Object.keys(c))typeof o[f]!="function"&&o[f]!==c[f]&&(o[f]=d=>d[f])}const s=(u,c,f=d=>d)=>{if(u!=null)return typeof u=="function"?{type:"interval",property:"count",stops:(e==null?void 0:e.map(d=>[d.minMarkersLength??0,f(u(d))??c]))??[]}:f(u)??c},a=u=>{var c;return u.size.width/2-(((c=u.anchor)==null?void 0:c.x)??0)},l=u=>{var c;return u.size.height/2-(((c=u.anchor)==null?void 0:c.y)??0)},h=typeof o.size=="function"||typeof o.anchor=="function"?{dx:s(a,0),dy:s(l,0)}:{dx:a(o),dy:l(o)};return{textSymbol:{textSize:s(o.textSize,16),textFill:s(o.textColor,"white"),...o.anchor&&{textDx:h.dx,textDy:h.dy,textVerticalAlignment:"middle",textHorizontalAlignment:"middle"}},symbol:{markerFile:s(o.url,"https://error"),markerWidth:s(o.size,40,u=>u.width),markerHeight:s(o.size,40,u=>u.height),...o.anchor?{markerDx:s(o.anchor,0,u=>-u.x),markerDy:s(o.anchor,0,u=>-u.y),markerVerticalAlignment:"bottom",markerHorizontalAlignment:"right"}:{markerVerticalAlignment:"middle",markerHorizontalAlignment:"middle"}}}}n.toTalks=i})(ua||(ua={}));class Uw{constructor(r){P(this,"map");this.map=r,Dr()}clearMarkers(r){this.inner.clearMarkers()}addMarker(r){this.inner.addMarker(r.innerOverlay)}removeMarker(r){return this.inner.removeMarker(r.innerOverlay)}addMarkers(r){this.inner.addMarkers(r.map(t=>t.innerOverlay))}removeMarkers(r){return this.inner.removeMarkers(r.map(t=>t.innerOverlay))}}class Ak extends Uw{constructor(t,i){var o;super(t);P(this,"inner");this.inner=new Xe(t.innerMap,{gridSize:i.gridSize,maxZoom:i.maxZoom,minClusterSize:i.minClusterSize,isAverageCenter:i.averageCenter,styles:(o=i.styles)==null?void 0:o.map(s=>ua.toBaidu(s)),zIndex:i.zIndex});const e=i.stylesIndexCalculator??$w(i.styles);e&&this.inner.setStylesIndexCalculator((s,a)=>e(s.length,a)),i.markers&&this.addMarkers(i.markers)}recreate(){this.inner._redraw()}}class Lk extends Uw{constructor(t,i){var o,s;super(t);P(this,"inner");this.inner=new Pk(t.innerMap,(o=i.markers)==null?void 0:o.map(a=>a.innerOverlay),{gridSize:i.gridSize,maxZoom:i.maxZoom,minimumClusterSize:i.minClusterSize,averageCenter:i.averageCenter,styles:(s=i.styles)==null?void 0:s.map(a=>ua.toGoogle(a)),zIndex:i.zIndex});const e=i.stylesIndexCalculator??$w(i.styles);e&&this.inner.setCalculator((a,l)=>({text:a.length,index:e(a.length,l)+1}))}recreate(){this.inner.repaint()}}class Ik{constructor(r,t){P(this,"map");P(this,"inner");var e;this.map=r,this.inner=new Xh("cluster",(e=t.markers)==null?void 0:e.map(o=>o.innerOverlay),Cr.deleteUndefinedPropertyOnPlainObjectDeeply({...ua.toTalks(t.styles),maxClusterRadius:t.gridSize??(r.currentBaseLayerId==="baidu"||r.currentBaseLayerId==="baidu-detail"?60:100),maxClusterZoom:t.maxZoom,zIndex:t.zIndex})),this.inner.on("identifyempty",o=>{const s=r.innerMap.containerPointToCoordinate(o.containerPoint),a=this.inner.identify(s,o);a&&!Array.isArray(a)&&r.innerMap.fitExtent(Gr.extentFromCoordinates(a.children.map(l=>l.getCoordinates())))}),r.innerMap.addLayer(this.inner);const i=Mk(()=>{var a;const o=new Set(((a=this.inner.getRenderer())==null?void 0:a.getCurrentNeedRenderGeos())??[]),s=this.inner.getGeometries();for(const l of s){const h=l.__visible_in_cluster??l.isVisible(),u=o.has(l);h!==u&&(l.__visible_in_cluster=u,l.fire("visible-change-in-cluster",{visible:u}))}},100);r.innerMap.on("zoomend",i),i()}clearMarkers(r=!0){this.inner.clear(),r&&this.inner.remove()}addMarker(r){this.inner.addMarker(r.innerOverlay)}removeMarker(r){return this.inner.removeGeometry(r.innerOverlay),!0}addMarkers(r){this.inner.addMarker(r.map(t=>t.innerOverlay))}removeMarkers(r){return this.inner.removeGeometry(r.map(t=>t.innerOverlay)),!0}recreate(){const r=this.inner.getRenderer();r==null||r.setToRedraw()}}class Jw{constructor(){Dr()}}class Dk extends Jw{constructor(t,i){super();P(this,"map");P(this,"inner");this.map=t,this.inner=new google.maps.places.PlacesService(t.innerMap)}search(t,i){return this.searchImpl(t,i instanceof te?i.toGoogle(this.map.coordType):i??this.map.innerMap.getCenter())}searchInBounds(t,i){return this.searchImpl(t,i.toGoogle(this.map.coordType))}searchNearBy(t,i,e){return this.searchImpl(t,{center:i.toGoogle(this.map.coordType),radius:e})}searchImpl(t,i){return new Promise((e,o)=>{this.inner.findPlaceFromQuery({query:t,fields:["formatted_address","geometry","name","place_id"],locationBias:i},(s,a)=>{switch(a){case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.OK:{const l=(s??[]).map(h=>Bw(h,this.map));e(l);break}default:o(new Error(`status: ${a}`));break}})})}}class zk extends Jw{constructor(t,i){super();P(this,"map");P(this,"searchRequestMap",new Map);P(this,"currentSearch");this.map=t}get inner(){return this.currentSearch}search(t,i){return this.newSearch(i instanceof te?i.toBaidu(this.map.coordType):i??this.map.innerMap.getCenter(),e=>{e.search(t)})}searchInBounds(t,i){return this.newSearch(void 0,e=>{e.searchInBounds(t,i.toBaidu(this.map.coordType))})}searchNearBy(t,i,e){return this.newSearch(void 0,o=>{o.searchNearby(t,i.toBaidu(this.map.coordType),e)})}newSearch(t,i){return new Promise((e,o)=>{const s=new BMap.LocalSearch(t??this.map.innerMap,{onSearchComplete:a=>{Array.isArray(a)&&zf("当前只支持一次搜索一条数据");const l=s.getStatus();switch(l){case BMAP_STATUS_SUCCESS:{const h=[];for(let u=0;u<a.getCurrentNumPois();u++){const c=a.getPoi(u);h.push({id:c.uid,city:c.city,country:"",position:te.fromBaidu(c.point,this.map.coordType),province:c.province,title:c.title,address:c.address})}e(h);break}case BMAP_STATUS_UNKNOWN_LOCATION:e([]);break;default:o(new Error(`status: ${l}`));break}}});i(s)})}}class Xw{constructor(r,t){P(this,"map");P(this,"input");P(this,"onData");P(this,"onError");this.map=r,this.input=t,Dr()}setSearchListener(r,t){return this.onData&&Pt("setSearchListener只能调用一次"),this.onData=r,this.onError=t,Dr}}class Bk extends Xw{constructor(t,i){super(t,i.input);P(this,"searchBox");this.searchBox=new google.maps.places.SearchBox(i.input),this.searchBox.bindTo("bounds",t.innerMap)}setSearchListener(t,i){return super.setSearchListener(t,i),Sw(this.searchBox,"places_changed",()=>{const e=this.searchBox.getPlaces();t((e??[]).map(o=>Bw(o,this.map)))})}search(){this.input.value&&(google.maps.event.trigger(this.input,"focus",{}),google.maps.event.trigger(this.input,"keydown",{keyCode:13}))}}class Gk extends Xw{constructor(t,i){super(t,i.input);P(this,"autocomplete");P(this,"placesService");this.autocomplete=t.createAutocomplete({input:i.input,bindToMap:!0}),this.placesService=t.createPlacesService({})}setSearchListener(t,i){return super.setSearchListener(t,i),this.autocomplete.addResultListener(e=>{this.searchImpl(e.country+e.province+e.city+e.district+e.street+e.streetNumber+e.title)})}search(){this.input.value&&this.searchImpl(this.input.value)}searchImpl(t){this.placesService.search(t).then(this.onData,this.onError)}}const Fk=["single","multi"];var zt;(function(n){n.auto="auto",n.none="none",n.greedy="greedy",n.cooperative="cooperative"})(zt||(zt={}));var pf;(function(n){function r(t){Cr.deleteUndefinedPropertyOnPlainObjectDeeply(t);const i={center:te.ZERO,zoom:5};return Tw(i,t||{},{isMergeableObject:Ew})}n.create=r})(pf||(pf={}));var Wr;(function(n){n[n.WORLD=1]="WORLD",n[n.STATE=5]="STATE",n[n.CITY=10]="CITY",n[n.STREET=15]="STREET",n[n.BUILDING=20]="BUILDING"})(Wr||(Wr={}));class Ho{constructor(r){P(this,"element");P(this,"latestInfoWindow");P(this,"delegate",void 0);this.element=r}setEventTargetDelegate(r){this.delegate=r.setTarget(this)}addEventListener(r,t){this.delegate.addEventListener(r,t)}removeEventListener(r,t){this.delegate.removeEventListener(r,t)}getLatestInfoWindow(){return this.latestInfoWindow}setLatestInfoWindowInternal(r){this.latestInfoWindow=r}addOverlayMapType(r){this.addLayer(r)}removeOverlayMapType(r){this.removeLayer(r)}addControl(r){r.addTo(this)}removeControl(r){r.removeFrom(this)}getZoom(){return this.innerMap.getZoom()??0}setZoom(r){this.innerMap.setZoom(r)}}class Qd{constructor(r,t){P(this,"innerOverlay");P(this,"coordType");P(this,"_delegate");this.innerOverlay=r,this.coordType=t}get delegate(){return this._delegate??(this._delegate=this.createDelegate().setTarget(this)),this._delegate}addEventListener(r,t){this.delegate.addEventListener(r,t)}removeEventListener(r,t){this.delegate.removeEventListener(r,t)}remove(){this.map.removeOverlay(this)}}class eg extends Qd{constructor(t,i,e){super(t,i);P(this,"map");this.map=e}createDelegate(){return new Lo(this.innerOverlay,this.map)}isVisible(){return this.innerOverlay.getVisible()}setVisible(t){this.innerOverlay.setVisible(t)}}class eu extends Qd{constructor(t,i,e){super(t,i);P(this,"map");this.map=e}createDelegate(){return new la(this.innerOverlay,this.map)}get overlay(){return this.innerOverlay}isVisible(){return this.overlay.isVisible()}setVisible(t){t?this.overlay.show():this.overlay.hide()}visibleOptionInternal(t){return t!==void 0&&(t||this.setVisible(!1)),this}}class tg extends Qd{constructor(t,i,e){super(t,i);P(this,"map");this.map=e}createDelegate(){return new zi(this.innerOverlay,this.map)}isVisible(){return this.innerOverlay.isVisible()}setVisible(t){Gr.setVisible(this.innerOverlay,t)}}const zs=class zs extends eu{constructor(t,i,e,o){super(t,i,e);P(this,"state");this.state=o}isEditable(){return this.state.editable}setEditable(t){this.state.editable=t,t?this.innerOverlay.enableEditing():this.innerOverlay.disableEditing()}setStrokeColor(t){this.innerOverlay.setStrokeColor(t)}setStrokeOpacity(t){this.innerOverlay.setStrokeOpacity(t+zs.OPACITY_DELTA)}setStrokeWeight(t){this.innerOverlay.setStrokeWeight(t)}setFillColor(t){this.innerOverlay.setFillColor(t)}setFillOpacity(t){this.innerOverlay.setFillOpacity(t+zs.OPACITY_DELTA)}setZIndex(t){}};P(zs,"OPACITY_DELTA",.001);let Xr=zs;class tu extends eg{isEditable(){return this.innerOverlay.getEditable()}setEditable(r){this.innerOverlay.setEditable(r)}setStrokeColor(r){this.innerOverlay.setOptions({strokeColor:r})}setStrokeOpacity(r){this.innerOverlay.setOptions({strokeOpacity:r})}setStrokeWeight(r){this.innerOverlay.setOptions({strokeWeight:r})}setFillColor(r){this.innerOverlay.setOptions({fillColor:r})}setFillOpacity(r){this.innerOverlay.setOptions({fillOpacity:r})}setZIndex(r){this.innerOverlay.setOptions({zIndex:r})}}class ru extends tg{isEditable(){return this.innerOverlay.config().editable??!0}setEditable(r){this.innerOverlay.config({editable:r})}setStrokeColor(r){this.innerOverlay.updateSymbol({lineColor:r})}setStrokeOpacity(r){this.innerOverlay.updateSymbol({lineOpacity:r})}setStrokeWeight(r){this.innerOverlay.updateSymbol({lineWidth:r})}setFillColor(r){this.innerOverlay.updateSymbol({polygonFill:r})}setFillOpacity(r){this.innerOverlay.updateSymbol({polygonOpacity:r})}setZIndex(r){this.setZIndex(r)}}class rg extends Xr{constructor(){super(...arguments);P(this,"prevCenter");P(this,"prevRadius");P(this,"isDoingSetCenter",!1);P(this,"isDoingSetRadius",!1);P(this,"eventHubDelegate");P(this,"onRadiusChanged",()=>{var i;const t=this.innerOverlay.getRadius();this.prevRadius!==t&&(this.isDoingSetRadius||(i=this.eventHubDelegate)==null||i.notify({type:"radius-changed",target:this}),this.prevRadius=t)});P(this,"onCenterChanged",()=>{var i;const t=this.innerOverlay.getCenter();this.prevCenter!==t&&(this.isDoingSetCenter||(i=this.eventHubDelegate)==null||i.notify({type:"center-changed",target:this}),this.prevCenter=t)});P(this,"resetEditableTimeoutId")}static create(t){const i=this.coordType,e=new BMap.Circle(t.center.toBaidu(i),t.radius,{enableClicking:t.clickable,enableEditing:!1,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity!=null?t.strokeOpacity+Xr.OPACITY_DELTA:void 0,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity!=null?t.fillOpacity+Xr.OPACITY_DELTA:void 0}),o=new rg(e,i,this,{editable:!!t.editable}).visibleOptionInternal(t.visible);return o.state.editable&&setTimeout(()=>{o.state.editable&&e.enableEditing()},0),o}createDelegate(){return this.eventHubDelegate=new Yh(super.createDelegate(),{types:["radius-changed","center-changed"],onListen:t=>{t==="radius-changed"?(this.prevRadius=this.innerOverlay.getRadius(),this.innerOverlay.addEventListener("lineupdate",this.onRadiusChanged)):(this.prevCenter=this.innerOverlay.getCenter(),this.innerOverlay.addEventListener("lineupdate",this.onCenterChanged))},onCancel:t=>{this.innerOverlay.removeEventListener("lineupdate",t==="radius-changed"?this.onRadiusChanged:this.onCenterChanged)}})}setCenter(t){this.coordType=this.map.coordType,this.isDoingSetCenter=!0,this.innerOverlay.setCenter(t.toBaidu(this.coordType)),this.isDoingSetCenter=!1,this.state.editable&&(clearTimeout(this.resetEditableTimeoutId),this.resetEditableTimeoutId=setTimeout(()=>{this.state.editable&&(this.innerOverlay.disableEditing(),this.innerOverlay.enableEditing())},0))}getCenter(){return te.fromBaidu(this.innerOverlay.getCenter(),this.coordType)}setRadius(t){this.isDoingSetRadius=!0,this.innerOverlay.setRadius(t),this.isDoingSetRadius=!1}getRadius(){return this.innerOverlay.getRadius()}}class ig extends tu{static create(r){const t=this.coordType,i=new google.maps.Circle({center:r.center.toGoogle(t),radius:r.radius,clickable:r.clickable,editable:r.editable,strokeColor:r.strokeColor,strokeOpacity:r.strokeOpacity,strokeWeight:r.strokeWeight,fillColor:r.fillColor,fillOpacity:r.fillOpacity,visible:r.visible,zIndex:r.zIndex});return new ig(i,t,this)}setCenter(r){this.coordType=this.map.coordType,this.innerOverlay.setCenter(r.toGoogle(this.coordType))}getCenter(){return te.fromGoogle(this.innerOverlay.getCenter()??ln.LATLNG_ZERO,this.coordType)}setRadius(r){this.innerOverlay.setRadius(r)}getRadius(){return this.innerOverlay.getRadius()}}class ng extends ru{static create(r){const t=this.coordType,i=new zr(r.center.toTalks(t),r.radius,{interactive:r.clickable??!0,editable:r.editable,symbol:{lineColor:r.strokeColor,lineOpacity:r.strokeOpacity,lineWidth:r.strokeWeight,polygonFill:r.fillColor??Ao.FILL_COLOR_TG,polygonOpacity:r.fillOpacity??Ao.FILL_OPACITY_TG},visible:r.visible??!0,zIndex:r.zIndex});return new ng(i,t,this)}setCenter(r){this.coordType=this.map.coordType,this.innerOverlay.setCoordinates(r.toTalks(this.coordType))}getCenter(){return te.fromTalks(this.innerOverlay.getCoordinates(),this.coordType)}setRadius(r){this.innerOverlay.setRadius(r)}getRadius(){return this.innerOverlay.getRadius()}}var Yr;(function(n){n.ZERO={x:0,y:0}})(Yr||(Yr={}));let xc;function Nk(n,r,t,i,e,o){return xc||(xc=Hk()),new xc(n,r,t,i,e,o)}class ca{constructor(r,t,i=654,e=""){P(this,"content");P(this,"container");P(this,"border");P(this,"inner");P(this,"close");this.content=r;const o="baidu-info-box-container";this.container=document.createElement("div"),this.container.className=o,this.container.style.position="absolute";const s=a=>a.stopPropagation();this.container.onclick=s,this.container.ondblclick=s,this.container.oncontextmenu=s,this.container.onmousedown=s,this.container.onmousemove=s,this.container.onmousewheel=s,this.border=document.createElement("div"),this.border.className=`${o}__border ${e}`,this.inner=document.createElement("div"),this.inner.className=o+"__inner",this.close=document.createElement("span"),this.close.className=o+"__close",this.inner.appendChild(r),this.border.appendChild(this.inner),this.border.appendChild(this.close),this.container.appendChild(this.border),t&&this.setZIndex(t),this.setMaxWidth(i)}setZIndex(r){this.container.style.zIndex=`${r}`}setMaxWidth(r){this.border.style.maxWidth=`${r}px`}setPosition(r,t){this.container.style.left=`${r}px`,this.container.style.top=`${t}px`}}P(ca,"OFFSET_Y",-11);function Hk(){Rw();const n=new BMap.Point(0,0);return class extends BMap.OverlayV3{constructor(i,e=n,o=Yr.ZERO,s,a,l){super();P(this,"content");P(this,"position");P(this,"offset");P(this,"elements");P(this,"map");P(this,"marker");this.content=i,this.position=e,this.offset=o,this.elements=new ca(i,s,a,l),this.elements.container.style.transform=`translateY(${ca.OFFSET_Y}px)`,this.elements.close.addEventListener("click",()=>{this.close(),this.dispatchEvent({type:"onclickclose"})}),this.onMarkerPositionChanged=this.onMarkerPositionChanged.bind(this)}initialize(i){return this.map=i,i.getPanes().floatPane.appendChild(this.elements.container),this.elements.container}draw(){if(!this.map)return;const i=this.marker?this.marker.getPosition():this.position,e=this.map.pointToOverlayPixel(i),o=e.x+this.offset.x,s=e.y+this.offset.y;this.elements.setPosition(o,s)}open(i,e){e&&e===this.marker||(this.marker&&this.detachMarker(this.marker),this.marker=e,this.marker&&this.attachMarker(this.marker),this.isOpen()?this.draw():this.marker&&!this.marker.getMap()||i.addOverlay(this))}attachMarker(i){i.__info_box__=this,i.addEventListener("dragging",this.onMarkerPositionChanged),i.addEventListener("dragend",this.onMarkerPositionChanged)}detachMarker(i){i.__info_box__=void 0,i.removeEventListener("dragging",this.onMarkerPositionChanged),i.removeEventListener("dragend",this.onMarkerPositionChanged)}close(){this.map&&(this.map.removeOverlay(this),this.marker&&(this.detachMarker(this.marker),this.marker=void 0),this.map=void 0)}isOpen(){return this.map&&this.map.getPanes().floatPane===this.elements.container.parentNode}onMarkerPositionChanged(){this.draw()}setZIndex(i){this.elements.setZIndex(i)}setMaxWidth(i){this.elements.setMaxWidth(i)}setPosition(i){this.marker||(this.position=i,this.draw())}getPosition(){return this.position}setOffset(i){this.offset=i,this.draw()}getOffset(){return this.offset}}}class Aa{constructor(r){P(this,"delegate");this.delegate=r,this.delegate.setTarget(this)}addEventListener(r,t){this.delegate.addEventListener(r,t)}removeEventListener(r,t){this.delegate.removeEventListener(r,t)}}class og extends Aa{constructor(t,i,e){super(new la(t,i));P(this,"inner");P(this,"map");P(this,"state");this.inner=t,this.map=i,this.state=e}static create(t){const i=t.position||te.ZERO,e=new BMap.InfoWindow(t.content,{maxWidth:t.maxWidth,offset:t.offset&&new BMap.Size(t.offset.x,t.offset.y),enableAutoPan:!t.disableAutoPan});return new og(e,this,{position:i})}isOpen(){return this.inner.isOpen()}open(t){t?t.innerOverlay.openInfoWindow(this.inner):this.map.innerMap.openInfoWindow(this.inner,(this.state.position||te.ZERO).toBaidu(this.map.coordType)),this.map.setLatestInfoWindowInternal(this)}close(){this.inner.isOpen()&&this.map.innerMap.closeInfoWindow()}getPosition(){const t=this.inner.getPosition();return t&&te.fromBaidu(t,this.map.coordType)||this.state.position||te.ZERO}setPosition(t){this.state.position=t,this.inner.isOpen()&&this.open()}}class sg extends Aa{constructor(t,i){super(new Lo(t,i));P(this,"inner");P(this,"map");P(this,"eventHub",new Ow);P(this,"isOpened",!1);this.inner=t,this.map=i,t.addListener("closeclick",()=>{this.isOpened=!1,this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})}),t.addListener("map_changed",()=>{const e=this.isOpened;this.isOpened=!!t.getMap(),e&&!this.isOpened&&this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})})}static create(t){const i=t.position||te.ZERO,e=new google.maps.InfoWindow({content:t.content,maxWidth:t.maxWidth,pixelOffset:t.offset&&new google.maps.Size(t.offset.x,t.offset.y),position:i.toGoogle(this.coordType),disableAutoPan:t.disableAutoPan});return new sg(e,this)}isOpen(){return this.isOpened}addEventListener(t,i){if(t==="open"||t==="close"){this.eventHub.addEventListener(t,i);return}super.addEventListener(t,i)}removeEventListener(t,i){if(t==="open"||t==="close"){this.eventHub.removeEventListener(t,i);return}super.removeEventListener(t,i)}open(t){if(!this.isOpened){if(this.map.mapOptions.infoWindowMode==="single"){const i=this.map.getLatestInfoWindow();i&&i.close()}this.inner.open(this.map.innerMap,t==null?void 0:t.innerOverlay),this.isOpened=!0,this.map.setLatestInfoWindowInternal(this),this.eventHub.notify({type:"open",target:this})}}close(){this.isOpened&&(this.isOpened=!1,this.inner.close(),this.eventHub.notify({type:"close",target:this}))}getPosition(){return te.fromGoogle(this.inner.getPosition()??ln.LATLNG_ZERO,this.map.coordType)}setPosition(t){this.inner.setPosition(t.toGoogle(this.map.coordType))}}class ag extends Aa{constructor(t,i,e){super(new zi(t,i));P(this,"inner");P(this,"map");P(this,"state");P(this,"marker");P(this,"pendingShowAction");P(this,"onVisibleChangeInCluster",t=>{"visible"in t&&Gr.setVisible(this.inner,t.visible)});this.inner=t,this.map=i,this.state=e}static create(t){const i=t.offset??Yr.ZERO,e={content:t.content,dx:i.x,dy:i.y,width:t.maxWidth?t.maxWidth+"px":void 0,autoPan:!t.disableAutoPan,autoOpenOn:void 0,single:this.mapOptions.infoWindowMode==="single",animation:""};return new ag(new Oo.InfoWindow(e),this,{position:t.position,offset:i})}open(t){var e,o;this.detachMarker(),this.marker=t;const i=((e=this.marker)==null?void 0:e.innerOverlay)??this.map.innerMap;if(this.inner.getOwner()!==i&&(this.inner.config({autoOpenOn:this.marker?"click":void 0}),this.inner.addTo(i)),this.marker){const s=this.marker,a=()=>{if(this.marker!==s)return;const l=this.marker.getInfoWindowOffset();l&&this.inner.config({dx:this.state.offset.x-l.x,dy:this.state.offset.y-l.y}),this.inner.show()};this.marker.innerOverlay.getLayer()==null?(this.pendingShowAction=async()=>{await U_(0),a()},this.marker.innerOverlay.on("add",this.pendingShowAction)):a(),this.marker.innerOverlay.on("visible-change-in-cluster",this.onVisibleChangeInCluster)}else this.inner.show((o=this.state.position)==null?void 0:o.toTalks(this.map.coordType))}detachMarker(){this.marker&&(this.marker.innerOverlay.off("visible-change-in-cluster",this.onVisibleChangeInCluster),this.pendingShowAction&&(this.marker.innerOverlay.off("add",this.pendingShowAction),this.pendingShowAction=void 0),this.marker=void 0)}close(){this.inner.remove(),this.detachMarker()}getPosition(){return this.marker?this.marker.getPosition():this.state.position??te.ZERO}setPosition(t){this.state.position=t,this.inner.isVisible()&&this.open()}isOpen(){return this.inner.isVisible()}}class lg extends eu{constructor(t,i,e){super(t,i,e);P(this,"baiduMap");this.baiduMap=e}static create(t){var o;const i=this.coordType,e=Nk(t.content,(o=t.position)==null?void 0:o.toBaidu(i),t.offset,t.zIndex,t.maxWidth,t.borderClass);return new lg(e,i,this)}open(t){this.innerOverlay.open(this.baiduMap.innerMap,t==null?void 0:t.innerOverlay)}close(){this.innerOverlay.close()}getPosition(){return te.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType))}setMaxWidth(t){this.innerOverlay.setMaxWidth(t)}setZIndex(t){this.innerOverlay.setZIndex(t)}}class hg extends Aa{constructor(t,i,e){super(new Lo(t,e));P(this,"inner");P(this,"coordType");P(this,"map");this.inner=t,this.coordType=i,this.map=e}static create(t){var s;const i=this.coordType,e=new google.maps.InfoWindow({content:t.content,position:(s=t.position)==null?void 0:s.toGoogle(i),pixelOffset:t.offset&&new google.maps.Size(t.offset.x,t.offset.y),zIndex:t.zIndex,maxWidth:t.maxWidth,disableAutoPan:t.disableAutoPan}),o=t.borderClass;return o&&e.addListener("domready",()=>{var l;const a=(l=t.content.parentElement)==null?void 0:l.parentElement;a&&a.className.includes("gm-style-iw-c")&&!a.className.includes(o)&&(a.className+=` ${o}`)}),new hg(e,i,this)}open(t){this.inner.open(this.map.innerMap,t==null?void 0:t.innerOverlay)}close(){this.inner.close()}getPosition(){return te.fromGoogle(this.inner.getPosition()??ln.LATLNG_ZERO,this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.inner.setPosition(t.toGoogle(this.coordType))}isOpen(){return this.inner.getMap()!=null}setMaxWidth(t){if(this.isOpen()){const i=this.inner.getMap(),e=this.inner.getAnchor();this.inner.close(),this.inner.setOptions({maxWidth:t}),this.inner.open(i,e)}else this.inner.setOptions({maxWidth:t})}setZIndex(t){this.inner.setZIndex(t)}}class ug extends Aa{constructor(t,i,e,o,s){super(new zi(t,e));P(this,"inner");P(this,"coordType");P(this,"map");P(this,"elements");P(this,"state");P(this,"marker");P(this,"pendingShowAction");P(this,"onVisibleChangeInCluster",t=>{"visible"in t&&Gr.setVisible(this.inner,t.visible)});this.inner=t,this.coordType=i,this.map=e,this.elements=o,this.state=s,o.close.addEventListener("click",()=>{this.close(),this.inner.fire("closeclick")})}static create(t){var a,l;const i=this.coordType,e={x:((a=t.offset)==null?void 0:a.x)??0,y:(((l=t.offset)==null?void 0:l.y)??0)+ca.OFFSET_Y},o=new ca(t.content,void 0,t.maxWidth,t.borderClass),s={custom:!0,content:o.container,dx:e.x,dy:e.y,zIndex:t.zIndex,autoPan:!t.disableAutoPan,autoOpenOn:void 0,single:!1,animation:""};return t.borderClass&&(s.containerClass=Oo.InfoWindow.prototype.options.containerClass+" "+t.borderClass),new ug(new Oo.InfoWindow(s),i,this,o,{position:t.position,offset:e})}open(t){var e,o;this.detachMarker(),this.marker=t;const i=((e=this.marker)==null?void 0:e.innerOverlay)??this.map.innerMap;if(this.inner.getOwner()!==i&&(this.inner.config({autoOpenOn:this.marker?"click":void 0}),this.inner.addTo(i)),this.marker){const s=this.marker,a=()=>{if(this.marker!==s)return;const l=this.marker.getInfoWindowOffset();l&&this.inner.config({dx:this.state.offset.x-l.x,dy:this.state.offset.y-l.y}),this.inner.show()};this.marker.innerOverlay.getLayer()==null?(this.pendingShowAction=async()=>{await U_(0),a()},this.marker.innerOverlay.on("add",this.pendingShowAction)):a(),this.marker.innerOverlay.on("visible-change-in-cluster",this.onVisibleChangeInCluster)}else this.inner.show((o=this.state.position)==null?void 0:o.toTalks(this.coordType))}detachMarker(){this.marker&&(this.marker.innerOverlay.off("visible-change-in-cluster",this.onVisibleChangeInCluster),this.pendingShowAction&&(this.marker.innerOverlay.off("add",this.pendingShowAction),this.pendingShowAction=void 0),this.marker=void 0)}close(){this.inner.remove(),this.detachMarker()}getPosition(){return this.marker?this.marker.getPosition():this.state.position??te.ZERO}setPosition(t){this.state.position=t,this.inner.isVisible()&&this.open()}isOpen(){return this.inner.isVisible()}setMaxWidth(t){this.elements.setMaxWidth(t)}setZIndex(t){this.inner.setZIndex(t)}}var er;(function(n){n.map="map",n.overlay="overlay",n.overlayMouseTarget="overlayMouseTarget",n.float="float"})(er||(er={}));var fa;(function(n){function r(i,e){switch(i){case er.float:return e.floatPane;case er.overlayMouseTarget:return e.overlayMouseTarget;case er.overlay:return e.overlayLayer;case er.map:return e.mapPane;default:Ll(i)}}n.toGoogle=r;function t(i,e){switch(i){case er.float:return e.floatPane;case er.overlayMouseTarget:return e.markerMouseTarget;case er.overlay:return e.markerPane;case er.map:return e.mapPane;default:Ll(i)}}n.toBaidu=t})(fa||(fa={}));class Yw{constructor(r,t){P(this,"map");P(this,"baidu");P(this,"google");P(this,"projection");P(this,"element",void 0);P(this,"mapPane");this.map=r,this.mapPane=t.mapPane}create(){return this.element=this.onCreate(),this.element.className+=" element-overlay",this.element}draw(){this.projection&&this.onDraw(this.projection)}getProjection(){return this.projection}asBaidu(){if(!this.baidu){const r=this;Rw();class t extends BMap.OverlayV3{initialize(o){var l;const s=r.create(),a=o.getPanes();return(l=fa.toBaidu(r.mapPane,a))==null||l.appendChild(s),s}draw(){r.draw()}}this.baidu=new t;const i=r.map.innerMap;this.projection={fromLatLngToOverlayPoint(e){return i.pointToOverlayPixel(e.toBaidu(r.map.coordType))},fromOverlayPointToLatLng(e){return te.fromBaidu(i.overlayPixelToPoint(new BMap.Pixel(e.x,e.y)),r.map.coordType)}}}return this.baidu}asGoogle(){if(!this.google){const r=this;class t extends google.maps.OverlayView{onAdd(){const e=r.create(),o=this.getPanes()??Pt("onAdd回调中一定会有panes");fa.toGoogle(r.mapPane,o).appendChild(e)}draw(){r.draw()}onRemove(){var e;(e=r.element.parentNode)==null||e.removeChild(r.element)}}this.google=new t,this.projection={fromLatLngToOverlayPoint(i){return r.google.getProjection().fromLatLngToDivPixel(i.toGoogle(r.map.coordType))??Yr.ZERO},fromOverlayPointToLatLng(i){return te.fromGoogle(r.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(i.x,i.y))??ln.LATLNG_ZERO,r.map.coordType)}}}return this.google}}let Cc;function jk(n,r,t,i,e){return Cc||(Cc=Zk()),new Cc(n,r,t,i,e)}function Zk(){return class extends google.maps.OverlayView{constructor(t,i,e,o=er.overlayMouseTarget,s){super();P(this,"position");P(this,"offset");P(this,"_mapPane");P(this,"container");this.position=i,this.offset=e,this._mapPane=o,this.container=document.createElement("div"),this.container.className="label-container",this.container.style.position="absolute",s&&this.setZIndex(s),this.container.addEventListener("click",()=>{google.maps.event.trigger(this,"click")}),this.setElement(t)}setZIndex(t){this.container.style.zIndex=`${t}`}setElement(t){const i=this.container.firstChild;i!==t&&(i?this.container.replaceChild(i,t):this.container.appendChild(t))}onAdd(){const t=this.getPanes()??Pt("onAdd回调中一定能够获取panes");fa.toGoogle(this._mapPane,t).appendChild(this.container)}draw(){var t,i;if(this.container.style.display=this.position?"block":"none",this.position){const e=this.getProjection();if(e){const o=e.fromLatLngToDivPixel(this.position);o&&(this.container.style.left=`${o.x+(((t=this.offset)==null?void 0:t.x)??0)}px`,this.container.style.top=`${o.y+(((i=this.offset)==null?void 0:i.y)??0)}px`)}}}onRemove(){var t;(t=this.container.parentNode)==null||t.removeChild(this.container)}setPosition(t){this.position=t,this.draw()}getPosition(){return this.position}setOffset(t){this.offset=t,this.draw()}getOffset(){return this.offset}getVisible(){return this.container.style.visibility!=="hidden"}setVisible(t){this.container.style.visibility=t?"visible":"hidden"}}}var Dn;(function(n){function r(i){return typeof i=="string"?i:i.outerHTML}n.toString=r;function t(i){if(typeof i=="string"){const e=document.createElement("div");return e.innerHTML=i,e}return i}n.toElement=t})(Dn||(Dn={}));class cg extends eu{constructor(t,i,e,o){super(t,i,e);P(this,"icon");P(this,"iconAnchor");P(this,"content",void 0);P(this,"contentObserver");this.setContentInternal(o,!0)}static create(t){var s;const i=this.coordType,e=new BMap.Label(Dn.toString(t.content),{position:(s=t.position)==null?void 0:s.toBaidu(i),offset:t.offset&&new BMap.Size(t.offset.x,t.offset.y)});t.zIndex&&e.setZIndex(t.zIndex),e.setStyle({border:"0px",padding:"0px",backgroundColor:"unset"});const o=new cg(e,i,this,t.content);return e.__label__=o,o}setContentInternal(t,i=!1){this.content!==t&&(this.contentObserver&&(this.contentObserver.disconnect(),this.contentObserver=void 0),typeof t!="string"&&(this.contentObserver=new MutationObserver(()=>{this.innerOverlay.setContent(t.outerHTML)}),this.contentObserver.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})),i||this.innerOverlay.setContent(Dn.toString(t)),this.content=t)}setZIndex(t){this.innerOverlay.setZIndex(t)}getPosition(){return te.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType))}getOffset(){const t=this.innerOverlay.getOffset();let i=0,e=0;return this.iconAnchor&&(i=this.iconAnchor.width,e=this.iconAnchor.height),{x:t.width-i,y:t.height-e}}setOffset(t){t??(t=Yr.ZERO);let i=0,e=0;this.iconAnchor&&(i=this.iconAnchor.width,e=this.iconAnchor.height),this.innerOverlay.setOffset(new BMap.Size(t.x+i,t.y+e))}setContent(t){this.setContentInternal(t)}attachIcon(t){var a;let i;if(t instanceof BMap.Icon)i=t.anchor;else if(t)if(t.anchor)i=t.anchor;else{const l=((a=t.__icon__)==null?void 0:a.baiduLabelOffset)??{x:0,y:0};i={width:t.style.anchor.width+l.x,height:t.style.anchor.height+l.y}}const e=this.innerOverlay.getOffset()??{width:0,height:0};let o=e.width,s=e.height;this.iconAnchor&&(o-=this.iconAnchor.width,s-=this.iconAnchor.height),i&&(o+=i.width,s+=i.height),this.innerOverlay.setOffset(new BMap.Size(o,s)),this.icon=t,this.iconAnchor=i}}class fg extends eg{static create(r){var e;const t=this.coordType,i=jk(Dn.toElement(r.content),(e=r.position)==null?void 0:e.toGoogle(t),r.offset,r.mapPane,r.zIndex);return new fg(i,t,this)}setZIndex(r){this.innerOverlay.setZIndex(r)}setContent(r){this.innerOverlay.setElement(Dn.toElement(r))}getPosition(){const r=this.innerOverlay.getPosition();return r?te.fromGoogle(r,this.coordType):te.ZERO}setPosition(r){this.coordType=this.map.coordType,this.innerOverlay.setPosition(r.toGoogle(this.coordType))}getOffset(){return this.innerOverlay.getOffset()??Yr.ZERO}setOffset(r){this.innerOverlay.setOffset(r??Yr.ZERO)}}class dg extends tg{static create(r){var o,s,a;const t=this.coordType,i=document.createElement("div");i.appendChild(Dn.toElement(r.content)),i.style.whiteSpace="nowrap",i.style.fontSize="12px",i.style.lineHeight="normal";const e=new Oo.UIMarker(((o=r.position)==null?void 0:o.toTalks(t))??[0,0],{content:i,dx:((s=r.offset)==null?void 0:s.x)??0,dy:((a=r.offset)==null?void 0:a.y)??0,verticalAlignment:"bottom",horizontalAlignment:"right",animation:""});return new dg(e,t,this)}setContent(r){this.innerOverlay.setContent(r)}getPosition(){return te.fromTalks(this.innerOverlay.getCoordinates(),this.coordType)}setPosition(r){this.coordType=this.map.coordType,this.innerOverlay.setCoordinates(r.toTalks(this.coordType))}getOffset(){const r=this.innerOverlay.config();return{x:r.dx??0,y:r.dy??0}}setOffset(r){this.innerOverlay.config({dx:(r==null?void 0:r.x)??0,dy:(r==null?void 0:r.y)??0})}setZIndex(r){this.setZIndex(r)}}const da={toGoogle:n=>"url"in n?ks.toGoogle(n):On.toGoogle(n),toBaidu:n=>"url"in n?ks.toBaidu(n):On.toBaidu(n),toTalks:n=>"url"in n?ks.toTalks(n):On.toTalks(n)};var ks;(function(n){function r(e){return{url:e.url,size:new google.maps.Size(e.size.width,e.size.height),origin:e.origin&&new google.maps.Point(e.origin.x,e.origin.y),scaledSize:e.scaledSize&&new google.maps.Size(e.scaledSize.width,e.scaledSize.height),anchor:e.anchor&&new google.maps.Point(e.anchor.x,e.anchor.y),labelOrigin:e.labelOrigin&&new google.maps.Point(e.labelOrigin.x,e.labelOrigin.y)}}n.toGoogle=r;function t(e){const o=new BMap.Icon(e.url,new BMap.Size(e.size.width,e.size.height),{...e.origin?{imageOffset:new BMap.Size(-e.origin.x,-e.origin.y)}:{},imageSize:e.scaledSize&&new BMap.Size(e.scaledSize.width,e.scaledSize.height),anchor:e.anchor?new BMap.Size(e.anchor.x,e.anchor.y):new BMap.Size(e.size.width/2,e.size.height)});return o.__icon__=e,o}n.toBaidu=t;function i(e){return{markerFile:e.url,markerWidth:e.size.width,markerHeight:e.size.height,...e.anchor&&{markerDx:-e.anchor.x,markerDy:-e.anchor.y,markerVerticalAlignment:"bottom",markerHorizontalAlignment:"right"}}}n.toTalks=i})(ks||(ks={}));var On;(function(n){function r(e){return{path:typeof e.path=="string"?e.path:e.path.google(),anchor:e.anchor&&new google.maps.Point(e.anchor.x,e.anchor.y),fillColor:e.fillColor,fillOpacity:e.fillOpacity,scale:e.scale,rotation:e.rotation,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight}}n.toGoogle=r;function t(e){var s,a;const o=Aw.create(typeof e.path=="string"?e.path:e.path.baidu(),{anchor:e.anchor&&new BMap.Size(e.anchor.x,e.anchor.y),fillColor:e.fillColor,fillOpacity:e.fillOpacity,scale:e.scale,rotation:e.rotation,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight});return o.__icon__=e,o.infoWindowAnchor=o.infoWindowOffset=new BMap.Size(((((s=e.anchor)==null?void 0:s.x)??0)+(e.strokeWeight??1))*(e.scale??1),(((a=e.anchor)==null?void 0:a.y)??0+(e.strokeWeight??1))*(e.scale??1)),o}n.toBaidu=t;function i(e){const o=e.talksPathSize??(console.warn("talks需要设置talksPathSize才能正确显示",e),{width:24,height:24}),s=e.scale??1;return{...typeof e.path=="string"?{markerType:"path",markerPath:[{path:e.path,"stroke-linecap":"round"}],markerPathWidth:o.width,markerPathHeight:o.height}:{markerType:e.path.talks()},markerFill:e.fillColor,markerFillOpacity:e.fillOpacity,markerLineColor:e.strokeColor,markerLineOpacity:e.strokeOpacity,markerLineWidth:e.strokeWeight,markerWidth:o.width*s,markerHeight:o.height*s,markerRotation:-(e.rotation??0),...e.anchor&&{markerDx:-e.anchor.x*s,markerDy:-e.anchor.y*s,markerVerticalAlignment:"bottom",markerHorizontalAlignment:"right"}}}n.toTalks=i})(On||(On={}));const Vk={BACKWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,talks:()=>"triangle"}};var oh;(function(n){function r(i){return{icon:On.toGoogle(i.icon),offset:i.offset,repeat:i.repeat,fixedRotation:i.fixedRotation}}n.toGoogle=r;function t(i){return new BMap.IconSequence(On.toBaidu(i.icon),i.offset,i.repeat??"",i.fixedRotation)}n.toBaidu=t})(oh||(oh={}));const sh={toBaidu:n=>{const r=["baidu-marker-label"];n.className&&r.push(n.className);const t=new BMap.Label(`<span class="${r.join(" ")}">${n.text}</span>`);return t.setStyle({border:"0px",padding:"0px",backgroundColor:"unset",color:n.color??"black",fontSize:n.fontSize??"14px",fontWeight:n.fontWeight??"",fontFamily:n.fontFamily??"Roboto, Arial, sans-serif"}),t},toGoogle:n=>n,toTalks:(n,r)=>({properties:{label:n.text},symbol:{textName:"{label}",textFill:n.color??"black",textSize:gT.parseCssDimen(n.fontSize??"14px"),textWeight:n.fontWeight,textFaceName:n.fontFamily??"Roboto, Arial, sans-serif",...r}})};class ga extends eu{constructor(t,i,e,o){super(t,i,e);P(this,"state");this.state=o}static create(t){const i=this.coordType,e=t.icon,o={icon:e&&da.toBaidu(e),enableClicking:t.clickable,enableDragging:t.draggable,raiseOnDrag:t.crossOnDrag===void 0?!0:t.crossOnDrag,draggingCursor:t.cursor};t.title&&(o.title=t.title);const s=new BMap.Marker(t.position.toBaidu(i,t.normalizePositionForBaidu),o);s.__create_by_tg__=!0,t.zIndex!==void 0&&s.setZIndex(t.zIndex);const a=t.clickable===void 0?!0:t.clickable,l=!!t.draggable,h=new ga(s,i,this,{clickable:a,draggable:l,zIndex:t.zIndex,normalize:t.normalizePositionForBaidu}).visibleOptionInternal(t.visible);return t.label&&h.setLabel(t.label),h}getPosition(){return te.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){var i;this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType,this.state.normalize)),(i=this.innerOverlay.__info_box__)==null||i.onMarkerPositionChanged()}setTitle(t){this.innerOverlay.setTitle(t)}getTitle(){return this.innerOverlay.getTitle()}setIcon(t){const i=da.toBaidu(t);this.innerOverlay.setIcon(i),this._updateMarkerLabelOffset();const e=this.getLabelOverlay();e&&e.attachIcon(i)}getIcon(){return this.innerOverlay.getIcon()}setClickable(t){this.state.clickable=t}isClickable(){return this.state.clickable}setDraggable(t){this.state.draggable=t,t?this.innerOverlay.enableDragging():this.innerOverlay.disableDragging()}isDraggable(){return this.state.draggable}setZIndex(t){this.state.zIndex=t,this.innerOverlay.setZIndex(t||0)}getZIndex(){return this.state.zIndex}setLabel(t){const i=this.innerOverlay.getLabel();i&&this.map.innerMap.removeOverlay(i),this.innerOverlay.setLabel(sh.toBaidu(t)),this._updateMarkerLabelOffset()}_updateMarkerLabelOffset(){const t=this.innerOverlay.getIcon(),i=t.__icon__,e=this.innerOverlay.getLabel();if(e&&t&&!i&&t.imageUrl==="https://api.map.baidu.com/images/marker_red_sprite.png"){e.setOffset(new BMap.Size(9,9));return}!e||!i||!("size"in i)||e.setOffset(i.labelOrigin?new BMap.Size(i.labelOrigin.x,i.labelOrigin.y):new BMap.Size(i.size.width/2,i.size.height/2))}attachLabelOverlay(t){const i=this.getLabelOverlay();i&&i.attachIcon(void 0),t&&t.attachIcon(this.innerOverlay.getIcon()),this.innerOverlay.setLabel(t==null?void 0:t.innerOverlay)}getLabelOverlay(){var t;return(t=this.innerOverlay.getLabel())==null?void 0:t.__label__}}class gg extends eg{constructor(){super(...arguments);P(this,"label");P(this,"labelPositionListener");P(this,"labelVisibleListener");P(this,"labelMapChangedListener")}static create(t){const i=this.coordType,e=t.icon,o={position:t.position.toGoogle(i),title:t.title,label:t.label&&sh.toGoogle(t.label),zIndex:t.zIndex,visible:t.visible,icon:e&&da.toGoogle(e),clickable:t.clickable,draggable:t.draggable,crossOnDrag:t.crossOnDrag,cursor:t.cursor,anchorPoint:new google.maps.Point(0,0)};return new gg(new google.maps.Marker(o),i,this)}getPosition(){return te.fromGoogle(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toGoogle(this.coordType))}setTitle(t){this.innerOverlay.setTitle(t)}getTitle(){return this.innerOverlay.getTitle()||""}setIcon(t){this.innerOverlay.setIcon(da.toGoogle(t))}getIcon(){return this.innerOverlay.getIcon()}setClickable(t){this.innerOverlay.setClickable(t)}isClickable(){return this.innerOverlay.getClickable()}setDraggable(t){this.innerOverlay.setDraggable(t)}isDraggable(){return!!this.innerOverlay.getDraggable()}setZIndex(t){this.innerOverlay.setZIndex(t===void 0?null:t)}getZIndex(){const t=this.innerOverlay.getZIndex();return t===null?void 0:t}setLabel(t){this.innerOverlay.setLabel(sh.toGoogle(t))}attachLabelOverlay(t){if(this.label&&this.map.removeOverlay(this.label),this.labelPositionListener&&this.labelPositionListener.remove(),this.labelVisibleListener&&this.labelVisibleListener.remove(),this.labelMapChangedListener&&this.labelMapChangedListener.remove(),t){const i=()=>{t.innerOverlay.setPosition(this.innerOverlay.getPosition())},e=()=>{t.innerOverlay.setVisible(this.innerOverlay.getVisible())},o=()=>{this.innerOverlay.getMap()?this.map.addOverlay(t):this.map.removeOverlay(t)};o(),i(),e(),this.label=t,this.labelMapChangedListener=this.innerOverlay.addListener("map_changed",o),this.labelPositionListener=this.innerOverlay.addListener("position_changed",i),this.labelVisibleListener=this.innerOverlay.addListener("visible_changed",e)}else this.label=void 0,this.labelPositionListener=void 0,this.labelVisibleListener=void 0,this.labelMapChangedListener=void 0}}class qi extends tg{constructor(t,i,e,o){super(t,i,e);P(this,"state");P(this,"label");P(this,"labelPositionListener");P(this,"labelVisibleListener");P(this,"labelMapChangedListener");P(this,"labelVisibleChangeInCluster");this.state=o}static create(t){const i=this.coordType,e={zIndex:t.zIndex,visible:t.visible??!0,draggable:t.draggable,interactive:t.clickable??!0,cursor:t.cursor,...qi.createSymbolOptions(t)};return new qi(new et(t.position.toTalks(i),e),i,this,{title:t.title,label:t.label,icon:t.icon})}static createSymbolOptions(t){let i;const e=[];if(t.icon?e.push(da.toTalks(t.icon)):e.push(et.prototype.options.symbol),t.label){const o={textDx:0,textDy:0};if(!t.icon)o.textDy=-21;else if("size"in t.icon){const s=t.icon.labelOrigin??{x:t.icon.size.width/2,y:t.icon.size.height/2},a=t.icon.anchor??{x:t.icon.size.width/2,y:t.icon.size.height};o.textDx=s.x-a.x,o.textDy=s.y-a.y}i=sh.toTalks(t.label,o),e.push(i.symbol)}return{properties:i==null?void 0:i.properties,symbol:e.length>1?e:e[0]}}getPosition(){return te.fromTalks(this.innerOverlay.getCoordinates(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setCoordinates(t.toTalks(this.coordType))}setTitle(t){this.state.title=t}getTitle(){return this.state.title??""}setLabel(t){this.state.label=t;const{symbol:i,properties:e}=qi.createSymbolOptions(this.state);this.innerOverlay.setSymbol(i),this.innerOverlay.setProperties(e??{})}setIcon(t){this.state.icon=t;const{symbol:i}=qi.createSymbolOptions(this.state);this.innerOverlay.setSymbol(i)}getIcon(){return this.innerOverlay.getSymbol()}setClickable(t){this.innerOverlay.config("interactive",t)}isClickable(){return this.innerOverlay.config().interactive??!0}setDraggable(t){this.innerOverlay.config("draggable",t)}isDraggable(){return this.innerOverlay.config().draggable??!1}setZIndex(t){this.innerOverlay.setZIndex(t??0)}getZIndex(){return this.innerOverlay.getZIndex()}getInfoWindowOffset(){var e;const t=(e=this.innerOverlay._getPainter())==null?void 0:e.getFixedExtent();if(!(t!=null&&t.xmax)||!t.ymin)return;const i=this.innerOverlay.getSize()??new ft(0,0);return{x:t.xmax-i.width/2,y:t.ymin}}attachLabelOverlay(t){if(this.label&&this.map.removeOverlay(this.label),this.labelMapChangedListener&&this.innerOverlay.off("add remove",this.labelMapChangedListener),this.labelPositionListener&&this.innerOverlay.off("positionchange",this.labelPositionListener),this.labelVisibleListener&&this.innerOverlay.off("show hide",this.labelVisibleListener),this.labelVisibleChangeInCluster&&this.innerOverlay.off("visible-change-in-cluster",this.labelVisibleChangeInCluster),t){const i=this.labelPositionListener=()=>{t.innerOverlay.setCoordinates(this.innerOverlay.getCoordinates())},e=this.labelVisibleListener=()=>{t.setVisible(this.isVisible())},o=this.labelMapChangedListener=()=>{this.innerOverlay.getLayer()?this.map.addOverlay(t):this.map.removeOverlay(t)},s=this.labelVisibleChangeInCluster=a=>{"visible"in a&&t.setVisible(a.visible)};o(),i(),e(),this.label=t,this.innerOverlay.on("add remove",o),this.innerOverlay.on("positionchange",i),this.innerOverlay.on("show hide",e),this.innerOverlay.on("visible-change-in-cluster",s)}else this.label=void 0,this.labelMapChangedListener=void 0,this.labelPositionListener=void 0,this.labelVisibleListener=void 0,this.labelVisibleChangeInCluster=void 0}}class pg extends Xr{constructor(){super(...arguments);P(this,"eventHubDelegate");P(this,"prevPath");P(this,"isDoingSetPath",!1);P(this,"onLineUpdate",()=>{var i;const t=this.innerOverlay.getPath();t!==this.prevPath&&(this.isDoingSetPath||(i=this.eventHubDelegate)==null||i.notify({type:this.pathEditedEventType,target:this,originalEvent:{prevPath:this.prevPath,path:t}}),this.prevPath=t)})}setPathInternal(t){this.isDoingSetPath=!0,this.innerOverlay.setPath(t),this.isDoingSetPath=!1}createDelegate(){return this.eventHubDelegate=new Yh(super.createDelegate(),{types:[this.pathEditedEventType],onListen:()=>{this.prevPath=this.innerOverlay.getPath(),this.innerOverlay.addEventListener("lineupdate",this.onLineUpdate)},onCancel:()=>{this.innerOverlay.removeEventListener("lineupdate",this.onLineUpdate),this.prevPath=void 0}})}}class vg extends pg{constructor(){super(...arguments);P(this,"pathEditedEventType","path-edited")}static create(t){var o,s;const i=this.coordType,e=new BMap.Polyline(t.path.map(a=>a.toBaidu(i)),{enableClicking:t.clickable,enableEditing:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity!=null?t.strokeOpacity+Xr.OPACITY_DELTA:void 0,...t.strokeWeight!=null&&{strokeWeight:t.strokeWeight},icons:(o=t.icons)==null?void 0:o.map(oh.toBaidu)});return new vg(e,i,this,{editable:!!t.editable,symbolIcons:(s=t.icons)==null?void 0:s.map(a=>a.icon)}).visibleOptionInternal(t.visible)}getPath(){return this.innerOverlay.getPath().map(t=>te.fromBaidu(t,this.coordType))}setPath(t){this.coordType=this.map.coordType,this.setPathInternal(t.map(i=>i.toBaidu(this.coordType)))}remove(){var t;super.remove(),(t=this.state.symbolIcons)!=null&&t.length&&this.map.innerMap.getOverlays().filter(e=>{var l;if(!(e instanceof BMap.Marker))return!1;const o=e;if(o.__create_by_tg__)return!1;const s=o.getIcon();if(!Aw.is(s))return!1;const a=s;return a.__icon__?(l=this.state.symbolIcons)==null?void 0:l.includes(a.__icon__):!1}).forEach(e=>this.map.innerMap.removeOverlay(e))}}class mg extends tu{constructor(){super(...arguments);P(this,"pathChangedListeners");P(this,"eventHubDelegate")}static create(t){var o;const i=this.coordType,e=new google.maps.Polyline({path:t.path.map(s=>s.toGoogle(i)),clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,visible:t.visible,zIndex:t.zIndex,icons:(o=t.icons)==null?void 0:o.map(oh.toGoogle)});return new mg(e,i,this)}setupPathChangedListeners(){const t=()=>{var e;return(e=this.eventHubDelegate)==null?void 0:e.notify({type:"path-edited",target:this})},i=this.innerOverlay.getPath();this.pathChangedListeners=Ro.listenChanged(i,t)}clearPathChangedListeners(){var t;(t=this.pathChangedListeners)==null||t.forEach(i=>i.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new Yh(super.createDelegate(),{types:["path-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPath(){const t=[];return this.innerOverlay.getPath().forEach(i=>{t.push(te.fromGoogle(i,this.coordType))}),t}setPath(t){var i;this.coordType=this.map.coordType,this.innerOverlay.setPath(t.map(e=>e.toGoogle(this.coordType))),(i=this.eventHubDelegate)!=null&&i.hasListener("path-edited")&&this.setupPathChangedListeners()}}class _g extends ru{static create(r){const t=this.coordType,i=new pt(r.path.map(e=>e.toTalks(t)),{interactive:r.clickable??!0,editable:r.editable,symbol:{lineColor:r.strokeColor,lineOpacity:r.strokeOpacity,lineWidth:r.strokeWeight,lineCap:"round"},visible:r.visible??!0,zIndex:r.zIndex});return new _g(i,t,this)}getPath(){return this.innerOverlay.getCoordinates().map(r=>te.fromTalks(r,this.coordType))}setPath(r){this.coordType=this.map.coordType,this.innerOverlay.setCoordinates(r.map(t=>t.toTalks(this.coordType)))}}class yg extends pg{constructor(){super(...arguments);P(this,"pathEditedEventType","paths-edited")}static create(t){const i=this.coordType;t.paths.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]");const e=t.paths[0]||[],o=new BMap.Polygon(e.map(s=>s.toBaidu(i)),{enableClicking:t.clickable,enableEditing:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity!=null?t.strokeOpacity+Xr.OPACITY_DELTA:void 0,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity!=null?t.fillOpacity+Xr.OPACITY_DELTA:void 0});return new yg(o,i,this,{editable:!!t.editable}).visibleOptionInternal(t.visible)}getPaths(){return[this.innerOverlay.getPath().map(t=>te.fromBaidu(t,this.coordType))]}setPaths(t){t.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]"),this.coordType=this.map.coordType,this.setPathInternal((t[0]||[]).map(i=>i.toBaidu(this.coordType)))}}class wg extends tu{constructor(){super(...arguments);P(this,"pathChangedListeners");P(this,"eventHubDelegate")}static create(t){const i=this.coordType,e=new google.maps.Polygon({paths:t.paths.map(o=>o.map(s=>s.toGoogle(i))),clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible,zIndex:t.zIndex});return new wg(e,i,this)}setupPathChangedListeners(){const t=()=>{var e;return(e=this.eventHubDelegate)==null?void 0:e.notify({type:"paths-edited",target:this})},i=this.innerOverlay.getPaths();this.pathChangedListeners=[],i.forEach(e=>{this.pathChangedListeners.push(...Ro.listenChanged(e,t))})}clearPathChangedListeners(){var t;(t=this.pathChangedListeners)==null||t.forEach(i=>i.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new Yh(super.createDelegate(),{types:["paths-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPaths(){const t=this.innerOverlay.getPaths(),i=[];return t.forEach(e=>{const o=[];i.push(o),e.forEach(s=>{o.push(te.fromGoogle(s,this.coordType))})}),i}setPaths(t){var i;this.coordType=this.map.coordType,this.innerOverlay.setPaths(t.map(e=>e.map(o=>o.toGoogle(this.coordType)))),(i=this.eventHubDelegate)!=null&&i.hasListener("paths-edited")&&this.setupPathChangedListeners()}}class xg extends ru{static create(r){const t=this.coordType,i=new it(r.paths.map(e=>e.map(o=>o.toTalks(t))),{interactive:r.clickable??!0,editable:r.editable,symbol:{lineColor:r.strokeColor,lineOpacity:r.strokeOpacity,lineWidth:r.strokeWeight,lineCap:"round",polygonFill:r.fillColor??Ao.FILL_COLOR_TG,polygonOpacity:r.fillOpacity??Ao.FILL_OPACITY_TG},visible:r.visible??!0,zIndex:r.zIndex});return new xg(i,t,this)}getPaths(){return this.innerOverlay.getCoordinates().map(r=>r.map(t=>te.fromTalks(t,this.coordType)))}setPaths(r){this.coordType=this.map.coordType,this.innerOverlay.setCoordinates(r.map(t=>t.map(i=>i.toTalks(this.coordType))))}}class Cg extends pg{constructor(t,i,e,o){super(t,i,e,o);P(this,"pathEditedEventType","bounds-changed");P(this,"isDoingUpdateRectangle",!1);P(this,"onBoundsChanged",({originalEvent:t})=>{if(this.isDoingUpdateRectangle)return;const i=t.prevPath??[],e=t.path;setTimeout(()=>{let o=e;const s=e.length;if(i.length===4)if(s>i.length){for(let l=0;l<s;l++)if(i[l]==null||!Cm.equals(e[l],i[l])){const h=e[(l-2+s)%s],u=e[(l-1+s)%s],c=e[l],f=e[(l+1)%s],d=e[(l+2)%s];let g;u.lat===f.lat?g=new BMap.Point(u.lng,c.lat):u.lng===f.lng?g=new BMap.Point(c.lng,u.lat):g=c,o=[h,d,g];break}}else if(s===i.length){for(let l=0;l<s;l++)if(!Cm.equals(e[l],i[l])){o=[e[l],e[(l+2)%4]];break}}else s<i.length;const a=Rt.fromArray(o.map(l=>te.fromBaidu(l,this.coordType)));a&&(this.isDoingUpdateRectangle=!0,this.innerOverlay.setPath(a.toRectArray().map(l=>l.toBaidu(this.coordType))),this.isDoingUpdateRectangle=!1)},0)});this.addEventListener("bounds-changed",this.onBoundsChanged)}static create(t){const i=this.coordType,e=new BMap.Polygon(t.bounds.toRectArray().map(o=>o.toBaidu(i)),{enableClicking:t.clickable,enableEditing:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity!=null?t.strokeOpacity+Xr.OPACITY_DELTA:void 0,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity!=null?t.fillOpacity+Xr.OPACITY_DELTA:void 0});return new Cg(e,i,this,{editable:!!t.editable}).visibleOptionInternal(t.visible)}getBounds(){return Rt.fromBaidu(this.innerOverlay.getBounds(),this.coordType)}setBounds(t){const i=t.toRectArray();this.innerOverlay.getPath().length===i.length?t.toRectArray().forEach((e,o)=>{this.innerOverlay.setPositionAt(o,e.toBaidu(this.coordType))}):this.setPathInternal(i.map(e=>e.toBaidu(this.coordType)))}}class Tg extends tu{static create(r){const t=this.coordType,i=new google.maps.Rectangle({bounds:r.bounds.toGoogle(t),clickable:r.clickable,editable:r.editable,strokeColor:r.strokeColor,strokeOpacity:r.strokeOpacity,strokeWeight:r.strokeWeight,fillColor:r.fillColor,fillOpacity:r.fillOpacity,visible:r.visible,zIndex:r.zIndex});return new Tg(i,t,this)}getBounds(){return Rt.fromGoogle(this.innerOverlay.getBounds()??ln.BOUNDS_ZERO,this.coordType)}setBounds(r){const t=r.toGoogle(this.coordType);t.equals(this.innerOverlay.getBounds())||this.innerOverlay.setBounds(t)}}class Rs extends ru{static create(r){const t=this.coordType,i=Rs.convertBoundsToRect(r.bounds,t),e=new Sn(i.northWest,i.width,i.height,{interactive:r.clickable??!0,editable:r.editable,symbol:{lineColor:r.strokeColor,lineOpacity:r.strokeOpacity,lineWidth:r.strokeWeight,polygonFill:r.fillColor??Ao.FILL_COLOR_TG,polygonOpacity:r.fillOpacity??Ao.FILL_OPACITY_TG},visible:r.visible??!0,zIndex:r.zIndex});return new Rs(e,t,this)}static convertBoundsToRect(r,t){const i=te.fromLngLat(r.sw.lng,r.ne.lat,r.sw.coord);return{northWest:i.toTalks(t),width:ym(i,r.ne),height:ym(i,r.sw)}}getBounds(){return Rt.fromTalks(this.innerOverlay.getExtent(),this.coordType)}setBounds(r){this.coordType=this.map.coordType;const t=Rs.convertBoundsToRect(r,this.coordType);this.innerOverlay.setCoordinates(t.northWest),this.innerOverlay.setWidth(t.width),this.innerOverlay.setHeight(t.height)}}const mn=1;class Wk extends Ho{constructor(t,i){var e;super(t);P(this,"buildInMapTypeId2BIMT");P(this,"baiduMapType2BIMT");P(this,"map");P(this,"createLabel",cg.create);P(this,"createCircle",rg.create);P(this,"createPolygon",yg.create);P(this,"createPolyline",vg.create);P(this,"createRectangle",Cg.create);P(this,"createInfoWindow",og.create);P(this,"createInfoBox",lg.create);P(this,"createMarker",ga.create);P(this,"createMapTypeControl",Hd.create);P(this,"createZoomControl",Xd.create);P(this,"createStreetViewControl",$d.create);P(this,"createScaleControl",Zd.create);this.buildInMapTypeId2BIMT=or.BUILD_IN_MAP_TYPES.getValueMap(Vr.prototype.getId),this.baiduMapType2BIMT=or.BUILD_IN_MAP_TYPES.getValueMap(Vr.prototype.asBaiduMapType),lk(),this.map=new BMap.Map(t,{minZoom:i.minZoom&&i.minZoom+mn,maxZoom:i.maxZoom&&i.maxZoom+mn,mapType:i.buildInMapTypeId&&((e=this.buildInMapTypeId2BIMT.get(i.buildInMapTypeId))==null?void 0:e.asBaiduMapType()),enableMapClick:!1}),this.map.centerAndZoom(i.center.toBaidu(this.coordType),i.zoom+mn),this.setGestureHandling(i.gestureHandling),i.infoWindowMode==="multi"&&console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"),i.mapStyle&&this.map.setMapStyleV2(i.mapStyle.baidu),this.setEventTargetDelegate(new la(this.map,this)),this.map.addEventListener("addoverlay",o=>{const s=o.target.__info_box__;s&&(console.debug("add:info-box",s),this.map.addOverlay(s))}),this.map.addEventListener("removeoverlay",o=>{const s=o.target.__info_box__;s&&(console.debug("remove:info-box",s),this.map.removeOverlay(s))})}setGestureHandling(t=zt.auto){switch(t===zt.auto&&(t=this.element.parentElement&&rh.isScrollable(this.element.parentElement)?zt.cooperative:zt.greedy),t){case zt.cooperative:this.map.disableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case zt.greedy:this.map.enableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case zt.none:this.map.disableDragging(),this.map.disableScrollWheelZoom(),this.map.disableDoubleClickZoom();break}}get innerMap(){return this.map}get coordType(){return this.getMapType().getBaiduCoordType()}addEventListener(t,i){if(t==="center-changed"){super.addEventListener("movestart",i),super.addEventListener("moving",i),super.addEventListener("moveend",i),super.addEventListener("zoomend",i);return}super.addEventListener(t,i)}removeEventListener(t,i){if(t==="center-changed"){super.removeEventListener("movestart",i),super.removeEventListener("moving",i),super.removeEventListener("moveend",i),super.removeEventListener("zoomend",i);return}super.removeEventListener(t,i)}fromContainerPointToLatLng(t){return te.fromBaidu(this.innerMap.pixelToPoint(new BMap.Pixel(t.x,t.y)),this.coordType)}fromLatLngToContainerPoint(t){return this.innerMap.pointToPixel(t.toBaidu(this.coordType))}setHideLogo(t){}setFractionalZoom(t){}setDefaultCursor(t){this.innerMap.setDefaultCursor(t)}setDraggable(t){t?this.innerMap.enableDragging():this.innerMap.disableDragging()}setDoubleClickZoom(t){t?this.map.enableDoubleClickZoom():this.map.disableDoubleClickZoom()}getCenter(){return te.fromBaidu(this.map.getCenter(),this.coordType)}setCenter(t){this.map.setCenter(t.toBaidu(this.coordType))}getZoom(){return super.getZoom()-mn}setZoom(t){return super.setZoom(t+mn)}setMinZoom(t){this.map.setMinZoom(t+mn)}setMaxZoom(t){this.map.setMaxZoom(t+mn)}setMapStyle(t){this.map.setMapStyleV2((t==null?void 0:t.baidu)??{styleJson:[]})}setBuildInMapTypeId(t){var e;const i=(e=this.buildInMapTypeId2BIMT.get(t))==null?void 0:e.asBaiduMapType();this.map.setMapType(i??Pt("理论上来说不可能为空"))}setMapType(t){this.map.setMapType(t.asBaiduMapType())}getMapType(){const t=this.map.getMapType(),i=this.baiduMapType2BIMT.get(t);return i||(t.__baidu_map_type__??Pt("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"))}addLayer(t){this.map.addTileLayer(t.asBaiduLayer())}removeLayer(t){this.map.removeTileLayer(t.asBaiduLayer())}panTo(t){this.map.panTo(t.toBaidu(this.coordType))}panBy(t,i){this.map.panBy(t,i)}fitBounds(t,i){this.map.setViewport(t.toBaiduArray(this.coordType),{margins:i&&[i.top,i.right,i.bottom,i.left]})}getBounds(){return Rt.fromBaidu(this.map.getBounds(),this.coordType)}addElementOverlay(t){this.map.addOverlay(t.asBaidu())}removeElementOverlay(t){this.map.removeOverlay(t.asBaidu())}addOverlay(t){this.map.addOverlay(t.innerOverlay)}removeOverlay(t){this.map.removeOverlay(t.innerOverlay)}addCustomControl(t){if(!t.inner){const i=class extends BMap.Control{constructor(){super(...arguments);P(this,"defaultAnchor",fr.getBaidu().toValue(t.position));P(this,"defaultOffset",new BMap.Size(0,0))}initialize(o){const s=t.onCreateElement();return o.getContainer().appendChild(s),s}};t.inner=new i,this.map.addControl(t.inner)}}removeCustomControl(t){t.inner&&(Ps(t.inner instanceof BMap.Control,`control.inner(${t.inner})需要是BMap.Control`),this.map.removeControl(t.inner))}createMarkerClusterer(t){return new Ak(this,t)}createHeatmap(t){return new Ck(this,t)}createAutocomplete(t){return new vk(this,t)}createSearchBox(t){return new Gk(this,t)}createPlacesService(t){return new zk(this,t)}createMapUrls(t){return new gf(t)}}class $k extends Ho{constructor(t,i){var o,s;super(t);P(this,"mapOptions");P(this,"buildInMapTypeId2BIMT");P(this,"googleMapTypeId2BIMT");P(this,"map");P(this,"createLabel",fg.create);P(this,"createCircle",ig.create);P(this,"createPolygon",wg.create);P(this,"createPolyline",mg.create);P(this,"createRectangle",Tg.create);P(this,"createInfoWindow",sg.create);P(this,"createInfoBox",hg.create);P(this,"createMarker",gg.create);P(this,"createMapTypeControl",ff.create);P(this,"createZoomControl",Yd.create);P(this,"createStreetViewControl",Ud.create);P(this,"createScaleControl",Vd.create);this.mapOptions=i,this.buildInMapTypeId2BIMT=or.BUILD_IN_MAP_TYPES.getValueMap(Vr.prototype.getId),this.googleMapTypeId2BIMT=or.BUILD_IN_MAP_TYPES.getValueMap(Vr.prototype.getGoogleMapTypeId);const e=i.buildInMapTypeId&&this.buildInMapTypeId2BIMT.get(i.buildInMapTypeId);this.map=new google.maps.Map(t,{center:i.center.toGoogle((e??or.NORMAL).getGoogleCoordType()),zoom:i.zoom,disableDefaultUI:!0,gestureHandling:i.gestureHandling,isFractionalZoomEnabled:i.fractionalZoom??!1,minZoom:i.minZoom,maxZoom:i.maxZoom,styles:(o=i.mapStyle)==null?void 0:o.google.styles,mapId:(s=i.mapStyle)==null?void 0:s.google.mapId,mapTypeId:e==null?void 0:e.getGoogleMapTypeId()}),this.setEventTargetDelegate(new Lo(this.map,this))}setGestureHandling(t){this.map.setOptions({gestureHandling:t})}get innerMap(){return this.map}get coordType(){return this.getMapType().getGoogleCoordType()}fromContainerPointToLatLng(t){const i=this.innerMap.getProjection(),e=this.innerMap.getBounds();if(i==null||e==null)return te.ZERO;const o=i.fromLatLngToPoint(e.getSouthWest()),s=i.fromLatLngToPoint(e.getNorthEast()),a=this.innerMap.getZoom();if(o==null||s==null||a==null)return te.ZERO;const l=Math.pow(2,a),h=new google.maps.Point(t.x/l+o.x,t.y/l+s.y);return te.fromGoogle(i.fromPointToLatLng(h)??ln.LATLNG_ZERO,this.coordType)}fromLatLngToContainerPoint(t){const i=this.innerMap.getProjection(),e=this.innerMap.getBounds();if(i==null||e==null)return Yr.ZERO;const o=i.fromLatLngToPoint(e.getSouthWest()),s=i.fromLatLngToPoint(e.getNorthEast()),a=this.innerMap.getZoom();if(o==null||s==null||a==null)return Yr.ZERO;const l=Math.pow(2,a),h=i.fromLatLngToPoint(t.toGoogle(this.coordType));return h==null?Yr.ZERO:{x:(h.x-o.x)*l,y:(h.y-s.y)*l}}setHideLogo(t){}setFractionalZoom(t){this.innerMap.setOptions({isFractionalZoomEnabled:t})}setDefaultCursor(t){this.innerMap.setOptions({draggableCursor:t})}setDraggable(t){this.innerMap.setOptions({draggable:t})}setDoubleClickZoom(t){this.map.setOptions({disableDoubleClickZoom:!t})}getCenter(){return te.fromGoogle(this.map.getCenter()??ln.LATLNG_ZERO,this.coordType)}setCenter(t){this.map.setCenter(t.toGoogle(this.coordType))}setMinZoom(t){this.map.setOptions({minZoom:t})}setMaxZoom(t){this.map.setOptions({maxZoom:t})}setMapStyle(t){this.map.setOptions({styles:t==null?void 0:t.google.styles,mapId:t==null?void 0:t.google.mapId})}setBuildInMapTypeId(t){var e;const i=(e=this.buildInMapTypeId2BIMT.get(t))==null?void 0:e.getGoogleMapTypeId();this.map.setMapTypeId(i??Pt("理论上来说不可能为空"))}setMapType(t){t instanceof Vr?this.map.setMapTypeId(t.getGoogleMapTypeId()):(this.map.mapTypes.set(t.id,t.asGoogleMapType()),this.map.setMapTypeId(t.id))}getMapType(){const t=this.map.getMapTypeId()??google.maps.MapTypeId.ROADMAP,i=this.googleMapTypeId2BIMT.get(t);return i||(this.map.mapTypes.get(t).__google_map_type__??Pt(`实现${t}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`))}addOverlayMapType(t){this.map.overlayMapTypes.push(t.asGoogleMapType())}removeOverlayMapType(t){Ro.remove(this.map.overlayMapTypes,t.asGoogleMapType())}addLayer(t){t.asGoogleLayer().setMap(this.map)}removeLayer(t){t.asGoogleLayer().setMap(null)}panTo(t){this.map.panTo(t.toGoogle(this.coordType))}panBy(t,i){this.map.panBy(t,i)}fitBounds(t,i){this.map.fitBounds(t.toGoogle(this.coordType),i)}getBounds(){const t=this.map.getBounds();return t?Rt.fromGoogle(t,this.coordType):Rt.EMPTY}addElementOverlay(t){t.asGoogle().setMap(this.map)}removeElementOverlay(t){t.asGoogle().setMap(null)}addOverlay(t){t.innerOverlay.setMap(this.map)}removeOverlay(t){t.innerOverlay.setMap(null)}addCustomControl(t){t.inner||(t.inner=t.onCreateElement(),this.map.controls[fr.getGoogle().toValue(t.position)].push(t.inner))}removeCustomControl(t){if(t.inner){const i=this.map.controls[fr.getGoogle().toValue(t.position)];Ro.remove(i,t.inner)}}createMarkerClusterer(t){return new Lk(this,t)}createHeatmap(t){return new xk(this,t)}createAutocomplete(t){return new pk(this,t)}createSearchBox(t){return new Bk(this,t)}createPlacesService(t){return new Dk(this,t)}createMapUrls(t){return new df(t)}}class Uk extends Ho{constructor(t,i){var s;super(t);P(this,"mapOptions");P(this,"map");P(this,"defaultLayers");this.mapOptions=i;const e=qh().here;th.includes(e.version)||Pt(`不支持${e.version}, HereMap当前只支持如下版本: ${th}`);const o=new H.service.Platform({app_id:e.key.split(",")[0],app_code:e.key.split(",")[1]});this.defaultLayers=o.createDefaultLayers(),this.map=new H.Map(t,this.defaultLayers.normal.map,{zoom:i.zoom,center:(s=i.center)==null?void 0:s.toHere(this.coordType)}),new H.mapevents.Behavior(new H.mapevents.MapEvents(this.map)),H.ui.UI.createDefault(this.map,this.defaultLayers)}get innerMap(){return this.map}get coordType(){return De.wgs84}getCenter(){return te.fromHere(this.map.getCenter(),this.coordType)}setCenter(t){this.map.setCenter(t.toHere(this.coordType))}setHideLogo(t){throw new Error("Method not implemented.")}setFractionalZoom(t){throw new Error("Method not implemented.")}setGestureHandling(t){throw new Error("Method not implemented.")}fromContainerPointToLatLng(t){throw new Error("Method not implemented.")}fromLatLngToContainerPoint(t){throw new Error("Method not implemented.")}setDefaultCursor(t){throw new Error("Method not implemented.")}setDraggable(t){throw new Error("Method not implemented.")}setDoubleClickZoom(t){throw new Error("Method not implemented.")}setMinZoom(t){throw new Error("Method not implemented.")}setMaxZoom(t){throw new Error("Method not implemented.")}setMapStyle(t){throw new Error("Method not implemented.")}setBuildInMapTypeId(t){throw new Error("Method not implemented.")}setMapType(t){throw new Error("Method not implemented.")}getMapType(){throw new Error("Method not implemented.")}addLayer(t){throw new Error("Method not implemented.")}removeLayer(t){throw new Error("Method not implemented.")}panTo(t){throw new Error("Method not implemented.")}panBy(t,i){throw new Error("Method not implemented.")}fitBounds(t,i){throw new Error("Method not implemented.")}getBounds(){throw new Error("Method not implemented.")}addElementOverlay(t){throw new Error("Method not implemented.")}removeElementOverlay(t){throw new Error("Method not implemented.")}addOverlay(t){throw new Error("Method not implemented.")}removeOverlay(t){throw new Error("Method not implemented.")}createMarker(t){throw new Error("Method not implemented.")}createMarkerClusterer(t){throw new Error("Method not implemented.")}createHeatmap(t){throw new Error("Method not implemented.")}createAutocomplete(t){throw new Error("Method not implemented.")}createSearchBox(t){throw new Error("Method not implemented.")}createPlacesService(t){throw new Error("Method not implemented.")}createMapUrls(t){throw new Error("Method not implemented.")}createInfoWindow(t){throw new Error("Method not implemented.")}createInfoBox(t){throw new Error("Method not implemented.")}createPolyline(t){throw new Error("Method not implemented.")}createPolygon(t){throw new Error("Method not implemented.")}createRectangle(t){throw new Error("Method not implemented.")}createCircle(t){throw new Error("Method not implemented.")}createLabel(t){throw new Error("Method not implemented.")}addCustomControl(t){throw new Error("Method not implemented.")}removeCustomControl(t){throw new Error("Method not implemented.")}createMapTypeControl(t){throw new Error("Method not implemented.")}createZoomControl(t){throw new Error("Method not implemented.")}createStreetViewControl(t){throw new Error("Method not implemented.")}createScaleControl(t){throw new Error("Method not implemented.")}}const Jk=(n,r,t)=>{const i=new Array(n);let e=1<<n-1,o,s;for(o=0;o<n;++o)s=48,r&e&&(s+=1),t&e&&(s+=2),i[o]=String.fromCharCode(s),e>>=1;return i.join("")},Xk=["osm","osm-simple","google","baidu","baidu-detail","amap","tencent","geoq","tianditu","yandex","bing"];function qw(n){switch(n){case"baidu":case"baidu-detail":return De.bd09;case"osm-simple":case"osm":case"yandex":return De.wgs84;default:return De.gcj02}}const Sm=1;function Kw(n,{id:r=n,visible:t=!0}={}){switch(n){case"amap":return new gt(r,{visible:t,urlTemplate:"http://webrd03.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}&lang=zh_cn",minZoom:3,maxZoom:18,attribution:'© <a target="_blank" href="https://amap.com/">AMap</a>'});case"baidu":return new gt(r,{visible:t,urlTemplate:`http://online{s}.map.bdimg.com/tile/?qt=vtile&x={x}&y={y}&z={z}&styles=pl&type=sate&scaler=${Sm}`,subdomains:["0","1","2","3"],spatialReference:{projection:"baidu"},minZoom:3,maxZoom:20,attribution:'© <a target="_blank" href="http://map.baidu.com">Baidu</a>'});case"baidu-detail":return new gt(r,{visible:t,urlTemplate:`https://gss{s}.bdstatic.com/8bo_dTSlRsgBo1vgoIiO_jowehsv/tile/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=${Sm}&udt=20170927`,subdomains:["0","1","2","3"],spatialReference:{projection:"baidu"},minZoom:3,maxZoom:19,attribution:'© <a target="_blank" href="http://map.baidu.com">Baidu</a>'});case"tencent":return new gt(r,{visible:t,urlTemplate:(e,o,s,a)=>`http://rt${a}.map.gtimg.com/realtimerender?z=${s}&x=${e}&y=${(1<<s)-o-1}&type=vector&style=0`,subdomains:["0","1","2","3"],minZoom:3,maxZoom:18});case"google":return new gt(r,{visible:t,urlTemplate:"https://api.xiox.top/proxy/https://maps.google.com/maps/vt?lyrs=m&x={x}&y={y}&z={z}&hl=zh-CN",subdomains:["0","1","2","3"],attribution:'© <a target="_blank" href="https://www.google.com/maps">Google</a>'});case"geoq":return new gt(r,{visible:t,urlTemplate:"https://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}",subdomains:["0","1","2","3"]});case"tianditu":const i="64449e86f8446d34ee0681b86f5e3562";return new gt(r,{visible:t,tileSystem:[1,-1,-180,90],urlTemplate:`https://t{s}.tianditu.gov.cn/vec_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${i}`,subdomains:["1","2","3","4","5"],attribution:'© <a target="_blank" href="http://www.tianditu.cn">Tianditu</a>',spatialReference:{projection:"EPSG:4326"}});case"yandex":return new gt(r,{visible:t,urlTemplate:"https://core-renderer-tiles.maps.yandex.net/tiles?l=map&v=23.10.17-2-b231014085130&x={x}&y={y}&z={z}&scale=1&lang=zh_CN&experimental_pp_over_dj=prod",subdomains:["1","2","3","4"],maxZoom:21,attribution:'© <a target="_blank" href="https://yandex.com/maps/">Yandex</a>'});case"bing":return new gt(r,{visible:t,urlTemplate:(e,o,s,a)=>`https://r${a}.tiles.ditu.live.com/tiles/r${Jk(s,e,o)}.png?g=100&mkt=zh-cn`,subdomains:["1","2","3"],minZoom:3,maxZoom:18});case"osm":return new gt(r,{visible:t,urlTemplate:"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",subdomains:["a","b","c"],attribution:'© <a target="_blank" href="http://www.osm.org/copyright">OSM</a>'});case"osm-simple":return new gt(r,{visible:t,urlTemplate:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",subdomains:["a","b","c","d"],attribution:'© <a target="_blank" href="http://www.osm.org/copyright">OSM</a> contributors, © <a target="_blank" href="https://carto.com/attributions">CARTO</a>'})}}const Om={content:"TG"};class Qn extends Ho{constructor(t,i,e){super(t);P(this,"mapOptions");P(this,"map");P(this,"currentBaseLayerId");P(this,"markerLayer");P(this,"overlayLayer");P(this,"createMarker",qi.create);P(this,"createInfoWindow",ag.create);P(this,"createInfoBox",ug.create);P(this,"createPolyline",_g.create);P(this,"createPolygon",xg.create);P(this,"createRectangle",Rs.create);P(this,"createCircle",ng.create);P(this,"createLabel",dg.create);P(this,"createMapTypeControl",jd.create);P(this,"createZoomControl",qd.create);P(this,"createStreetViewControl",Jd.create);P(this,"createScaleControl",Wd.create);this.mapOptions=i;const o=pT.values(tn).indexOf(i.buildInMapTypeId??tn.normal);this.currentBaseLayerId=e[o]??e[0];const a=e.map(l=>Kw(l,{visible:l===this.currentBaseLayerId})).find(l=>l.isVisible());this.markerLayer=new Lr("markers"),this.overlayLayer=new Lr("overlays"),this.map=new Se(t,{attribution:i.hideLogo?!1:Om,baseLayer:a,spatialReference:a==null?void 0:a.config().spatialReference,layers:[this.overlayLayer,this.markerLayer],center:i.center.toTalks(this.coordType),seamlessZoom:i.fractionalZoom??!1,zoom:i.zoom,minZoom:i.minZoom??(a==null?void 0:a.config().minZoom),maxZoom:i.maxZoom??(a==null?void 0:a.config().maxZoom)}),this.setGestureHandling(i.gestureHandling),this.setEventTargetDelegate(new zi(this.map,this))}setGestureHandling(t=zt.auto){switch(t===zt.auto&&(t=this.element.parentElement&&rh.isScrollable(this.element.parentElement)?zt.cooperative:zt.greedy),t){case zt.cooperative:this.map.config({scrollWheelZoom:!1,draggable:!0,doubleClickZoom:!0});break;case zt.greedy:this.map.config({scrollWheelZoom:!0,draggable:!0,doubleClickZoom:!0});break;case zt.none:this.map.config({scrollWheelZoom:!1,draggable:!1,doubleClickZoom:!1});break}}get innerMap(){return this.map}get coordType(){return qw(this.currentBaseLayerId)}fromContainerPointToLatLng(t){const i=this.map.containerPointToCoordinate(new z(t.x,t.y));return te.fromTalks(i,this.coordType)}fromLatLngToContainerPoint(t){return this.map.coordinateToContainerPoint(t.toTalks(this.coordType))}setHideLogo(t){this.map.config("attribution",t?!1:Om)}setFractionalZoom(t){this.map.config("seamlessZoom",t)}setDefaultCursor(t){this.map.setCursor(t)}setDraggable(t){this.map.config("draggable",t)}setDoubleClickZoom(t){this.map.config("doubleClickZoom",t)}getCenter(){return te.fromTalks(this.map.getCenter(),this.coordType)}setCenter(t){this.map.setCenter(t.toTalks(this.coordType))}setMinZoom(t){this.map.setMinZoom(t)}setMaxZoom(t){this.map.setMaxZoom(t)}setMapStyle(t){}setBuildInMapTypeId(t){}setMapType(t){}getMapType(){return or.NORMAL}addLayer(t){}removeLayer(t){}panTo(t){this.map.panTo(t.toTalks(this.coordType))}panBy(t,i){this.map.panBy([t,i])}fitBounds(t,i){this.map.fitExtent(t.toTalks(this.coordType),void 0,i&&{paddingBottom:i.bottom,paddingLeft:i.left,paddingTop:i.top,paddingRight:i.right})}getBounds(){return Rt.fromTalks(this.map.getExtent(),this.coordType)}addElementOverlay(t){}removeElementOverlay(t){}addOverlay(t){if(t.innerOverlay instanceof Oo.UIComponent){t.innerOverlay.addTo(this.map);return}(t instanceof qi?this.markerLayer:this.overlayLayer).addGeometry(t.innerOverlay)}removeOverlay(t){if(t.innerOverlay instanceof Oo.UIComponent){t.innerOverlay.remove();return}(t instanceof qi?this.markerLayer:this.overlayLayer).removeGeometry(t.innerOverlay)}createMarkerClusterer(t){return new Ik(this,t)}createHeatmap(t){throw new Error("Method not implemented.")}createAutocomplete(t){throw new Error("Method not implemented.")}createSearchBox(t){throw new Error("Method not implemented.")}createPlacesService(t){throw new Error("Method not implemented.")}createMapUrls(t){throw new Error("Method not implemented.")}addCustomControl(t){}removeCustomControl(t){}}var Ye;(function(n){n.google="google",n.baidu="baidu",n.here="here",n.baiduFree="baiduFree",n.googleFree="googleFree",n.yandex="yandex",n.amap="amap",n.osm="osm",n.talks="talks"})(Ye||(Ye={}));var vf;(function(n){function r(t,i,e){const o=pf.create(e);switch(t){case Ye.google:return new $k(i,o);case Ye.baidu:return new Wk(i,o);case Ye.here:return new Uk(i,o);case Ye.baiduFree:return new Qn(i,o,["baidu","osm"]);case Ye.googleFree:return new Qn(i,o,["google","osm"]);case Ye.amap:return new Qn(i,o,["amap"]);case Ye.osm:return new Qn(i,o,["osm"]);case Ye.yandex:return new Qn(i,o,["yandex"]);case Ye.talks:return new Qn(i,o,[qh().talks.layerId||"bing"]);default:Ll(t)}}n.createMap=r})(vf||(vf={}));const Yk={};function qk(n){return Cr.putIfAbsent(Yk,n,()=>bk(()=>Kk({type:n,config:qh()[n]})))()}function Kk({type:n,config:r}){const t=window,i=Qk(n);if(!i||i.some(e=>Cr.get(t,e)))return Promise.resolve();switch(n!==Ye.here&&!r.key&&Pt(`请先配置${n}地图的key`),n){case Ye.google:return Tc(`https://maps.googleapis.com/maps/api/js?key=${r.key}&language=${r.language}&v=${r.version}&libraries=${r.libraries.join(",")}`);case Ye.baidu:return"type"in r&&r.type==="webgl"?Tc(`https://api.map.baidu.com/api?type=${r.type}&v=${r.version}&ak=${r.key}`).then(ak):Tc(`https://api.map.baidu.com/api?v=${r.version}&ak=${r.key}`);case Ye.here:return cs(us("core",r.version)).then(()=>Promise.all([cs(us("service",r.version)),cs(us("mapevents",r.version)),cs(us("clustering",r.version)),cs(us("ui",r.version))])).catch(e=>(i.forEach(o=>Cr.del(t,o)),Promise.reject(e)));default:Ll(n)}}function us(n,r=th[0]){return`https://js.api.here.com/v3/${r}/mapsjs-${n}.js`}function Qk(n){switch(n){case Ye.google:return["google.maps"];case Ye.baidu:return["BMap","BMapGL"];case Ye.here:return["H"];default:return}}let eR=0;function Tc(n,r="callback"){return new Promise((t,i)=>{const e=`__callback${eR++}`;window[e]=t;const o=document.createElement("script");o.src=`${n}&${r}=${e}`,o.onerror=i,document.body.appendChild(o)})}function cs(n){return new Promise((r,t)=>{const i=document.createElement("script");i.src=n,i.onload=r,i.onerror=t,document.body.appendChild(i)})}function tR(n){if(n==null)return;let r;if(typeof n=="string"){if(r=+n,Number.isNaN(r))return n}else r=n;return`${r}px`}function rR(n,r){const t=n.y;let i=n.x;const e=1<<r;return t<0||t>=e?null:((i<0||i>=e)&&(i=(i%e+e)%e),{x:i,y:t})}function qr(n,r){return{type:String,default:r,validator:t=>Object.values(n).includes(t)}}function iR(n,r){return{type:String,default:r,validator:t=>n.includes(t)}}function Fr(n){return{type:n,required:!0}}function fe(n,r){return{type:n,default:r}}function jo(){return on()}function fl(n,r){const t=n.$options[r];if(t)for(const i of t)i.call(n)}function nR(n,r){const t={},i={},e={};return Object.keys(n).forEach(o=>{o.startsWith("on")?t[ha.pascal2kebab(o.substring(2))]=n[o]:i[o]=n[o]}),r&&Object.keys(r).forEach(o=>{o.startsWith("on")&&(e[ha.pascal2kebab(o.substring(2))]=r[o])}),{binds:i,listeners:t,listenerProps:e}}function di(n,r){return wt(()=>nR(n,r))}function Vt(){return Function}const La=()=>{let n,r;function t(e){console.log(e),n=e&&e.type,r=Date.now()}function i(e){((e&&e.type)!==n||Date.now()-(r??0)>1e3)&&t(e)}return{eventLog:t,eventLogLess:i}};function mf(n,r){return(n==null?void 0:n.$options.name)===r.name}function Qw(n,r){return mf(n,r)?n:void 0}function bg(n,r,t){let i=r;for(;i;){if(mf(i,n))return i;if(t&&mf(i,t))return;i=i.$parent}}const iu="$map",pa="onCreate",va="onDestroy",dr=ke({inject:[iu],mounted(){fl(this,pa)},beforeUnmount(){fl(this,va)},methods:{recreate(){fl(this,va),fl(this,pa)}},render(){return jo()}}),e1={type:qr(Ye,Ye.google),center:Fr(te),centerSyncDelay:fe(Number,300),currentCenter:fe(te),lastCenter:fe(te),zoom:Fr(Number),infoWindowMode:iR(Fk),gestureHandling:qr(zt),fractionalZoom:fe(Boolean),minZoom:fe(Number),maxZoom:fe(Number),mapStyle:fe(Object),mapTypeId:qr(tn),mapType:fe(Object),hideLogo:fe(Boolean),onLoad:Vt(),"onUpdate:center":Vt(),"onUpdate:current-center":Vt(),"onUpdate:last-center":Vt(),"onUpdate:map-type":Vt(),"onUpdate:map-type-id":Vt(),"onUpdate:zoom":Vt(),onError:Vt()},oR=ke({name:"tg-map",provide(){return{[iu]:wt(()=>this.map)}},inheritAttrs:!1,props:e1,emits:void 0,setup(n,{attrs:r}){return{attrs:di(r,n),centerSyncTimeoutId:void 0}},data(){return{map:zc(),isDestroyed:!1}},computed:{propsJson(){return Cr.toJsonSafely(this.$props)}},watch:{gestureHandling(n){var r;n&&((r=this.map)==null||r.setGestureHandling(n))},minZoom(n){var r;(r=this.map)==null||r.setMinZoom(n)},maxZoom(n){var r;(r=this.map)==null||r.setMaxZoom(n)},mapStyle(n){var r;(r=this.map)==null||r.setMapStyle(n)},mapTypeId(n){var r;n&&((r=this.map)==null||r.setBuildInMapTypeId(n))},mapType(n){var r;(r=this.map)==null||r.setMapType(n??or.NORMAL)},hideLogo(n){var r;(r=this.map)==null||r.setHideLogo(n??!1)},fractionalZoom(n){var r;(r=this.map)==null||r.setFractionalZoom(n??!1)}},async mounted(){const n=this.type;try{await qk(n)}catch(e){this.$emit("error",e);return}if(this.isDestroyed){console.warn(`tg-map(type=${n})已销毁, 不需要继续执行`);return}const r=vf.createMap(n,this.$refs.map,{center:this.center,zoom:this.zoom,infoWindowMode:this.infoWindowMode,gestureHandling:this.gestureHandling,minZoom:this.minZoom,maxZoom:this.maxZoom,mapStyle:this.mapStyle,buildInMapTypeId:this.mapTypeId,hideLogo:this.hideLogo,fractionalZoom:this.fractionalZoom});if(this.map=kf(r),this.mapType&&r.setMapType(this.mapType),"ready"in this.attrs.listeners&&console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"),fi(this.attrs.listeners,r,["load"]),this.$emit("load",r),tt([()=>this.zoom,()=>this.center],([e,o],[s,a])=>{e!==s&&r.setZoom(e),o!==a&&(r.getCenter().equals(o)||r.setCenter(o))}),this.attrs.listenerProps["update:center"]){const e=()=>this.$emit("update:center",r.getCenter());r.addEventListener("center-changed",()=>{this.centerSyncDelay>0?(clearTimeout(this.centerSyncTimeoutId),this.centerSyncTimeoutId=setTimeout(e,this.centerSyncDelay)):e()})}this.attrs.listenerProps["update:current-center"]&&(this.$emit("update:current-center",this.center),r.addEventListener("center-changed",()=>{this.$emit("update:current-center",r.getCenter())})),this.attrs.listenerProps["update:zoom"]&&r.addEventListener("zoom-changed",()=>{this.$emit("update:zoom",r.getZoom())});const t=this.attrs.listenerProps["update:map-type"],i=this.attrs.listenerProps["update:map-type-id"];(t||i)&&r.addEventListener("map-type-changed",()=>{const e=r.getMapType();t&&this.$emit("update:map-type",e),i&&this.$emit("update:map-type-id",e.id)})},unmounted(){this.isDestroyed=!0,this.map&&(this.attrs.listenerProps["update:last-center"]&&this.$emit("update:last-center",this.map.getCenter()),this.attrs.listenerProps["update:center"]&&(clearTimeout(this.centerSyncTimeoutId),this.$emit("update:center",this.map.getCenter())))},methods:{}}),nt=(n,r)=>{const t=n.__vccOpts||n;for(const[i,e]of r)t[i]=e;return t};function sR(n,r,t,i,e,o){return he(),xe("div",_r({class:"tg-map"},n.attrs.binds),[F("div",{ref:"map",class:Bi({"tg-map__map":!0,[`tg-map__map--hide-logo-${n.type}`]:n.hideLogo})},null,2),on("",!0),n.map?Jt(n.$slots,"default",{key:1}):on("",!0),Jt(n.$slots,"overlay")],16)}const Nt=nt(oR,[["render",sR]]),aR=ke({name:"tg-map-widget",props:{left:{type:[Number,String],default:null},top:{type:[Number,String],default:null},right:{type:[Number,String],default:null},bottom:{type:[Number,String],default:null}},computed:{topValue(){return this.top==null&&this.bottom==null?0:this.top}},methods:{dimen:tR}});function lR(n,r,t,i,e,o){return he(),xe("div",{class:Bi(n.$options.name),style:zo({left:n.dimen(n.left),top:n.dimen(n.topValue),right:n.dimen(n.right),bottom:n.dimen(n.bottom)})},[Jt(n.$slots,"default")],6)}const Io=nt(aR,[["render",lR]]),hR=ke({name:"tg-custom-control",mixins:[dr],props:{position:qr(Ze,Ze.RIGHT_BOTTOM)},setup(){return{control:void 0}},watch:{position(){this.recreate()}},onCreate(){Qw(this.$parent,Nt)||console.warn("请将tg-custom-control放到tg-map中");const{$el:n}=this,r=class extends Lw{onCreateElement(){return n}};this.control=new r(this.position),this.$map.addCustomControl(this.control)},onDestroy(){this.$map.removeCustomControl(this.control)}});function uR(n,r,t,i,e,o){return he(),xe("div",{class:Bi(n.$options.name)},[Jt(n.$slots,"default")],2)}const cR=nt(hR,[["render",uR]]),t1=ke({name:"tg-map-type-control",mixins:[dr],props:{position:qr(Ze,Ze.TOP_LEFT),type:qr(oi),mapTypes:fe(Array)},setup(){return{control:void 0}},watch:{position(n){this.control.setPosition(n)},type(){this.recreate()},mapTypes:{handler(){this.recreate()},deep:!0}},onCreate(){this.control=this.$map.createMapTypeControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}}),Mg=ke({name:"tg-scale-control",mixins:[dr],props:{position:qr(Ze,Ze.BOTTOM_RIGHT)},setup(){return{control:void 0}},watch:{position(n){this.control.setPosition(n)}},onCreate(){this.control=this.$map.createScaleControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}});function r1(){var t;const n=(t=F_())==null?void 0:t.type;let r=(n==null?void 0:n.name)??(n==null?void 0:n.__name);if(!r){const i=n==null?void 0:n.__file;i&&(r=vT.basename(i,".vue"))}return r}function km(n,r,t){return ex((i,e)=>{let o=n[r];return tt(()=>n[r],s=>{o!==Ne(s)&&(o=s,e())}),{get:()=>(i(),o),set:s=>{o=s,t(`update:${r}`,s)}}})}function Ia(){const n=bs(iu);let r,t;return n==null&&Pt(`<${r1()||"unknown"}>必须作为<tg-map>的子代组件`),{mapRef:n,get map(){return n.value??Pt("map尚未初始化")},[pa](i){ya(i),r&&Pt(`${pa}只能调用一次`),r=i},[va](i){_h(i),t&&Pt(`${va}只能调用一次`),t=i},recreate(){t==null||t(),r==null||r()}}}const fR=ke({name:"tg-street-view-control",props:{position:qr(Ze,Ze.RIGHT_BOTTOM)},setup(n){let r=void 0;const{map:t,onCreate:i,onDestroy:e}=Ia();return i(()=>{r=t.createStreetViewControl(n),t.addControl(r)}),e(()=>{t.removeControl(r)}),tt(()=>n.position,o=>{r.setPosition(o)}),jo}}),i1=ke({name:"tg-zoom-control",props:{position:qr(Ze,Ze.RIGHT_BOTTOM),showZoomLevel:fe(Boolean)},setup(n){let r=void 0;const{map:t,onCreate:i,onDestroy:e}=Ia();return i(()=>{r=t.createZoomControl(n),t.addControl(r)}),e(()=>{t.removeControl(r)}),tt(()=>n.position,o=>{r.setPosition(o)}),tt(()=>n.showZoomLevel,o=>{r.setShowZoomLevel(o??!0)}),jo}}),Rm=ke({name:"tg-heatmap",props:{maxIntensity:fe(Number),gradient:fe(Object),opacity:fe(Number),radius:fe(Number),data:Fr(Array)},setup(n){const{map:r,onCreate:t,onDestroy:i}=Ia();let e=void 0;return t(()=>{e=r.createHeatmap(n)}),i(()=>{e.remove()}),tt(()=>n.data,o=>e.setData(o)),tt([()=>n.maxIntensity,()=>n.gradient,()=>n.opacity,()=>n.radius],()=>e.setOptions(n)),jo}}),dR=ke({name:"tg-marker-clusterer",mixins:[dr],props:{gridSize:fe(Number),maxZoom:fe(Number),minClusterSize:fe(Number),averageCenter:fe(Boolean),styles:fe(Array),stylesIndexCalculator:fe(Function),zIndex:fe(Number)},setup(){return{clusterer:void 0,markers:[]}},watch:{gridSize(){this.recreate()},maxZoom(){this.recreate()},minClusterSize(){this.recreate()},averageCenter(){this.recreate()},styles:{handler(){this.recreate()},deep:!0},stylesIndexCalculator(){this.recreate()},zIndex(){this.recreate()}},onCreate(){this.clusterer=this.$map.createMarkerClusterer(this)},onDestroy(){this.clusterer.clearMarkers(!0)},methods:{isInitiated(){return this.clusterer!=null},onAddMarker(n){this.markers.push(n),this.isInitiated()&&this.clusterer.addMarker(n)},onRemoveMarker(n){this.isInitiated()&&this.clusterer.removeMarker(n),X_.remove(this.markers,n)}}});function gR(n,r,t,i,e,o){return he(),xe("div",{class:Bi(n.$options.name)},[Jt(n.$slots,"default")],2)}const Pg=nt(dR,[["render",gR]]),pR=ke({name:"tg-traffic-layer",mixins:[dr],setup(){return{layer:void 0}},watch:{},onCreate(){this.layer=new fk,this.$map.addLayer(this.layer)},onDestroy(){this.$map.removeLayer(this.layer)}}),n1=ke({name:"tg-circle",mixins:[dr],inheritAttrs:!1,props:{center:Fr(te),radius:Fr(Number),clickable:fe(Boolean),editable:fe(Boolean),strokeColor:fe(String),strokeOpacity:fe(Number),strokeWeight:fe(Number),visible:fe(Boolean),zIndex:fe(Number),fillColor:fe(String),fillOpacity:fe(Number),"onUpdate:center":Vt(),"onUpdate:radius":Vt()},emits:void 0,setup(n,{attrs:r}){return{attrs:di(r,n),overlay:void 0,emittedRadius:void 0,emittedCenter:void 0}},watch:{center(n){if(this.emittedCenter!=null){const r=this.emittedCenter;if(this.emittedCenter=void 0,r===Ne(n))return}this.overlay.setCenter(n)},radius(n){if(this.emittedRadius!=null){const r=this.emittedRadius;if(this.emittedRadius=void 0,r===n)return}this.overlay.setRadius(n)},clickable(){this.recreate()},editable(n){this.overlay.setEditable(n)},strokeColor(n){this.overlay.setStrokeColor(n)},strokeOpacity(n){this.overlay.setStrokeOpacity(n)},strokeWeight(n){this.overlay.setStrokeWeight(n)},fillColor(n){this.overlay.setFillColor(n)},fillOpacity(n){this.overlay.setFillOpacity(n)},visible(n){this.overlay.setVisible(n)},zIndex(n){this.overlay.setZIndex(n)}},onCreate(){this.overlay=this.$map.createCircle(this),this.$map.addOverlay(this.overlay),fi(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:center"]&&this.overlay.addEventListener("center-changed",()=>{this.$emit("update:center",this.emittedCenter=this.overlay.getCenter())}),this.attrs.listenerProps["update:radius"]&&this.overlay.addEventListener("radius-changed",()=>{this.$emit("update:radius",this.emittedRadius=this.overlay.getRadius())})},onDestroy(){this.$map.removeOverlay(this.overlay)}});class vR extends Yw{constructor(r,t,i,e){super(r,t),this.content=i,this.position=e}onCreate(){return this.content}onDraw(r){const t=r.fromLatLngToOverlayPoint(this.position);this.content.style.left=t.x+"px",this.content.style.top=t.y+"px"}setPosition(r){this.position=r,this.draw()}}const mR=ke({name:"tg-element-overlay",mixins:[dr],props:{mapPane:qr(er,er.overlayMouseTarget),position:Fr(te)},setup(){return{overlay:void 0}},watch:{position(n){this.overlay.setPosition(n)},mapPane(){this.recreate()}},methods:{content(){return this.$el}},onCreate(){this.overlay=new vR(this.$map,this,this.content(),this.position),this.$map.addElementOverlay(this.overlay)},onDestroy(){this.$map.removeElementOverlay(this.overlay)}});function _R(n,r,t,i,e,o){return he(),xe("div",_r({class:n.$options.name},n.$attrs),[Jt(n.$slots,"default")],16)}const yR=nt(mR,[["render",_R]]),o1={position:Fr(te),title:fe(String),label:fe(Object),icon:fe(Object),clickable:fe(Boolean),draggable:fe(Boolean),crossOnDrag:fe(Boolean),cursor:fe(String),zIndex:fe(Number),visible:fe(Boolean),normalizePositionForBaidu:fe(Boolean),autoAddToClusterer:fe(Boolean,!0),"onUpdate:position":Vt()},wR=ke({name:"tg-marker",mixins:[dr],inheritAttrs:!1,props:o1,emits:void 0,setup(n,{attrs:r}){return{attrs:di(r,n),marker:void 0,labelOverlay:zc(),info:zc(),emittedPosition:void 0,autoAddToClustererWhenCreate:n.autoAddToClusterer}},watch:{position(n){if(this.emittedPosition!=null){const r=this.emittedPosition;if(this.emittedPosition=void 0,r===Ne(n))return}this.marker.setPosition(n)},title(n){this.marker.setTitle(n)},label(n,r){mT(n,r)||(n?this.marker.setLabel(n):this.recreate())},icon(n){n?this.marker.setIcon(n):this.recreate()},clickable(n){this.marker instanceof ga?this.recreate():this.marker.setClickable(n)},draggable(n){this.marker.setDraggable(n)},crossOnDrag(){this.recreate()},cursor(){this.recreate()},zIndex(n){this.marker instanceof ga?this.recreate():this.marker.setZIndex(n)},visible(n){this.marker.setVisible(n)},normalizePositionForBaidu(){this.recreate()},autoAddToClusterer(){this.recreate()}},onCreate(){this.marker=this.$map.createMarker(this),this.labelOverlay&&this.marker.attachLabelOverlay(this.labelOverlay.overlay),this.$clusterer()&&this.autoAddToClusterer?this.$clusterer().onAddMarker(this.marker):this.$map.addOverlay(this.marker),this.autoAddToClustererWhenCreate=this.autoAddToClusterer,this.info&&this.info.show&&this.info.overlay.open(this.marker),fi(this.attrs.listeners,this.marker),this.attrs.listenerProps["update:position"]&&this.marker.addEventListener("dragend",n=>{this.$emit("update:position",this.emittedPosition=n.position)})},onDestroy(){this.$clusterer()&&this.autoAddToClustererWhenCreate?this.$clusterer().onRemoveMarker(this.marker):this.$map.removeOverlay(this.marker)},methods:{$clusterer(){return Qw(this.$parent,Pg)},onAddLabel(n){this.labelOverlay=n,this.marker&&this.marker.attachLabelOverlay(n.overlay)},onRemoveLabel(n){this.marker.attachLabelOverlay(void 0),this.labelOverlay=void 0},onAddInfo(n){this.info=n,this.marker&&n.show&&n.overlay.open(this.marker)},onRemoveInfo(n){n.overlay.close(),this.info=void 0},onInfoShowChanged(n,r){r?n.overlay.open(this.marker):n.overlay.close()}}});function xR(n,r,t,i,e,o){return Jt(n.$slots,"default")}const ot=nt(wR,[["render",xR]]),CR=ke({name:"tg-info-box",mixins:[dr],inheritAttrs:!1,props:{show:Fr(Boolean),position:fe(te),offset:fe(Object),maxWidth:fe(Number),borderClass:fe(String),zIndex:fe(Number),disableAutoPan:fe(Boolean),"onUpdate:show":Vt()},emits:void 0,setup(n,{attrs:r}){return{attrs:di(r,n),overlay:void 0}},watch:{show(n){this.$marker()?this.$marker().onInfoShowChanged(this,n):n?this.overlay.open():this.overlay.close()},position(n){this.overlay.setPosition(n)},offset(){this.recreate()},maxWidth(n){this.overlay.setMaxWidth(n)},borderClass(){this.recreate()},zIndex(n){this.overlay.setZIndex(n)},disableAutoPan(){this.recreate()}},onCreate(){this.overlay=this.$map.createInfoBox(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.attrs.listenerProps["update:show"]&&this.overlay.addEventListener("closeclick",()=>{this.$emit("update:show",!1)}),fi(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()},methods:{getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,maxWidth:this.maxWidth,borderClass:this.borderClass,disableAutoPan:this.disableAutoPan}},content(){return this.$el},$marker(){return bg(ot,this.$parent,Nt)},open(n){this.overlay.open(n)},close(){this.overlay.close()}}});function TR(n,r,t,i,e,o){return he(),xe("div",_r({class:n.$options.name},n.attrs.binds),[Jt(n.$slots,"default")],16)}const As=nt(CR,[["render",TR]]),bR=ke({name:"tg-info-window",mixins:[dr],inheritAttrs:!1,props:{show:Fr(Boolean),position:fe(te),maxWidth:fe(Number),offset:fe(Object),disableAutoPan:fe(Boolean),"onUpdate:show":Vt()},emits:void 0,setup(n,{attrs:r}){return{attrs:di(r,n),overlay:void 0}},watch:{show(n){this.$marker()?this.$marker().onInfoShowChanged(this,n):n?this.overlay.open():this.overlay.close()},position(n){this.overlay.setPosition(n)},maxWidth(){this.recreate()},offset(){this.recreate()},disableAutoPan(){this.recreate()}},methods:{content(){return this.$el},$marker(){return bg(ot,this.$parent,Nt)},getOptions(){return{content:this.content(),position:this.position,maxWidth:this.maxWidth,offset:this.offset,disableAutoPan:this.disableAutoPan}}},onCreate(){this.overlay=this.$map.createInfoWindow(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.overlay.addEventListener("open",()=>{this.$emit("update:show",!0)}),this.overlay.addEventListener("close",()=>{this.$emit("update:show",!1)}),fi(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()}});function MR(n,r,t,i,e,o){return Ve((he(),xe("div",_r({class:n.$options.name},n.attrs.binds),[Jt(n.$slots,"default")],16)),[[bC,n.show]])}const Eg=nt(bR,[["render",MR]]),PR=ke({name:"tg-label",mixins:[dr],inheritAttrs:!1,props:{position:fe(te),offset:fe(Object),zIndex:fe(Number),mapPane:qr(er)},emits:void 0,setup(n,{attrs:r}){return{attrs:di(r),overlay:void 0}},watch:{position(n){this.overlay.setPosition(n)},offset(n){this.overlay.setOffset(n)},zIndex(n){this.overlay.setZIndex(n)},visible(n){this.overlay.setVisible(n)},mapPane(){this.recreate()}},methods:{content(){return this.$el},marker(){var n;return(n=this.$marker())==null?void 0:n.marker},$marker(){return bg(ot,this.$parent,Nt)},getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,mapPane:this.mapPane}}},onCreate(){this.overlay=this.$map.createLabel(this.getOptions()),this.$marker()?this.$marker().onAddLabel(this):this.$map.addOverlay(this.overlay),fi(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveLabel(this):this.$map.removeOverlay(this.overlay)}});function ER(n,r,t,i,e,o){return he(),xe("div",_r({class:n.$options.name},n.attrs.binds),[Jt(n.$slots,"default")],16)}const $r=nt(PR,[["render",ER]]),s1={paths:Fr(Array),clickable:fe(Boolean),editable:fe(Boolean),strokeColor:fe(String),strokeOpacity:fe(Number),strokeWeight:fe(Number),visible:fe(Boolean),zIndex:fe(Number),fillColor:fe(String),fillOpacity:fe(Number),"onUpdate:paths":Vt()},_f=ke({name:"tg-polygon",mixins:[dr],inheritAttrs:!1,props:s1,emits:void 0,setup(n,{attrs:r}){return{attrs:di(r,n),overlay:void 0,emittedPaths:void 0}},watch:{paths:{handler(n){if(this.emittedPaths!=null){const r=this.emittedPaths;if(this.emittedPaths=void 0,r.length===n.length&&r.every((t,i)=>t===Ne(n[i])))return}this.overlay.setPaths(n)},deep:!0},clickable(){this.recreate()},editable(n){this.overlay.setEditable(n)},strokeColor(n){this.overlay.setStrokeColor(n)},strokeOpacity(n){this.overlay.setStrokeOpacity(n)},strokeWeight(n){this.overlay.setStrokeWeight(n)},fillColor(n){this.overlay.setFillColor(n)},fillOpacity(n){this.overlay.setFillOpacity(n)},visible(n){this.overlay.setVisible(n)},zIndex(n){this.overlay.setZIndex(n)}},onCreate(){this.overlay=this.$map.createPolygon(this),this.$map.addOverlay(this.overlay),fi(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:paths"]&&this.overlay.addEventListener("paths-edited",()=>{this.$emit("update:paths",this.emittedPaths=this.overlay.getPaths())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),ah=ke({name:"tg-polyline",mixins:[dr],inheritAttrs:!1,props:{path:Fr(Array),icons:fe(Array),clickable:fe(Boolean),editable:fe(Boolean),strokeColor:fe(String),strokeOpacity:fe(Number),strokeWeight:fe(Number),visible:fe(Boolean),zIndex:fe(Number),"onUpdate:path":Vt()},emits:void 0,setup(n,{attrs:r}){return{attrs:di(r,n),overlay:void 0,emittedPath:void 0}},watch:{path:{handler(n){if(this.emittedPath!=null){const r=this.emittedPath;if(this.emittedPath=void 0,r===Ne(n))return}this.overlay.setPath(n)},deep:!0},icons:{handler(){this.recreate()},deep:!0},clickable(){this.recreate()},editable(n){this.overlay.setEditable(n)},strokeColor(n){this.overlay.setStrokeColor(n)},strokeOpacity(n){this.overlay.setStrokeOpacity(n)},strokeWeight(n){this.overlay.setStrokeWeight(n)},visible(n){this.overlay.setVisible(n)},zIndex(n){this.overlay.setZIndex(n)}},onCreate(){this.overlay=this.$map.createPolyline(this),this.$map.addOverlay(this.overlay),fi(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:path"]&&this.overlay.addEventListener("path-edited",()=>{this.$emit("update:path",this.emittedPath=this.overlay.getPath())})},onDestroy(){this.overlay.remove()}}),a1=ke({name:"tg-rectangle",mixins:[dr],inheritAttrs:!1,props:{bounds:Fr(Object),clickable:fe(Boolean),editable:fe(Boolean),strokeColor:fe(String),strokeOpacity:fe(Number),strokeWeight:fe(Number),visible:fe(Boolean),zIndex:fe(Number),fillColor:fe(String),fillOpacity:fe(Number),"onUpdate:bounds":Vt()},emits:void 0,setup(n,{attrs:r}){return{attrs:di(r,n),overlay:void 0,emittedBounds:void 0}},watch:{bounds(n){if(this.emittedBounds!=null){const r=this.emittedBounds;if(this.emittedBounds=void 0,r.equals(n))return}this.overlay.setBounds(n)},clickable(){this.recreate()},editable(n){this.overlay.setEditable(n)},strokeColor(n){this.overlay.setStrokeColor(n)},strokeOpacity(n){this.overlay.setStrokeOpacity(n)},strokeWeight(n){this.overlay.setStrokeWeight(n)},fillColor(n){this.overlay.setFillColor(n)},fillOpacity(n){this.overlay.setFillOpacity(n)},visible(n){this.overlay.setVisible(n)},zIndex(n){this.overlay.setZIndex(n)}},onCreate(){this.overlay=this.$map.createRectangle(this),this.$map.addOverlay(this.overlay),fi(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:bounds"]&&this.overlay.addEventListener("bounds-changed",()=>{this.$emit("update:bounds",this.emittedBounds=this.overlay.getBounds())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),SR=["beforeUpdate","updated"],OR={install(n,r={}){if(r.enable!==!1){const t=ke({beforeCreate(){const i=r1()??"",o=(r.nameRegex||/^[A-Z]/).test(i)?s=>{r.hookNames?r.hookNames.includes(s)&&console.debug("[lifecycle]",i,s):SR.includes(s)||console.debug("[lifecycle]",i,s)}:Dr;o("beforeCreate"),this.__life_impl=o},created(){this.__life("created")},beforeMount(){this.__life("beforeMount")},mounted(){this.__life("mounted")},beforeUpdate(){this.__life("beforeUpdate")},updated(){this.__life("updated")},beforeUnmount(){this.__life("beforeUnmount")},unmounted(){this.__life("unmounted")},methods:{__life(i){this.__life_impl(i)}},onCreate(){this.__life("onCreate")},onDestroy(){this.__life("onDestroy")}});n.mixin(t)}}},kR={install(n,r){sk(r);const t=n.config.optionMergeStrategies;t[pa]=t[va]=(i,e)=>i?[...new Set([].concat(i,e))]:Array.isArray(e)?e:[e]}},RR="modulepreload",AR=function(n){return"/"+n},Am={},Et=function(r,t,i){let e=Promise.resolve();if(t&&t.length>0){let s=function(h){return Promise.all(h.map(u=>Promise.resolve(u).then(c=>({status:"fulfilled",value:c}),c=>({status:"rejected",reason:c}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));e=s(t.map(h=>{if(h=AR(h),h in Am)return;Am[h]=!0;const u=h.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${c}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":RR,u||(f.as="script"),f.crossOrigin="",f.href=h,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((d,g)=>{f.addEventListener("load",d),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return e.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return r().catch(o)})},LR=ke({});function IR(n,r,t,i,e,o){return he(),xe("div",null,[r[0]||(r[0]=ae("404 ")),F("p",null,"$router: "+Ae(n.$router),1)])}const DR=nt(LR,[["render",IR]]),zR="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20261.76%20226.69'%3e%3cpath%20d='M161.096.001l-30.225%2052.351L100.647.001H-.005l130.877%20226.688L261.749.001z'%20fill='%2341b883'/%3e%3cpath%20d='M161.096.001l-30.225%2052.351L100.647.001H52.346l78.526%20136.01L209.398.001z'%20fill='%2334495e'/%3e%3c/svg%3e",BR={class:"greetings"},GR={class:"green"},FR=ke({__name:"HelloWorld",props:{msg:{}},setup(n){return(r,t)=>(he(),xe("div",BR,[F("h1",GR,Ae(r.msg),1),t[0]||(t[0]=F("h3",null,[ae(" You’ve successfully created a project with "),F("a",{href:"https://vitejs.dev/",target:"_blank",rel:"noopener"},"Vite"),ae(" + "),F("a",{href:"https://vuejs.org/",target:"_blank",rel:"noopener"},"Vue 3"),ae(". What's next? ")],-1))]))}}),NR=nt(FR,[["__scopeId","data-v-a3827877"]]),HR={},jR={class:"responsive-app__body"},ZR={class:"responsive-app__app"};function VR(n,r){return he(),xe("div",jR,[F("div",ZR,[Jt(n.$slots,"default")])])}const WR=nt(HR,[["render",VR]]),$R={},UR={class:"about"};function JR(n,r){return he(),xe("div",UR,r[0]||(r[0]=[F("h1",null,"This is an about page",-1)]))}const XR=nt($R,[["render",JR]]),YR={},qR={class:"item"},KR={class:"details"};function QR(n,r){return he(),xe("div",qR,[F("i",null,[Jt(n.$slots,"icon",{},void 0,!0)]),F("div",KR,[F("h3",null,[Jt(n.$slots,"heading",{},void 0,!0)]),Jt(n.$slots,"default",{},void 0,!0)])])}const fs=nt(YR,[["render",QR],["__scopeId","data-v-dcfc8ba0"]]),eA={},tA={xmlns:"http://www.w3.org/2000/svg",width:"20",height:"17",fill:"currentColor"};function rA(n,r){return he(),xe("svg",tA,r[0]||(r[0]=[F("path",{d:"M11 2.253a1 1 0 1 0-2 0h2zm-2 13a1 1 0 1 0 2 0H9zm.447-12.167a1 1 0 1 0 1.107-1.666L9.447 3.086zM1 2.253L.447 1.42A1 1 0 0 0 0 2.253h1zm0 13H0a1 1 0 0 0 1.553.833L1 15.253zm8.447.833a1 1 0 1 0 1.107-1.666l-1.107 1.666zm0-14.666a1 1 0 1 0 1.107 1.666L9.447 1.42zM19 2.253h1a1 1 0 0 0-.447-.833L19 2.253zm0 13l-.553.833A1 1 0 0 0 20 15.253h-1zm-9.553-.833a1 1 0 1 0 1.107 1.666L9.447 14.42zM9 2.253v13h2v-13H9zm1.553-.833C9.203.523 7.42 0 5.5 0v2c1.572 0 2.961.431 3.947 1.086l1.107-1.666zM5.5 0C3.58 0 1.797.523.447 1.42l1.107 1.666C2.539 2.431 3.928 2 5.5 2V0zM0 2.253v13h2v-13H0zm1.553 13.833C2.539 15.431 3.928 15 5.5 15v-2c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM5.5 15c1.572 0 2.961.431 3.947 1.086l1.107-1.666C9.203 13.523 7.42 13 5.5 13v2zm5.053-11.914C11.539 2.431 12.928 2 14.5 2V0c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM14.5 2c1.573 0 2.961.431 3.947 1.086l1.107-1.666C18.203.523 16.421 0 14.5 0v2zm3.5.253v13h2v-13h-2zm1.553 12.167C18.203 13.523 16.421 13 14.5 13v2c1.573 0 2.961.431 3.947 1.086l1.107-1.666zM14.5 13c-1.92 0-3.703.523-5.053 1.42l1.107 1.666C11.539 15.431 12.928 15 14.5 15v-2z"},null,-1)]))}const iA=nt(eA,[["render",rA]]),nA={},oA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",class:"iconify iconify--mdi",width:"24",height:"24",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24"};function sA(n,r){return he(),xe("svg",oA,r[0]||(r[0]=[F("path",{d:"M20 18v-4h-3v1h-2v-1H9v1H7v-1H4v4h16M6.33 8l-1.74 4H7v-1h2v1h6v-1h2v1h2.41l-1.74-4H6.33M9 5v1h6V5H9m12.84 7.61c.1.22.16.48.16.8V18c0 .53-.21 1-.6 1.41c-.4.4-.85.59-1.4.59H4c-.55 0-1-.19-1.4-.59C2.21 19 2 18.53 2 18v-4.59c0-.32.06-.58.16-.8L4.5 7.22C4.84 6.41 5.45 6 6.33 6H7V5c0-.55.18-1 .57-1.41C7.96 3.2 8.44 3 9 3h6c.56 0 1.04.2 1.43.59c.39.41.57.86.57 1.41v1h.67c.88 0 1.49.41 1.83 1.22l2.34 5.39z",fill:"currentColor"},null,-1)]))}const aA=nt(nA,[["render",sA]]),lA={},hA={xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"currentColor"};function uA(n,r){return he(),xe("svg",hA,r[0]||(r[0]=[F("path",{d:"M11.447 8.894a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm0 1.789a1 1 0 1 0 .894-1.789l-.894 1.789zM7.447 7.106a1 1 0 1 0-.894 1.789l.894-1.789zM10 9a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0H8zm9.447-5.606a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm2 .789a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zM18 5a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0h-2zm-5.447-4.606a1 1 0 1 0 .894-1.789l-.894 1.789zM9 1l.447-.894a1 1 0 0 0-.894 0L9 1zm-2.447.106a1 1 0 1 0 .894 1.789l-.894-1.789zm-6 3a1 1 0 1 0 .894 1.789L.553 4.106zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zm-2-.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 2.789a1 1 0 1 0 .894-1.789l-.894 1.789zM2 5a1 1 0 1 0-2 0h2zM0 7.5a1 1 0 1 0 2 0H0zm8.553 12.394a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 1a1 1 0 1 0 .894 1.789l-.894-1.789zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zM8 19a1 1 0 1 0 2 0H8zm2-2.5a1 1 0 1 0-2 0h2zm-7.447.394a1 1 0 1 0 .894-1.789l-.894 1.789zM1 15H0a1 1 0 0 0 .553.894L1 15zm1-2.5a1 1 0 1 0-2 0h2zm12.553 2.606a1 1 0 1 0 .894 1.789l-.894-1.789zM17 15l.447.894A1 1 0 0 0 18 15h-1zm1-2.5a1 1 0 1 0-2 0h2zm-7.447-5.394l-2 1 .894 1.789 2-1-.894-1.789zm-1.106 1l-2-1-.894 1.789 2 1 .894-1.789zM8 9v2.5h2V9H8zm8.553-4.894l-2 1 .894 1.789 2-1-.894-1.789zm.894 0l-2-1-.894 1.789 2 1 .894-1.789zM16 5v2.5h2V5h-2zm-4.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zm-2.894-1l-2 1 .894 1.789 2-1L8.553.106zM1.447 5.894l2-1-.894-1.789-2 1 .894 1.789zm-.894 0l2 1 .894-1.789-2-1-.894 1.789zM0 5v2.5h2V5H0zm9.447 13.106l-2-1-.894 1.789 2 1 .894-1.789zm0 1.789l2-1-.894-1.789-2 1 .894 1.789zM10 19v-2.5H8V19h2zm-6.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zM2 15v-2.5H0V15h2zm13.447 1.894l2-1-.894-1.789-2 1 .894 1.789zM18 15v-2.5h-2V15h2z"},null,-1)]))}const cA=nt(lA,[["render",uA]]),fA={},dA={xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor"};function gA(n,r){return he(),xe("svg",dA,r[0]||(r[0]=[F("path",{d:"M15 4a1 1 0 1 0 0 2V4zm0 11v-1a1 1 0 0 0-1 1h1zm0 4l-.707.707A1 1 0 0 0 16 19h-1zm-4-4l.707-.707A1 1 0 0 0 11 14v1zm-4.707-1.293a1 1 0 0 0-1.414 1.414l1.414-1.414zm-.707.707l-.707-.707.707.707zM9 11v-1a1 1 0 0 0-.707.293L9 11zm-4 0h1a1 1 0 0 0-1-1v1zm0 4H4a1 1 0 0 0 1.707.707L5 15zm10-9h2V4h-2v2zm2 0a1 1 0 0 1 1 1h2a3 3 0 0 0-3-3v2zm1 1v6h2V7h-2zm0 6a1 1 0 0 1-1 1v2a3 3 0 0 0 3-3h-2zm-1 1h-2v2h2v-2zm-3 1v4h2v-4h-2zm1.707 3.293l-4-4-1.414 1.414 4 4 1.414-1.414zM11 14H7v2h4v-2zm-4 0c-.276 0-.525-.111-.707-.293l-1.414 1.414C5.42 15.663 6.172 16 7 16v-2zm-.707 1.121l3.414-3.414-1.414-1.414-3.414 3.414 1.414 1.414zM9 12h4v-2H9v2zm4 0a3 3 0 0 0 3-3h-2a1 1 0 0 1-1 1v2zm3-3V3h-2v6h2zm0-6a3 3 0 0 0-3-3v2a1 1 0 0 1 1 1h2zm-3-3H3v2h10V0zM3 0a3 3 0 0 0-3 3h2a1 1 0 0 1 1-1V0zM0 3v6h2V3H0zm0 6a3 3 0 0 0 3 3v-2a1 1 0 0 1-1-1H0zm3 3h2v-2H3v2zm1-1v4h2v-4H4zm1.707 4.707l.586-.586-1.414-1.414-.586.586 1.414 1.414z"},null,-1)]))}const pA=nt(fA,[["render",gA]]),vA={},mA={xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor"};function _A(n,r){return he(),xe("svg",mA,r[0]||(r[0]=[F("path",{d:"M10 3.22l-.61-.6a5.5 5.5 0 0 0-7.666.105 5.5 5.5 0 0 0-.114 7.665L10 18.78l8.39-8.4a5.5 5.5 0 0 0-.114-7.665 5.5 5.5 0 0 0-7.666-.105l-.61.61z"},null,-1)]))}const yA=nt(vA,[["render",_A]]),wA=ke({__name:"TheWelcome",setup(n){return(r,t)=>(he(),xe(We,null,[Y(fs,null,{icon:ue(()=>[Y(iA)]),heading:ue(()=>t[0]||(t[0]=[ae(" Documentation ")])),default:ue(()=>[t[1]||(t[1]=ae(" Vue’s ")),t[2]||(t[2]=F("a",{href:"https://vuejs.org/",target:"_blank",rel:"noopener"},"official documentation",-1)),t[3]||(t[3]=ae(" provides you with all information you need to get started. "))]),_:1,__:[1,2,3]}),Y(fs,null,{icon:ue(()=>[Y(aA)]),heading:ue(()=>t[4]||(t[4]=[ae(" Tooling ")])),default:ue(()=>[t[5]||(t[5]=ae(" This project is served and bundled with ")),t[6]||(t[6]=F("a",{href:"https://vitejs.dev/guide/features.html",target:"_blank",rel:"noopener"},"Vite",-1)),t[7]||(t[7]=ae(". The recommended IDE setup is ")),t[8]||(t[8]=F("a",{href:"https://code.visualstudio.com/",target:"_blank",rel:"noopener"},"VSCode",-1)),t[9]||(t[9]=ae(" + ")),t[10]||(t[10]=F("a",{href:"https://github.com/johnsoncodehk/volar",target:"_blank",rel:"noopener"},"Volar",-1)),t[11]||(t[11]=ae(". If you need to test your components and web pages, check out ")),t[12]||(t[12]=F("a",{href:"https://www.cypress.io/",target:"_blank",rel:"noopener"},"Cypress",-1)),t[13]||(t[13]=ae(" and ")),t[14]||(t[14]=F("a",{href:"https://on.cypress.io/component",target:"_blank"},"Cypress Component Testing",-1)),t[15]||(t[15]=ae(". ")),t[16]||(t[16]=F("br",null,null,-1)),t[17]||(t[17]=ae(" More instructions are available in ")),t[18]||(t[18]=F("code",null,"README.md",-1)),t[19]||(t[19]=ae(". "))]),_:1,__:[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]}),Y(fs,null,{icon:ue(()=>[Y(cA)]),heading:ue(()=>t[20]||(t[20]=[ae(" Ecosystem ")])),default:ue(()=>[t[21]||(t[21]=ae(" Get official tools and libraries for your project: ")),t[22]||(t[22]=F("a",{href:"https://pinia.vuejs.org/",target:"_blank",rel:"noopener"},"Pinia",-1)),t[23]||(t[23]=ae(", ")),t[24]||(t[24]=F("a",{href:"https://router.vuejs.org/",target:"_blank",rel:"noopener"},"Vue Router",-1)),t[25]||(t[25]=ae(", ")),t[26]||(t[26]=F("a",{href:"https://test-utils.vuejs.org/",target:"_blank",rel:"noopener"},"Vue Test Utils",-1)),t[27]||(t[27]=ae(", and ")),t[28]||(t[28]=F("a",{href:"https://github.com/vuejs/devtools",target:"_blank",rel:"noopener"},"Vue Dev Tools",-1)),t[29]||(t[29]=ae(". If you need more resources, we suggest paying ")),t[30]||(t[30]=F("a",{href:"https://github.com/vuejs/awesome-vue",target:"_blank",rel:"noopener"},"Awesome Vue",-1)),t[31]||(t[31]=ae(" a visit. "))]),_:1,__:[21,22,23,24,25,26,27,28,29,30,31]}),Y(fs,null,{icon:ue(()=>[Y(pA)]),heading:ue(()=>t[32]||(t[32]=[ae(" Community ")])),default:ue(()=>[t[33]||(t[33]=ae(" Got stuck? Ask your question on ")),t[34]||(t[34]=F("a",{href:"https://chat.vuejs.org",target:"_blank",rel:"noopener"},"Vue Land",-1)),t[35]||(t[35]=ae(", our official Discord server, or ")),t[36]||(t[36]=F("a",{href:"https://stackoverflow.com/questions/tagged/vue.js",target:"_blank",rel:"noopener"},"StackOverflow",-1)),t[37]||(t[37]=ae(". You should also subscribe to ")),t[38]||(t[38]=F("a",{href:"https://news.vuejs.org",target:"_blank",rel:"noopener"},"our mailing list",-1)),t[39]||(t[39]=ae(" and follow the official ")),t[40]||(t[40]=F("a",{href:"https://twitter.com/vuejs",target:"_blank",rel:"noopener"},"@vuejs",-1)),t[41]||(t[41]=ae(" twitter account for latest news in the Vue world. "))]),_:1,__:[33,34,35,36,37,38,39,40,41]}),Y(fs,null,{icon:ue(()=>[Y(yA)]),heading:ue(()=>t[42]||(t[42]=[ae(" Support Vue ")])),default:ue(()=>[t[43]||(t[43]=ae(" As an independent project, Vue relies on community backing for its sustainability. You can help us by ")),t[44]||(t[44]=F("a",{href:"https://vuejs.org/sponsor/",target:"_blank",rel:"noopener"},"becoming a sponsor",-1)),t[45]||(t[45]=ae(". "))]),_:1,__:[43,44,45]})],64))}}),xA=ke({__name:"HomeView",setup(n){return(r,t)=>(he(),xe("main",null,[Y(wA)]))}}),CA={class:"wrapper"},TA=["href"],bA=ke({__name:"Main",setup(n){return(r,t)=>(he(),Ue(WR,null,{default:ue(()=>[F("header",null,[t[0]||(t[0]=F("img",{alt:"Vue logo",class:"logo",src:zR,width:"125",height:"125"},null,-1)),F("div",CA,[Y(NR,{msg:"You did it!"}),F("nav",null,[(he(!0),xe(We,null,St(Object.entries(r.$router.routes),([i,e])=>(he(),xe("a",{key:i,class:Bi({"router-link-exact-active":i===r.$route.fullPath}),href:"#"+i},Ae(e),11,TA))),128))])])]),r.$route.fullPath==="/"?(he(),Ue(XR,{key:0})):(he(),Ue(xA,{key:1}))]),_:1}))}}),MA=nt(bA,[["__scopeId","data-v-7f87fe56"]]);class PA{constructor(r){P(this,"state");this.state=xr(r.state)}}const EA={install(n,r){r&&Dr()}},SA=localStorage.settings?JSON.parse(localStorage.settings):{},OA={mapType:Ye.baidu,...SA};class kA extends PA{constructor(){super({state:OA})}setMapType(r){this.state.mapType=r,this.saveSettings()}saveSettings(){localStorage.settings=JSON.stringify({mapType:this.state.mapType})}}const Tr=new kA,RA=ke({computed:{type:{get(){return Tr.state.mapType},set(n){Tr.setMapType(n)}},types(){return Object.keys(Ye)}}});function AA(n,r,t,i,e,o){return Ve((he(),xe("select",{"onUpdate:modelValue":r[0]||(r[0]=s=>n.type=s),style:{"z-index":"10"}},[(he(!0),xe(We,null,St(n.types,s=>(he(),xe("option",{key:s},Ae(s),1))),128))],512)),[[Dc,n.type]])}const ti=nt(RA,[["render",AA]]),Ut=[te.create(39.920244,116.403555,De.bd09),te.create(39.92,116.41,De.bd09),te.create(22.628099,114.056314,De.bd09),te.create(23.628099,114.056314,De.bd09)],ki=[te.fromLngLat(114.040822,22.617649,De.gcj02),te.fromLngLat(114.029235,22.609884,De.gcj02),te.fromLngLat(114.01018,22.599663,De.gcj02),te.fromLngLat(113.999623,22.590153,De.gcj02),te.fromLngLat(113.965205,22.58207,De.gcj02),te.fromLngLat(113.943404,22.580723,De.gcj02)],LA=[te.create(39.920244,116.403555,De.bd09),te.create(39.92,116.41,De.bd09),te.create(39.91,116.425,De.bd09),te.create(39.91,116.394,De.bd09)],l1=[te.fromLiteral({lat:34.051205182663224,lng:241.75119610232755})],h1=te.fromLngLat(1e3,1),IA=te.create(22.625284596662958,114.0533362455912,De.bd09),DA=te.create(27.822956287075982,114.42719399189357,De.gcj02),u1=te.create(22.28451,114.158321),lr=[...Ut,...ki,...l1,h1,u1],zA=[{lng:116.418261,lat:39.921984,count:50},{lng:116.423332,lat:39.916532,count:51},{lng:116.419787,lat:39.930658,count:15},{lng:116.418455,lat:39.920921,count:40},{lng:116.418843,lat:39.915516,count:100},{lng:116.42546,lat:39.918503,count:6},{lng:116.423289,lat:39.919989,count:18},{lng:116.418162,lat:39.915051,count:80},{lng:116.422039,lat:39.91782,count:11},{lng:116.41387,lat:39.917253,count:7},{lng:116.41773,lat:39.919426,count:42},{lng:116.421107,lat:39.916445,count:4},{lng:116.417521,lat:39.917943,count:27},{lng:116.419812,lat:39.920836,count:23},{lng:116.420682,lat:39.91463,count:60},{lng:116.415424,lat:39.924675,count:8},{lng:116.419242,lat:39.914509,count:15},{lng:116.422766,lat:39.921408,count:25},{lng:116.421674,lat:39.924396,count:21},{lng:116.427268,lat:39.92267,count:1},{lng:116.417721,lat:39.920034,count:51},{lng:116.412456,lat:39.92667,count:7},{lng:116.420432,lat:39.919114,count:11},{lng:116.425013,lat:39.921611,count:35},{lng:116.418733,lat:39.931037,count:22},{lng:116.419336,lat:39.931134,count:4},{lng:116.413557,lat:39.923254,count:5},{lng:116.418367,lat:39.92943,count:3},{lng:116.424312,lat:39.919621,count:100},{lng:116.423874,lat:39.919447,count:87},{lng:116.424225,lat:39.923091,count:32},{lng:116.417801,lat:39.921854,count:44},{lng:116.417129,lat:39.928227,count:21},{lng:116.426426,lat:39.922286,count:80},{lng:116.421597,lat:39.91948,count:32},{lng:116.423895,lat:39.920787,count:26},{lng:116.423563,lat:39.921197,count:17},{lng:116.417982,lat:39.922547,count:17},{lng:116.426126,lat:39.921938,count:25},{lng:116.42326,lat:39.915782,count:100},{lng:116.419239,lat:39.916759,count:39},{lng:116.417185,lat:39.929123,count:11},{lng:116.417237,lat:39.927518,count:9},{lng:116.417784,lat:39.915754,count:47},{lng:116.420193,lat:39.917061,count:52},{lng:116.422735,lat:39.915619,count:100},{lng:116.418495,lat:39.915958,count:46},{lng:116.416292,lat:39.931166,count:9},{lng:116.419916,lat:39.924055,count:8},{lng:116.42189,lat:39.921308,count:11},{lng:116.413765,lat:39.929376,count:3},{lng:116.418232,lat:39.920348,count:50},{lng:116.417554,lat:39.930511,count:15},{lng:116.418568,lat:39.918161,count:23},{lng:116.413461,lat:39.926306,count:3},{lng:116.42232,lat:39.92161,count:13},{lng:116.4174,lat:39.928616,count:6},{lng:116.424679,lat:39.915499,count:21},{lng:116.42171,lat:39.915738,count:29},{lng:116.417836,lat:39.916998,count:99},{lng:116.420755,lat:39.928001,count:10},{lng:116.414077,lat:39.930655,count:14},{lng:116.426092,lat:39.922995,count:16},{lng:116.41535,lat:39.931054,count:15},{lng:116.413022,lat:39.921895,count:13},{lng:116.415551,lat:39.913373,count:17},{lng:116.421191,lat:39.926572,count:1},{lng:116.419612,lat:39.917119,count:9},{lng:116.418237,lat:39.921337,count:54},{lng:116.423776,lat:39.921919,count:26},{lng:116.417694,lat:39.92536,count:17},{lng:116.415377,lat:39.914137,count:19},{lng:116.417434,lat:39.914394,count:43},{lng:116.42588,lat:39.922622,count:27},{lng:116.418345,lat:39.919467,count:8},{lng:116.426883,lat:39.917171,count:3},{lng:116.423877,lat:39.916659,count:34},{lng:116.415712,lat:39.915613,count:14},{lng:116.419869,lat:39.931416,count:12},{lng:116.416956,lat:39.925377,count:11},{lng:116.42066,lat:39.925017,count:38},{lng:116.416244,lat:39.920215,count:91},{lng:116.41929,lat:39.915908,count:54},{lng:116.422116,lat:39.919658,count:21},{lng:116.4183,lat:39.925015,count:15},{lng:116.421969,lat:39.913527,count:3},{lng:116.422936,lat:39.921854,count:24},{lng:116.41905,lat:39.929217,count:12},{lng:116.424579,lat:39.914987,count:57},{lng:116.42076,lat:39.915251,count:70},{lng:116.425867,lat:39.918989,count:8}].map(n=>({position:te.fromLngLat(n.lng,n.lat,De.bd09),weight:n.count})),tr=[{url:"/favicon.ico",size:{width:32,height:32},anchor:{x:16,y:32}},{url:"http://lbsyun.baidu.com/skins/MySkin/resources/img/icon/lbsyunlogo_icon.ico",size:{width:32,height:32},anchor:{x:16,y:16}},{path:Vk.BACKWARD_CLOSED_ARROW,baiduLabelOffset:{x:6,y:16},talksPathSize:{width:12,height:17}},{path:"m0.5,48.67105l106.55963,0m-53.03642,45.73853l52.06349,51.09042m-52.06349,-51.57716l-48.65731,51.57716m48.41391,-112.39955l0,60.82238m16.17517,-77.24814c0,8.93415 -7.24208,16.17461 -16.17517,16.17461c-8.93307,0 -16.17464,-7.24046 -16.17464,-16.17461c0,-8.93309 7.24156,-16.1747 16.17464,-16.1747c8.93309,0 16.17517,7.24161 16.17517,16.1747z",fillColor:"green",fillOpacity:.8,strokeColor:"red",strokeOpacity:.5,strokeWeight:8,scale:1,anchor:{x:53.5,y:77},talksPathSize:{width:107,height:154},rotation:0,baiduLabelOffset:{x:4,y:4}},{path:"M1 18.4V1.6C1 1.44087 1.06321 1.28826 1.17574 1.17574C1.28826 1.06321 1.44087 1 1.6 1H18.4C18.5591 1 18.7117 1.06321 18.8243 1.17574C18.9368 1.28826 19 1.44087 19 1.6V18.4C19 18.5591 18.9368 18.7117 18.8243 18.8243C18.7117 18.9368 18.5591 19 18.4 19H1.6C1.44087 19 1.28826 18.9368 1.17574 18.8243C1.06321 18.7117 1 18.5591 1 18.4Z",scale:1,strokeWeight:2,strokeColor:"green",fillOpacity:.5,fillColor:"white",rotation:180,anchor:{x:10,y:10},baiduLabelOffset:{x:17763568394002505e-31,y:-17763568394002505e-31}},{path:"M1.675 17.725C1.475 17.8083 1.271 17.8293 1.063 17.788C0.855004 17.7467 0.67567 17.6507 0.525003 17.5C0.375003 17.35 0.279003 17.171 0.237003 16.963C0.195003 16.755 0.216004 16.5507 0.300004 16.35L7.1 1.05C7.28334 0.649997 7.59167 0.449997 8.025 0.449997C8.45834 0.449997 8.76667 0.649997 8.95 1.05L15.75 16.35C15.8333 16.55 15.8543 16.7543 15.813 16.963C15.7717 17.1717 15.6757 17.3507 15.525 17.5C15.375 17.65 15.196 17.746 14.988 17.788C14.78 17.83 14.5757 17.809 14.375 17.725L8.025 15L1.675 17.725Z",fillColor:"gray",scale:.7,anchor:{x:8,y:9.1},talksPathSize:{width:16,height:18.2},fillOpacity:1,strokeColor:"white",strokeOpacity:.5,strokeWeight:1,rotation:90},{url:"/favicon.ico",size:{width:64,height:64},scaledSize:{width:64,height:64}}],BA=ke({components:{MapTypeSelect:ti,TgMarker:ot,TgMapTypeControl:t1,TgZoomControl:i1,TgScaleControl:Mg,TgStreetViewControl:fR,TgCustomControl:cR,TgMap:Nt},setup(){const n=La();return{mapTypeControl:void 0,...n}},data(){return{center:ki[0],zoom:13,count:0,points:[te.ZERO,te.create(0,180),te.create(0,180,De.bd09)],icons:tr,currentCenter:te.ZERO,hideLogo:!0}},computed:{mapType(){return Tr.state.mapType}},methods:{onMapLoad(n){if(!(n instanceof Ho))return;const r=class extends Lw{constructor(){super(Ze.TOP_LEFT)}onCreateElement(){const t=document.createElement("div");return t.appendChild(document.createTextNode("fuck")),t.style.background="red",t}};n.addCustomControl(new r)}}}),GA={style:{width:"100%"}};function FA(n,r,t,i,e,o){const s=_t("tg-marker"),a=_t("tg-map-type-control"),l=_t("tg-zoom-control"),h=_t("tg-scale-control"),u=_t("tg-street-view-control"),c=_t("tg-custom-control"),f=_t("MapTypeSelect"),d=_t("tg-map");return he(),xe("div",null,[(he(),Ue(d,{key:n.mapType,zoom:n.zoom,"onUpdate:zoom":r[5]||(r[5]=g=>n.zoom=g),"current-center":n.currentCenter,"onUpdate:currentCenter":r[6]||(r[6]=g=>n.currentCenter=g),class:"abs-container","hide-logo":n.hideLogo,type:n.mapType,center:n.center,onLoad:n.onMapLoad,onError:n.eventLog,onX_mousemove:r[7]||(r[7]=g=>n.eventLog(g.position))},{overlay:ue(()=>[F("div",GA,[Y(f),r[9]||(r[9]=F("br",null,null,-1)),F("label",null,[Ve(F("input",{"onUpdate:modelValue":r[4]||(r[4]=g=>n.hideLogo=g),type:"checkbox"},null,512),[[bt,n.hideLogo]]),r[8]||(r[8]=ae(" 隐藏Logo "))])])]),default:ue(()=>[(he(!0),xe(We,null,St(n.points,(g,p)=>(he(),Ue(s,{key:g.toString(),position:g,icon:n.icons[p%n.icons.length],title:g.toString()},null,8,["position","icon","title"]))),128)),Y(s,{position:n.currentCenter},null,8,["position"]),Y(a,{position:"right-top"}),Y(a),Y(l),Y(h),Y(u),Y(c,{position:"right-bottom"},{default:ue(()=>[F("button",{onClick:r[0]||(r[0]=g=>n.count++)},"RT1:"+Ae(n.count),1)]),_:1}),Y(c,{position:"right-bottom"},{default:ue(()=>[F("button",{onClick:r[1]||(r[1]=g=>n.count++)},"RT2:"+Ae(n.count),1)]),_:1}),Y(c,{position:"bottom-right"},{default:ue(()=>[F("button",{onClick:r[2]||(r[2]=g=>n.count++)},"BR1:"+Ae(n.count),1)]),_:1}),Y(c,{position:"bottom-right"},{default:ue(()=>[F("button",{onClick:r[3]||(r[3]=g=>n.count++)},"BR2:"+Ae(n.count),1)]),_:1})]),_:1},8,["zoom","current-center","hide-logo","type","center","onLoad","onError"]))])}const NA=nt(BA,[["render",FA]]);function Sg(n={}){const r=qe(n.defaultCenter??Ut[0]),t=qe(n.defaultZoom??Wr.STREET),i=wt(()=>eo(n.type)??Tr.state.mapType),e=qe();return{map:e,mapBindValues:xr({class:"abs-container",key:i,type:i,center:r,zoom:t,"onUpdate:center":o=>{r.value=o},"onUpdate:zoom":o=>{t.value=o},onLoad:o=>{e.value=o}})}}const HA={style:{display:"flex"}},jA={style:{position:"absolute","background-color":"rgba(255, 255, 255, 0.597)"}},ZA=ke({__name:"HeatmapDemo",setup(n){const{mapBindValues:r}=Sg({type:Ye.google,defaultCenter:te.fromLngLat(116.418261,39.921984,De.bd09),defaultZoom:14}),t=qe(zA),i=["rgba(0, 255, 255, 0)","rgba(0, 255, 255, 1)","rgba(0, 191, 255, 1)","rgba(0, 127, 255, 1)","rgba(0, 63, 255, 1)","rgba(0, 0, 255, 1)","rgba(0, 0, 223, 1)","rgba(0, 0, 191, 1)","rgba(0, 0, 159, 1)","rgba(0, 0, 127, 1)","rgba(63, 0, 91, 1)","rgba(127, 0, 63, 1)","rgba(191, 0, 31, 1)","rgba(255, 0, 0, 1)"],e=["rgba(102, 255, 0, 0)","rgba(102, 255, 0, 1)","rgba(147, 255, 0, 1)","rgba(193, 255, 0, 1)","rgba(238, 255, 0, 1)","rgba(244, 227, 0, 1)","rgba(249, 198, 0, 1)","rgba(255, 170, 0, 1)","rgba(255, 113, 0, 1)","rgba(255, 57, 0, 1)","rgba(255, 0, 0, 1)"],o=h=>Object.fromEntries(h.map((u,c)=>{const f=c/(i.length-1);return[Math.pow(f,1/3),u]})),s={baidu:{0:"rgba(0, 255, 255, 0)",.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},google:o(e),custom:o(i),default:void 0},a=qe("default"),l=xr({gradient:wt(()=>s[a.value])});return(h,u)=>(he(),xe("div",HA,[Y(j(Nt),_r({style:{flex:"1"}},j(r),{type:"google"}),{default:ue(()=>[Y(j(Rm),_r({data:t.value},l),null,16,["data"])]),_:1},16),Y(j(Nt),_r({style:{flex:"1"}},j(r),{type:"baidu"}),{default:ue(()=>[Y(j(Rm),_r({data:t.value},l),null,16,["data"])]),_:1},16),F("div",jA,[F("label",null,[u[6]||(u[6]=ae(" opacity ")),Ve(F("input",{"onUpdate:modelValue":u[0]||(u[0]=c=>l.opacity=c),type:"number",step:"0.1"},null,512),[[Mn,l.opacity]])]),u[16]||(u[16]=F("br",null,null,-1)),F("label",null,[u[7]||(u[7]=ae(" radius ")),Ve(F("input",{"onUpdate:modelValue":u[1]||(u[1]=c=>l.radius=c),type:"number",step:"10"},null,512),[[Mn,l.radius]])]),u[17]||(u[17]=F("br",null,null,-1)),u[18]||(u[18]=ae(" 自定义gradient: ")),F("div",null,[F("label",null,[u[8]||(u[8]=ae("default ")),Ve(F("input",{"onUpdate:modelValue":u[2]||(u[2]=c=>a.value=c),type:"radio",value:"default"},null,512),[[Na,a.value]])]),u[12]||(u[12]=F("br",null,null,-1)),F("label",null,[u[9]||(u[9]=ae("google ")),Ve(F("input",{"onUpdate:modelValue":u[3]||(u[3]=c=>a.value=c),type:"radio",value:"google"},null,512),[[Na,a.value]])]),u[13]||(u[13]=F("br",null,null,-1)),F("label",null,[u[10]||(u[10]=ae("baidu ")),Ve(F("input",{"onUpdate:modelValue":u[4]||(u[4]=c=>a.value=c),type:"radio",value:"baidu"},null,512),[[Na,a.value]])]),u[14]||(u[14]=F("br",null,null,-1)),F("label",null,[u[11]||(u[11]=ae("custom ")),Ve(F("input",{"onUpdate:modelValue":u[5]||(u[5]=c=>a.value=c),type:"radio",value:"custom"},null,512),[[Na,a.value]])]),u[15]||(u[15]=F("br",null,null,-1))]),u[19]||(u[19]=F("br",null,null,-1))])]))}}),VA=ke({components:{TgInfoBox:As,TgInfoWindow:Eg,MapTypeSelect:ti,TgMarker:ot,TgMapWidget:Io,TgMap:Nt},setup(){return{...La()}},data(){return{window1:!0,window2:!0,window3:!0,box4:!1,box5:!1,position:lr[0],points:lr,center:lr[0],zoom:5,icons:tr,currentIcon:void 0,multi:!1,offset:{x:0,y:-10},multiLineText:"slkdfjaiewcnasxdjfnrhfgcdsdbgxmwexfgwerfgrhwencfdsgscjgfshmghxkgtrjghcsfhfdgbkjskwehegfdfkgngvfjjhfdjcgrebgkdfcgfdgkhnrvhgdcdfjgfdddfjchrvefjcnhfdsfdjcegrfgghhjgjfkdfkfdkfkfkfhfkfkdleoeiejxmnshsagdkflghpgifuwyt36374hxgwtejrfu47"}},computed:{mapType(){return Tr.state.mapType}},methods:{stringify:Cr.toJsonSafely,onShowClick(){this.window1=!this.window1,this.window2=!this.window2,this.window3=!this.window3,this.box4=!this.box4,this.box5=!this.box5},onInfoWindowContentClick(){console.log("onInfoWindowContentClick")}}}),WA=["disabled"],$A=["disabled"],UA=["value"],JA=["value"];function XA(n,r,t,i,e,o){const s=_t("tg-info-window"),a=_t("tg-info-box"),l=_t("tg-marker"),h=_t("tg-map-widget"),u=_t("MapTypeSelect"),c=_t("tg-map");return he(),Ue(c,{key:n.mapType+n.multi,center:n.center,"onUpdate:center":r[15]||(r[15]=f=>n.center=f),zoom:n.zoom,"onUpdate:zoom":r[16]||(r[16]=f=>n.zoom=f),type:n.mapType,"info-window-mode":n.multi?"multi":"single"},{overlay:ue(()=>[Y(h,null,{default:ue(()=>[Y(u)]),_:1})]),default:ue(()=>[n.multi?(he(),xe(We,{key:0},[Y(s,{show:n.window1,"onUpdate:show":r[0]||(r[0]=f=>n.window1=f),position:n.position},{default:ue(()=>[ae(" window1: "+Ae(n.window1)+" ",1),r[17]||(r[17]=F("h2",null,"Title",-1)),r[18]||(r[18]=F("div",null,"Content",-1))]),_:1,__:[17,18]},8,["show","position"]),Y(s,{show:n.window3,"onUpdate:show":r[1]||(r[1]=f=>n.window3=f),position:n.position},{default:ue(()=>[ae(" window3: "+Ae(n.window3),1)]),_:1},8,["show","position"])],64)):on("",!0),Y(l,{position:n.points[2],icon:n.currentIcon},{default:ue(()=>[Y(s,{show:n.window2,"onUpdate:show":r[3]||(r[3]=f=>n.window2=f)},{default:ue(()=>[F("div",{onClick:r[2]||(r[2]=(...f)=>n.onInfoWindowContentClick&&n.onInfoWindowContentClick(...f))}," window2: "+Ae(n.window2),1)]),_:1},8,["show"]),Y(a,{show:n.box5,"onUpdate:show":r[4]||(r[4]=f=>n.box5=f)},{default:ue(()=>[ae(" box5: "+Ae(n.box5),1)]),_:1},8,["show"])]),_:1},8,["position","icon"]),Y(l,{position:n.points[0],icon:n.currentIcon},{default:ue(()=>[Y(a,{show:n.box4,"onUpdate:show":r[5]||(r[5]=f=>n.box4=f),offset:n.offset,"border-class":"custom-info-box",onCloseclick:n.eventLog},{default:ue(()=>[ae(" box4: "+Ae(n.box4)+" "+Ae(n.multiLineText),1)]),_:1},8,["show","offset","onCloseclick"])]),_:1},8,["position","icon"]),Y(h,{bottom:"0",right:"0",style:{background:"white","user-select":"none"}},{default:ue(()=>[F("label",null,[Ve(F("input",{"onUpdate:modelValue":r[6]||(r[6]=f=>n.multi=f),type:"checkbox"},null,512),[[bt,n.multi]]),r[19]||(r[19]=ae(" multi"))]),F("button",{onClick:r[7]||(r[7]=(...f)=>n.onShowClick&&n.onShowClick(...f))}," toggle "),F("label",null,[Ve(F("input",{"onUpdate:modelValue":r[8]||(r[8]=f=>n.window1=f),disabled:!n.multi,type:"checkbox"},null,8,WA),[[bt,n.window1]]),r[20]||(r[20]=ae("window1"))]),F("label",null,[Ve(F("input",{"onUpdate:modelValue":r[9]||(r[9]=f=>n.window2=f),type:"checkbox"},null,512),[[bt,n.window2]]),r[21]||(r[21]=ae("window2"))]),F("label",null,[Ve(F("input",{"onUpdate:modelValue":r[10]||(r[10]=f=>n.window3=f),disabled:!n.multi,type:"checkbox"},null,8,$A),[[bt,n.window3]]),r[22]||(r[22]=ae("window3"))]),F("label",null,[Ve(F("input",{"onUpdate:modelValue":r[11]||(r[11]=f=>n.box4=f),type:"checkbox"},null,512),[[bt,n.box4]]),r[23]||(r[23]=ae("box4"))]),F("label",null,[Ve(F("input",{"onUpdate:modelValue":r[12]||(r[12]=f=>n.box5=f),type:"checkbox"},null,512),[[bt,n.box5]]),r[24]||(r[24]=ae("box5"))]),Ve(F("select",{"onUpdate:modelValue":r[13]||(r[13]=f=>n.position=f)},[(he(!0),xe(We,null,St(n.points,f=>(he(),xe("option",{key:n.stringify(f),value:f},Ae(f),9,UA))),128))],512),[[Dc,n.position]]),Ve(F("select",{"onUpdate:modelValue":r[14]||(r[14]=f=>n.currentIcon=f)},[r[25]||(r[25]=F("option",{value:null}," null ",-1)),(he(!0),xe(We,null,St(n.icons,f=>(he(),xe("option",{key:n.stringify(f),value:f},Ae("url"in f?f.url.split("/").slice(-1)[0]:f.path.toString().substring(0,5)),9,JA))),128))],512),[[Dc,n.currentIcon]])]),_:1})]),_:1},8,["center","zoom","type","info-window-mode"])}const YA=nt(VA,[["render",XA]]),qA=JSON.parse('[{"featureType":"land","elementType":"geometry","stylers":{"color":"#242f3eff"}},{"featureType":"manmade","elementType":"geometry","stylers":{"color":"#242f3eff"}},{"featureType":"water","elementType":"geometry","stylers":{"color":"#17263cff"}},{"featureType":"road","elementType":"geometry.fill","stylers":{"color":"#9e7d60ff"}},{"featureType":"road","elementType":"geometry.stroke","stylers":{"color":"#554631ff"}},{"featureType":"districtlabel","elementType":"labels.text.fill","stylers":{"color":"#d69563ff"}},{"featureType":"districtlabel","elementType":"labels.text.stroke","stylers":{"color":"#17263cff","weight":"3"}},{"featureType":"poilabel","elementType":"labels.text.fill","stylers":{"color":"#d69563ff"}},{"featureType":"poilabel","elementType":"labels.text.stroke","stylers":{"color":"#17263cff","weight":"3"}},{"featureType":"subway","elementType":"geometry","stylers":{"visibility":"off"}},{"featureType":"railway","elementType":"geometry","stylers":{"visibility":"off"}},{"featureType":"poilabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"subwaylabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"subwaylabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"tertiarywaysign","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"tertiarywaysign","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"provincialwaysign","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"provincialwaysign","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"nationalwaysign","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"nationalwaysign","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"highwaysign","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"highwaysign","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"green","elementType":"geometry","stylers":{"color":"#263b3eff"}},{"featureType":"nationalwaysign","elementType":"labels.text.fill","stylers":{"color":"#d0021bff"}},{"featureType":"nationalwaysign","elementType":"labels.text.stroke","stylers":{"color":"#ffffffff"}},{"featureType":"city","elementType":"labels","stylers":{"visibility":"on"}},{"featureType":"city","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"city","elementType":"labels.text.fill","stylers":{"color":"#d69563ff"}},{"featureType":"city","elementType":"labels.text.stroke","stylers":{"color":"#17263cff"}},{"featureType":"water","elementType":"labels.text.fill","stylers":{"color":"#d69563ff"}},{"featureType":"water","elementType":"labels.text.stroke","stylers":{"color":"#242f3eff"}},{"featureType":"local","elementType":"geometry.fill","stylers":{"color":"#38414eff"}},{"featureType":"local","elementType":"geometry.stroke","stylers":{"color":"#ffffff00"}},{"featureType":"fourlevelway","elementType":"geometry.fill","stylers":{"color":"#38414eff"}},{"featureType":"fourlevelway","elementType":"geometry.stroke","stylers":{"color":"#ffffff00"}},{"featureType":"tertiaryway","elementType":"geometry.fill","stylers":{"color":"#38414eff"}},{"featureType":"tertiaryway","elementType":"geometry.stroke","stylers":{"color":"#ffffff00"}},{"featureType":"tertiaryway","elementType":"labels.text.fill","stylers":{"color":"#759879ff"}},{"featureType":"fourlevelway","elementType":"labels.text.fill","stylers":{"color":"#759879ff"}},{"featureType":"highway","elementType":"labels.text.fill","stylers":{"color":"#759879ff"}},{"featureType":"highway","elementType":"geometry.fill","stylers":{"color":"#9e7d60ff"}},{"featureType":"highway","elementType":"geometry.stroke","stylers":{"color":"#554631ff"}},{"featureType":"provincialway","elementType":"geometry.fill","stylers":{"color":"#9e7d60ff"}},{"featureType":"provincialway","elementType":"geometry.stroke","stylers":{"color":"#554631ff"}},{"featureType":"tertiaryway","elementType":"labels.text.stroke","stylers":{"color":"#1a2e1cff"}},{"featureType":"fourlevelway","elementType":"labels.text.stroke","stylers":{"color":"#1a2e1cff"}},{"featureType":"highway","elementType":"labels.text.stroke","stylers":{"color":"#1a2e1cff"}},{"featureType":"nationalway","elementType":"labels.text.stroke","stylers":{"color":"#1a2e1cff"}},{"featureType":"nationalway","elementType":"labels.text.fill","stylers":{"color":"#759879ff"}},{"featureType":"nationalway","elementType":"geometry.fill","stylers":{"color":"#9e7d60ff"}},{"featureType":"nationalway","elementType":"geometry.stroke","stylers":{"color":"#554631ff"}},{"featureType":"cityhighway","elementType":"geometry.fill","stylers":{"color":"#9e7d60ff"}},{"featureType":"cityhighway","elementType":"geometry.stroke","stylers":{"color":"#554631ff"}},{"featureType":"arterial","elementType":"geometry.fill","stylers":{"color":"#9e7d60ff"}},{"featureType":"arterial","elementType":"geometry.stroke","stylers":{"color":"#554631fa"}},{"featureType":"medicallabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"medicallabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"entertainmentlabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"entertainmentlabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"estatelabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"estatelabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"businesstowerlabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"businesstowerlabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"companylabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"companylabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"governmentlabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"governmentlabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"restaurantlabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"restaurantlabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"hotellabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"hotellabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"shoppinglabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"shoppinglabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"lifeservicelabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"lifeservicelabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"carservicelabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"carservicelabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"financelabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"financelabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"otherlabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"otherlabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"airportlabel","elementType":"labels","stylers":{"visibility":"on"}},{"featureType":"airportlabel","elementType":"labels.text.fill","stylers":{"color":"#d69563ff"}},{"featureType":"airportlabel","elementType":"labels.text.stroke","stylers":{"color":"#17263cff"}},{"featureType":"airportlabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"building","elementType":"geometry.topfill","stylers":{"color":"#2a3341ff"}},{"featureType":"building","elementType":"geometry.sidefill","stylers":{"color":"#313b4cff"}},{"featureType":"building","elementType":"geometry.stroke","stylers":{"color":"#1a212eff"}},{"featureType":"road","elementType":"labels.text.fill","stylers":{"color":"#759879ff"}},{"featureType":"road","elementType":"labels.text.stroke","stylers":{"color":"#1a2e1cff"}},{"featureType":"provincialway","elementType":"labels.text.fill","stylers":{"color":"#759879ff"}},{"featureType":"cityhighway","elementType":"labels.text.fill","stylers":{"color":"#759879ff"}},{"featureType":"arterial","elementType":"labels.text.fill","stylers":{"color":"#759879ff"}},{"featureType":"provincialway","elementType":"labels.text.stroke","stylers":{"color":"#1a2e1cff"}},{"featureType":"cityhighway","elementType":"labels.text.stroke","stylers":{"color":"#1a2e1cff"}},{"featureType":"arterial","elementType":"labels.text.stroke","stylers":{"color":"#1a2e1cff"}},{"featureType":"local","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"manmade","elementType":"labels.text.fill","stylers":{"color":"#d69563ff"}},{"featureType":"manmade","elementType":"labels.text.stroke","stylers":{"color":"#17263cff"}},{"featureType":"subwaystation","elementType":"geometry","stylers":{"visibility":"off"}},{"featureType":"transportationlabel","elementType":"labels.icon","stylers":{"visibility":"off"}},{"featureType":"transportationlabel","elementType":"labels","stylers":{"visibility":"off"}},{"featureType":"estate","elementType":"geometry","stylers":{"color":"#2a3341ff"}}]'),KA=[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}],QA={style:{left:"0px",bottom:"0px",top:"unset"}},eL={style:{background:"white"}},tL={style:{"background-color":"black",color:"white"}},rL=ke({__name:"MapDemo",setup(n){const r=La(),t={baidu:{styleJson:qA},google:{styles:KA}},i=xr({points:[...ki],cities:[...Ut],zoom:13,currentCenter:Ut[0],bounds:Rt.create(ki[1],ki[0]),center:Ut[0],icon:tr[0]}),e=qe(),o=wt(()=>Tr.state.mapType);tt(()=>i.points,()=>{i.center=i.points[i.points.length-1]||te.ZERO},{deep:!0});const s=xr({draggable:!0,doubleClickZoom:!0,dark:!1});tt([()=>s.draggable,()=>s.doubleClickZoom,e],([d,g,p])=>{p==null||p.setDraggable(d),p==null||p.setDoubleClickZoom(g)});function a(d){e.value=d,r.eventLog(`ready: ${d.getBounds()}`)}function l(){const d=i.cities.pop();d&&i.points.push(d)}function h(){const d=i.points.pop();d&&i.cities.push(d)}function u(){f(Wr.STREET,i.points[0])}function c(){f(Wr.STATE,i.points[i.points.length-1])}function f(d,g){i.center=g,i.zoom=d}return(d,g)=>(he(),xe("div",null,[(he(),Ue(j(Nt),{key:o.value,center:i.center,"onUpdate:center":g[8]||(g[8]=p=>i.center=p),zoom:i.zoom,"onUpdate:zoom":g[9]||(g[9]=p=>i.zoom=p),"current-center":i.currentCenter,"onUpdate:currentCenter":g[10]||(g[10]=p=>i.currentCenter=p),"last-center":i.center,"onUpdate:lastCenter":g[11]||(g[11]=p=>i.center=p),class:"abs-container",type:o.value,"map-style":s.dark?t:void 0,"min-zoom":0,"gesture-handling":"greedy",onLoad:a,onClick:j(r).eventLog,onDblclick:j(r).eventLog,onRightclick:j(r).eventLog,onContextmenu:j(r).eventLog,onX_dragstart:j(r).eventLog,onX_drag:j(r).eventLogLess,onX_dragend:j(r).eventLog,onMouseover:j(r).eventLog,onX_mousemove:j(r).eventLogLess,onMouseout:j(r).eventLog,onMousedown:j(r).eventLog,onMouseup:j(r).eventLog},{overlay:ue(()=>[Y(ti)]),default:ue(()=>[Y(j(Mg)),Y(j(ah),{path:i.points,"stroke-color":"#f00","stroke-weight":10,"stroke-opacity":.7},null,8,["path"]),Y(j(ot),{position:i.currentCenter},null,8,["position"]),Y(j(ot),{position:i.center,icon:i.icon},null,8,["position","icon"]),F("div",QA,[F("button",{onClick:u},"<"),F("button",{onClick:l}," Add "),F("button",{onClick:h}," Remove "),F("button",{onClick:c},">"),F("div",eL,[F("button",{onClick:g[0]||(g[0]=p=>i.zoom++)}," + "),ae(" "+Ae(i.zoom)+" ",1),F("button",{onClick:g[1]||(g[1]=p=>i.zoom--)}," - ")]),F("div",tL,[F("label",null,[Ve(F("input",{"onUpdate:modelValue":g[2]||(g[2]=p=>s.draggable=p),type:"checkbox"},null,512),[[bt,s.draggable]]),g[12]||(g[12]=ae("拖拽"))]),F("label",null,[Ve(F("input",{"onUpdate:modelValue":g[3]||(g[3]=p=>s.doubleClickZoom=p),type:"checkbox"},null,512),[[bt,s.doubleClickZoom]]),g[13]||(g[13]=ae("双击放大"))]),F("label",null,[Ve(F("input",{"onUpdate:modelValue":g[4]||(g[4]=p=>s.dark=p),type:"checkbox"},null,512),[[bt,s.dark]]),g[14]||(g[14]=ae("暗色"))])]),F("button",{onClick:g[5]||(g[5]=p=>{var m;return(m=e.value)==null?void 0:m.panTo(i.points[0])})},"panTo"),F("button",{onClick:g[6]||(g[6]=p=>{var m;return(m=e.value)==null?void 0:m.fitBounds(i.bounds)})},"fitBounds"),F("button",{onClick:g[7]||(g[7]=p=>{var m;return j(r).eventLog((m=e.value)==null?void 0:m.getBounds())})},"getBounds")])]),_:1},8,["center","zoom","current-center","last-center","type","map-style","onClick","onDblclick","onRightclick","onContextmenu","onX_dragstart","onX_drag","onX_dragend","onMouseover","onX_mousemove","onMouseout","onMousedown","onMouseup"])),g[15]||(g[15]=F("div",{style:{height:"100px"}}," Other ",-1))]))}});function iL(){return new ck(De.wgs84,{id:"moon",getTileUrl(n,r){const t=rR(n,r);return t?`//mw1.google.com/mw-planetary/lunar/lunarmaps_v1/clem_bw/${r}/${t.x}/${Math.pow(2,r)-t.y-1}.jpg`:null},maxZoom:9,minZoom:1,name:"moon-name",describe:"moon-describe"})}const nL=ke({components:{TgMap:Nt,MapTypeSelect:ti,TgTrafficLayer:pR,TgMapTypeControl:t1},data(){return{center:te.ZERO,zoom:4,showTraffic:!1,mapTypeId:void 0,mapTypes:[or.NORMAL,iL(),or.SATELLITE,or.TERRAIN],mapTypeObject:void 0}},computed:{mapType(){return Tr.state.mapType}},methods:{onMapLoad(n){},onMoonClick(){this.$refs.map.map.setMapType(this.mapTypes[1])}}});function oL(n,r,t,i,e,o){const s=_t("tg-traffic-layer"),a=_t("tg-map-type-control"),l=_t("MapTypeSelect"),h=_t("tg-map");return he(),Ue(h,{ref:"map",key:n.mapType,"map-type-id":n.mapTypeId,"onUpdate:mapTypeId":r[2]||(r[2]=u=>n.mapTypeId=u),"map-type":n.mapTypeObject,"onUpdate:mapType":r[3]||(r[3]=u=>n.mapTypeObject=u),class:"abs-container",type:n.mapType,center:n.center,zoom:n.zoom,onLoad:n.onMapLoad},{default:ue(()=>[n.showTraffic?(he(),Ue(s,{key:0})):on("",!0),Y(a,{"map-types":n.mapTypes},null,8,["map-types"]),F("button",{style:{left:"0px",bottom:"0px",top:"unset"},onClick:r[0]||(r[0]=u=>n.showTraffic=!n.showTraffic)},"交通流量图层: "+Ae(n.showTraffic),1),F("button",{style:{right:"0px"},onClick:r[1]||(r[1]=(...u)=>n.onMoonClick&&n.onMoonClick(...u))},"月球"),Y(l)]),_:1},8,["map-type-id","map-type","type","center","zoom","onLoad"])}const sL=nt(nL,[["render",oL]]),aL=ke({__name:"MapUrlsDemo",setup(n){const r=[...lr,"宜春","1970科技小镇",te.fromLngLat(116.478648,42.186836)],t={宜春:DA,"1970科技小镇":IA},i=qe(),e=wt(()=>Tr.state.mapType),o=qe(Ut[2]),s=qe(Wr.CITY),a=qe(),l=qe(),h=wt(()=>{var f;return(f=i.value)==null?void 0:f.createMapUrls({})});function u(){if(!l.value||!h.value)return;const f=h.value.directions(a.value,l.value);console.log("handleDirectionsClick",f.href),window.open(f)}function c(f){var g;const d=(g=h.value)==null?void 0:g.search(f);console.log("openSearch",d==null?void 0:d.href),window.open(d)}return(f,d)=>(he(),Ue(j(Nt),{key:e.value,center:o.value,"onUpdate:center":d[1]||(d[1]=g=>o.value=g),zoom:s.value,"onUpdate:zoom":d[2]||(d[2]=g=>s.value=g),type:e.value,class:"abs-container",onLoad:d[3]||(d[3]=g=>i.value=g)},{overlay:ue(()=>[Y(ti)]),default:ue(()=>[(he(),xe(We,null,St(r,(g,p)=>Y(j(ot),{key:p,position:typeof g=="string"?t[g]??j(te).ZERO:g,onClick:m=>a.value=g,onContextmenu:m=>l.value=g},null,8,["position","onClick","onContextmenu"])),64)),Y(j(Io),{style:{"background-color":"white"}},{default:ue(()=>[a.value?(he(),xe("button",{key:0,onClick:d[0]||(d[0]=g=>c(a.value))},Ae(a.value),1)):(he(),xe(We,{key:1},[ae(" 请点击Marker ")],64)),ae(" => "+Ae(l.value??"请右键点击Marker")+" ",1),F("button",{onClick:u},"导航")]),_:1})]),_:1},8,["center","zoom","type"]))}}),lL=ke({__name:"BubbleLabel",setup(n){return(r,t)=>(he(),Ue(j($r),{class:"popover",offset:{x:-63,y:-55}},{default:ue(()=>[t[0]||(t[0]=F("div",{class:"arrow"},null,-1)),F("div",null,[Jt(r.$slots,"default",{},void 0,!0)])]),_:3,__:[0]}))}}),hL=nt(lL,[["__scopeId","data-v-06071a3a"]]),uL=["d","stroke-width","stroke","fill","fill-opacity"],cL={style:{position:"absolute",left:"0px",top:"0px"},class:"pointer-events-none-layer"},fL=["onClick"],dL=["onClick"],gL=["href"],bc=5,pL=ke({__name:"MarkerDemo",setup(n){const r=La(),t=Cr.toJsonSafely,i=tr[bc],e=qe();kl(()=>{var g;console.log("svgPath:",e.value,(g=e.value)==null?void 0:g.getBBox())});const o=xr({showInfoWindow:!1,updateValue:0,center:lr[bc],zoom:15,clusterPoints:lr.slice(),showMarkerClusterer:!1,showAllIcon:!1});let s;const a=wt({get:()=>Tr.state.mapType,set:g=>Tr.setMapType(g)});function l(){o.updateValue++}function h(g){console.log("ready",g),s=g}function u(g){console.log("onMarkerClick",g)}function c(){s==null||s.fitBounds(Rt.fromArray(lr)??Rt.EMPTY)}function f(g){const p=globalThis.BMap&&te.fromBaidu(g.toBaidu(g.coord),g.coord),m=globalThis.google&&te.fromGoogle(g.toGoogle(g.coord),g.coord);return`${g} => ${p} ${m}`}function d(){console.log("testInvalidPosition:"),console.log(f(h1)),console.log(f(l1[0])),console.log(f(te.fromLngLat(180,90))),console.log(f(te.fromLngLat(181,91))),console.log(f(te.fromLngLat(-180,-90))),console.log(f(te.fromLngLat(-181,-91)))}return(g,p)=>(he(),xe("div",null,[(he(),Ue(j(Nt),{ref:"mapView",key:a.value,type:a.value,center:o.center,zoom:o.zoom,onLoad:h},{overlay:ue(()=>[Y(j(Io),{bottom:"8",left:"8"},{default:ue(()=>[Y(ti),F("button",{onClick:l}," click: "+Ae(o.updateValue),1),F("button",{onClick:c}," Bounds ")]),_:1})]),default:ue(()=>[Y(j(ot),{position:j(u1)},null,8,["position"]),ae(" "+Ae(d())+" ",1),o.showAllIcon?(he(!0),xe(We,{key:0},St(j(lr),(m,v)=>(he(),Ue(j(ot),{key:v,"z-index":9999,icon:j(tr)[v%j(tr).length],position:m},{default:ue(()=>[(he(),Ue(j($r),{key:0,"z-index":999,style:{"background-color":"white"}},{default:ue(()=>[ae(Ae(j(Cr).omit(j(tr)[v%j(tr).length],"path","url")),1)]),_:2},1024))]),_:2},1032,["icon","position"]))),128)):(he(),xe(We,{key:1},St(2,m=>Y(j(ot),{key:m,icon:Object.assign({},j(i),{rotation:j(i).rotation+m*180}),position:j(lr)[bc]},null,8,["icon","position"])),64)),Y(j(Io),{right:"0"},{default:ue(()=>[(he(),xe("svg",null,[F("path",{ref_key:"svgPathRef",ref:e,style:zo({transform:`scale(${j(i).scale})`}),d:j(i).path,"stroke-width":j(i).strokeWeight,"stroke-linecap":"round",stroke:j(i).strokeColor,fill:j(i).fillColor,"fill-opacity":j(i).fillOpacity},null,12,uL)]))]),_:1}),F("div",cL,[Ve(F("input",{"onUpdate:modelValue":p[0]||(p[0]=m=>o.showMarkerClusterer=m),type:"checkbox"},null,512),[[bt,o.showMarkerClusterer]]),p[7]||(p[7]=ae(" 点聚合 ")),Ve(F("input",{"onUpdate:modelValue":p[1]||(p[1]=m=>o.showAllIcon=m),type:"checkbox"},null,512),[[bt,o.showAllIcon]]),p[8]||(p[8]=ae(" 显示所有Icon ")),(he(!0),xe(We,null,St(j(lr),(m,v)=>(he(),xe("button",{key:m.toString(),style:{display:"block"},onClick:_=>o.center=m}," point["+Ae(v)+"]: "+Ae(m),9,fL))),128)),(he(),xe(We,null,St(20,m=>F("button",{key:m,style:{display:"block"},onClick:v=>o.zoom=m}," zoom: "+Ae(m),9,dL)),64)),Y(j(ot),{position:j(lr)[0],visible:!0},{default:ue(()=>[Y(hL,{onClick:j(r).eventLog},{default:ue(()=>[ae(Ae("-------["+o.updateValue+"]-------"),1)]),_:1},8,["onClick"])]),_:1},8,["position"]),Y(j(ot),{position:j(lr)[1],icon:j(tr)[0],label:{text:"V",color:"white"},draggable:"",clickable:!0,"cross-on-drag":!1,onDragstart:p[2]||(p[2]=m=>j(r).eventLog(m)),onDrag:p[3]||(p[3]=m=>j(r).eventLog(m)),onDragend:p[4]||(p[4]=m=>j(r).eventLog(m))},null,8,["position","icon"]),Y(j(ot),{position:o.clusterPoints[2],"onUpdate:position":p[5]||(p[5]=m=>o.clusterPoints[2]=m),"z-index":4,draggable:!0,onClick:u,onRightclick:j(r).eventLog,onDragstart:j(r).eventLog,onDragend:j(r).eventLog,onX_position_changed:j(r).eventLog},null,8,["position","onRightclick","onDragstart","onDragend","onX_position_changed"]),Y(j(ot),{position:j(lr)[2],"z-index":2,onClick:u},null,8,["position"]),Y(j(ot),{position:o.clusterPoints[2],icon:j(tr)[0],"z-index":1,onClick:u},null,8,["position","icon"]),Y(j(ot),{position:j(lr)[9],onClick:p[6]||(p[6]=m=>o.showInfoWindow=!o.showInfoWindow)},{default:ue(()=>[Y(j(Eg),{show:o.showInfoWindow},{default:ue(()=>[ae(" InfoWindow: "+Ae(o.updateValue),1)]),_:1},8,["show"])]),_:1},8,["position"]),o.showMarkerClusterer?(he(),Ue(j(Pg),{key:0,"z-index":10},{default:ue(()=>[(he(!0),xe(We,null,St(o.clusterPoints,(m,v)=>(he(),Ue(j(ot),{key:v,"normalize-position-for-baidu":!0,"z-index":9,position:m,icon:j(tr)[1],title:j(t)(m),draggable:"",onClick:_=>o.clusterPoints.splice(v,1)},{default:ue(()=>[Y(j($r),{"z-index":8,style:{background:"red"},offset:{y:-15}},{default:ue(()=>[ae(Ae(j(t)(m)),1)]),_:2},1024),Y(j(As),{show:"","z-index":7},{default:ue(()=>[ae(Ae(v)+": "+Ae(j(t)(m)),1)]),_:2},1024)]),_:2},1032,["position","icon","title","onClick"]))),128))]),_:1})):on("",!0),Y(j($r),{position:o.center,style:{"background-color":"#00000055",padding:"4px"}},{default:ue(()=>[F("a",{href:"/test/"+o.updateValue},Ae(o.updateValue),9,gL)]),_:1},8,["position"])])]),_:1},8,["type","center","zoom"]))]))}}),vL=nt(pL,[["__scopeId","data-v-49dba6a9"]]),mL={style:{display:"flex"}},_L=ke({__name:"MultiMapDemo",setup(n){const r=xr([{center:Ut[0],zoom:Wr.STREET,type:Ye.google},{center:Ut[0],zoom:Wr.STREET,type:Ye.google},{center:Ut[0],zoom:Wr.STREET,type:Ye.baidu},{center:Ut[0],zoom:Wr.STREET,type:Ye.baidu}]);return(t,i)=>(he(),xe("div",mL,[(he(!0),xe(We,null,St(r,(e,o)=>(he(),Ue(j(Nt),{key:`${e.type}${o}`,style:{flex:"1"},center:e.center,zoom:e.zoom,type:e.type},null,8,["center","zoom","type"]))),128))]))}});class yL extends Yw{onCreate(){console.log("TestElementOverlay.onCreate");const r=document.createElement("div");return r.className="fuck-you",r.style.width="100px",r.style.height="100px",r.style.backgroundColor="red",r}onDraw(r){console.log("TestElementOverlay.onDraw");const t=r.fromLatLngToOverlayPoint(te.ZERO);this.element.style.left=t.x+"px",this.element.style.top=t.y+"px"}}const wL=ke({components:{MapTypeSelect:ti,TgElementOverlay:yR,TgMap:Nt},data(){return{points:[...ki],cities:[...Ut],center:te.ZERO,zoom:1,show:!0}},computed:{mapType(){return Tr.state.mapType}},methods:{onMapLoad(n){if(!(n instanceof Ho))return;const r=new yL(n,{mapPane:er.overlayMouseTarget});n.addElementOverlay(r)}}});function xL(n,r,t,i,e,o){const s=_t("MapTypeSelect"),a=_t("tg-element-overlay"),l=_t("tg-map");return he(),Ue(l,{key:n.mapType,center:n.center,"onUpdate:center":r[1]||(r[1]=h=>n.center=h),zoom:n.zoom,"onUpdate:zoom":r[2]||(r[2]=h=>n.zoom=h),class:"abs-container",type:n.mapType,onLoad:n.onMapLoad},{default:ue(()=>[Y(s),n.show?(he(),Ue(a,{key:0,position:n.center,onClick:r[0]||(r[0]=h=>n.show=!n.show)},{default:ue(()=>r[3]||(r[3]=[ae(" tg-element-overlay ")])),_:1,__:[3]},8,["position"])):on("",!0)]),_:1},8,["center","zoom","type","onLoad"])}const CL=nt(wL,[["render",xL]]),TL={style:{position:"absolute",left:"50%",transform:"translateX(-50%)"}},bL=["onClick"],ML=ke({__name:"PlaceDemo",setup(n){const r=qe(),t=wt(()=>Tr.state.mapType),i=qe(Ut[2]),e=qe(Wr.CITY),o=qe([]);function s(v){var y,w;o.value=v,console.log("places:",o.value);const _=Rt.fromArray(o.value.map(x=>x.position));o.value.length===1?(y=r.value)==null||y.panTo(o.value[0].position):_&&((w=r.value)==null||w.fitBounds(_))}const a=qe(""),l=qe();let h;const u=wt(()=>{var v;return((v=r.value)==null?void 0:v.createPlacesService({}))??Pt()});kl(()=>{var v;!r.value||!l.value||(h=(v=r.value)==null?void 0:v.createAutocomplete({input:l.value,bindToMap:!0}),h.addResultListener(async _=>{console.log("result:",_),c([_.country,_.province,_.city,_.district,_.street,_.title].filter(y=>!!y).join(","))}))});async function c(v){console.log("search:",v);const _=await u.value.search(v);s(_)}function f(){a.value&&c(a.value)}const d=qe(""),g=qe();let p;kl(()=>{var v;!r.value||!g.value||(p=(v=r.value)==null?void 0:v.createSearchBox({input:g.value}),p.setSearchListener(_=>{d.value=g.value.value,s(_)},_=>{console.log("addSearchListener.onError:",_)}))});function m(){p==null||p.search()}return(v,_)=>(he(),Ue(j(Nt),{key:t.value,center:i.value,"onUpdate:center":_[2]||(_[2]=y=>i.value=y),zoom:e.value,"onUpdate:zoom":_[3]||(_[3]=y=>e.value=y),type:t.value,class:"abs-container",onLoad:_[4]||(_[4]=y=>r.value=y)},{overlay:ue(()=>[F("div",TL,[Y(ti),_[5]||(_[5]=F("br",null,null,-1)),(he(!0),xe(We,null,St(j(Ut),(y,w)=>(he(),xe("button",{key:w,onClick:x=>i.value=y},"city"+Ae(w),9,bL))),128))])]),default:ue(()=>[(he(!0),xe(We,null,St(o.value,y=>(he(),Ue(j(ot),{key:y.id,position:y.position},{default:ue(()=>[Y(j($r),null,{default:ue(()=>[ae(Ae(y.title),1)]),_:2},1024)]),_:2},1032,["position"]))),128)),Y(j(Io),{left:"8",top:"8"},{default:ue(()=>[Ve(F("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":_[0]||(_[0]=y=>a.value=y)},null,512),[[Mn,a.value]]),F("button",{onClick:f},"Search"),ae(" "+Ae(a.value),1)]),_:1}),Y(j(Io),{right:"8",top:"8"},{default:ue(()=>[ae(Ae(d.value)+" ",1),Ve(F("input",{ref_key:"searchRef",ref:g,"onUpdate:modelValue":_[1]||(_[1]=y=>d.value=y)},null,512),[[Mn,d.value]]),F("button",{onClick:m},"Search")]),_:1})]),_:1},8,["center","zoom","type"]))}}),PL={style:{left:"0px"}},EL=ke({__name:"ShapeDemo",setup(n){const r=La(),t=xr({points:[...ki],cities:[...Ut],editable:!1,strokeOpacity:1,strokeWeight:8,fillOpacity:0,bold:!1,polylineIconsVisible:!0,radius:1e3}),i=wt(()=>Tr.state.mapType),e=wt({get:()=>[t.cities],set:u=>{t.cities=u[0]}}),o=wt({get:()=>vr.at(t.points,-1)||te.ZERO,set:u=>vr.at(t.points,-1,u)}),s=wt({get:()=>Rt.from(vr.at(t.points,-1)??te.ZERO,vr.at(t.cities,-1)??te.ZERO),set(u){vr.at(t.points,-1,u.sw),vr.at(t.cities,-1,u.ne)}}),a=wt(()=>{const u={width:12,height:8},c=t.strokeWeight*(t.bold?2:1);return{icons:t.polylineIconsVisible?[{icon:{path:"M6 2.8L1.4 7.4L0 6L6 0L12 6L10.6 7.4L6 2.8Z",scale:c/(u.width+4),fillOpacity:1,fillColor:"white",strokeColor:"white",anchor:{x:u.width/2,y:u.height/2}},repeat:"40px"}]:[],strokeWeight:c}});function l(){const u=t.cities.pop();u&&t.points.push(u)}function h(){const u=t.points.pop();u&&t.cities.push(u)}return(u,c)=>(he(),Ue(j(Nt),{key:i.value,class:"abs-container",type:i.value,center:o.value,zoom:12},{default:ue(()=>[Y(ti),Y(j(ot),{position:t.points[0]},null,8,["position"]),Y(j(ah),_r({path:t.points,"onUpdate:path":c[0]||(c[0]=f=>t.points=f),"stroke-color":"#f00","stroke-opacity":t.strokeOpacity,editable:t.editable},a.value,{onPathEdited:j(r).eventLog,onX_lineupdate:j(r).eventLog}),null,16,["path","stroke-opacity","editable","onPathEdited","onX_lineupdate"]),Y(j(_f),{paths:e.value,"onUpdate:paths":c[1]||(c[1]=f=>e.value=f),editable:t.editable,onX_lineupdate:j(r).eventLog},null,8,["paths","editable","onX_lineupdate"]),Y(j(n1),{center:o.value,"onUpdate:center":c[2]||(c[2]=f=>o.value=f),radius:t.radius,"onUpdate:radius":c[3]||(c[3]=f=>t.radius=f),"stroke-weight":t.bold?20:10,editable:t.editable,onX_lineupdate:j(r).eventLog},null,8,["center","radius","stroke-weight","editable","onX_lineupdate"]),Y(j(a1),{bounds:s.value,"onUpdate:bounds":c[4]||(c[4]=f=>s.value=f),editable:t.editable,"stroke-weight":t.bold?20:10,"stroke-color":"blue","fill-color":"blue","stroke-opacity":t.strokeOpacity,"fill-opacity":t.fillOpacity,onBoundsChanged:j(r).eventLog,onLineupdate:j(r).eventLog},null,8,["bounds","editable","stroke-weight","stroke-opacity","fill-opacity","onBoundsChanged","onLineupdate"]),Y(j($r),{position:o.value,style:{"background-color":"blue",padding:"4px",color:"white"}},{default:ue(()=>c[11]||(c[11]=[ae(" (default) ")])),_:1,__:[11]},8,["position"]),Y(j($r),{"map-pane":"overlay",position:o.value,offset:{x:0,y:-24},style:{"background-color":"green",padding:"4px",color:"white"}},{default:ue(()=>c[12]||(c[12]=[ae(" (overlay) ")])),_:1,__:[12]},8,["position"]),F("div",PL,[F("button",{onClick:l}," Add "),F("button",{onClick:h}," Remove "),c[19]||(c[19]=F("br",null,null,-1)),F("label",null,[Ve(F("input",{"onUpdate:modelValue":c[5]||(c[5]=f=>t.editable=f),type:"checkbox"},null,512),[[bt,t.editable]]),c[13]||(c[13]=ae("可编辑"))]),c[20]||(c[20]=F("br",null,null,-1)),F("label",null,[Ve(F("input",{"onUpdate:modelValue":c[6]||(c[6]=f=>t.bold=f),type:"checkbox"},null,512),[[bt,t.bold]]),c[14]||(c[14]=ae("粗线"))]),c[21]||(c[21]=F("br",null,null,-1)),F("label",null,[Ve(F("input",{"onUpdate:modelValue":c[7]||(c[7]=f=>t.polylineIconsVisible=f),type:"checkbox"},null,512),[[bt,t.polylineIconsVisible]]),c[15]||(c[15]=ae("Polyline图标"))]),c[22]||(c[22]=F("br",null,null,-1)),F("label",null,[c[16]||(c[16]=ae("stroke-opacity")),Ve(F("input",{"onUpdate:modelValue":c[8]||(c[8]=f=>t.strokeOpacity=f),autocomplete:"off",type:"number",min:0,max:1.1,step:.05},null,512),[[Mn,t.strokeOpacity]])]),c[23]||(c[23]=F("br",null,null,-1)),F("label",null,[c[17]||(c[17]=ae("stroke-weight")),Ve(F("input",{"onUpdate:modelValue":c[9]||(c[9]=f=>t.strokeWeight=f),autocomplete:"off",type:"number",min:1,max:100,step:1},null,512),[[Mn,t.strokeWeight]])]),c[24]||(c[24]=F("br",null,null,-1)),F("label",null,[c[18]||(c[18]=ae("fill-opacity")),Ve(F("input",{"onUpdate:modelValue":c[10]||(c[10]=f=>t.fillOpacity=f),autocomplete:"off",type:"number",min:0,max:1.1,step:.05},null,512),[[Mn,t.fillOpacity]])])])]),_:1},8,["type","center"]))}}),SL={style:{"background-color":"white","text-align":"start"}},OL={style:{background:"red",padding:"8px"}},kL=ke({__name:"TalksDemo",setup(n){const{mapBindValues:r}=Sg({defaultCenter:ki[4],defaultZoom:12}),t=[...LA],i=xr(ki.map(s=>({position:s,show:!0})));kl(()=>{console.log("markers可见性",i.map(s=>s.show))});const e=[{size:53,len:0},{size:56,len:3},{size:90,len:6}].map((s,a)=>({url:`clusters/m${a+1}.png`,size:{width:s.size,height:s.size},textColor:"red",textSize:11,minMarkersLength:s.len})),o=qe(!0);return(s,a)=>(he(),Ue(j(Nt),b1(G_(j(r))),{overlay:ue(()=>[Y(ti),F("div",SL,[ae(" zoom: "+Ae(j(r).zoom),1),a[8]||(a[8]=F("br",null,null,-1)),ae(" center: "+Ae(j(r).center)+" ",1),a[9]||(a[9]=F("br",null,null,-1)),F("label",null,[Ve(F("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l),type:"checkbox"},null,512),[[bt,o.value]]),a[7]||(a[7]=ae(" disableAutoPan "))])])]),default:ue(()=>[Y(j(i1)),Y(j(Mg)),Y(j(ot),{position:t[0],icon:j(tr)[3]},null,8,["position","icon"]),Y(j(ot),{position:t[0],title:"title",onClick:console.log},null,8,["position","onClick"]),Y(j(ot),{position:t[1],clickable:!1},null,8,["position"]),Y(j(ot),{position:t[1],icon:j(tr)[2]},null,8,["position","icon"]),Y(j(As),{show:!0,position:t[1],"disable-auto-pan":o.value},{default:ue(()=>a[1]||(a[1]=[ae(" 未关联marker的infoBox ")])),_:1,__:[1]},8,["position","disable-auto-pan"]),Y(j(ot),{position:t[2],label:{text:"LABEL"},icon:j(tr)[0]},{default:ue(()=>[Y(j(As),{show:!0,"disable-auto-pan":o.value},{default:ue(()=>a[2]||(a[2]=[ae(" 关联marker的infoBox 关联marker的infoBox 关联marker的infoBox 关联marker的infoBox 关联marker的infoBox 关联marker的infoBox 关联marker的infoBox ")])),_:1,__:[2]},8,["disable-auto-pan"])]),_:1},8,["position","icon"]),Y(j($r),{position:t[2],onClick:console.log},{default:ue(()=>a[3]||(a[3]=[F("div",{style:{"background-color":"#fffa",border:"1px solid black","border-radius":"8px",padding:"4px"}}," HTML LABEL ",-1)])),_:1,__:[3]},8,["position","onClick"]),Y(j($r),{style:{"background-color":"red",color:"white"}},{default:ue(()=>a[4]||(a[4]=[ae(" 未设置position的label ")])),_:1,__:[4]}),Y(j(ot),{position:t[3],icon:j(tr)[5]},{default:ue(()=>[Y(j($r),null,{default:ue(()=>a[5]||(a[5]=[ae(" 关联marker的label ")])),_:1,__:[5]}),Y(j(Eg),{show:!0,"disable-auto-pan":o.value},{default:ue(()=>a[6]||(a[6]=[ae(" 关联marker的infoWindow ")])),_:1,__:[6]},8,["disable-auto-pan"])]),_:1},8,["position","icon"]),Y(j(ah),{path:t}),Y(j(ah),{path:j(vr).subarray(t,-1,2),"stroke-color":"red","stroke-opacity":.2,"stroke-weight":20},null,8,["path"]),Y(j(_f),{paths:[j(vr).subarray(t,0,3)]},null,8,["paths"]),Y(j(_f),{paths:[j(vr).subarray(t,3,3)],"fill-color":"green","stroke-color":"green","stroke-weight":4},null,8,["paths"]),Y(j(n1),{center:t[0],radius:1e3},null,8,["center"]),Y(j(a1),{bounds:j(Rt).fromArray(t)},null,8,["bounds"]),Y(j(Pg),{styles:j(e)},{default:ue(()=>[(he(!0),xe(We,null,St(i,(l,h)=>(he(),Ue(j(ot),{key:h,position:l.position,onClick:u=>l.show=!0},{default:ue(()=>[Y(j(As),{show:l.show,"onUpdate:show":u=>l.show=u,"disable-auto-pan":o.value},{default:ue(()=>[ae(Ae(h),1)]),_:2},1032,["show","onUpdate:show","disable-auto-pan"]),Y(j($r),null,{default:ue(()=>[F("span",OL,Ae(h),1)]),_:2},1024)]),_:2},1032,["position","onClick"]))),128))]),_:1},8,["styles"])]),_:1},16))}});class RL{constructor(r,t,i,e){P(this,"delegate");this.innerMap=r,this.coordTypeValue=t,this.markerLayer=i,this.overlayLayer=e,this.delegate=new zi(r,this).setTarget(this)}addEventListener(r,t){this.delegate.addEventListener(r,t)}removeEventListener(r,t){this.delegate.removeEventListener(r,t)}get element(){return this.innerMap.getContainer()}get coordType(){return this.coordTypeValue.value}setBuildInMapTypeId(r){throw new Error("Method not implemented.")}setMapType(r){throw new Error("Method not implemented.")}getMapType(){throw new Error("Method not implemented.")}fromContainerPointToLatLng(r){throw new Error("Method not implemented.")}fromLatLngToContainerPoint(r){throw new Error("Method not implemented.")}setDefaultCursor(r){throw new Error("Method not implemented.")}setDraggable(r){throw new Error("Method not implemented.")}setDoubleClickZoom(r){throw new Error("Method not implemented.")}getCenter(){return te.fromTalks(this.innerMap.getCenter(),this.coordType)}setCenter(r){this.innerMap.setCenter(r.toTalks(this.coordType))}getZoom(){return this.innerMap.getZoom()}setZoom(r){this.innerMap.setZoom(r)}setMinZoom(r){this.innerMap.setMinZoom(r)}setMaxZoom(r){this.innerMap.setMaxZoom(r)}panTo(r){throw new Error("Method not implemented.")}panBy(r,t){throw new Error("Method not implemented.")}fitBounds(r,t){throw new Error("Method not implemented.")}getBounds(){throw new Error("Method not implemented.")}createAutocomplete(r){throw new Error("Method not implemented.")}createSearchBox(r){throw new Error("Method not implemented.")}createPlacesService(r){throw new Error("Method not implemented.")}createMapUrls(r){throw new Error("Method not implemented.")}}const AL=ke({name:"tg-marker2",inheritAttrs:!1,props:o1,emits:void 0,slots:{},setup:(n,{slots:r})=>{const{onCreate:t,onDestroy:i,map:e}=Ia();let o=void 0;return t(()=>{o=new et(n.position.toTalks(e.coordType),{visible:n.visible??!0,cursor:n.cursor,zIndex:n.zIndex}),e.markerLayer.addGeometry(o)}),i(()=>{e.markerLayer.removeGeometry(o)}),tt(()=>n.visible,s=>Gr.setVisible(o,s??!0)),tt(()=>n.zIndex,s=>o.setZIndex(s??0)),tt(()=>n.cursor,s=>o.setOptions({cursor:s})),tt(()=>n.position,s=>o.setCoordinates(s.toTalks(e.coordType))),r.default??jo}}),LL="#000",IL=.3,DL=ke({name:"tg-polygon2",inheritAttrs:!1,props:s1,emits:void 0,setup:n=>{const{map:r,onCreate:t,onDestroy:i}=Ia(),e=wt(()=>n.paths.map(a=>a.map(l=>l.toTalks(r.coordType)))),o=wt(()=>({lineColor:n.strokeColor,lineWidth:n.strokeWeight,polygonFill:n.fillColor??LL,polygonOpacity:n.fillOpacity??IL}));let s=void 0;return t(()=>{s=new it(e.value,{visible:n.visible??!0,zIndex:n.zIndex,symbol:o.value}),r.overlayLayer.addGeometry(s)}),i(()=>{r.overlayLayer.removeGeometry(s)}),tt(()=>n.visible,a=>Gr.setVisible(s,a??!0)),tt(()=>n.zIndex,a=>s.setZIndex(a??0)),tt(e,a=>s.setCoordinates(a)),tt(o,a=>s.setSymbol(a)),jo}}),zL=ke({name:"tg-map2",inheritAttrs:!1,props:e1,emits:void 0,slots:{},setup:(n,{attrs:r,slots:t,emit:i})=>{const e=di(r,n),o=qe(),s=qe(),a=km(n,"zoom",i),l=km(n,"center",i),h=n.type,u=wt(()=>{switch(h){case Ye.googleFree:return"google";case Ye.baiduFree:return"baidu";case Ye.here:return"bing";case Ye.talks:return qh().talks.layerId||"bing";default:return h}}),c=wt(()=>qw(u.value));C_(iu,s);let f;return ya(()=>{if(!o.value)return;const d=Xk.map(_=>Kw(_,{visible:_===u.value})),g=new Lr("markers"),p=new Lr("overlays"),m=new Se(o.value,{attribution:!n.hideLogo,baseLayer:new Sd("base",d),layers:[p,g],center:n.center.toTalks(c.value),zoom:n.zoom,minZoom:n.minZoom,maxZoom:n.maxZoom});s.value=kf(new RL(m,c,g,p));const v=e.value;if(fi(v.listeners,s.value),i("load",s.value),v.listenerProps["update:last-center"]&&console.error("update:last-center事件已废弃, 请使用 update:center 替代"),v.listenerProps["update:current-center"]&&console.error("update:current-center事件已废弃, 请使用 update:center + centerSyncDelay=0 替代"),v.listenerProps["update:center"]){const _=()=>{l.value=te.fromTalks(m.getCenter(),c.value)};m.on(zi.EVENT_TYPE_MAP["center-changed"],()=>{n.centerSyncDelay>0?(clearTimeout(f),f=setTimeout(_,n.centerSyncDelay)):_()})}v.listenerProps["update:zoom"]&&m.on(zi.EVENT_TYPE_MAP["zoom-changed"],()=>{a.value=m.getZoom()}),tt(u,_=>d.forEach(y=>Gr.setVisible(y,y.getId()===_))),tt([a,l],([_,y],[w,x])=>{const C=_!==w,b=y!==x;C&&b?m.setCenterAndZoom(y.toTalks(c.value),_):C?m.setZoom(_):b&&m.setCenter(y.toTalks(c.value))}),tt(()=>n.minZoom,_=>_!=null&&m.setMinZoom(_)),tt(()=>n.maxZoom,_=>_!=null&&m.setMaxZoom(_)),tt(()=>n.hideLogo,_=>m.setOptions({attribution:!_}))}),yh(()=>{s.value&&e.value.listenerProps["update:center"]&&(clearTimeout(f),l.value=s.value.getCenter())}),()=>{var d,g;return Y("div",_r({class:"tg-map"},e.value.binds),[Y("div",{ref:o,class:"tg-map__map"},[ae(" ")]),s.value&&((d=t.default)==null?void 0:d.call(t)),(g=t.overlay)==null?void 0:g.call(t)])}}}),BL={style:{"background-color":"white","text-align":"start"}},GL=ke({__name:"V2Demo",setup(n){const{map:r,mapBindValues:t}=Sg({}),i=[[...Ut]];return tt(r,()=>{r.value&&console.log(r.value)}),(e,o)=>(he(),Ue(j(zL),_r(j(t),{class:"abs-container"}),{overlay:ue(()=>[Y(ti),F("div",BL,[ae(" zoom: "+Ae(j(t).zoom),1),o[0]||(o[0]=F("br",null,null,-1)),ae(" center: "+Ae(j(t).center),1)])]),default:ue(()=>[(he(!0),xe(We,null,St(j(Ut),(s,a)=>(he(),Ue(j(AL),{key:a,position:s},{default:ue(()=>o[1]||(o[1]=[ae(" marker ")])),_:2,__:[1]},1032,["position"]))),128)),Y(j(DL),{paths:i})]),_:1},16))}}),FL={},NL={style:{width:"100vw",height:"100vh","background-color":"gray",position:"relative",display:"block"}};function HL(n,r){return he(),xe("div",NL,r[0]||(r[0]=[F("div",{class:"parent"},[F("div",{class:"child"}),F("div",{class:"child2"}),ae(" child3 ")],-1),ae(" text ")]))}const jL=nt(FL,[["render",HL],["__scopeId","data-v-4925c329"]]),ZL={class:"singleline",style:{}},VL=ke({name:"lifecycle-bug-item",__name:"Item",setup(n){let r="init";const t=console.log.bind(console),i=console.warn.bind(console);return m_(()=>{(r==="init"?t:i)(r.padEnd(16),"=>",r="onBeforeMount")}),ya(()=>{(r==="onBeforeMount"?t:i)(r.padEnd(16),"=>",r="onMounted")}),_h(()=>{(r==="onMounted"?t:i)(r.padEnd(16),"=>",r="onBeforeUnmount")}),yh(()=>{(r==="onBeforeUnmount"?t:i)(r.padEnd(16),"=>",r="onUnmounted")}),(e,o)=>(he(),xe("div",ZL,Ae(e.$attrs),1))}}),WL={key:0},$L=ke({name:"lifecycle-bug-modal",__name:"Modal",props:{visible:{type:Boolean}},setup(n,{expose:r}){const t=n,i=qe(!1);return tt(()=>t.visible,e=>{i.value=e},{immediate:!1}),r({effectiveVisible:i}),(e,o)=>e.visible?(he(),xe("div",WL,[Jt(e.$slots,"default")])):on("",!0)}}),UL=["onClick"],JL=ke({name:"lifecycle-bug",__name:"index",setup(n){const r=Array.from({length:10},(h,u)=>u),t=qe([]),i=qe(),e=qe(!1),o=qe(),s=wt(()=>t.value.filter(h=>{var u;return!((u=o.value)!=null&&u.effectiveVisible)||h!==i.value}));function a(h){console.log(`open: ${h}`),i.value=h,e.value=!0,t.value.includes(h)||t.value.push(h)}function l(){console.log("close"),e.value=!1}return(h,u)=>(he(),xe("div",null,[(he(!0),xe(We,null,St(j(r),c=>(he(),xe("button",{key:c,onClick:f=>a(c)},"open:"+Ae(c),9,UL))),128)),u[2]||(u[2]=F("br",null,null,-1)),F("button",{onClick:l},"close"),F("div",null,[u[0]||(u[0]=ae(" showing: ")),Y($L,{ref_key:"modelRef",ref:o,visible:e.value},{default:ue(()=>[ae(Ae(i.value),1)]),_:1},8,["visible"])]),F("div",null,[u[1]||(u[1]=ae(" list: ")),(he(!0),xe(We,null,St(s.value,c=>(he(),Ue(VL,{key:c,value:c},null,8,["value"]))),128))])]))}}),XL=ke({__name:"LifecycleBugDemo",setup(n){return(r,t)=>(he(),Ue(JL))}}),YL=ke({__name:"ReactiveDemo",setup(n){const r=qe({}),t=qe({enabled:!0});r.value.state=t;const i=tx(r.value.state);function e(){r.value.state={enabled:!1}}function o(){r.value.state=qe({enabled:!1})}function s(a){return(l,h)=>{console.info(`${a}:`,JSON.stringify(h,void 0,0))}}return tt(()=>r,s("store"),{deep:!0}),tt(()=>t,s("state"),{deep:!0}),(a,l)=>(he(),xe("div",null,[F("div",null,[ae(" store: "+Ae(r.value)+" ",1),Ve(F("input",{"onUpdate:modelValue":l[0]||(l[0]=h=>r.value.state.enabled=h),type:"checkbox"},null,512),[[bt,r.value.state.enabled]])]),F("div",null,[ae(" state: "+Ae(t.value)+" ",1),Ve(F("input",{"onUpdate:modelValue":l[1]||(l[1]=h=>t.value.enabled=h),type:"checkbox"},null,512),[[bt,t.value.enabled]])]),F("div",null,[ae(" stateRefs: "+Ae(j(i))+" ",1),Ve(F("input",{"onUpdate:modelValue":l[2]||(l[2]=h=>j(i).enabled.value=h),type:"checkbox"},null,512),[[bt,j(i).enabled.value]])]),F("button",{onClick:e}," resetByObject "),F("button",{onClick:o}," resetByRef ")]))}});class qL{constructor(r){P(this,"route");P(this,"currentRoute",wt(()=>({...this.route,matched:[this.route]})));this.routes=r,this.route=xr({fullPath:location.hash.slice(1)}),window.addEventListener("hashchange",()=>{this.route.fullPath=location.hash.slice(1)})}getRoutes(){return Object.entries(this.routes).map(([r,t])=>({path:r,name:t}))}}const Lm=ke({name:"router-view",computed:{component(){const n=this.$router.routes[this.$router.route.fullPath]||"404";return document.title=n,Object.assign({"../views/404.vue":DR,"../views/Main.vue":MA,"../views/map/ControlDemo.vue":NA,"../views/map/HeatmapDemo.vue":ZA,"../views/map/InfoDemo.vue":YA,"../views/map/MapDemo.vue":rL,"../views/map/MapTypeDemo.vue":sL,"../views/map/MapUrlsDemo.vue":aL,"../views/map/MarkerDemo.vue":vL,"../views/map/MultiMapDemo.vue":_L,"../views/map/OverlayDemo.vue":CL,"../views/map/PlaceDemo.vue":ML,"../views/map/ShapeDemo.vue":EL,"../views/map/TalksDemo.vue":kL,"../views/map/V2Demo.vue":GL,"../views/others/CssPositionDemo.vue":jL,"../views/others/LifecycleBugDemo.vue":XL,"../views/others/ReactiveDemo.vue":YL})[`../views/${n}.vue`]},routes(){return this.$router.routes}},render(){return j_(this.component)}}),KL={install(n,r){n.component(Lm.name,Lm),Object.defineProperties(n.config.globalProperties,{$router:{get(){return r.router}},$route:{get(){return r.router.route}}})}};function QL(){const n=Object.assign({"../views/404.vue":()=>Et(()=>import("./404-D34FYbNB.js"),[]).then(r=>r.default),"../views/Main.vue":()=>Et(()=>import("./Main-DGU58I8w.js"),[]).then(r=>r.default),"../views/map/ControlDemo.vue":()=>Et(()=>import("./ControlDemo-BvElkDpq.js"),[]).then(r=>r.default),"../views/map/HeatmapDemo.vue":()=>Et(()=>import("./HeatmapDemo-CKEH0W3g.js"),[]).then(r=>r.default),"../views/map/InfoDemo.vue":()=>Et(()=>import("./InfoDemo-BSp_czCk.js"),[]).then(r=>r.default),"../views/map/MapDemo.vue":()=>Et(()=>import("./MapDemo-Z4UTQNq5.js"),[]).then(r=>r.default),"../views/map/MapTypeDemo.vue":()=>Et(()=>import("./MapTypeDemo-bv5WPraY.js"),[]).then(r=>r.default),"../views/map/MapUrlsDemo.vue":()=>Et(()=>import("./MapUrlsDemo-D0075XSg.js"),[]).then(r=>r.default),"../views/map/MarkerDemo.vue":()=>Et(()=>import("./MarkerDemo-D9YK-9Js.js"),[]).then(r=>r.default),"../views/map/MultiMapDemo.vue":()=>Et(()=>import("./MultiMapDemo-D-BWUDR1.js"),[]).then(r=>r.default),"../views/map/OverlayDemo.vue":()=>Et(()=>import("./OverlayDemo-BtSawKbN.js"),[]).then(r=>r.default),"../views/map/PlaceDemo.vue":()=>Et(()=>import("./PlaceDemo-DswQxAPt.js"),[]).then(r=>r.default),"../views/map/ShapeDemo.vue":()=>Et(()=>import("./ShapeDemo-CX9Jwa7y.js"),[]).then(r=>r.default),"../views/map/TalksDemo.vue":()=>Et(()=>import("./TalksDemo-D0da45jA.js"),[]).then(r=>r.default),"../views/map/V2Demo.vue":()=>Et(()=>import("./V2Demo-vX7YCqCc.js"),[]).then(r=>r.default),"../views/others/CssPositionDemo.vue":()=>Et(()=>import("./CssPositionDemo-DbSCIYVw.js"),[]).then(r=>r.default),"../views/others/LifecycleBugDemo.vue":()=>Et(()=>import("./LifecycleBugDemo-Bldh5GGg.js"),[]).then(r=>r.default),"../views/others/ReactiveDemo.vue":()=>Et(()=>import("./ReactiveDemo-D5H5d9dh.js"),[]).then(r=>r.default)});return Cr.fromEntries(Object.keys(n).map(r=>{const t=r.slice(9,-4);return[`/${t}`,t]}))}const e2=new qL({"":"Main","/":"Main",...QL()}),Da=HC(VC);hk();Da.use(kR,{google:{key:""},baidu:{key:""},here:{key:""},talks:{layerId:void 0}});Da.use(OR,{nameRegex:/.*/,enable:!0,hookNames:["onCreate","onDestroy"]});Da.use(KL,{router:e2});Da.use(EA,{});Da.mount("#app");
|
|
352
|
-
//# sourceMappingURL=index-DkG0ZlIx.js.map
|