@zhnyfe/zhnyfe_xnom 0.0.0-alpha.13 → 0.0.0-alpha.14
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/sdk.common.js +1 -1
- package/dist/sdk.esm.js +11 -6
- package/package.json +1 -1
package/dist/sdk.common.js
CHANGED
|
@@ -41,4 +41,4 @@ object-assign
|
|
|
41
41
|
* LICENSE: MIT
|
|
42
42
|
* (c) 2019-2019 https://github.com/sakitam-gis/kriging.js
|
|
43
43
|
*/
|
|
44
|
-
function Hx(t){return Math.max.apply(null,t)}function Zx(t){return Math.min.apply(null,t)}function Kx(t,e){for(var n=[],r=0;r<e;r++)n.push(t);return n}function Jx(t,e,n){for(var r=0,i=t.length-1,o=!1,s=t.length;r<s;i=r++)t[r][1]>n!=t[i][1]>n&&e<(t[i][0]-t[r][0])*(n-t[r][1])/(t[i][1]-t[r][1])+t[r][0]&&(o=!o);return o}function $x(t,e){for(var n=0,r=Kx(0,e*e);n<e;n++)r[n*e+n]=t;return r}function Qx(t,e,n){for(var r,i=0,o=Array(n*e);i<e;i++)for(r=0;r<n;r++)o[r*e+i]=t[i*n+r];return o}function tw(t,e,n,r){for(var i,o=0,s=Array(n*r);o<n;o++)for(i=0;i<r;i++)s[o*r+i]=t[o*r+i]+e[o*r+i];return s}function ew(t,e,n,r,i){for(var o,s,a=0,u=Array(n*i);a<n;a++)for(o=0;o<i;o++)for(u[a*i+o]=0,s=0;s<r;s++)u[a*i+o]+=t[a*r+s]*e[s*i+o];return u}function nw(t,e){var n,r,i,o=Array(e);for(n=0;n<e;n++)o[n]=t[n*e+n];for(n=0;n<e;n++){for(r=0;r<n;r++)o[n]-=t[n*e+r]*t[n*e+r];if(o[n]<=0)return!1;for(o[n]=Math.sqrt(o[n]),r=n+1;r<e;r++){for(i=0;i<n;i++)t[r*e+n]-=t[r*e+i]*t[n*e+i];t[r*e+n]/=o[n]}}for(n=0;n<e;n++)t[n*e+n]=o[n];return!0}function rw(t,e){var n,r,i,o;for(n=0;n<e;n++)for(t[n*e+n]=1/t[n*e+n],r=n+1;r<e;r++){for(o=0,i=n;i<r;i++)o-=t[r*e+i]*t[i*e+n];t[r*e+n]=o/t[r*e+r]}for(n=0;n<e;n++)for(r=n+1;r<e;r++)t[n*e+r]=0;for(n=0;n<e;n++){for(t[n*e+n]*=t[n*e+n],i=n+1;i<e;i++)t[n*e+n]+=t[i*e+n]*t[i*e+n];for(r=n+1;r<e;r++)for(i=r;i<e;i++)t[n*e+r]+=t[i*e+n]*t[i*e+r]}for(n=0;n<e;n++)for(r=0;r<n;r++)t[n*e+r]=t[r*e+n]}function iw(t,e){var n,r,i,o,s,a,u,l,c,h=e,f=Array(e*e),p=Array(e),d=Array(e),g=Array(e),y=0,v=0;for(n=0;n<e;n++)for(r=0;r<e;r++)f[n*e+r]=n===r?1:0;for(r=0;r<e;r++)g[r]=0;for(n=0;n<e;n++){for(a=0,r=0;r<e;r++)if(1!==g[r])for(i=0;i<e;i++)0===g[i]&&Math.abs(t[r*e+i])>=a&&(a=Math.abs(t[r*e+i]),v=r,y=i);if(++g[y],v!==y){for(o=0;o<e;o++)c=t[v*e+o],t[v*e+o]=t[y*e+o],t[y*e+o]=c;for(o=0;o<h;o++)c=f[v*e+o],f[v*e+o]=f[y*e+o],f[y*e+o]=c}if(d[n]=v,p[n]=y,0===t[y*e+y])return!1;for(l=1/t[y*e+y],t[y*e+y]=1,o=0;o<e;o++)t[y*e+o]*=l;for(o=0;o<h;o++)f[y*e+o]*=l;for(s=0;s<e;s++)if(s!==y){for(u=t[s*e+y],t[s*e+y]=0,o=0;o<e;o++)t[s*e+o]-=t[y*e+o]*u;for(o=0;o<h;o++)f[s*e+o]-=f[y*e+o]*u}}for(o=e-1;o>=0;o--)if(d[o]!==p[o])for(i=0;i<e;i++)c=t[i*e+d[o]],t[i*e+d[o]]=t[i*e+p[o]],t[i*e+p[o]]=c;return!0}function ow(t,e,n,r,i){return e+(r-e)/n*(1-Math.exp(-1/i*Math.pow(t/n,2)))}function sw(t,e,n,r,i){return e+(r-e)/n*(1-Math.exp(-1/i*(t/n)))}function aw(t,e,n,r){return t>n?e+(r-e)/n:e+(r-e)/n*(t/n*1.5-.5*Math.pow(t/n,3))}function uw(t,e,n){var r,i=Array(n.n);for(r=0;r<n.n;r++)i[r]=n.model(Math.pow(Math.pow(t-n.x[r],2)+Math.pow(e-n.y[r],2),.5),n.nugget,n.range,n.sill,n.A);return ew(i,n.M,1,n.n,1)[0]}var lw={train:function(t,e,n,r,i,o){var s,a,u,l,c={t:t,x:e,y:n,nugget:0,range:0,sill:0,A:1/3,n:0,model:sw,K:[],M:[]};switch(r){case"gaussian":c.model=ow;break;case"exponential":default:c.model=sw;break;case"spherical":c.model=aw}var h=t.length,f=Array((h*h-h)/2);for(s=0,u=0;s<h;s++)for(a=0;a<s;a++,u++)f[u]=Array(2),f[u][0]=Math.pow(Math.pow(e[s]-e[a],2)+Math.pow(n[s]-n[a],2),.5),f[u][1]=Math.abs(t[s]-t[a]);f.sort(function(t,e){return t[0]-e[0]}),c.range=f[(h*h-h)/2-1][0];var p=(h*h-h)/2>30?30:(h*h-h)/2,d=c.range/p,g=Kx(0,p),y=Kx(0,p);if(p<30)for(l=0;l<p;l++)g[l]=f[l][0],y[l]=f[l][1];else{for(s=0,a=0,u=0,l=0;s<p&&a<(h*h-h)/2;s++,u=0){for(;f[a][0]<=(s+1)*d&&(g[l]+=f[a][0],y[l]+=f[a][1],u++,!(++a>=(h*h-h)/2)););u>0&&(g[l]/=u,y[l]/=u,l++)}if(l<2)return c}h=l,c.range=g[h-1]-g[0];var v=Kx(1,2*h),_=Array(h),m=c.A;for(s=0;s<h;s++){switch(r){case"gaussian":v[2*s+1]=1-Math.exp(-1/m*Math.pow(g[s]/c.range,2));break;case"exponential":v[2*s+1]=1-Math.exp(-1/m*g[s]/c.range);break;case"spherical":v[2*s+1]=g[s]/c.range*1.5-.5*Math.pow(g[s]/c.range,3)}_[s]=y[s]}var x=Qx(v,h,2),w=ew(x,v,2,h,2),b=(w=tw(w,$x(1/o,2),2,2)).slice(0);nw(w,2)?rw(w,2):(iw(b,2),w=b);var E=ew(ew(w,x,2,2,h),_,2,h,1);c.nugget=E[0],c.sill=E[1]*c.range+c.nugget,c.n=e.length,h=e.length;var C=Array(h*h);for(s=0;s<h;s++){for(a=0;a<s;a++)C[s*h+a]=c.model(Math.pow(Math.pow(e[s]-e[a],2)+Math.pow(n[s]-n[a],2),.5),c.nugget,c.range,c.sill,c.A),C[a*h+s]=C[s*h+a];C[s*h+s]=c.model(0,c.nugget,c.range,c.sill,c.A)}var S=tw(C,$x(i,h),h,h),P=S.slice(0);nw(S,h)?rw(S,h):(iw(P,h),S=P);var I=S.slice(0),M=ew(S,t,h,h,1);return c.K=I,c.M=M,c},predict:uw,variance:function(t,e,n){var r,i=Array(n.n);for(r=0;r<n.n;r++)i[r]=n.model(Math.pow(Math.pow(t-n.x[r],2)+Math.pow(e-n.y[r],2),.5),n.nugget,n.range,n.sill,n.A);var o=ew(ew(i,n.K,1,n.n,n.n),i,1,n.n,1)[0];return n.model(0,n.nugget,n.range,n.sill,n.A)+o},grid:function(t,e,n){var r,i,o,s=t.length;if(0!==s){var a,u,l=[t[0][0][0],t[0][0][0]],c=[t[0][0][1],t[0][0][1]];for(r=0;r<s;r++)for(i=0;i<t[r].length;i++)t[r][i][0]<l[0]&&(l[0]=t[r][i][0]),t[r][i][0]>l[1]&&(l[1]=t[r][i][0]),t[r][i][1]<c[0]&&(c[0]=t[r][i][1]),t[r][i][1]>c[1]&&(c[1]=t[r][i][1]);var h=Array(2),f=Array(2),p=Array(2),d=Array(2),g=Math.ceil((l[1]-l[0])/n),y=Math.ceil((c[1]-c[0])/n),v=Array(g+1);for(r=0;r<=g;r++)v[r]=Array(y+1);for(r=0;r<s;r++){for(p[0]=t[r][0][0],p[1]=p[0],d[0]=t[r][0][1],d[1]=d[0],i=1;i<t[r].length;i++)t[r][i][0]<p[0]&&(p[0]=t[r][i][0]),t[r][i][0]>p[1]&&(p[1]=t[r][i][0]),t[r][i][1]<d[0]&&(d[0]=t[r][i][1]),t[r][i][1]>d[1]&&(d[1]=t[r][i][1]);for(h[0]=Math.floor((p[0]-(p[0]-l[0])%n-l[0])/n),h[1]=Math.ceil((p[1]-(p[1]-l[1])%n-l[0])/n),f[0]=Math.floor((d[0]-(d[0]-c[0])%n-c[0])/n),f[1]=Math.ceil((d[1]-(d[1]-c[1])%n-c[0])/n),i=h[0];i<=h[1];i++)for(o=f[0];o<=f[1];o++)a=l[0]+i*n,u=c[0]+o*n,Jx(t[r],a,u)&&(v[i][o]=uw(a,u,e))}return{xlim:l,ylim:c,width:n,data:v,zlim:[Zx(e.t),Hx(e.t)]}}},plot:function(t,e,n,r,i){var o=t.getContext("2d"),s=e.data,a=e.zlim,u=e.width;if(o){o.clearRect(0,0,t.width,t.height);var l=[n[1]-n[0],r[1]-r[0],a[1]-a[0]],c=void 0,h=void 0,f=void 0,p=void 0,d=void 0,g=s.length,y=s[0].length,v=Math.ceil(u*t.width/(n[1]-n[0])),_=Math.ceil(u*t.height/(r[1]-r[0]));for(c=0;c<g;c++)for(h=0;h<y;h++)void 0!==s[c][h]&&(f=t.width*(c*u+e.xlim[0]-n[0])/l[0],p=t.height*(1-(h*u+e.ylim[0]-r[0])/l[1]),(d=(s[c][h]-a[0])/l[2])<0&&(d=0),d>1&&(d=1),o.fillStyle=i[Math.floor((i.length-1)*d)],o.fillRect(Math.round(f-v/2),Math.round(p-_/2),v,_))}},max:Hx,min:Zx,pip:Jx,rep:Kx,matrixDiag:$x,matrixTranspose:Qx,matrixAdd:tw,matrixMultiply:ew,matrixChol:nw,matrixChol2inv:rw,matrixSolve:iw,variogramGaussian:ow,variogramExponential:sw,variogramSpherical:aw},cw=lw;function hw(t){return hw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hw(t)}function fw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,dw(r.key),r)}}function pw(t,e,n){return(e=dw(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dw(t){var e=function(t,e){if("object"!=hw(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=hw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==hw(e)?e:e+""}var gw=function(){return t=function t(e){var n=this;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),pw(this,"source",void 0),pw(this,"getDataForLonlat",function(t){var e=!1,r=ja(t);if(Array.isArray(n.path[0][0]))e=n.path.some(function(t){var e=Ga([t]);return su(r,e)});else{var i=Ga([n.path]);su(r,i)&&(e=!0)}if(!e)return[];var o=n.variogramList;return null==o?void 0:o.map(function(e){return cw.predict(t[0],t[1],e)})}),this.init(e)},e=[{key:"init",value:function(t){if(!t)return new Yx({source:new Gx});if(!Array.isArray(t.data)||t.data.length.length<3)return console.info("数据量太小。"),new Yx({source:new Gx});if(this.calculateVariogram(t.data),t.colors&&(!Array.isArray(t.colors)||t.colors.length<2))return console.info("颜色组不正确。"),new Yx({source:new Gx});var e={};if(t.colors?e.colors=t.colors:e.colors=["#f5222d","#e6fffb","#1677ff"],t.alpha?t.alpha>1?e.alpha=1:t.alpha<0?e.alpha=0:e.alpha=t.alpha:e.alpha=.8,t.width?e.width=t.width:e.width=.1,e.path=t.path,!Array.isArray(e.path))return console.info("范围不正确。"),new Yx({source:new Gx});try{Array.isArray(e.path[0][0])||(e.path=[e.path])}catch(t){return console.error("路径不正确。"),!1}this.path=e.path;var n=[],r=[],i=[];t.data.forEach(function(t){n.push(parseFloat(t.value)),r.push(parseFloat(t.lon)),i.push(parseFloat(t.lat))});var o=cw.train(n,r,i,"exponential",0,100);this.kriging=cw,this.mode=o;var s=cw.grid(e.path,o,e.width),a=new Gx({canvasFunction:function(t,n,r,i,o){var a=document.createElement("canvas");return a.width=i[0],a.height=i[1],a.style.display="block",cw.plot(a,s,[t[0],t[2]],[t[1],t[3]],e.colors),a},projection:dv});this.source=a;var u=new Yx({name:t.name,source:a,zIndex:t.zIndex,opacity:e.alpha});return u.getDataForLonlat=this.getDataForLonlat,u}},{key:"calculateVariogram",value:function(t){var e=[],n=[],r=[],i=[],o=[],s=[];t.forEach(function(t){e.push(parseFloat(t.value)),r.push(parseFloat(t.currentValue)),n.push(parseFloat(t.hisValue)),i.push(+new Date(t.updateTime)),o.push(parseFloat(t.lon)),s.push(parseFloat(t.lat))});var a=cw.train(r,o,s,"exponential",0,100),u=cw.train(n,o,s,"exponential",0,100),l=cw.train(e,o,s,"exponential",0,100),c=cw.train(i,o,s,"exponential",0,100);this.variogramList=[a,u,l,c]}}],e&&fw(t.prototype,e),n&&fw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),yw={Tile:bx,Vector:pv,KrigingLayer:gw},vw=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_w=0,mw=1,xw=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),render:r.render})||this).dragListenerKeys_=[],n.currentResolution_=void 0,n.direction_=_w,n.dragging_,n.heightLimit_=0,n.widthLimit_=0,n.startX_,n.startY_,n.thumbSize_=null,n.sliderInitialized_=!1,n.duration_=void 0!==r.duration?r.duration:200;var i=void 0!==r.className?r.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=i+"-thumb "+on;var s=n.element;return s.className=i+" "+on+" "+sn,s.appendChild(o),s.addEventListener(ar,n.handleDraggerStart_.bind(n),!1),s.addEventListener(sr,n.handleDraggerDrag_.bind(n),!1),s.addEventListener(ur,n.handleDraggerEnd_.bind(n),!1),s.addEventListener(ne,n.handleContainerClick_.bind(n),!1),o.addEventListener(ne,Ut,!1),n}return vw(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,n=t.offsetHeight;if(0===e&&0===n)return this.sliderInitialized_=!1;var r=getComputedStyle(t);e-=parseFloat(r.paddingRight)+parseFloat(r.paddingLeft),n-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);var i=t.firstElementChild,o=getComputedStyle(i),s=i.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),a=i.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);return this.thumbSize_=[s,a],e>n?(this.direction_=mw,this.widthLimit_=e-s):(this.direction_=_w,this.heightLimit_=n-a),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),n=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),r=this.getResolutionForPosition_(n),i=e.getConstrainedZoom(e.getZoomForResolution(r));e.animateInternal({zoom:i,duration:this.duration_,easing:Gi})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){var n=this.handleDraggerDrag_,r=this.handleDraggerEnd_,i=this.getMap().getOwnerDocument();this.dragListenerKeys_.push(ce(i,sr,n,this),ce(i,ur,r,this))}}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,n=t.clientY-this.startY_,r=this.getRelativePosition_(e,n);this.currentResolution_=this.getResolutionForPosition_(r),this.getMap().getView().setResolution(this.currentResolution_)}},e.prototype.handleDraggerEnd_=function(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(fe),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),n=this.element.firstElementChild;this.direction_==mw?n.style.left=this.widthLimit_*e+"px":n.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return wt(this.direction_===mw?t/this.widthLimit_:e/this.heightLimit_,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){return wt(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},e.prototype.render=function(t){if(t.frameState&&(this.sliderInitialized_||this.initSlider_())){var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},e}(as),ww=xw;function bw(t){return bw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bw(t)}function Ew(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Cw(t,e,n){return(e=Pw(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pw(r.key),r)}}function Pw(t){var e=function(t,e){if("object"!=bw(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=bw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==bw(e)?e:e+""}function Iw(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mw(t,e){return t.get(Ow(t,e))}function Ow(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Lw=new WeakMap,Rw=new WeakSet,kw=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Iw(n=this,r=Rw),r.add(n),function(t,e,n){Iw(t,e),e.set(t,n)}(this,Lw,void 0),this.init(Ow(Rw,this,Tw).call(this,e))},e=[{key:"init",value:function(t){t.zoomBtn&&this.initZoomBtn(t.zoomBtnClassName),t.zoomBar&&this.initZoomBar(t.zoomBarClassName)}},{key:"initZoomBtn",value:function(t){this.zoomBtn=new ys({className:t})}},{key:"initZoomBar",value:function(t){this.zoomBar=new ww({className:t})}},{key:"setMap",value:function(t){var e,n,r;Mw(Lw,this)&&(Mw(Lw,this).map.removeControl(this.zoomBtn),Mw(Lw,this).map.removeControl(this.zoomBar)),t&&(n=this,r=t,(e=Lw).set(Ow(e,n),r),this.zoomBtn&&t.map.addControl(this.zoomBtn),this.zoomBar&&t.map.addControl(this.zoomBar))}},{key:"map",get:function(){return Mw(Lw,this)}}],e&&Sw(t.prototype,e),n&&Sw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Tw(t){var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ew(Object(n),!0).forEach(function(e){Cw(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ew(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({zoomBtn:!0,zoomBar:!1},t);return e}var Nw=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Aw=.75,Dw=.1,Fw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Nw(e,t),e.prototype.createRenderer=function(){return new Bn(this)},e}(is),jw=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).boundHandleRotationChanged_=n.handleRotationChanged_.bind(n),n.collapsed_=void 0===r.collapsed||r.collapsed,n.collapsible_=void 0===r.collapsible||r.collapsible,n.collapsible_||(n.collapsed_=!1),n.rotateWithView_=void 0!==r.rotateWithView&&r.rotateWithView,n.viewExtent_=void 0;var i=void 0!==r.className?r.className:"ol-overviewmap",o=void 0!==r.tipLabel?r.tipLabel:"Overview map",s=void 0!==r.collapseLabel?r.collapseLabel:"‹";"string"==typeof s?(n.collapseLabel_=document.createElement("span"),n.collapseLabel_.textContent=s):n.collapseLabel_=s;var a=void 0!==r.label?r.label:"›";"string"==typeof a?(n.label_=document.createElement("span"),n.label_.textContent=a):n.label_=a;var u=n.collapsible_&&!n.collapsed_?n.collapseLabel_:n.label_,l=document.createElement("button");l.setAttribute("type","button"),l.title=o,l.appendChild(u),l.addEventListener(ne,n.handleClick_.bind(n),!1),n.ovmapDiv_=document.createElement("div"),n.ovmapDiv_.className="ol-overviewmap-map",n.view_=r.view,n.ovmap_=new Fw({view:r.view});var c=n.ovmap_;r.layers&&r.layers.forEach(function(t){c.addLayer(t)});var h=document.createElement("div");h.className="ol-overviewmap-box",h.style.boxSizing="border-box",n.boxOverlay_=new Vy({position:[0,0],positioning:"center-center",element:h}),n.ovmap_.addOverlay(n.boxOverlay_);var f=i+" "+on+" "+sn+(n.collapsed_&&n.collapsible_?" "+an:"")+(n.collapsible_?"":" ol-uncollapsible"),p=n.element;p.className=f,p.appendChild(n.ovmapDiv_),p.appendChild(l);var d=n,g=n.boxOverlay_,y=n.boxOverlay_.getElement(),v=function(t){var e,n={clientX:(e=t).clientX,clientY:e.clientY},r=c.getEventCoordinateInternal(n);g.setPosition(r)},_=function(t){var e=c.getEventCoordinateInternal(t);d.getMap().getView().setCenterInternal(e),window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",_)};return y.addEventListener("mousedown",function(){window.addEventListener("mousemove",v),window.addEventListener("mouseup",_)}),n}return Nw(e,t),e.prototype.setMap=function(e){var n=this.getMap();if(e!==n){if(n){var r=n.getView();r&&this.unbindView_(r),this.ovmap_.setTarget(null)}if(t.prototype.setMap.call(this,e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(ce(e,Xt,this.handleMapPropertyChange_,this));var i=e.getView();i&&(this.bindView_(i),i.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}},e.prototype.handleMapPropertyChange_=function(t){if(t.key===xr){var e=t.oldValue;e&&this.unbindView_(e);var n=this.getMap().getView();this.bindView_(n)}else this.ovmap_.isRendered()||t.key!==mr&&t.key!==_r||this.ovmap_.updateSize()},e.prototype.bindView_=function(t){if(!this.view_){var e=new Jo({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(Fr.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()},e.prototype.unbindView_=function(t){t.removeChangeListener(Fr.ROTATION,this.boundHandleRotationChanged_)},e.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},e.prototype.validateExtent_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var n=t.getSize(),r=t.getView().calculateExtentInternal(n);if(!this.viewExtent_||!$(r,this.viewExtent_)){this.viewExtent_=r;var i=e.getSize(),o=e.getView().calculateExtentInternal(i),s=e.getPixelFromCoordinateInternal(pt(r)),a=e.getPixelFromCoordinateInternal(st(r)),u=Math.abs(s[0]-a[0]),l=Math.abs(s[1]-a[1]),c=i[0],h=i[1];u<c*Dw||l<h*Dw||u>c*Aw||l>h*Aw?this.resetExtent_():W(o,r)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,n=t.getSize(),r=t.getView().calculateExtentInternal(n),i=e.getView(),o=Math.log(7.5)/Math.LN2;_t(r,1/(Math.pow(2,o/2)*Dw)),i.fitInternal(Wo(r))},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,n=t.getView();e.getView().setCenterInternal(n.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var n=t.getSize(),r=t.getView(),i=e.getView(),o=this.rotateWithView_?0:-r.getRotation(),s=this.boxOverlay_,a=this.boxOverlay_.getElement(),u=r.getCenterInternal(),l=r.getResolution(),c=i.getResolution(),h=n[0]*l/c,f=n[1]*l/c;if(s.setPosition(u),a){a.style.width=h+"px",a.style.height=f+"px";var p="rotate("+o+"rad)";a.style.transform=p}}},e.prototype.updateBoxAfterOvmapIsRendered_=function(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=he(this.ovmap_,fr,function(t){delete this.ovmapPostrenderKey_,this.updateBox_()},this))},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(an),this.collapsed_?gn(this.collapseLabel_,this.label_):gn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getRotateWithView=function(){return this.rotateWithView_},e.prototype.setRotateWithView=function(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},e.prototype.getOverviewMap=function(){return this.ovmap_},e.prototype.render=function(t){this.validateExtent_(),this.updateBox_()},e}(as),Gw=jw;function Bw(t){return Bw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bw(t)}function zw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Vw(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zw(Object(n),!0).forEach(function(e){Uw(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zw(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Uw(t,e,n){return(e=Xw(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ww(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xw(r.key),r)}}function Xw(t){var e=function(t,e){if("object"!=Bw(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Bw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Bw(e)?e:e+""}function qw(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yw(t,e){return t.get(Hw(t,e))}function Hw(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Zw=new WeakMap,Kw=new WeakSet,Jw=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),qw(n=this,r=Kw),r.add(n),function(t,e,n){qw(t,e),e.set(t,n)}(this,Zw,void 0),this.init(Hw(Kw,this,$w).call(this,e))},e=[{key:"init",value:function(t){this.opts=t}},{key:"setMap",value:function(t){var e,n,r;Yw(Zw,this)&&Yw(Zw,this).map.removeControl(this.overView),this.overView&&(this.overView.setMap(null),this.overView=void 0),t&&(n=this,r=t,(e=Zw).set(Hw(e,n),r),this.overView=new Gw(Vw(Vw({},this.opts),{},{layers:t.layers.map(function(t){return new ey({source:t.getSource()})})})),t.map.addControl(this.overView))}},{key:"map",get:function(){return Yw(Zw,this)}},{key:"isCollapsed",value:function(){return this.overView.getCollapsed()}},{key:"setCollapsed",value:function(t){this.overView.setCollapsed(t)}}],e&&Ww(t.prototype,e),n&&Ww(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function $w(t){return Vw({},t)}var Qw=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),tb="units",eb="degrees",nb="imperial",rb="nautical",ib="metric",ob="us",sb=[1,2,5],ab=25.4/.28,ub=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,n.once,n.un,n.innerElement_=document.createElement("div"),n.innerElement_.className=i+"-inner",n.element.className=i+" "+on,n.element.appendChild(n.innerElement_),n.viewState_=null,n.minWidth_=void 0!==r.minWidth?r.minWidth:64,n.maxWidth_=r.maxWidth,n.renderedVisible_=!1,n.renderedWidth_=void 0,n.renderedHTML_="",n.addChangeListener(tb,n.handleUnitsChanged_),n.setUnits(r.units||ib),n.scaleBar_=r.bar||!1,n.scaleBarSteps_=r.steps||4,n.scaleBarText_=r.text||!1,n.dpi_=r.dpi||void 0,n}return Qw(e,t),e.prototype.getUnits=function(){return this.get(tb)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(tb,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,n=t.projection,r=this.getUnits(),i=r==eb?Nr.DEGREES:Nr.METERS,o=pi(n,t.resolution,e,i),s=this.minWidth_*(this.dpi_||ab)/ab,a=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||ab)/ab:void 0,u=s*o,l="";if(r==eb){var c=Tr[Nr.DEGREES];(u*=c)<c/60?(l="″",o*=3600):u<c?(l="′",o*=60):l="°"}else r==nb?u<.9144?(l="in",o/=.0254):u<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):r==rb?(o/=1852,l="NM"):r==ib?u<.001?(l="μm",o*=1e6):u<1?(l="mm",o*=1e3):u<1e3?l="m":(l="km",o/=1e3):r==ob?u<.9144?(l="in",o*=39.37):u<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):P(!1,33);for(var h,f,p,d,g,y,v,_=3*Math.floor(Math.log(s*o)/Math.log(10));;){p=Math.floor(_/3);var m=Math.pow(10,p);if(h=sb[(_%3+3)%3]*m,f=Math.round(h/o),isNaN(f))return this.element.style.display="none",void(this.renderedVisible_=!1);if(void 0!==a&&f>=a){h=d,f=g,p=y;break}if(f>=s)break;d=h,g=f,y=p,++_}v=this.scaleBar_?this.createScaleBar(f,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=v&&(this.innerElement_.innerHTML=v,this.renderedHTML_=v),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+"px",this.renderedWidth_=f),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,n){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,s="ol-scale-singlebar-odd",a=0;a<this.scaleBarSteps_;a++)0===a&&i.push(this.createMarker("absolute",a)),i.push('<div><div class="ol-scale-singlebar '+s+'" style="width: '+o+'px;"></div>'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,n):"")+"</div>"),a===this.scaleBarSteps_-1&&i.push(this.createStepText(a+1,t,!0,e,n)),s="ol-scale-singlebar-odd"===s?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+r+"</div>":"")+i.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,n,r,i){var o=(0===t?0:Math.round(r/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(n?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=pi(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Nr.METERS),e=this.dpi_||ab;return parseFloat(t.toString())*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(as),lb=ub;function cb(t){return cb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cb(t)}function hb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function fb(t,e,n){return(e=db(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,db(r.key),r)}}function db(t){var e=function(t,e){if("object"!=cb(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=cb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==cb(e)?e:e+""}function gb(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yb(t,e){return t.get(vb(t,e))}function vb(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var _b=new WeakMap,mb=new WeakSet,xb=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),gb(n=this,r=mb),r.add(n),function(t,e,n){gb(t,e),e.set(t,n)}(this,_b,void 0),this.init(vb(mb,this,wb).call(this,e))},e=[{key:"init",value:function(t){this.scale=new lb(t)}},{key:"setMap",value:function(t){var e,n,r;yb(_b,this)&&yb(_b,this).map.removeControl(this.scale),t&&(n=this,r=t,(e=_b).set(vb(e,n),r),t.map.addControl(this.scale))}},{key:"map",get:function(){return yb(_b,this)}}],e&&pb(t.prototype,e),n&&pb(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function wb(t){var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?hb(Object(n),!0).forEach(function(e){fb(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hb(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t);return e}var bb={ZoomTool:kw,OverView:Jw,Scale:xb},Eb=n(2031),Cb={};Cb.styleTagTransform=tv(),Cb.setAttributes=Ky(),Cb.insert=Hy().bind(null,"head"),Cb.domAPI=qy(),Cb.insertStyleElement=$y();Wy()(Eb.A,Cb),Eb.A&&Eb.A.locals&&Eb.A.locals;var Sb=n.p+"assets/46ac1bfe350f7f38e22c.png",Pb=n.p+"assets/50157e3bd0227aa82a75.png",Ib=n.p+"assets/2a84d048717fc397253c.png",Mb=n.p+"assets/17094eba52722bdefd71.png";function Ob(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Lb(t){return Lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lb(t)}function Rb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Tb(r.key),r)}}function kb(t,e,n){return(e=Tb(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tb(t){var e=function(t,e){if("object"!=Lb(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Lb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Lb(e)?e:e+""}function Nb(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ab(t,e,n){return t.set(Fb(t,e),n),n}function Db(t,e){return t.get(Fb(t,e))}function Fb(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var jb={0:"#03C5FF",1:"#00FF80",2:"#00FF80",3:"#03C5FF",4:"#03C5FF"},Gb={0:Sb,1:Pb},Bb=new WeakMap,zb=new WeakSet,Vb=function(){return t=function t(e){var n,r,i=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Nb(n=this,r=zb),r.add(n),function(t,e,n){Nb(t,e),e.set(t,n)}(this,Bb,!0),kb(this,"playBtnCallback",function(){Db(Bb,i)?i.pauseMove():i.resumeMove()}),kb(this,"dragDot",function(t){i.pauseMove(),t=t||window.event,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&t.touches&&(t=t.touches[0]);var e=i.sliderDot.offsetLeft,n=i.sliderDot.offsetWidth,r=t.clientX,o=i.sliderRunway.offsetWidth,s=function(t){t=t||window.event,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?t=t.touches[0]:t.preventDefault&&t.preventDefault();var s=t.clientX-r,a=e+s;a<0&&(a=0),a>=o-n&&(a=o-n);var u=a/o*100;Fb(zb,i,Ub).call(i,u)},a=i;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?(window.addEventListener("touchmove",s),window.addEventListener("touchend",function(){window.removeEventListener("touchmove",s),a.resumeMove()},{once:!0})):(window.addEventListener("mousemove",s),window.addEventListener("mouseup",function(){window.removeEventListener("mousemove",s),a.resumeMove()},{once:!0}))}),kb(this,"setFraction",function(t){t=t||window.event,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(t=t.touches[0]);var e=i.sliderRunway.offsetWidth,n=i.sliderDot.offsetWidth,r=t.clientX-i.sliderRunway.offsetLeft-n/2-i.dom.getBoundingClientRect().left;r<0&&(r=0),r>=e-n&&(r=e-n);var o=r/e*100;Fb(zb,i,Ub).call(i,o),i.dragDot(t)}),kb(this,"playFinish",function(){i.updatePlayRatio(1),i.pauseMove(),"function"===Lb(i.options.playFinishCallback).toLocaleLowerCase()&&i.options.playFinishCallback()}),kb(this,"updatePlayRatio",function(t){var e,n=t*(null!==(e=i.baseFraction)&&void 0!==e?e:1)*100;Fb(zb,i,Ub).call(i,n)}),!e.data)throw new Error("data error.");this.options=e,this.findLastPointCB=e.findLastPointCB,this.initDom(),this.eventListener(),this.initMap(),this.formatData(),this.initTrack(),this.initCamera(),this.initCalcData()},e=[{key:"initCalcData",value:function(){var t,e=this.options.data;this.points=null!==(t=e.flat().map(function(t){return t.path}).flat())&&void 0!==t?t:[],this.totalLength=0,this.points[0].accLength=0;for(var n=0;n<this.points.length-1;n++){var r=uu(ja(this.points[n]),ja(this.points[n+1]));this.totalLength+=r,this.points[n+1][3]=this.totalLength}console.log("test data",this.points)}},{key:"findLastPoint",value:function(t){for(var e=this.totalLength*(t/100),n=0,r=this.points.length-1;n<r;){var i=Math.floor((n+r)/2);this.points[i][3]<e?n=i+1:r=i}this.findLastPointCB&&this.findLastPointCB(this.points[n][2])}},{key:"initDom",value:function(){var t=document.createElement("div");t.className="track_replay_box",this.dom=t;var e=document.createElement("div");e.className="track_map_box",e.id="tract_map_box",this.mapBox=e,t.appendChild(e);var n=document.createElement("div");n.className="track_set_box",t.appendChild(n);var r=document.createElement("div");r.className="track_time_slider_box",n.appendChild(r);var i=document.createElement("div");i.className="track_time_slider_playbtn",this.playBtn=i,r.appendChild(i);var o=document.createElement("div");o.className="track_time_slider_runway",r.appendChild(o),this.sliderRunway=o;var s=document.createElement("div");s.className="track_time_slider_bar",o.appendChild(s),this.sliderBar=s;var a=document.createElement("div");a.className="track_time_slider_dot",o.appendChild(a),this.sliderDot=a;var u=document.createElement("ul");u.className="track_time_slider_point_list",this.timeSliderPointList=u,o.appendChild(u);var l=document.createElement("div");l.className="track_btn_box",this.openBtnBox=l,n.appendChild(l)}},{key:"updateMap",value:function(){if(!this.map)return!1;this.map.updateSize()}},{key:"eventListener",value:function(){this.playBtn.addEventListener("click",this.playBtnCallback),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?(this.sliderDot.addEventListener("touchstart",this.dragDot),this.sliderRunway.addEventListener("touchstart",this.setFraction)):(this.sliderDot.addEventListener("mousedown",this.dragDot),this.sliderRunway.addEventListener("mousedown",this.setFraction));var t=this;new ResizeObserver(function(e){var n=t.sliderRunway.offsetWidth,r=t.sliderDot.offsetWidth;t.baseFraction=(n-r)/n,t.updateMap();var i=new rg(t.route.flat());t.map.setFitForGeom(i,{avoid:[20,20,60,20]})}).observe(this.dom)}},{key:"pauseMove",value:function(){if(!Db(Bb,this))return!1;Ab(Bb,this,!1),this.playBtn.className=(this.playBtn.className.replace(/playing/g,"")+" pause").replace(/\s+/," "),this.machine.pauseMove()}},{key:"resumeMove",value:function(){if(Db(Bb,this))return!1;Ab(Bb,this,!0),this.playBtn.className=(this.playBtn.className.replace(/pause/g,"")+" playing").replace(/\s+/," "),this.machine.resumeMove()}},{key:"initMap",value:function(){var t,e=this,n={target:this.mapBox,zoom:8,zooms:[1,20],center:[100,33],controls:{zoom:!0},tileMax:this.options.tileMax,layers:this.options.layers};this.options.layers&&(t=this.options.layers.map(function(t,n){var r;return new bx({zooms:[0,null!==(r=e.options.tileMax)&&void 0!==r?r:20],tileUrl:t,zIndex:n+1}).layer})),t&&(n.layerConfig={default:!1,layers:t}),this.map=new wm(n);var r=this,i=!1;r.map.on("loadend",function t(){if(i)return r.map.off("loadend",t),!1;var e=document.querySelector(".track_map_box .ol-zoom-out");e||setTimeout(t,1e3);var n=document.createElement("div");n.className="ol-zoom-number",n.innerHTML=Math.round(r.map.getZoom()).toString(),e.parentNode.insertBefore(n,e),r.map.map.getView().on("change:resolution",function(){n.innerHTML=Math.round(r.map.getZoom()).toString()}),i=!0})}},{key:"formatData",value:function(){var t=this,e=this.options.data,n=[],r=[],i=e.map(function(t){return n.push(t[0].path[0]),r.push(t.map(function(t){return t.path})),t.map(function(t){return t.path}).flat()});this.route=i,this.markerPos=n,this.polylineOptsList=e.map(function(t){return t.flat()}).map(function(t){return t.map(function(t,e,n){return n[e+1]&&t.path.push(n[e+1].path[0]),t})});var o=wu(Va(this.route),{units:"kilometers"}),s=0;r.forEach(function(e){var n=wu(Ba(e.flat(1)),{units:"kilometers"}),r=document.createElement("li");r.style.left=s+"%",t.timeSliderPointList.appendChild(r),s+=n/o*100})}},{key:"initTrack",value:function(){var t,e=this;this.machine=new Wm({map:this.map,position:this.route[0][0],autoRotation:!0,src:Gb[null!==(t=this.options.machine)&&void 0!==t?t:0],rotation:Math.atan2(1,0),scale:.5,anchor:[.5,1]}),this.machine.moveAlong(this.route,10,this.playFinish,this.updatePlayRatio),this.pauseMove();var n=Rv();this.trackPolylines=this.polylineOptsList.map(function(t){return t.map(function(t){return new x_({map:e.map,group:n,path:t.path,color:jb[t.status],borderWidth:0})})}),this.trackPoints=this.markerPos.map(function(t,n){return new Wm({map:e.map,position:t,scale:.4375,anchor:[.5,1],src:Mb,text:"".concat(n+1),fontSize:28})});var r=S_().throttle(function(){var t=e.map.getZoom();switch(!0){case t>=18:e.trackPoints.forEach(function(t){t.setScale(.4375),t.setTextFontSize(14)});break;case t<18&&t>=17:e.trackPoints.forEach(function(t){t.setScale(.375),t.setTextFontSize(12)});break;case t<17&&t>=16:e.trackPoints.forEach(function(t){t.setScale(.3125),t.setTextFontSize(9)});break;case t<16:e.trackPoints.forEach(function(t){t.setScale(.25),t.setTextFontSize(7)});break;default:e.trackPoints.forEach(function(t){t.setScale(.4375),t.setTextFontSize(14)})}},600);this.map.map.getView().on("change:resolution",r)}},{key:"setMoveMultiply",value:function(t){this.machine.setMoveMultiply(t)}},{key:"getMoveMultiply",value:function(){return this.machine.moveMultiply}},{key:"initCamera",value:function(){if(!this.options.cameraList)return!1;var t=this;this.cameraList=this.options.cameraList.map(function(e){var n=new Wm({map:t.map,position:[e.lon,e.lat],src:Ib,scale:.5});return n.on("click",function(){t.clickCamera(e.did)}),n})}},{key:"clickCamera",value:function(t){"function"===Lb(this.options.clickCameraCallback).toLocaleLowerCase()&&this.options.clickCameraCallback(t,this.showCameraInfo)}},{key:"showCameraInfo",value:function(t){var e=t.position,n=t.dom;if(!e||!n)return!1;var r=new ox(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ob(Object(n),!0).forEach(function(e){kb(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ob(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({anchor:[.5,1]},t));return r.setMap(this.map),r}}],e&&Rb(t.prototype,e),n&&Rb(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Ub(t){var e,n=this.sliderRunway.offsetWidth,r=this.sliderDot.offsetWidth,i=(n-r)/n,o=r/2/n*100;this.fraction=t/i,this.sliderBar.style.width="".concat(t+o,"%"),this.sliderDot.style.left="".concat(t,"%");var s=null!==(e=this.baseFraction)&&void 0!==e?e:1;this.machine&&this.machine.setMoveRatio(t/s/100),this.findLastPoint(t)}function Wb(t){return Wb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wb(t)}function Xb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yb(r.key),r)}}function qb(t,e,n){return(e=Yb(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yb(t){var e=function(t,e){if("object"!=Wb(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Wb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Wb(e)?e:e+""}function Hb(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function Zb(t,e){return t.get(Jb(t,e))}function Kb(t,e,n){return t.set(Jb(t,e),n),n}function Jb(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var $b=new WeakMap,Qb=new WeakMap,tE=new WeakMap,eE=function(){return t=function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Hb(this,$b,void 0),qb(this,"featureName",void 0),Hb(this,Qb,void 0),Hb(this,tE,void 0),qb(this,"corerGeom",function(t){var e=n.getPath()[0];kl(Ga(e),Ga([t.path]))?(t.geom.openEdit(),n.core=t.geom):(t.geom.setMap(null),e.push(t.path),n.layer.getSource().getFeatures()[0].getGeometry().setCoordinates(e))}),qb(this,"condition",function(t){return console.log("condition",t),n.conditionCallback(t.coordinate)}),qb(this,"defaultCondition",function(t){var e=Ga(n.getPath()[0]);return su(ja(t),e)}),qb(this,"finishRemoveCore",function(){if(!n.core)return!1;var t=n.getPath()[0],e=n.core.getPath();if(kl(Ga(t),Ga([e])))return!1;t.push(n.core.getPath()),n.layer.getSource().getFeatures()[0].getGeometry().setCoordinates(t),n.core.closeEdit(),n.core.setMap(null),n.core=void 0}),this.init(this.formatOptions(e))},e=[{key:"formatOptions",value:function(t){var e,n,r;return t.path?(t.borderWidth=null!==(e=t.borderWidth)&&void 0!==e?e:3,t.strokeColor=null!==(n=t.strokeColor)&&void 0!==n?n:"#3366ff66",t.fillColor=null!==(r=t.fillColor)&&void 0!==r?r:"#1199ffaa",t):(console.error("path is error."),!1)}},{key:"init",value:function(t){var e=this;console.log("complex polygon options",t);var n=!1;try{n=Array.isArray(t.path[0][0][0])}catch(t){return console.error("path error."),!1}this.featureName=Rv(),n?(Kb($b,this,[]),t.path.forEach(function(t){Zb($b,e).push(new Na({type:"polygon",geometry:new Uo(t),name:e.featureName}))})):Kb($b,this,new Na({type:"polygon",geometry:new Uo(t.path),name:this.featureName})),this.style=new Vf({stroke:new Df({width:t.borderWidth,color:t.strokeColor}),fill:new Nf({color:t.fillColor})}),Array.isArray(Zb($b,this))?(Zb($b,this).forEach(function(t){t.setStyle(e.style)}),this.layer=new pv(Zb($b,this))):(Zb($b,this).setStyle(this.style),this.layer=new pv([Zb($b,this)])),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return Zb($b,this)}},{key:"getPath",value:function(){return this.layer.getSource().getFeatures().map(function(t){return t.getGeometry().getCoordinates()})}},{key:"isVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){Zb(Qb,this)&&Zb(Qb,this).removeFeature(this.layer),t?(t.addFeature(this.layer),Kb(Qb,this,t),Kb(tE,this,new Mv(this,Zb(Qb,this).map))):Zb(Qb,this)&&Zb(Qb,this).removeFeature(this.layer)}},{key:"map",get:function(){return Zb(Qb,this)}},{key:"eventList",get:function(){return Zb(tE,this).eventList}},{key:"on",value:function(t,e){return Zb(tE,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return Zb(tE,this).off(t,e,Fv)}},{key:"openEdit",value:function(){Zb(Qb,this).editGeom(this)}},{key:"closeEdit",value:function(){return!!Zb(Qb,this).getEditGeom(this)&&Zb(Qb,this).closeEditGeom(this)}},{key:"getArea",value:function(){return this.getPath().reduce(function(t,e){return t+e.reduce(function(t,e){return t-kv(e)},2*kv(e[0]))},0)}},{key:"getRegion",value:function(){return this.getPath().reduce(function(t,e){return t+kv(e[0])},0)}},{key:"useCorer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultCondition;return!!this.map&&!this.core&&(this.conditionCallback=t,void this.map.startDraw("polygon",this.corerGeom,this.condition))}}],e&&Xb(t.prototype,e),n&&Xb(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function nE(t){return nE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nE(t)}function rE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function iE(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?rE(Object(n),!0).forEach(function(e){uE(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rE(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function oE(t){return function(t){if(Array.isArray(t))return sE(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return sE(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sE(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sE(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function aE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,lE(r.key),r)}}function uE(t,e,n){return(e=lE(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lE(t){var e=function(t,e){if("object"!=nE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=nE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nE(e)?e:e+""}function cE(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function hE(t,e){return t.get(pE(t,e))}function fE(t,e,n){return t.set(pE(t,e),n),n}function pE(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var dE=new Vf({image:new kf({fill:new Nf({color:"#18a058"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),zIndex:9}),gE=new kf({fill:new Nf({color:"#e59810"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),yE=new Vf({image:gE,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new lg(e)}}),vE=new Vf({zIndex:5,image:gE,geometry:function(t){var e=t.getGeometry().getCoordinates();return new lg(e)}}),_E={base:[new Vf({fill:new Nf({color:"#9ffbc74d"}),stroke:new Df({color:"#16e96f",width:2})})],select:[new Vf({fill:new Nf({color:"#ff7f1db3"}),stroke:new Df({color:"#ff7f1d",width:2})})],draw:[dE,new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#e59810",width:2,lineDash:[10,10]})}),vE],edit:[new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#e59810",width:2})}),yE],error:[new Vf({fill:new Nf({color:"#ff492480"}),stroke:new Df({color:"#e59810",width:2})}),yE]},mE={base:[new Vf({fill:new Nf({color:"#ff7f1d4d"}),stroke:new Df({color:"#ffffff",width:2})})],select:[new Vf({fill:new Nf({color:"#ff7f1db3"}),stroke:new Df({color:"#ff7f1d",width:1})})],draw:[dE,new Vf({fill:new Nf({color:"#e5981099"}),stroke:new Df({color:"#ffffff",width:1,lineDash:[6,10]})}),vE],edit:[new Vf({fill:new Nf({color:"#e5981099"}),stroke:new Df({color:"#ffffff",width:1})}),yE],error:[new Vf({fill:new Nf({color:"#ff492480"}),stroke:new Df({color:"#e59810",width:2})}),yE]},xE=new WeakMap,wE=new WeakMap,bE=new WeakMap,EE=function(){return t=function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),cE(this,xE,void 0),cE(this,wE,void 0),cE(this,bE,void 0),uE(this,"textList",[]),uE(this,"isShowLength",!1),uE(this,"tempShowLenFnCB",function(t){n.showLengthFn(t.target)}),uE(this,"active",!1),uE(this,"clickCorePointCB",function(t){if(!t)return n.hideClickPoint(),n.changeSelectPoint&&n.changeSelectPoint(),!1;switch(t.type){case"modifystart":return n.hideClickPoint(),void(n.changeSelectPoint&&n.changeSelectPoint());case"modifyend":return void n.changeCoreErrorStatus(n.coreStatusIsError());default:console.info("click point",t)}var e=ja(t.coordinate),r=Ba(n.core.getPath());return su(e,uf(r,.001))?(n.selectPoint?(n.selectPoint.show(),n.selectPoint.setPosition(t.coordinate)):n.selectPoint=new Wm({map:n.map,position:t.coordinate,color:"#18a058",borderColor:"#ffffff",borderWidth:1}),n.changeSelectPoint&&n.changeSelectPoint(n.selectPoint),n.changeCoreErrorStatus(n.coreStatusIsError()),!0):(n.hideClickPoint(),n.changeSelectPoint&&n.changeSelectPoint(),n.changeCoreErrorStatus(n.coreStatusIsError()),!1)}),uE(this,"clickPointCB",function(t){if(console.log("clickPointCB 被调用",null==t?void 0:t.type),console.log("点击的坐标",null==t?void 0:t.coordinate,t),!t)return n.hideClickPoint(),n.changeSelectPoint&&n.changeSelectPoint(),!1;switch(t.type){case"modifystart":return n.hideClickPoint(),void(n.changeSelectPoint&&n.changeSelectPoint());case"modifyend":return void n.changeErrorStatus(n.statusIsError());default:console.info("click point",t)}var e=ja(t.coordinate),r=Ba(n.getPath()[0]);return su(e,uf(r,.001))?(n.selectPoint?(n.selectPoint.show(),n.selectPoint.setPosition(t.coordinate)):n.selectPoint=new Wm({map:n.map,position:t.coordinate,color:"#18a058",borderColor:"#ffffff",borderWidth:1}),n.changeSelectPoint&&n.changeSelectPoint(n.selectPoint),n.changeErrorStatus(n.statusIsError()),!0):(n.hideClickPoint(),n.changeSelectPoint&&n.changeSelectPoint(),n.changeErrorStatus(n.statusIsError()),!1)}),uE(this,"corerGeom",function(t){n.finishCoreDrawCB&&n.finishCoreDrawCB();var e,r,i=oE(n.getPath());n.core=t.geom,n.core.setSourceStyle(mE.base),n.coreList?(i.push.apply(i,oE(null===(e=n.coreList)||void 0===e?void 0:e.map(function(t){return t.getPath()}))),null!==(r=n.coreList)&&void 0!==r&&r.some(function(t){return t===n.core})||n.coreList.push(n.core)):n.coreList=[n.core],kl(Ga(i),Ga(t.path)),hE(wE,n).editGeom(t.geom,mE.edit,dE,n.clickCorePointCB),t.geom.setActiveStyle(mE.select),n.changeCoreErrorStatus(n.coreStatusIsError())}),uE(this,"selectCoreCB",function(t){if(t.target.isActive())return t.target.setActive(!1),!1;n.coreList.forEach(function(t){return t.setActive(!1)}),t.target.setActive(!0)}),uE(this,"condition",function(t){return console.log("condition",t),n.conditionCallback(t.coordinate)}),uE(this,"defaultCondition",function(t){var e=Ga(n.getPath()),r=su(ja(t),e);return r||n.outOfBoundsCB&&n.outOfBoundsCB(),r}),uE(this,"finishRemoveCore",function(){return!!n.core&&(!n.coreStatusIsError()&&(n.coreList?null!==(t=n.coreList)&&void 0!==t&&t.some(function(t){return t===n.core})||n.coreList.push(n.core):n.coreList=[n.core],hE(wE,n).getEditGeom(n.core)&&(n.hideClickPoint(),hE(wE,n).closeEditGeom(n.core)),void(n.core=void 0)));var t}),e.changeSelectPoint&&(this.changeSelectPoint=e.changeSelectPoint),e.isError&&(this.isError=e.isError),e.changeAreaCB&&(this.changeAreaCB=e.changeAreaCB),e.outOfBoundsCB&&(this.outOfBoundsCB=e.outOfBoundsCB),this.finishDrawCB=e.finishDrawCB,this.finishCoreDrawCB=e.finishCoreDrawCB,this.init(this.formatOptions(e))},e=[{key:"formatOptions",value:function(t){return t}},{key:"init",value:function(t){console.log("smart polygon options",t),this.featureName=Rv(),t.path&&(fE(xE,this,new Na({type:"polygon",geometry:new Uo(t.path),name:this.featureName})),this.style=_E.base,hE(xE,this).setStyle(this.style),this.layer=new pv({features:[hE(xE,this)],zIndex:999}),this.initPath=t.path),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return hE(xE,this)}},{key:"startDraw",value:function(){var t;if(hE(xE,this))return!1;var e=this;return null===(t=hE(wE,this))||void 0===t||t.startDraw("smartPolygon",function(t){e.setPath(t.path,!0),e.finishDrawCB&&e.finishDrawCB(),t.geom.setMap()},function(t){return!0},_E.draw),!0}},{key:"hideLength",value:function(){this.isShowLength=!1,this.textList.length>0&&(this.textList.forEach(function(t){return t.destroy()}),this.textList=[]),hE(xE,this)&&hE(xE,this).getGeometry().un("change",this.tempShowLenFnCB)}},{key:"showLength",value:function(){var t;this.isShowLength=!0,hE(xE,this)&&this.showLengthFn(null===(t=hE(xE,this))||void 0===t?void 0:t.getGeometry()),hE(xE,this)&&hE(xE,this).getGeometry().on("change",this.tempShowLenFnCB)}},{key:"showLengthFn",value:function(t){var e=this,n=[];t.getCoordinates()[0].reduce(function(t,e){if(!t)return e;var r=[(t[0]+e[0])/2,(t[1]+e[1])/2],i=wu(Ba([t,e]));i=i<1?Math.round(1e3*i*100)/100+" m":Math.round(100*i)/100+" km";var o=Math.atan2(t[0]-e[0],t[1]-e[1])+Math.PI/2;return n.push({position:r,content:i,rotation:o}),e},!1),n.forEach(function(t,n){var r=e.textList[n];r?(r.setRotation(t.rotation),r.setText(t.content),r.setPosition(t.position)):(r=new H_(iE(iE({},t),{},{textBaseline:"bottom",fill:"#ffffff",stroke:"#2b2b2b",borderWidth:4,fontSize:"16px",map:e.map})),e.textList[n]=r)})}},{key:"setPath",value:function(t,e){console.log("path",t,e,hE(xE,this)),hE(xE,this)?hE(xE,this).getGeometry().setCoordinates(t):(fE(xE,this,new Na({type:"polygon",geometry:new Uo(t),name:this.featureName})),this.style=_E.base,hE(xE,this).setStyle(this.style),this.layer=new pv({features:[hE(xE,this)],zIndex:999}),console.log("path",t,this.layer),hE(wE,this).addFeature(this.layer),this.isShowLength&&this.showLength()),e&&(this.openEdit(),this.changeErrorStatus(this.statusIsError()))}},{key:"setActive",value:function(t){"boolean"!==nE(t).toLocaleString()&&(t=!!t),this.active=t,t?hE(xE,this).setStyle(_E.select):hE(xE,this).setStyle(_E.base)}},{key:"isActive",value:function(){return!!this.active}},{key:"getPath",value:function(){var t;if(hE(xE,this))return null===(t=this.layer)||void 0===t?void 0:t.getSource().getFeatures().map(function(t){return t.getGeometry().getCoordinates()})[0]}},{key:"isVisible",value:function(){var t;return null===(t=this.layer)||void 0===t?void 0:t.getVisible()}},{key:"show",value:function(){var t;null===(t=this.layer)||void 0===t||t.setVisible(!0)}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.setVisible(!1)}},{key:"setMap",value:function(t){hE(wE,this)&&this.layer&&hE(wE,this).removeFeature(this.layer),t?(this.layer&&t.addFeature(this.layer),fE(wE,this,t),fE(bE,this,new Mv(this,hE(wE,this).map))):fE(wE,this,void 0)}},{key:"map",get:function(){return hE(wE,this)}},{key:"eventList",get:function(){return hE(bE,this).eventList}},{key:"on",value:function(t,e){return hE(bE,this).featureOn(t,e,yv)}},{key:"off",value:function(t,e){return hE(bE,this).off(t,e,yv)}},{key:"hideClickPoint",value:function(){var t;null===(t=this.selectPoint)||void 0===t||t.hide()}},{key:"deleteSelectPoint",value:function(){if(!this.selectPoint)return!1;this.hideClickPoint(),this.changeSelectPoint&&this.changeSelectPoint(void 0),this.core?(this.map.deletePointForGeom(this.core),this.changeCoreErrorStatus(this.coreStatusIsError())):(this.map.deletePointForGeom(this),this.changeErrorStatus(this.statusIsError()))}},{key:"openEdit",value:function(){var t=this;if(this.initPath){this.setPath([this.initPath[0]]),hE(wE,this).editGeom(this,_E.edit,dE,this.clickPointCB),this.initPath.shift();var e=this;this.initPath.forEach(function(n){var r=new r_({path:[n],map:t.map,borderWidth:1,strokeColor:"#ffffff",fillColor:"#ff7f1d4d"});e.corerGeom({path:[n],geom:r}),e.finishRemoveCore()}),this.initPath=void 0}this.layer&&hE(wE,this).editGeom(this,_E.edit,dE,this.clickPointCB)}},{key:"closeEdit",value:function(){return!!hE(wE,this).getEditGeom(this)&&(this.hideClickPoint(),hE(wE,this).closeEditGeom(this))}},{key:"coreStatusIsError",value:function(){var t=this,e=this.core.getPath();if(mu(Ga([e])).features.length>0)return this.isError&&this.isError("kinks"),!0;if(!this.core)return!1;var n,r=oE(this.getPath()),i=!1,o=Ga([e]);return this.coreList&&r.push.apply(r,oE(null===(n=this.coreList)||void 0===n?void 0:n.filter(function(e){return e!==t.core}).map(function(t){var e=t.getPath(),n=Ga([e]);return(Il(o,n)||Il(n,o))&&(i=!0),e}))),kl(Ga(r),o)||i?(this.isError&&this.isError("outBounds"),this.outOfBoundsCB&&this.outOfBoundsCB(),!0):(this.isError(!1),!1)}},{key:"statusIsError",value:function(){return mu(Ga(this.getPath())).features.length>0?(this.isError&&this.isError("kinks"),!0):(this.isError(!1),!1)}},{key:"changeErrorStatus",value:function(t){var e=hE(xE,this);t?e.setStyle(_E.error):e.setStyle(_E.edit)}},{key:"changeCoreErrorStatus",value:function(t){var e=this.core.feature;Array.isArray(e)&&(e=e[0]),t?e.setStyle(mE.error):e.setStyle(mE.edit)}},{key:"deletePolygon",value:function(){this.closeEdit(),this.map.removeFeature(this.layer),fE(xE,this,void 0)}},{key:"getArea",value:function(){var t,e;return kv(this.getPath()[0])-(null!==(t=null===(e=this.coreList)||void 0===e?void 0:e.map(function(t){return t.getPath()}))&&void 0!==t?t:[]).reduce(function(t,e){return t+kv(e)},0)}},{key:"getRegion",value:function(){return kv(this.getPath()[0])}},{key:"useCorer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultCondition;return!!this.map&&(this.closeEdit(),!this.core&&(this.conditionCallback=t,void this.map.startDraw("smartPolygon",this.corerGeom,this.condition,mE.draw)))}},{key:"openSelectCore",value:function(){var t=this;this.closeEdit(),this.coreList.forEach(function(e){e.on("click",t.selectCoreCB)})}},{key:"closeSelectCore",value:function(){var t=this;this.openEdit(),this.coreList.forEach(function(e){e.off("click",t.selectCoreCB)}),this.coreList.forEach(function(t){return t.setActive(!1)})}},{key:"openCoreEdit",value:function(){this.core=this.coreList.find(function(t){return t.active}),this.coreList.forEach(function(t){return t.setActive(!1)}),this.tempCorePath=this.core.getPath(),hE(wE,this).editGeom(this.core,mE.edit,dE,this.clickCorePointCB)}},{key:"cancelCoreEdit",value:function(){if(!this.tempCorePath)return!1;this.core&&(hE(wE,this).getEditGeom(this.core)&&(this.hideClickPoint(),hE(wE,this).closeEditGeom(this.core)),this.core.setPath(this.tempCorePath))}},{key:"deleteCore",value:function(){var t;if(this.core=(null===(t=this.coreList)||void 0===t?void 0:t.find(function(t){return t.active}))||this.core,!this.core)return!1;var e=this.coreList.findIndex(function(t){return t.active});this.coreList.splice(e,1),this.core&&(hE(wE,this).getEditGeom(this.core)&&(this.hideClickPoint(),hE(wE,this).closeEditGeom(this.core)),this.core.hide()),this.tempCore=this.core,this.core=void 0}},{key:"cancelDeleteCore",value:function(){if(!this.tempCore)return!1;this.coreList?this.coreList.push(this.tempCore):this.coreList=[this.tempCore],this.tempCore.show(),this.core=this.tempCore}},{key:"clearCore",value:function(){this.coreList.forEach(function(t){t.destroy()}),this.coreList=void 0}},{key:"getCorePaths",value:function(){var t,e;return(null===(t=this.coreList)||void 0===t?void 0:t.length)>0?[[this.getPath()[0]].concat(oE(null===(e=this.coreList)||void 0===e?void 0:e.map(function(t){return t.getPath()})))]:this.getPath()?[this.getPath()]:[]}},{key:"getLength",value:function(){return 1e3*wu(Ba(this.getPath()[0]),{units:"kilometers"})}}],e&&aE(t.prototype,e),n&&aE(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function CE(t){return CE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},CE(t)}function SE(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return PE(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?PE(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PE(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function IE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,OE(r.key),r)}}function ME(t,e,n){return(e=OE(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OE(t){var e=function(t,e){if("object"!=CE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=CE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==CE(e)?e:e+""}function LE(t,e,n){RE(t,e),e.set(t,n)}function RE(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kE(t,e){return t.get(NE(t,e))}function TE(t,e,n){return t.set(NE(t,e),n),n}function NE(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var AE=new Vf({image:new kf({fill:new Nf({color:"#18a058"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),zIndex:9}),DE=new kf({fill:new Nf({color:"#e59810"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),FE=new Vf({image:DE,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new lg(e)}}),jE=new Vf({zIndex:5,image:DE,geometry:function(t){var e=t.getGeometry().getCoordinates();return new lg(e)}}),GE={select:[new Vf({fill:new Nf({color:"#fff42799"}),stroke:new Df({color:"#fff427",width:2})})],base:[new Vf({fill:new Nf({color:"#ff7f1d99"}),stroke:new Df({color:"#e59810ff",width:2})})],draw:[AE,new Vf({fill:new Nf({color:"#ff74ae99"}),stroke:new Df({color:"#ffffff",width:1,lineDash:[10,10]})}),jE],edit:[new Vf({fill:new Nf({color:"#ff74ae99"}),stroke:new Df({color:"#ffffff",width:1})}),FE],error:[new Vf({fill:new Nf({color:"#ff492480"}),stroke:new Df({color:"#e59810ff",width:1})}),FE]},BE=new WeakMap,zE=new WeakMap,VE=new WeakMap,UE=new WeakMap,WE=new WeakMap,XE=new WeakSet,qE=function(){return t=function t(e){var n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),RE(n=this,r=XE),r.add(n),LE(this,BE,{}),LE(this,zE,void 0),LE(this,VE,void 0),ME(this,"editList",{}),LE(this,UE,void 0),LE(this,WE,void 0),ME(this,"clickPointCB",function(t){if(!t)return i.hideClickPoint(),!1;switch(t.type){case"modifystart":return i.hideClickPoint(),void(i.changeSelectPoint&&i.changeSelectPoint());case"modifyend":return i.hideClickPoint(),i.changeSelectPoint&&i.changeSelectPoint(),void i.changeErrorStatus(i.statusIsError());default:console.info("click point",t)}var e=ja(t.coordinate),n=Ba(i.getPath()[0]);return su(e,uf(n,.001))?(i.selectPoint?(i.selectPoint.show(),i.selectPoint.setPosition(t.coordinate)):i.selectPoint=new Wm({map:i.map,position:t.coordinate,color:"#18a058",borderColor:"#ffffff",borderWidth:1}),i.changeSelectPoint&&i.changeSelectPoint(i.selectPoint),i.changeErrorStatus(i.statusIsError()),!0):(i.hideClickPoint(),!1)}),console.log("change select point",this.changeSelectPoint),e.changeSelectPoint&&(this.changeSelectPoint=e.changeSelectPoint),console.log("isError",this.isError,e.isError),e.isError&&(this.isError=e.isError),console.log("changeSelectIdCB",this.changeSelectIdCB,e.changeSelectIdCB),e.changeSelectIdCB&&(this.changeSelectIdCB=e.changeSelectIdCB),this.init(NE(XE,this,YE).call(this,e))},e=[{key:"init",value:function(t){if(console.log("isolation options: ",t),TE(VE,this,Rv()),null!=t&&t.map&&this.setMap(t.map),null!=t&&t.path){if(!Array.isArray(t.path))return console.error("path is error."),!1;if(!Array.isArray(t.path[0][0]))return console.error("path is error."),!1;var e=this;t.path.forEach(function(t,n){e.addPath([t],!0)})}}},{key:"feature",get:function(){return Object.values(kE(BE,this)).map(function(t){return t.polygon})}},{key:"isolation",get:function(){return Object.values(kE(BE,this))}},{key:"selectId",get:function(){return kE(UE,this)}},{key:"statusIsError",value:function(){var t=kE(UE,this),e=kE(BE,this)[t].feature.getGeometry().getCoordinates();if(mu(Ga(e)).features.length>0)return this.isError&&this.isError("kinks"),!0;var n=Object.values(kE(BE,this)).filter(function(e){return e.id!==t}).map(function(t){return t.feature.getGeometry().getCoordinates()}),r=Ga(e),i=n.some(function(t){var e=Ga(t);return kl(r,e)});return i?(this.isError&&this.isError("overlap"),!0):(this.isError&&this.isError(!1),!1)}},{key:"getPath",value:function(){return Object.values(kE(BE,this)).map(function(t){return t.layer.getSource().getFeatures()[0].getGeometry().getCoordinates()[0]})}},{key:"addPath",value:function(t,e){var n=Object.values(kE(BE,this)).length,r=kE(VE,this)+n,i=new Na({type:"polygon",geometry:new Uo(t),name:r});i.setStyle(GE.base);var o=new pv([i]);if(kE(BE,this)[r]={id:r,style:GE.base,feature:i,polygon:i,layer:o},kE(zE,this)&&kE(zE,this).addFeature(o),TE(UE,this,r),e)return!0;this.changeSelectIdCB&&this.changeSelectIdCB(kE(UE,this)),this.openEdit(r);var s=Object.values(kE(BE,this)).map(function(t){return t.feature.getGeometry().getCoordinates()}),a=Ga(t),u=s.some(function(t){var e=Ga(t);return kl(a,e)});u&&this.changeErrorStatus(!0),this.changeErrorStatus(this.statusIsError()),console.log("test isolation selectId",kE(UE,this),kE(BE,this))}},{key:"changeErrorStatus",value:function(t){var e=kE(UE,this),n=kE(BE,this)[e];t?n.feature.setStyle(GE.error):n.feature.setStyle(GE.edit)}},{key:"isVisible",value:function(){return Object.values(kE(BE,this)).every(function(t){return t.layer.getVisible()})}},{key:"show",value:function(){Object.values(kE(BE,this)).forEach(function(t){return t.layer.setVisible(!0)})}},{key:"hide",value:function(){Object.values(kE(BE,this)).forEach(function(t){return t.layer.setVisible(!1)})}},{key:"setMap",value:function(t){var e=kE(zE,this);e&&Object.values(kE(BE,this)).forEach(function(t){return e.removeFeature(t.layer)}),t?(Object.values(kE(BE,this)).forEach(function(e){return t.addFeature(e.layer)}),TE(zE,this,t),TE(WE,this,new Mv(this,kE(zE,this).map))):kE(zE,this)&&Object.values(kE(BE,this)).forEach(function(t){return e.removeFeature(t.layer)})}},{key:"map",get:function(){return kE(zE,this)}},{key:"eventList",get:function(){return kE(WE,this).eventList}},{key:"on",value:function(t,e){return kE(WE,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return kE(WE,this).off(t,e,Fv)}},{key:"startDraw",value:function(){var t;if(!kE(zE,this))return console.error("Missing the necessary map object."),!1;var e=this,n=Object.values(kE(BE,this)).map(function(t){return t.feature.getGeometry().getCoordinates()});return null===(t=kE(zE,this))||void 0===t||t.startDraw("smartPolygon",function(t){e.addPath(t.path),t.geom.setMap()},function(t){var e=ja(t.coordinate);return n.every(function(t){var n=Ga(t);return!su(e,n)})},GE.draw),!0}},{key:"getIdByLonlat",value:function(t){var e=this;return Object.keys(kE(BE,this)).find(function(n){var r=kE(BE,e)[n].feature.getGeometry().getCoordinates();return su(ja(t),Ga(r))})}},{key:"openEdit",value:function(t){t=null!=t?t:this.selectId,console.log("test open edit",t);var e=new Vf({image:new kf({fill:new Nf({color:"#18a058"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),zIndex:9});this.editList[t]=kE(BE,this)[t],kE(zE,this).editGeom(kE(BE,this)[t],GE.edit,e,this.clickPointCB)}},{key:"closeEdit",value:function(t,e){if(t=null!=t?t:this.selectId,this.statusIsError()&&!e)return!1;if(this.selectPoint&&(this.selectPoint.setMap(),this.selectPoint=null,this.changeSelectPoint&&this.changeSelectPoint(null)),t&&kE(BE,this)[t]){var n=Object.values(kE(BE,this)).filter(function(e){return e.name!==t}).map(function(t){return t.feature.getGeometry().getCoordinates()}),r=Ga(kE(BE,this)[t].feature.getGeometry().getCoordinates()),i=n.some(function(t){var e=Ga(t);return kl(r,e)});return!i&&(delete this.editList[t],kE(zE,this).closeEditGeom(kE(BE,this)[t]))}var o=this;return Object.keys(this.editList).forEach(function(t){o.closeEdit(t)}),!0}},{key:"hideClickPoint",value:function(){var t;null===(t=this.selectPoint)||void 0===t||t.hide()}},{key:"deleteSelectPoint",value:function(){if(!this.selectPoint)return!1;var t=kE(UE,this),e=kE(BE,this)[t];this.map.deletePointForGeom(e),this.changeErrorStatus(this.statusIsError())}},{key:"selectIsolation",value:function(t){var e,n;return!(Object.keys(this.editList).length>0||(console.log("ttttt",null===(e=kE(BE,this)[kE(UE,this)])||void 0===e?void 0:e.feature),null===(n=kE(BE,this)[kE(UE,this)])||void 0===n||n.feature.setStyle(GE.base),kE(BE,this)[t].feature.setStyle(GE.select),TE(UE,this,t),this.changeSelectIdCB&&this.changeSelectIdCB(kE(UE,this)),0))}},{key:"deleteIsolation",value:function(t){t=t||this.selectId;var e=kE(BE,this)[t];kE(zE,this).removeFeature(e.layer),this.closeEdit(this.selectId,!0),delete kE(BE,this)[t]}},{key:"getArea",value:function(){return this.getPath().reduce(function(t,e){return t+kv(e)},0)}},{key:"getHighByCoordinate",value:function(t){var e=.017453292519943295,n=111319.49079327357,r=0;if(t.length<3)return 0;for(var i=0;i<t.length-1;i++){var o=SE(t[i].map(parseFloat),2),s=o[0],a=o[1],u=SE(t[i+1].map(parseFloat),2),l=u[0],c=u[1],h=a*n;r+=s*n*Math.cos(a*e)*c*n-l*n*Math.cos(c*e)*h}var f=SE(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=SE(t[0].map(parseFloat),2),y=g[0],v=g[1],_=d*n;return r+=p*n*Math.cos(d*e)*v*n-y*n*Math.cos(v*e)*_,.5*Math.abs(r)}},{key:"destroy",value:function(){var t=this;return!!kE(zE,this)&&(Object.values(kE(BE,this)).forEach(function(e){return kE(zE,t).removeFeature(e.layer)}),!0)}}],e&&IE(t.prototype,e),n&&IE(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function YE(t){return t}function HE(t){return HE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HE(t)}function ZE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,JE(r.key),r)}}function KE(t,e,n){return(e=JE(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JE(t){var e=function(t,e){if("object"!=HE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=HE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==HE(e)?e:e+""}function $E(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function QE(t,e){return t.get(eC(t,e))}function tC(t,e,n){return t.set(eC(t,e),n),n}function eC(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var nC=new WeakMap,rC=new WeakMap,iC=new WeakMap,oC=new WeakMap,sC=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$E(this,nC,void 0),$E(this,rC,void 0),$E(this,iC,void 0),$E(this,oC,void 0),KE(this,"draggable",!1),KE(this,"modify",void 0),this.init(e)},e=[{key:"init",value:function(t){if(!t)return!1;tC(iC,this,Rv()),tC(nC,this,new Na({geometry:new lg(t.data.map(function(t){return t.lonlat})),name:QE(iC,this)})),this.data=t.data;var e=[];if(t.styles){var n=t.styles;if(!Array.isArray(n))return console.error("styles is error."),!1;n.forEach(function(n,r){var i=t.data.filter(function(t){return t.styleIndex===r});e.push(new Vf({image:new cd({anchor:t.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:n.src,offset:t.offset,rotation:t.rotation,scale:t.scale}),geometry:new lg(i.map(function(t){return t.lonlat}))}))})}else{var r=new Nf({color:"rgba(37, 165, 247,0.6)"}),i=new Df({color:"#ffeeff",width:2});e.push(new Vf({image:new kf({fill:r,stroke:i,radius:5})}))}this.style=e,this.options=t,QE(nC,this).setStyle(e),this.layer=new pv({features:[QE(nC,this)],zIndex:(t.zIndex||0)+1e4}),t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable)}},{key:"feature",get:function(){return QE(nC,this)}},{key:"getClosestPoint",value:function(t){var e=QE(nC,this).getGeometry().getClosestPoint(t);return this.data.find(function(t){return t.lonlat[0]===e[0]&&t.lonlat[1]===e[1]})}},{key:"getVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){QE(rC,this)&&QE(rC,this).removeFeature(this.layer),t?(t.addFeature(this.layer),tC(rC,this,t),tC(oC,this,new Mv(this,QE(rC,this).map))):QE(rC,this)&&QE(rC,this).removeFeature(this.layer)}},{key:"map",get:function(){return QE(rC,this)}},{key:"eventList",get:function(){return QE(oC,this).eventList}},{key:"on",value:function(t,e){return console.log("t123"),QE(oC,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return QE(oC,this).off(t,e,Fv)}},{key:"setDraggable",value:function(t){if(this.draggable=t,t)this.modify||(this.modify=new Wd({hitDetection:this.layer,source:this.layer.getSource()})),QE(rC,this).map.addInteraction(this.modify);else{if(!this.modify)return;QE(rC,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"destroy",value:function(){return!!QE(rC,this)&&(QE(rC,this).removeFeature(this.layer),!0)}}],e&&ZE(t.prototype,e),n&&ZE(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),aC=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uC=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,wrapX:e.wrapX})||this;return n.resolution=void 0,n.distance=void 0!==e.distance?e.distance:20,n.minDistance=e.minDistance||0,n.interpolationRatio=0,n.features=[],n.geometryFunction=e.geometryFunction||function(t){var e=t.getGeometry();return P("Point"==e.getType(),10),e},n.createCustomCluster_=e.createCluster,n.source=null,n.boundRefresh_=n.refresh.bind(n),n.updateDistance(n.distance,n.minDistance),n.setSource(e.source||null),n}return aC(e,t),e.prototype.clear=function(e){this.features.length=0,t.prototype.clear.call(this,e)},e.prototype.getDistance=function(){return this.distance},e.prototype.getSource=function(){return this.source},e.prototype.loadFeatures=function(t,e,n){this.source.loadFeatures(t,e,n),e!==this.resolution&&(this.resolution=e,this.refresh())},e.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},e.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},e.prototype.getMinDistance=function(){return this.minDistance},e.prototype.setSource=function(t){this.source&&this.source.removeEventListener(Qt,this.boundRefresh_),this.source=t,t&&t.addEventListener(Qt,this.boundRefresh_),this.refresh()},e.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},e.prototype.updateDistance=function(t,e){var n=0===t?0:Math.min(e,t)/t,r=t!==this.distance||this.interpolationRatio!==n;this.distance=t,this.minDistance=e,this.interpolationRatio=n,r&&this.refresh()},e.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=[1/0,1/0,-1/0,-1/0],e=this.distance*this.resolution,n=this.source.getFeatures(),r={},i=0,o=n.length;i<o;i++){var s=n[i];if(!(p(s)in r)){var a=this.geometryFunction(s);if(a){K(a.getCoordinates(),t),B(t,e,t);var u=this.source.getFeaturesInExtent(t).filter(function(t){var e=p(t);return!(e in r)&&(r[e]=!0,!0)});this.features.push(this.createCluster(u,t))}}}},e.prototype.createCluster=function(t,e){for(var n=[0,0],r=t.length-1;r>=0;--r){var i=this.geometryFunction(t[r]);i?Ve(n,i.getCoordinates()):t.splice(r,1)}Ye(n,1/t.length);var o=at(e),s=this.interpolationRatio,a=new Io([n[0]*(1-s)+o[0]*s,n[1]*(1-s)+o[1]*s]);return this.createCustomCluster_?this.createCustomCluster_(a,t):new Na({geometry:a,features:t})},e}(kd),lC=uC;function cC(t){return cC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cC(t)}function hC(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pC(r.key),r)}}function fC(t,e,n){return(e=pC(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pC(t){var e=function(t,e){if("object"!=cC(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=cC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==cC(e)?e:e+""}function dC(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function gC(t,e){return t.get(vC(t,e))}function yC(t,e,n){return t.set(vC(t,e),n),n}function vC(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var _C=new WeakMap,mC=new WeakMap,xC=new WeakMap,wC=new WeakMap,bC=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),dC(this,_C,void 0),dC(this,mC,void 0),dC(this,xC,void 0),dC(this,wC,void 0),fC(this,"draggable",!1),fC(this,"modify",void 0),this.init(e)},e=[{key:"init",value:function(t){if(!t)return!1;yC(xC,this,Rv()),yC(_C,this,t.data.map(function(t){return new Na(new Io(t.lonlat))})),this.data=t.data;var e=new kd({features:gC(_C,this)}),n=new lC({distance:parseInt("40",10),minDistance:parseInt("2",10),source:e}),r={};this.layer=new wd({source:n,zIndex:1e3,style:function(t){var e=t.get("features").length,n=r[e];return n||(n=new Vf({image:new kf({radius:10,stroke:new Df({color:"#fff"}),fill:new Nf({color:"#3399CC"})}),text:new E_({text:e.toString(),fill:new Nf({color:"#fff"})})}),r[e]=n),n}}),this.options=t,t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable)}},{key:"feature",get:function(){return gC(_C,this)}},{key:"getClosestPoint",value:function(t){var e=gC(_C,this).getGeometry().getClosestPoint(t);return this.data.find(function(t){return t.lonlat[0]===e[0]&&t.lonlat[1]===e[1]})}},{key:"getVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){gC(mC,this)&&gC(mC,this).removeFeature(this.layer),t?(t.addFeature(this.layer),yC(mC,this,t),yC(wC,this,new Mv(this,gC(mC,this).map))):gC(mC,this)&&gC(mC,this).removeFeature(this.layer)}},{key:"map",get:function(){return gC(mC,this)}},{key:"eventList",get:function(){return gC(wC,this).eventList}},{key:"on",value:function(t,e){return console.log("t123"),gC(wC,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return gC(wC,this).off(t,e,Fv)}},{key:"setDraggable",value:function(t){if(this.draggable=t,t)this.modify||(this.modify=new Wd({hitDetection:this.layer,source:this.layer.getSource()})),gC(mC,this).map.addInteraction(this.modify);else{if(!this.modify)return;gC(mC,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"destroy",value:function(){return!!gC(mC,this)&&(gC(mC,this).removeFeature(this.layer),!0)}}],e&&hC(t.prototype,e),n&&hC(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function EC(t){return EC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},EC(t)}function CC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function SC(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?CC(Object(n),!0).forEach(function(e){OC(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):CC(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function PC(t){return function(t){if(Array.isArray(t))return IC(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return IC(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IC(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IC(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function MC(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,LC(r.key),r)}}function OC(t,e,n){return(e=LC(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LC(t){var e=function(t,e){if("object"!=EC(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=EC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==EC(e)?e:e+""}function RC(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function kC(t,e){return t.get(NC(t,e))}function TC(t,e,n){return t.set(NC(t,e),n),n}function NC(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var AC=new Vf({image:new kf({fill:new Nf({color:"#18a058"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),zIndex:9}),DC=new kf({fill:new Nf({color:"#e59810"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),FC=new Vf({image:DC,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new lg(e)}}),jC=new Vf({zIndex:5,image:DC,geometry:function(t){var e=t.getGeometry().getCoordinates();return new lg(e)}}),GC={base:[new Vf({fill:new Nf({color:"#9ffbc74d"}),stroke:new Df({color:"#16e96f",width:2})})],select:[new Vf({fill:new Nf({color:"#ff7f1db3"}),stroke:new Df({color:"#ff7f1d",width:2})})],draw:[AC,new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#e59810",width:2,lineDash:[10,10]})}),jC],edit:[new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#e59810",width:2})}),FC],error:[new Vf({fill:new Nf({color:"#ff492480"}),stroke:new Df({color:"#e59810",width:2})}),FC]},BC={base:[new Vf({fill:new Nf({color:"#ffbdb299"}),stroke:new Df({color:"#eb7272",width:2})})],base2:[new Vf({fill:new Nf({color:"#ff252599"}),stroke:new Df({color:"#ff7676",width:2})})],select:[new Vf({fill:new Nf({color:"#ff7f1db3"}),stroke:new Df({color:"#ff7f1d",width:1})})],draw:[AC,new Vf({fill:new Nf({color:"#ffbdb299"}),stroke:new Df({color:"#ffffff",width:1,lineDash:[6,10]})}),jC],edit:[new Vf({fill:new Nf({color:"#ffbdb299"}),stroke:new Df({color:"#eb7272",width:1})}),FC],edit2:[new Vf({fill:new Nf({color:"#ff252599"}),stroke:new Df({color:"#ff7676",width:1})}),FC],error:[new Vf({fill:new Nf({color:"#ff492480"}),stroke:new Df({color:"#e59810",width:2})}),FC]},zC=new WeakMap,VC=new WeakMap,UC=new WeakMap,WC=function(){return t=function t(e){var n,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),RC(this,zC,void 0),RC(this,VC,void 0),RC(this,UC,void 0),OC(this,"textList",[]),OC(this,"isShowLength",!1),OC(this,"tempShowLenFnCB",function(t){r.showLengthFn(t.target)}),OC(this,"active",!1),OC(this,"clickPointCB",function(t){if(!t)return r.hideClickPoint(),!1;switch(t.type){case"modifystart":return r.hideClickPoint(),void(r.changeSelectPoint&&r.changeSelectPoint());case"modifyend":return void r.changeRiskAreaErrorStatus(r.riskAreaStatusIsError());default:console.info("click point",t)}var e=ja(t.coordinate),n=Ba(r.activeRiskArea.getPath());return su(e,uf(n,.001))?(r.selectPoint?(r.selectPoint.show(),r.selectPoint.setPosition(t.coordinate)):r.selectPoint=new Wm({map:r.map,position:t.coordinate,color:"#18a058",borderColor:"#ffffff",borderWidth:1}),r.changeSelectPoint&&r.changeSelectPoint(r.selectPoint),r.changeRiskAreaErrorStatus(r.riskAreaStatusIsError()),!0):(r.hideClickPoint(),!1)}),OC(this,"activeRiskAreaGeom",function(t){var e,n,i=PC(r.getPath());r.activeRiskArea=t.geom,r.activeRiskArea.setSourceStyle(BC.base),r.activeRiskArea.setExtData({riskLevel:1}),r.riskAreaList?(i.push.apply(i,PC(null===(e=r.riskAreaList)||void 0===e?void 0:e.map(function(t){return t.getPath()}))),null!==(n=r.riskAreaList)&&void 0!==n&&n.some(function(t){return t===r.activeRiskArea})||r.riskAreaList.push(r.activeRiskArea)):r.riskAreaList=[r.activeRiskArea],kC(VC,r).editGeom(t.geom,BC.edit,AC,r.clickPointCB),t.geom.setActiveStyle(BC.select),r.changeRiskAreaErrorStatus(r.riskAreaStatusIsError()),r.finishRiskDrawCB&&r.finishRiskDrawCB()}),OC(this,"defaultCondition",function(t){var e=Ga(r.getPath()),n=su(ja(t),e);return n||r.outOfBoundsCB&&r.outOfBoundsCB(),n}),OC(this,"condition",function(t){return console.log("condition",t),r.conditionCallback(t.coordinate)}),OC(this,"selectRiskCB",function(t){var e;if(t.target.isActive())return t.target.setActive(!1),r.changeActiveRiskCB&&r.changeActiveRiskCB(),!1;null===(e=r.riskAreaList)||void 0===e||e.forEach(function(t){return t.setActive(!1)}),t.target.setActive(!0),r.changeActiveRiskCB&&r.changeActiveRiskCB(t.target)}),OC(this,"isOpenSelect",!1),OC(this,"finishEditRisk",function(){return!!r.activeRiskArea&&!r.riskAreaStatusIsError()&&(r.riskAreaList?r.riskAreaList.some(function(t){return t===r.activeRiskArea})||r.riskAreaList.push(r.activeRiskArea):r.riskAreaList=[r.activeRiskArea],kC(VC,r).getEditGeom(r.activeRiskArea)&&(r.hideClickPoint(),kC(VC,r).closeEditGeom(r.activeRiskArea)),void(r.activeRiskArea=void 0))});var i=null!==(n=e.callbacks)&&void 0!==n?n:{},o=i.changeSelectPoint,s=i.isError,a=i.outOfBoundsCB,u=i.finishRiskDrawCB,l=i.changeActiveRiskCB;this.changeSelectPoint=o,this.isError=s,this.outOfBoundsCB=a,this.finishRiskDrawCB=u,this.changeActiveRiskCB=l,console.log("test cb",this.changeSelectPoint,this.isError,this.outOfBoundsCB,this.finishRiskDrawCB),this.init(this.formatOptions(e))},e=[{key:"formatOptions",value:function(t){return t.path?t.map?t:(console.error("map is error."),!1):(console.error("path is error."),!1)}},{key:"init",value:function(t){var e=this;if(console.log("risk area options",t),this.featureName=Rv(),this.areaPath=t.path,TC(zC,this,new Na({type:"polygon",geometry:new Uo(t.path),name:this.featureName})),this.style=GC.base,kC(zC,this).setStyle(this.style),this.layer=new pv({features:[kC(zC,this)],zIndex:999}),this.initPath=t.path,this.setMap(t.map),t.riskAreaList){var n={1:"#ffbdb299",2:"#ff252599"},r={1:"#eb7272",2:"#ff7676"};this.riskAreaList=t.riskAreaList.map(function(t){var i=t.level,o=1===parseInt(t.isAll),s=new r_({path:o?t.path:t.path[0],map:e.map,borderWidth:1,strokeColor:r[i],fillColor:n[i],extData:SC({riskLevel:i},t),isGeomPolygon:o});return o&&(e.isAllRisk=!0),s.setActiveStyle(BC.select),s})}}},{key:"feature",get:function(){return kC(zC,this)}},{key:"hideLength",value:function(){this.isShowLength=!1,this.textList.length>0&&(this.textList.forEach(function(t){return t.destroy()}),this.textList=[]),kC(zC,this).getGeometry().un("change",this.tempShowLenFnCB)}},{key:"showLength",value:function(){this.isShowLength=!0,this.showLengthFn(kC(zC,this).getGeometry()),kC(zC,this).getGeometry().on("change",this.tempShowLenFnCB)}},{key:"showLengthFn",value:function(t){var e=this,n=[];t.getCoordinates()[0].reduce(function(t,e){if(!t)return e;var r=[(t[0]+e[0])/2,(t[1]+e[1])/2],i=wu(Ba([t,e]));i=i<1?Math.round(1e3*i*100)/100+" m":Math.round(100*i)/100+" km";var o=Math.atan2(t[0]-e[0],t[1]-e[1])+Math.PI/2;return n.push({position:r,content:i,rotation:o}),e},!1),n.forEach(function(t,n){var r=e.textList[n];r?(r.setRotation(t.rotation),r.setText(t.content),r.setPosition(t.position)):(r=new H_(SC(SC({},t),{},{textBaseline:"bottom",fill:"#ffffff",stroke:"#2b2b2b",borderWidth:4,fontSize:"16px",map:kC(VC,e)})),e.textList[n]=r)})}},{key:"getPath",value:function(){var t;if(kC(zC,this))return null===(t=this.layer)||void 0===t?void 0:t.getSource().getFeatures().map(function(t){return t.getGeometry().getCoordinates()})[0]}},{key:"setActive",value:function(t){"boolean"!==EC(t).toLocaleString()&&(t=!!t),this.active=t,t?kC(zC,this).setStyle(GC.select):kC(zC,this).setStyle(GC.base)}},{key:"isActive",value:function(){return!!this.active}},{key:"isVisible",value:function(){var t;return null===(t=this.layer)||void 0===t?void 0:t.getVisible()}},{key:"show",value:function(){var t;null===(t=this.layer)||void 0===t||t.setVisible(!0)}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.setVisible(!1)}},{key:"setMap",value:function(t){kC(VC,this)&&this.layer&&kC(VC,this).removeFeature(this.layer),t?(this.layer&&t.addFeature(this.layer),TC(VC,this,t),TC(UC,this,new Mv(this,kC(VC,this).map))):TC(VC,this,void 0)}},{key:"map",get:function(){return kC(VC,this)}},{key:"eventList",get:function(){return kC(UC,this).eventList}},{key:"on",value:function(t,e){return kC(UC,this).featureOn(t,e,yv)}},{key:"off",value:function(t,e){return kC(UC,this).off(t,e,yv)}},{key:"hideClickPoint",value:function(){var t;null===(t=this.selectPoint)||void 0===t||t.hide()}},{key:"deleteSelectPoint",value:function(){return!!this.selectPoint&&!!this.activeRiskArea&&(this.hideClickPoint(),this.changeSelectPoint&&this.changeSelectPoint(void 0),this.map.deletePointForGeom(this.activeRiskArea),void this.changeRiskAreaErrorStatus(this.riskAreaStatusIsError()))}},{key:"riskAreaStatusIsError",value:function(){var t=this;if(!this.activeRiskArea)return!1;if(this.isAllRisk)return!1;var e=Ga([this.activeRiskArea.getPath()]);if(mu(e).features.length>0)return this.isError&&this.isError("kinks"),!0;var n,r=PC(this.getPath()),i=r.some(function(t,n){return 0!==n&&Il(e,Ga([t]))}),o=!1;if(this.riskAreaList&&r.push.apply(r,PC(null===(n=this.riskAreaList)||void 0===n?void 0:n.filter(function(e){return e!==t.activeRiskArea}).map(function(t){var n=t.getPath(),r=Ga([n]);return(Il(e,r)||kl(r,e))&&(o=!0),n}))),o)return this.isError&&this.isError("overlap"),this.outOfBoundsCB&&this.outOfBoundsCB(),!0;var s=Ga(r);return kl(s,e)||!Il(s,e)||i?(this.isError&&this.isError("outBounds"),this.outOfBoundsCB&&this.outOfBoundsCB(),!0):(this.isError&&this.isError(!1),!1)}},{key:"changeRiskAreaErrorStatus",value:function(t){var e=this.activeRiskArea.feature;if(Array.isArray(e)&&(e=e[0]),t)e.setStyle(BC.error);else{var n,r,i=null===(n=this.activeRiskArea.extData)||void 0===n?void 0:n.riskLevel;switch(parseInt(i)){case 1:default:r=BC.edit;break;case 2:r=BC.edit2}e.setStyle(r)}}},{key:"drawRisk",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultCondition;return!this.isAllRisk&&!!this.map&&(this.finishEditRisk(),!this.activeRiskArea&&(this.conditionCallback=t,void this.map.startDraw("riskArea",this.activeRiskAreaGeom,this.condition,BC.draw)))}},{key:"openSelect",value:function(){var t;if(this.isOpenSelect)return!1;var e=this;this.isOpenSelect=!0,null===(t=this.riskAreaList)||void 0===t||t.forEach(function(t){t.on("click",e.selectRiskCB)})}},{key:"setActiveRiskLevel",value:function(t){var e,n=null===(e=this.riskAreaList)||void 0===e?void 0:e.find(function(t){return t.active});null==n||n.setExtData({riskLevel:t});var r=1===t?BC.base:BC.base2;n.setSourceStyle(r)}},{key:"closeSelect",value:function(){var t,e;this.isOpenSelect=!1;var n=this;null===(t=this.riskAreaList)||void 0===t||t.forEach(function(t){t.off("click",n.selectRiskCB)}),null===(e=this.riskAreaList)||void 0===e||e.forEach(function(t){return t.setActive(!1)}),this.changeActiveRiskCB&&this.changeActiveRiskCB()}},{key:"openRiskEdit",value:function(){var t,e,n,r;if(this.activeRiskArea=null===(t=this.riskAreaList)||void 0===t?void 0:t.find(function(t){return t.active}),this.closeSelect(),!this.activeRiskArea)return!1;null===(e=this.riskAreaList)||void 0===e||e.forEach(function(t){return t.setActive(!1)}),this.tempRiskPath=this.activeRiskArea.getPath();var i,o=null!==(n=null===(r=this.activeRiskArea.extData)||void 0===r?void 0:r.riskLevel)&&void 0!==n?n:1;switch(parseInt(o)){case 1:default:i=BC.edit;break;case 2:i=BC.edit2}kC(VC,this).editGeom(this.activeRiskArea,i,AC,this.clickPointCB)}},{key:"cancelRiskEdit",value:function(){if(!this.tempRiskPath)return!1;this.activeRiskArea&&(kC(VC,this).getEditGeom(this.activeRiskArea)&&(this.hideClickPoint(),kC(VC,this).closeEditGeom(this.activeRiskArea)),this.activeRiskArea.setPath(this.tempRiskPath))}},{key:"deleteRisk",value:function(){var t,e,n;if(this.activeRiskArea=(null===(t=this.riskAreaList)||void 0===t?void 0:t.find(function(t){return t.active}))||this.activeRiskArea,!this.activeRiskArea)return!1;var r=null===(e=this.riskAreaList)||void 0===e?void 0:e.findIndex(function(t){return t.active});null===(n=this.riskAreaList)||void 0===n||n.splice(r,1),this.activeRiskArea&&(kC(VC,this).getEditGeom(this.activeRiskArea)&&(this.hideClickPoint(),kC(VC,this).closeEditGeom(this.activeRiskArea)),this.activeRiskArea.hide()),this.tempRisk=this.activeRiskArea,this.activeRiskArea=void 0,this.isAllRisk&&(this.isAllRisk=!1)}},{key:"cancelDeleteRisk",value:function(){if(!this.tempRisk)return!1;this.riskAreaList?this.riskAreaList.push(this.tempRisk):this.riskAreaList=[this.tempRisk],this.tempRisk.show(),this.activeRiskArea=this.tempRisk,this.tempRisk=void 0}},{key:"setAllRisk",value:function(){this.isAllRisk=!0;var t=new r_({path:this.areaPath,isGeomPolygon:!0,map:this.map,borderWidth:1,strokeColor:"#eb7272",fillColor:"#ffbdb299",extData:{riskLevel:1}});t.setActiveStyle(BC.select),this.riskAreaList=[t]}}],e&&MC(t.prototype,e),n&&MC(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),XC={Logger:{prefix:"[MapSDK]",info:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=console).log.apply(e,["".concat(this.prefix," [INFO] ").concat(t)].concat(r))},error:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=console).error.apply(e,["".concat(this.prefix," [ERROR] ").concat(t)].concat(r))},warn:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=console).warn.apply(e,["".concat(this.prefix," [WARN] ").concat(t)].concat(r))}},ErrorHandler:{handle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return XC.Logger.error("[Error".concat(e?" - "+e:"","]:"),t),!1},validateMap:function(t,e){return!!t||(this.handle(new Error("地图未初始化"),e),!1)}},debounce:function(t,e){var n=null;return function(){for(var r=this,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];clearTimeout(n),n=setTimeout(function(){return t.apply(r,o)},e)}},throttle:function(t,e){var n;return function(){if(!n){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];t.apply(this,i),n=!0,setTimeout(function(){return n=!1},e)}}}},qC=XC;function YC(t){return YC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},YC(t)}function HC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function ZC(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?HC(Object(n),!0).forEach(function(e){KC(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):HC(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function KC(t,e,n){return(e=tS(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JC(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return $C(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$C(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $C(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function QC(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tS(r.key),r)}}function tS(t){var e=function(t,e){if("object"!=YC(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=YC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==YC(e)?e:e+""}var eS=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:MUTEX_CONFIG;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e,this.currentScenario=e.defaultScenario,this.activeFeatures=new Map,this.eventListeners=new Map},e=[{key:"switchScenario",value:function(t){var e=this;if(!this.config.scenarios[t])return qC.Logger.warn("[Mutex] 场景不存在:".concat(t)),!1;this.config.scenarios[this.currentScenario];var n=this.config.scenarios[t];return this.activeFeatures.forEach(function(t,r){var i=e.config.featureMap[r];if(i){var o,s,a=i.group;(null!==(o=n.disabledGroups)&&void 0!==o&&o.includes(a)||null===(s=n.enabledGroups)||void 0===s||!s.includes(a))&&e.deactivate(r)}}),this.currentScenario=t,qC.Logger.info("[Mutex] 场景切换:".concat(this.currentScenario)),!0}},{key:"activate",value:function(t,e,n){var r,i,o=this.config.featureMap[t];if(!o)return qC.Logger.info("[Mutex] 无互斥规则,直接激活:".concat(t)),e(),this.activeFeatures.set(t,{closeFn:n,timestamp:Date.now()}),this._emit("activate",t),!0;var s=o.group,a=o.id,u=this.config.groups[s],l=this.config.scenarios[this.currentScenario];if(null!==(r=l.disabledGroups)&&void 0!==r&&r.includes(s)||null===(i=l.enabledGroups)||void 0===i||!i.includes(s))return qC.Logger.warn("[Mutex] 场景禁用该功能组:".concat(s)),!1;if(null!=u&&u.exclusive&&this._closeGroupExcept(s,a),l.customRules){var c=l.customRules.filter(function(t){var e;return null===(e=t.blocks)||void 0===e?void 0:e.includes(a)}).map(function(t){return t.from});if(c.length>0)return qC.Logger.warn("[Mutex] 自定义规则阻止激活:".concat(t),c),!1}return e(),this.activeFeatures.set(a,{closeFn:n,timestamp:Date.now(),featureName:t,group:s}),qC.Logger.info("[Mutex] 激活:".concat(t," (组:").concat(s,", ID:").concat(a,")")),this._emit("activate",t,a),!0}},{key:"deactivate",value:function(t){var e=this.config.featureMap[t],n=(null==e?void 0:e.id)||t,r=this.activeFeatures.get(n);return!(!r||!r.closeFn||(r.closeFn(),this.activeFeatures.delete(n),qC.Logger.info("[Mutex] 关闭:".concat(t)),this._emit("deactivate",t,n),0))}},{key:"deactivateGroup",value:function(t){var e=this;return!!this.config.groups[t]&&(this.activeFeatures.forEach(function(n,r){n.group===t&&(n.closeFn&&n.closeFn(),e.activeFeatures.delete(r),qC.Logger.info("[Mutex] 关闭组功能:".concat(r)))}),this._emit("deactivateGroup",t),!0)}},{key:"getActiveFeatures",value:function(){return Array.from(this.activeFeatures.entries()).map(function(t){var e=JC(t,2),n=e[0],r=e[1];return{id:n,featureName:r.featureName,group:r.group,timestamp:r.timestamp}})}},{key:"isActive",value:function(t){var e=this.config.featureMap[t],n=(null==e?void 0:e.id)||t;return this.activeFeatures.has(n)}},{key:"getCurrentScenario",value:function(){return this.currentScenario}},{key:"on",value:function(t,e){this.eventListeners.has(t)||this.eventListeners.set(t,[]),this.eventListeners.get(t).push(e)}},{key:"off",value:function(t,e){var n=this.eventListeners.get(t);if(n){var r=n.indexOf(e);r>-1&&n.splice(r,1)}}},{key:"_emit",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=this.eventListeners.get(t);i&&i.forEach(function(t){return t.apply(void 0,n)})}},{key:"_closeGroupExcept",value:function(t,e){var n=this;this.activeFeatures.forEach(function(r,i){r.group===t&&i!==e&&(r.closeFn&&(r.closeFn(),qC.Logger.info("[Mutex] 互斥关闭:".concat(i))),n.activeFeatures.delete(i),n._emit("mutexClose",i,t))})}},{key:"clear",value:function(){this.activeFeatures.forEach(function(t,e){t.closeFn&&t.closeFn()}),this.activeFeatures.clear(),qC.Logger.info("[Mutex] 所有状态已清理"),this._emit("clear")}},{key:"addGroup",value:function(t,e){this.config.groups[t]=e,qC.Logger.info("[Mutex] 添加互斥组:".concat(t))}},{key:"addFeature",value:function(t,e){this.config.featureMap[t]=e,qC.Logger.info("[Mutex] 添加功能映射:".concat(t))}},{key:"addScenario",value:function(t,e){this.config.scenarios[t]=e,qC.Logger.info("[Mutex] 添加场景:".concat(t))}},{key:"updateConfig",value:function(t){this.config=ZC(ZC({},this.config),t),qC.Logger.info("[Mutex] 配置已更新")}}],e&&QC(t.prototype,e),n&&QC(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),nS=eS,rS={groups:{draw:{name:"绘制功能",features:["drawPolygon","drawPolyline","drawIsolation","drawRisk","drawSmartPolygon"],exclusive:!0},edit:{name:"编辑功能",features:["editPolygon","editIsolation","editRisk","editSmartPolygon"],exclusive:!0},measure:{name:"测量功能",features:["measureLength","measureArea"],exclusive:!0},annotation:{name:"标注功能",features:["addText","addMarker","addInfoWindow"],exclusive:!1},layer:{name:"图层功能",features:["addLayer","addKrigingLayer","addPolygonLayer"],exclusive:!1}},featureMap:{toggleDraw:{group:"draw",id:"drawPolygon"},startDrawIsolation:{group:"draw",id:"drawIsolation"},startDrawRisk:{group:"draw",id:"drawRisk"},startDrawSmartPolygon:{group:"draw",id:"drawSmartPolygon"},togglePolygonEdit:{group:"edit",id:"editPolygon"},openEditIsolation:{group:"edit",id:"editIsolation"},openEditRisk:{group:"edit",id:"editRisk"},openEditCore:{group:"edit",id:"editSmartPolygon"},length:{group:"measure",id:"measureLength"},area:{group:"measure",id:"measureArea"},addText:{group:"annotation",id:"addText"},addMarker:{group:"annotation",id:"addMarker"},addInfoWindow:{group:"annotation",id:"addInfoWindow"},addLayer:{group:"layer",id:"addLayer"},addKrigingLayer:{group:"layer",id:"addKrigingLayer"},addPolygonLayer:{group:"layer",id:"addPolygonLayer"}},scenarios:{default:{enabledGroups:["draw","edit","measure","annotation","layer"],description:"默认场景,所有互斥规则生效"},editMode:{enabledGroups:["draw","edit"],disabledGroups:["measure"],description:"编辑模式,只启用绘制和编辑互斥"},viewMode:{enabledGroups:["layer","annotation"],disabledGroups:["draw","edit","measure"],description:"查看模式,禁用所有编辑功能"},emergency:{enabledGroups:["draw","annotation"],customRules:[{from:"drawRisk",blocks:["drawIsolation"]}],description:"应急指挥场景,自定义互斥规则"}},defaultScenario:"default"},iS={MAP:{TARGET:"mapbox",TARGET_1:"mapbox1",DEFAULT_ZOOM:2,DEFAULT_ZOOM_1:15,ZOOMS:[1,18],CENTER:[116.3974,39.9093],CENTER_1:[120.566032634,33.355905081],PROJECTION:"EPSG:3857"},LAYER:{KRIGING:{NAME:"BZ",Z_INDEX:102,ALPHA:.7,WIDTH:.01},TILE:{Z_INDEX:100,Z_INDEX_1:101}},URLS:{TILE_1:"https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",TILE_2:"https://webst04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",ICON_1:"https://openlayers.org/en/v6.15.1/examples/data/icon.png",ICON_2:"https://openlayers.org/en/v6.15.1/apidoc/logo-70x70.png"},GROUP:{DEFAULT:"ttt",MASS:"mass",POLYLINE:"aa"}};function oS(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return sS(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sS(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sS(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function aS(t){return aS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aS(t)}function uS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lS(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hS(r.key),r)}}function cS(t,e,n){return e&&lS(t.prototype,e),n&&lS(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function hS(t){var e=function(t,e){if("object"!=aS(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=aS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==aS(e)?e:e+""}var fS=function(){return cS(function t(){var e=this;uS(this,t),this.mapManager=new pS,this.layerManager=new dS(this.mapManager),this.markerManager=new gS(this.mapManager),this.controlManager=new yS(this.mapManager),this.textManager=new vS(this.mapManager),this.infoWindowManager=new _S(this.mapManager),this.drawManager=new mS(this.mapManager,this.layerManager),this.eventManager=new xS(this.mapManager,this.markerManager),this.isolationManager=new wS(this.mapManager),this.riskManager=new bS(this.mapManager),this.smartEditManager=new ES(this.mapManager),this.trackManager=new CS,this.mutexManager=new nS(rS),this.mutexManager.on("activate",function(){return e._updateUIState()}),this.mutexManager.on("deactivate",function(){return e._updateUIState()}),this.mutexManager.on("mutexClose",function(){return e._updateUIState()}),this.mutexManager.on("scenarioChange",function(){return e._updateUIState()}),qC.Logger.info("MapService 初始化完成")},[{key:"initMap",value:function(){return this.mapManager.initMap()}},{key:"addKrigingLayer",value:function(){return this.layerManager.addKrigingLayer()}},{key:"addPolygon",value:function(){return this.layerManager.addPolygon()}},{key:"addComplexPolygon",value:function(){return this.layerManager.addComplexPolygon()}},{key:"addPolyline",value:function(){return this.layerManager.addPolyline()}},{key:"addMarker",value:function(){return this.markerManager.addMarker()}},{key:"addMarker1",value:function(){return this.markerManager.addMarker1()}},{key:"addMassMarker",value:function(){return this.markerManager.addMassMarker()}},{key:"addMassMarker1",value:function(){return this.markerManager.addMassMarker1()}},{key:"addClustersMarker1",value:function(){return this.markerManager.addClustersMarker1()}},{key:"toggleMarker",value:function(){return this.markerManager.toggleMarker()}},{key:"toggleMarkerDrag",value:function(){return this.markerManager.toggleMarkerDrag()}},{key:"openMoveMarker",value:function(){return this.markerManager.openMoveMarker()}},{key:"pauseMoveMarker",value:function(){return this.markerManager.pauseMoveMarker()}},{key:"addControlOverView",value:function(){return this.controlManager.addControlOverView()}},{key:"addControlScale",value:function(){return this.controlManager.addControlScale()}},{key:"addControlZoomTool",value:function(){return this.controlManager.addControlZoomTool()}},{key:"addText",value:function(){return this.textManager.addText()}},{key:"addInfoWindow",value:function(){return this.infoWindowManager.addInfoWindow()}},{key:"toggleInfoWindowVisible",value:function(){return this.infoWindowManager.toggleInfoWindowVisible()}},{key:"toggleDraw",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polygon";return this.mutexManager.activate("toggleDraw",function(){return t.drawManager.toggleDraw(e)},function(){return t.drawManager.toggleDraw(e)})}},{key:"undoDraw",value:function(){return this.drawManager.undoDraw()}},{key:"endDraw",value:function(){return this.drawManager.endDraw()}},{key:"startDrawIsolation",value:function(){var t=this;return this.mutexManager.activate("startDrawIsolation",function(){return t.isolationManager.startDrawIsolation()},function(){return t.isolationManager.closeEditIsolation()})}},{key:"startDrawRisk",value:function(){var t=this;return this.mutexManager.activate("startDrawRisk",function(){return t.riskManager.startDrawRisk()},function(){})}},{key:"startDrawSmartPolygon",value:function(){var t=this;return this.mutexManager.activate("startDrawSmartPolygon",function(){return t.smartEditManager.startDrawSmartPolygon()},function(){return t.smartEditManager.closeEditSmartPolygon()})}},{key:"togglePolygonEdit",value:function(){var t=this;return this.mutexManager.activate("togglePolygonEdit",function(){return t.drawManager.togglePolygonEdit()},function(){return t.drawManager.togglePolygonEdit()})}},{key:"togglePolygonVisible",value:function(){return this.drawManager.togglePolygonVisible()}},{key:"openEditIsolation",value:function(){var t=this;return this.mutexManager.activate("openEditIsolation",function(){return t.isolationManager.openEditIsolation()},function(){return t.isolationManager.closeEditIsolation()})}},{key:"openEditRisk",value:function(){var t=this;return this.mutexManager.activate("openEditRisk",function(){return t.riskManager.openEditRisk()},function(){})}},{key:"openEditCore",value:function(){var t=this;return this.mutexManager.activate("openEditCore",function(){return t.smartEditManager.openEditCore()},function(){return t.smartEditManager.closeEditCore()})}},{key:"openEditSmartPolygon",value:function(){return this.smartEditManager.openEditSmartPolygon()}},{key:"closeEditSmartPolygon",value:function(){return this.smartEditManager.closeEditSmartPolygon()}},{key:"length",value:function(){var t=this;return this.mutexManager.activate("length",function(){return t.drawManager.length()},function(){})}},{key:"newIsolation",value:function(){return this.isolationManager.newIsolation()}},{key:"selectIsolation",value:function(){return this.isolationManager.selectIsolation()}},{key:"closeEditIsolation",value:function(){return this.isolationManager.closeEditIsolation()}},{key:"newRiskArea",value:function(){return this.riskManager.newRiskArea()}},{key:"finishEditRisk",value:function(){return this.riskManager.finishEditRisk()}},{key:"openSelectRisk",value:function(){return this.riskManager.openSelectRisk()}},{key:"newSmartPolygon",value:function(){return this.smartEditManager.newSmartPolygon()}},{key:"useCorer",value:function(){return this.smartEditManager.useCorer()}},{key:"closeEditCore",value:function(){return this.smartEditManager.closeEditCore()}},{key:"showPopup",value:function(){return this.trackManager.showPopup()}},{key:"mapOnEvent",value:function(){return this.eventManager.mapOnEvent()}},{key:"mapOffEvent",value:function(){return this.eventManager.mapOffEvent()}},{key:"markerOnEvent",value:function(){return this.eventManager.markerOnEvent()}},{key:"markerOffEvent",value:function(){return this.eventManager.markerOffEvent()}},{key:"switchScenario",value:function(t){return this.mutexManager.switchScenario(t)}},{key:"getActiveFeatures",value:function(){return this.mutexManager.getActiveFeatures()}},{key:"getCurrentScenario",value:function(){return this.mutexManager.getCurrentScenario()}},{key:"clearAllFeatures",value:function(){this.mutexManager.clear(),this._updateUIState()}},{key:"_updateUIState",value:function(){var t=this,e=document.getElementById("scenario-indicator");e&&(e.textContent="场景:".concat(this.getCurrentScenario()));var n=this.getActiveFeatures(),r=document.getElementById("active-count"),i=document.getElementById("active-features-list");r&&(r.textContent="激活功能:".concat(n.length)),i&&(0===n.length?i.innerHTML='<p class="empty-tip">暂无激活功能</p>':i.innerHTML=n.map(function(t){return'<span class="feature-item">'.concat(t.featureName," (").concat(t.group||"无组",")</span>")}).join("")),document.querySelectorAll(".btn-tool").forEach(function(e){var n=e.getAttribute("data-feature");if(n){var r=t.mutexManager.isActive(n);e.classList.toggle("active",r)}}),document.querySelectorAll("[data-scenario]").forEach(function(e){var n=e.getAttribute("data-scenario");e.classList.toggle("btn-primary",n===t.getCurrentScenario()),e.classList.toggle("btn-secondary",n!==t.getCurrentScenario())})}},{key:"destroy",value:function(){try{this.mutexManager.clear(),this.eventManager.cleanup(),this.trackManager.destroy(),this.smartEditManager.destroy(),this.riskManager.destroy(),this.isolationManager.destroy(),this.infoWindowManager.destroy(),this.textManager.destroy(),this.controlManager.destroy(),this.drawManager.destroy(),this.markerManager.destroy(),this.layerManager.destroy(),this.mapManager.destroy(),qC.Logger.info("✅ 所有资源已销毁")}catch(t){qC.ErrorHandler.handle(t,"MapService.destroy")}}},{key:"getLayerManager",value:function(){return this.layerManager}},{key:"getMapManager",value:function(){return this.mapManager}},{key:"getMarkerManager",value:function(){return this.markerManager}}])}(),pS=function(){return cS(function t(){uS(this,t),this.map=null,this.map1=null,this.controlObj={}},[{key:"initMap",value:function(){try{var t={target:iS.MAP.TARGET,zoom:iS.MAP.DEFAULT_ZOOM,zooms:iS.MAP.ZOOMS,center:iS.MAP.CENTER,controls:{attribution:!1,zoom:!0,rotate:!1},undoDrawCB:function(t){qC.Logger.info("example undoDrawCB count:",t)}};return this.map=new XNOM.Map(t),this.map.on("loadend",PS),qC.Logger.info("主地图初始化成功"),this.map}catch(t){return qC.ErrorHandler.handle(t,"MapManager.initMap")}}},{key:"getMap",value:function(){return this.map}},{key:"getControlObj",value:function(){return this.controlObj}},{key:"setControlObj",value:function(t){this.controlObj=t}},{key:"destroy",value:function(){try{this.map&&"function"==typeof this.map.destroy&&(this.map.destroy(),this.map=null),this.map1&&"function"==typeof this.map1.destroy&&(this.map1.destroy(),this.map1=null),this.controlObj={},qC.Logger.info("地图资源已销毁")}catch(t){qC.ErrorHandler.handle(t,"MapManager.destroy")}}}])}(),dS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.layers={},this.krigingLayer=null,this.polygon=null,this.complexPolygon=null,this.polyline=null},[{key:"addKrigingLayer",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"LayerManager.addKrigingLayer")&&(this.krigingLayer=new XNOM.KrigingLayer({name:iS.LAYER.KRIGING.NAME,zIndex:iS.LAYER.KRIGING.Z_INDEX,alpha:iS.LAYER.KRIGING.ALPHA,width:iS.LAYER.KRIGING.WIDTH,data:[{id:1660,lat:"28.8",lon:"88.5",value:"-15"},{id:1661,lat:"29.1",lon:"88.8",value:"-8"},{id:1662,lat:"29.4",lon:"89.1",value:"-5.68"},{id:1663,lat:"29.1",lon:"88.5",value:"-8.66"},{id:1664,lat:"29.3",lon:"88.8",value:"10.290001"},{id:1665,lat:"29.6",lon:"89.1",value:"5.68"},{id:1666,lat:"29.8",lon:"89.3",value:"8.66"},{id:1667,lat:"30.1",lon:"89.7",value:"15"},{id:1668,lat:"30.5",lon:"90",value:"-5.68"}],path:[[89.591517,30.735206],[90.245204,30.070533],[90.091395,29.043311],[89.261927,28.719214],[88.344569,29.153174],[88.251185,30.043067],[88.899379,30.702247],[89.591517,30.735206]],colors:["#ff4400","#ff7c4c","#ffb499","#ffece5","#ffffff","#b9dcff","#84c2ff","#56a7fd","#2189ff"]}),t.map&&t.map.addLayer(this.krigingLayer),this.layers.kriging=this.krigingLayer,this.krigingLayer)}catch(t){return qC.ErrorHandler.handle(t,"LayerManager.addKrigingLayer")}}},{key:"addPolygon",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"LayerManager.addPolygon"))return!1;var e={group:iS.GROUP.DEFAULT,path:[[[89.591517,30.735206],[90.245204,30.070533],[90.091395,29.043311],[89.261927,28.719214],[88.344569,29.153174],[88.251185,30.043067],[88.899379,30.702247],[89.591517,30.735206]],[[88.591517,30.735206],[91.245204,30.070533],[91.091395,29.043311],[88.591517,30.735206]]],map:t};return this.polygon=new XNOM.Polygon(e),this.layers.polygon=this.polygon,this.polygon}catch(t){return qC.ErrorHandler.handle(t,"LayerManager.addPolygon")}}},{key:"addComplexPolygon",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"LayerManager.addComplexPolygon"))return!1;var e={path:[[[87.8883927613539,29.2847665670185],[88.88301011920525,29.253306650590112],[88.86849015777676,28.520048598451524],[88.60229086492117,28.31192915130988],[88.09167222135272,28.32886910630978],[87.74319314706904,28.59264840559396],[87.78191304421166,28.972587396306032],[87.8883927613539,29.2847665670185]]],map:t};return this.complexPolygon=new XNOM.ComplexPolygon(e),this.layers.complexPolygon=this.complexPolygon,this.complexPolygon}catch(t){return qC.ErrorHandler.handle(t,"LayerManager.addComplexPolygon")}}},{key:"addPolyline",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"LayerManager.addPolyline"))return!1;var e={path:[[88.8883927613539,30.2847665670185],[89.88301011920525,30.253306650590112],[89.86849015777676,29.520048598451524],[89.60229086492117,29.31192915130988],[89.09167222135272,29.32886910630978],[88.74319314706904,29.59264840559396],[88.78191304421166,29.972587396306032]],map:t,group:iS.GROUP.POLYLINE};this.polyline=new XNOM.Polyline(e);var n={path:[[89.8883927613539,30.2847665670185],[90.88301011920525,30.253306650590112],[90.86849015777676,29.520048598451524],[90.60229086492117,29.31192915130988],[90.09167222135272,29.32886910630978],[89.74319314706904,29.59264840559396],[89.78191304421166,29.972587396306032]],borderWidth:0,map:t,group:iS.GROUP.POLYLINE},r=new XNOM.Polyline(n);return this.layers.polyline=this.polyline,this.layers.polyline1=r,this.polyline}catch(t){return qC.ErrorHandler.handle(t,"LayerManager.addPolyline")}}},{key:"getPolygon",value:function(){return this.polygon}},{key:"getPolyline",value:function(){return this.polyline}},{key:"destroy",value:function(){try{Object.values(this.layers).forEach(function(t){t&&"function"==typeof t.destroy&&t.destroy()}),this.layers={},this.krigingLayer=null,this.polygon=null,this.complexPolygon=null,this.polyline=null,qC.Logger.info("图层资源已清理")}catch(t){qC.ErrorHandler.handle(t,"LayerManager.destroy")}}}])}(),gS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.markers={},this.massMarkers={},this.clustersMarkers={},this.isPause=!1},[{key:"addMarker",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"MarkerManager.addMarker"))return!1;var e={position:[89.3,29],src:iS.URLS.ICON_1,activeSrc:iS.URLS.ICON_2,rotation:Math.atan2(1,0),autoRotation:!0,anchor:[.5,1],map:t},n=new XNOM.Marker(e);return n.setMap(t),this.markers.main=n,n}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.addMarker")}}},{key:"addMarker1",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"MarkerManager.addMarker1"))return!1;var e={position:[120.566032634,33.355905081],src:iS.URLS.ICON_1,anchor:[1,1],rotation:Math.atan2(1,0),map:t},n=new XNOM.Marker(e);return this.markers.marker1=n,n}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.addMarker1")}}},{key:"addMassMarker",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"MarkerManager.addMassMarker"))return!1;var e=[];return[[82.2,30.1],[82.2,30.2],[82.3,30.1],[82.3,30.2],[82.3,30.3],[82.3,30.4],[82.4,30.1],[82.4,30.2]].forEach(function(n){var r={position:n,anchor:[.5,.5],group:iS.GROUP.MASS,map:t},i=new XNOM.Marker(r);i.setMap(t),e.push(i)}),this.massMarkers.mass1=e,e}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.addMassMarker")}}},{key:"addMassMarker1",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"MarkerManager.addMassMarker1"))return!1;var e={data:this._getMassMarkerData(),styles:[{src:iS.URLS.ICON_1},{src:iS.URLS.ICON_2}],map:t},n=new XNOM.MassMarker(e);return this.massMarkers.mass2=n,n.on("click",function(t){var e=t.lnglat,r=n.getClosestPoint(e);qC.Logger.info("海量标记点点击",r)}),n}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.addMassMarker1")}}},{key:"_getMassMarkerData",value:function(){for(var t=[],e=82.2;e<=83.6;e+=.1)for(var n=29.2;n<=31.7;n+=.1)t.push({lonlat:[parseFloat(e.toFixed(1)),parseFloat(n.toFixed(1))],styleIndex:Math.random()>.5?0:1,extData:"tttt"});return t.slice(0,200)}},{key:"addClustersMarker1",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"MarkerManager.addClustersMarker1"))return!1;var e={data:this._getMassMarkerData(),styles:[{src:iS.URLS.ICON_1},{src:iS.URLS.ICON_2}],map:t},n=new XNOM.ClustersMarker(e);return this.clustersMarkers.clusters1=n,n}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.addClustersMarker1")}}},{key:"getMarker",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"main";return this.markers[t]}},{key:"toggleMarker",value:function(){try{var t=this.markers.main;return t?(t.getVisible()?t.hide():t.show(),!0):(qC.Logger.warn("标记点不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.toggleMarker")}}},{key:"toggleMarkerDrag",value:function(){try{var t=this.markers.main;return t?(t.getDraggable()?t.setDraggable(!1):t.setDraggable(!0),!0):(qC.Logger.warn("标记点不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.toggleMarkerDrag")}}},{key:"openMoveMarker",value:function(){try{var t=this.markers.main;if(!t)return qC.Logger.warn("标记点不存在"),!1;var e=this._getMovePath();return t.moveAlong(e,10),this.isPause=!1,!0}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.openMoveMarker")}}},{key:"_getMovePath",value:function(){return[["117.917594333","36.9623245"],["117.917867167","36.961468167"],["117.91759","36.961894"]].map(function(t){return t.map(function(t){return parseFloat(t)})})}},{key:"pauseMoveMarker",value:function(){try{var t=this.markers.main;return t?(this.isPause?t.resumeMove():t.pauseMove(),this.isPause=!this.isPause,!0):(qC.Logger.warn("标记点不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.pauseMoveMarker")}}},{key:"getIsPause",value:function(){return this.isPause}},{key:"destroy",value:function(){try{Object.values(this.markers).forEach(function(t){t&&"function"==typeof t.destroy&&t.destroy()}),this.markers={},this.massMarkers={},this.clustersMarkers={},this.isPause=!1,qC.Logger.info("标记点资源已清理")}catch(t){qC.ErrorHandler.handle(t,"MarkerManager.destroy")}}}])}(),yS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.controls={}},[{key:"addControlOverView",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"ControlManager.addControlOverView"))return!1;var e=new XNOM.Control.OverView;return this.controls.overView=e,e.setMap(t),this.mapManager.getControlObj().overView=e,e}catch(t){return qC.ErrorHandler.handle(t,"ControlManager.addControlOverView")}}},{key:"addControlScale",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"ControlManager.addControlScale"))return!1;var e=new XNOM.Control.Scale;return this.controls.scale=e,e.setMap(t),this.mapManager.getControlObj().scale=e,e}catch(t){return qC.ErrorHandler.handle(t,"ControlManager.addControlScale")}}},{key:"addControlZoomTool",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"ControlManager.addControlZoomTool"))return!1;var e=new XNOM.Control.ZoomTool;return this.controls.zoomTool=e,e.setMap(t),this.mapManager.getControlObj().zoomTool=e,e}catch(t){return qC.ErrorHandler.handle(t,"ControlManager.addControlZoomTool")}}},{key:"destroy",value:function(){this.controls={}}}])}(),vS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.texts={}},[{key:"addText",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"TextManager.addText"))return!1;var e={position:[89.3,29],content:"测试文字",fontSize:"48px",fill:"#000",stroke:"#fff",borderWidth:3,map:t,group:iS.GROUP.DEFAULT},n=new XNOM.Text(e);return this.texts.text1=n,[n]}catch(t){return qC.ErrorHandler.handle(t,"TextManager.addText")}}},{key:"destroy",value:function(){this.texts={}}}])}(),_S=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.infoWindow=null},[{key:"addInfoWindow",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"InfoWindowManager.addInfoWindow"))return!1;var e={position:[120.566032634,33.355905081],anchor:[.5,1],dom:"infobox",map:t};return this.infoWindow=new XNOM.InfoWindow(e),this.infoWindow.setMap(t),this.infoWindow}catch(t){return qC.ErrorHandler.handle(t,"InfoWindowManager.addInfoWindow")}}},{key:"toggleInfoWindowVisible",value:function(){try{return this.infoWindow?(this.infoWindow.isVisible()?this.infoWindow.hide():this.infoWindow.show(),!0):(qC.Logger.warn("弹窗未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"InfoWindowManager.toggleInfoWindowVisible")}}},{key:"getInfoWindow",value:function(){return this.infoWindow}},{key:"destroy",value:function(){this.infoWindow&&"function"==typeof this.infoWindow.destroy&&this.infoWindow.destroy(),this.infoWindow=null}}])}(),mS=function(){return cS(function t(e,n){uS(this,t),this.mapManager=e,this.layerManager=n,this.isDraw=!1,this.drawList=[],this.editPoly=!1,this.editPolyline=!1,this.isMeasureOpen=!1,this.measureDblClickHandler=null},[{key:"toggleDraw",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polygon";try{var n=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(n,"DrawManager.toggleDraw")&&(this.isDraw?(n.stopDraw(),this.isDraw=!1):(n.startDraw(e),n.on("drawend",function(e){qC.Logger.info("drawend",e),e.geom.openEdit(),t.drawList.push(e.geom),t.isDraw=!1}),this.isDraw=!0),!0)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.toggleDraw")}}},{key:"undoDraw",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"DrawManager.undoDraw")&&(t.undoDraw(),!0)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.undoDraw")}}},{key:"endDraw",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"DrawManager.endDraw")&&(t.endDraw(),!0)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.endDraw")}}},{key:"togglePolygonEdit",value:function(){try{var t=this.layerManager?this.layerManager.getPolygon():this.mapManager.getLayerManager().getPolygon();return t?(this.editPoly?t.closeEdit():t.openEdit(),this.editPoly=!this.editPoly,!0):(qC.Logger.warn("多边形不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.togglePolygonEdit")}}},{key:"togglePolygonVisible",value:function(){try{var t=this.layerManager?this.layerManager.getPolygon():this.mapManager.getLayerManager().getPolygon();return t?(t.isVisible()?t.hide():t.show(),!0):(qC.Logger.warn("多边形不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.togglePolygonVisible")}}},{key:"length",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"DrawManager.length")&&(t.openMeasure("length"),!0)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.length")}}},{key:"showPopup",value:function(){try{var t=document.getElementById("track-box");return t&&(t.style.display="none"===t.style.display?"block":"none"),!0}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.showPopup")}}},{key:"destroy",value:function(){this.drawList=[],this.isDraw=!1,this.editPoly=!1,this.editPolyline=!1}}])}(),xS=function(){return cS(function t(e,n){uS(this,t),this.mapManager=e,this.markerManager=n,this.eventListeners=[]},[{key:"mapOnEvent",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"EventManager.mapOnEvent"))return!1;var e=t.on(["click"],IS);return this.eventListeners.push({type:"mapClick",listener:e,target:t}),qC.Logger.info("地图点击事件已绑定"),!0}catch(t){return qC.ErrorHandler.handle(t,"EventManager.mapOnEvent")}}},{key:"mapOffEvent",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"EventManager.mapOffEvent")&&(t.off("click",IS),qC.Logger.info("地图点击事件已解绑"),!0)}catch(t){return qC.ErrorHandler.handle(t,"EventManager.mapOffEvent")}}},{key:"markerOnEvent",value:function(){try{var t=this.markerManager.getMarker();if(!t)return qC.Logger.warn("标记点不存在"),!1;var e=t.on("pointermove",MS);return this.eventListeners.push({type:"markerMove",listener:e,target:t}),qC.Logger.info("标记点经过事件已绑定"),!0}catch(t){return qC.ErrorHandler.handle(t,"EventManager.markerOnEvent")}}},{key:"markerOffEvent",value:function(){try{var t=this.markerManager.getMarker();return t?(t.off("pointermove",MS),qC.Logger.info("标记点经过事件已解绑"),!0):(qC.Logger.warn("标记点不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"EventManager.markerOffEvent")}}},{key:"cleanup",value:function(){try{this.eventListeners.forEach(function(t){var e=t.type,n=t.listener,r=t.target;r&&r.off&&r.off(e,n)}),this.eventListeners=[],qC.Logger.info("事件监听器已清理")}catch(t){qC.ErrorHandler.handle(t,"EventManager.cleanup")}}}])}(),wS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.isolation=null,this.selectIsolationId=null},[{key:"newIsolation",value:function(){var t=this;try{var e=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(e,"IsolationManager.newIsolation")&&(this.isolation=new XNOM.Isolation({map:e,isError:function(t){return qC.Logger.info("is error",t)},changeSelectPoint:function(t){return qC.Logger.info("change select point",t)},changeSelectIdCB:function(e){qC.Logger.info("change select id",e),t.selectIsolationId=e}}),this.isolation)}catch(t){return qC.ErrorHandler.handle(t,"IsolationManager.newIsolation")}}},{key:"startDrawIsolation",value:function(){try{return this.isolation?(this.isolation.startDraw(),!0):(qC.Logger.warn("隔离区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"IsolationManager.startDrawIsolation")}}},{key:"openEditIsolation",value:function(){try{return this.isolation?(this.isolation.openEdit(),!0):(qC.Logger.warn("隔离区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"IsolationManager.openEditIsolation")}}},{key:"closeEditIsolation",value:function(){try{return this.isolation?(this.isolation.closeEdit(),!0):(qC.Logger.warn("隔离区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"IsolationManager.closeEditIsolation")}}},{key:"selectIsolation",value:function(){try{return!!this.isolation||(qC.Logger.warn("隔离区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"IsolationManager.selectIsolation")}}},{key:"getIsolation",value:function(){return this.isolation}},{key:"getSelectIsolationId",value:function(){return this.selectIsolationId}},{key:"destroy",value:function(){this.isolation&&"function"==typeof this.isolation.destroy&&this.isolation.destroy(),this.isolation=null,this.selectIsolationId=null}}])}(),bS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.riskArea=null},[{key:"newRiskArea",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"RiskManager.newRiskArea")&&(this.riskArea=new XNOM.RiskArea({map:t,callbacks:{changeSelectPoint:function(t){return qC.Logger.info("change select point",t)},isError:function(t){return qC.Logger.info("isError type:",t)},outOfBoundsCB:function(){return qC.Logger.info("test outOfBoundsCB")},finishRiskDrawCB:function(){return qC.Logger.info("test finishRiskDrawCB")}},path:[[[87.29903773963875,30.790137660768504],[87.25875431299633,29.321631577876087],[88.59542445838875,29.303321142759795],[88.45992596447891,30.720557470884795],[87.29903773963875,30.790137660768504]],[[87.89229945838875,30.270118017759795],[87.69820743799633,29.662207749751087],[88.26949650049633,29.647559535768504],[87.89229945838875,30.270118017759795]]],riskAreaList1:[{path:[[[87.29903773963875,30.790137660768504],[87.25875431299633,29.321631577876087],[88.59542445838875,29.303321142759795],[88.45992596447891,30.720557470884795],[87.29903773963875,30.790137660768504]]],level:1,isAll:1}]}),this.riskArea)}catch(t){return qC.ErrorHandler.handle(t,"RiskManager.newRiskArea")}}},{key:"startDrawRisk",value:function(){try{return this.riskArea?(this.riskArea.drawRisk(),!0):(qC.Logger.warn("风险区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"RiskManager.startDrawRisk")}}},{key:"finishEditRisk",value:function(){try{return this.riskArea?(this.riskArea.finishEditRisk(),!0):(qC.Logger.warn("风险区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"RiskManager.finishEditRisk")}}},{key:"openSelectRisk",value:function(){try{return this.riskArea?(this.riskArea.openSelect(),!0):(qC.Logger.warn("风险区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"RiskManager.openSelectRisk")}}},{key:"openEditRisk",value:function(){try{return this.riskArea?(this.riskArea.openRiskEdit(),!0):(qC.Logger.warn("风险区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"RiskManager.openEditRisk")}}},{key:"destroy",value:function(){this.riskArea&&"function"==typeof this.riskArea.destroy&&this.riskArea.destroy(),this.riskArea=null}}])}(),ES=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.smartPolygon=null},[{key:"newSmartPolygon",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"SmartEditManager.newSmartPolygon")&&(this.smartPolygon=new XNOM.SmartPolygon({map:t,isError:function(t){return qC.Logger.info("isError type:",t)},changeSelectPoint:function(t){return qC.Logger.info("change select point",t)},finishCoreDrawCB:function(){return qC.Logger.info("ttt finishCoreDrawCB")},outOfBoundsCB:function(){return qC.Logger.info("test outOfBoundsCB")},finishDrawCB:function(){return qC.Logger.info("test finishDrawCB")}}),this.smartPolygon)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.newSmartPolygon")}}},{key:"startDrawSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.startDraw(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.startDrawSmartPolygon")}}},{key:"useCorer",value:function(){try{return this.smartPolygon?(this.smartPolygon.useCorer(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.useCorer")}}},{key:"openEditCore",value:function(){try{return this.smartPolygon?(this.smartPolygon.openCoreEdit(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.openEditCore")}}},{key:"closeEditCore",value:function(){try{return this.smartPolygon?(this.smartPolygon.finishRemoveCore(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.closeEditCore")}}},{key:"openEditSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.openEdit(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.openEditSmartPolygon")}}},{key:"closeEditSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.closeEdit(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.closeEditSmartPolygon")}}},{key:"destroy",value:function(){this.smartPolygon&&"function"==typeof this.smartPolygon.destroy&&this.smartPolygon.destroy(),this.smartPolygon=null}}])}(),CS=function(){return cS(function t(){uS(this,t),this.trackReplay=null,this.resultArr=this._parseTrackData()},[{key:"_parseTrackData",value:function(){try{var t="2023-10-13 07:43:57,117.917594333,36.9623245,10.0,1,1;2023-10-13 07:44:02,117.917606667,36.962418167,10.0,1,1".split(";").map(function(t){var e=oS(t.split(","),6);return{time:e[0],lon:e[1],lat:e[2],deep:e[3],status:e[4],group:e[5]}}).reduce(function(t,e){var n=e.group;return n in t?t[n].push(e):t[n]=[e],t},{}),e=Object.keys(t).map(function(e){return t[e].reduce(function(t,e){var n=e.status,r=e.deep,i=e.lon,o=e.lat;return n!==t[t.length-1].status&&new Set(["0","1","2"]).has(n)&&t.push({status:n,deep:r,lon:i,lat:o}),t},[{status:"",deep:"",lon:"",lat:""}])});return e}catch(t){return qC.ErrorHandler.handle(t,"TrackManager._parseTrackData"),[]}}},{key:"showPopup",value:function(){try{this.trackReplay=new XNOM.TrackReplay({machine:1,data:this.resultArr,cameraList:[],clickCameraCallback:function(){},playFinishCallback:function(){},findLastPointCB:function(t){return qC.Logger.info("test point info:",t)},layers:[iS.URLS.TILE_1,iS.URLS.TILE_2]});var t=document.querySelector("#track-box");return t&&t.appendChild(this.trackReplay.dom),this.trackReplay}catch(t){return qC.ErrorHandler.handle(t,"TrackManager.showPopup")}}},{key:"destroy",value:function(){this.trackReplay&&"function"==typeof this.trackReplay.destroy&&this.trackReplay.destroy(),this.trackReplay=null}}])}(),SS=new fS;function PS(t){qC.Logger.info("地图加载完成",t)}function IS(t){qC.Logger.info("drag map",t)}function MS(t){qC.Logger.info("move marker",t,t.lnglat)}"undefined"!=typeof window&&(window.mapService=SS,window.initMap=function(){return SS.initMap()},window.initMap1=function(){return SS.initMap1()},window.addKrigingLayer=function(){return SS.addKrigingLayer()},window.addPolygon=function(){return SS.addPolygon()},window.addComplexPolygon=function(){return SS.addComplexPolygon()},window.addPolyline=function(){return SS.addPolyline()},window.addMarker=function(){return SS.addMarker()},window.addMarker1=function(){return SS.addMarker1()},window.addMassMarker=function(){return SS.addMassMarker()},window.addMassMarker1=function(){return SS.addMassMarker1()},window.addClustersMarker1=function(){return SS.addClustersMarker1()},window.toggleMarker=function(){return SS.toggleMarker()},window.toggleMarkerDrag=function(){return SS.toggleMarkerDrag()},window.openMoveMarker=function(){return SS.openMoveMarker()},window.pauseMoveMarker=function(){return SS.pauseMoveMarker()},window.addControlOverView=function(){return SS.addControlOverView()},window.addControlScale=function(){return SS.addControlScale()},window.addControlZoomTool=function(){return SS.addControlZoomTool()},window.addText=function(){return SS.addText()},window.addInfoWindow=function(){return SS.addInfoWindow()},window.toggleInfoWindowVisible=function(){return SS.toggleInfoWindowVisible()},window.toggleDraw=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polygon";return SS.toggleDraw(t)},window.undoDraw=function(){return SS.undoDraw()},window.endDraw=function(){return SS.endDraw()},window.togglePolygonEdit=function(){return SS.togglePolygonEdit()},window.togglePolygonVisible=function(){return SS.togglePolygonVisible()},window.length=function(){return SS.length()},window.newIsolation=function(){return SS.newIsolation()},window.startDrawIsolation=function(){return SS.startDrawIsolation()},window.selectIsolation=function(){return SS.selectIsolation()},window.openEditIsolation=function(){return SS.openEditIsolation()},window.closeEditIsolation=function(){return SS.closeEditIsolation()},window.newRiskArea=function(){return SS.newRiskArea()},window.startDrawRisk=function(){return SS.startDrawRisk()},window.finishEditRisk=function(){return SS.finishEditRisk()},window.openSelectRisk=function(){return SS.openSelectRisk()},window.openEditRisk=function(){return SS.openEditRisk()},window.newSmartPolygon=function(){return SS.newSmartPolygon()},window.startDrawSmartPolygon=function(){return SS.startDrawSmartPolygon()},window.useCorer=function(){return SS.useCorer()},window.openEditCore=function(){return SS.openEditCore()},window.closeEditCore=function(){return SS.closeEditCore()},window.openEditSmartPolygon=function(){return SS.openEditSmartPolygon()},window.closeEditSmartPolygon=function(){return SS.closeEditSmartPolygon()},window.showPopup=function(){return SS.showPopup()},window.mapOnEvent=function(){return SS.mapOnEvent()},window.mapOffEvent=function(){return SS.mapOffEvent()},window.markerOnEvent=function(){return SS.markerOnEvent()},window.markerOffEvent=function(){return SS.markerOffEvent()},window.switchScenario=function(t){return SS.switchScenario(t)},window.clearAllFeatures=function(){return SS.clearAllFeatures()},console.log("✅ MapService 方法已注册到 window 对象"),window.onload=function(){console.log("🚀 页面加载完成,开始初始化地图..."),initMap()});function OS(t){return OS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},OS(t)}function LS(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function RS(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?LS(Object(n),!0).forEach(function(e){kS(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):LS(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function kS(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=OS(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=OS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==OS(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var TS=RS(RS({Map:wm,Marker:Wm,Text:H_,Polygon:r_,Polyline:x_,InfoWindow:ox},yw),{},{Control:bb,TrackReplay:Vb,ComplexPolygon:eE,SmartPolygon:EE,Isolation:qE,MassMarker:sC,ClustersMarker:bC,RiskArea:WC},MapService);"undefined"!=typeof window&&(window.XNOM=TS);var NS=TS}(),r=r.default}()});
|
|
44
|
+
function Hx(t){return Math.max.apply(null,t)}function Zx(t){return Math.min.apply(null,t)}function Kx(t,e){for(var n=[],r=0;r<e;r++)n.push(t);return n}function Jx(t,e,n){for(var r=0,i=t.length-1,o=!1,s=t.length;r<s;i=r++)t[r][1]>n!=t[i][1]>n&&e<(t[i][0]-t[r][0])*(n-t[r][1])/(t[i][1]-t[r][1])+t[r][0]&&(o=!o);return o}function $x(t,e){for(var n=0,r=Kx(0,e*e);n<e;n++)r[n*e+n]=t;return r}function Qx(t,e,n){for(var r,i=0,o=Array(n*e);i<e;i++)for(r=0;r<n;r++)o[r*e+i]=t[i*n+r];return o}function tw(t,e,n,r){for(var i,o=0,s=Array(n*r);o<n;o++)for(i=0;i<r;i++)s[o*r+i]=t[o*r+i]+e[o*r+i];return s}function ew(t,e,n,r,i){for(var o,s,a=0,u=Array(n*i);a<n;a++)for(o=0;o<i;o++)for(u[a*i+o]=0,s=0;s<r;s++)u[a*i+o]+=t[a*r+s]*e[s*i+o];return u}function nw(t,e){var n,r,i,o=Array(e);for(n=0;n<e;n++)o[n]=t[n*e+n];for(n=0;n<e;n++){for(r=0;r<n;r++)o[n]-=t[n*e+r]*t[n*e+r];if(o[n]<=0)return!1;for(o[n]=Math.sqrt(o[n]),r=n+1;r<e;r++){for(i=0;i<n;i++)t[r*e+n]-=t[r*e+i]*t[n*e+i];t[r*e+n]/=o[n]}}for(n=0;n<e;n++)t[n*e+n]=o[n];return!0}function rw(t,e){var n,r,i,o;for(n=0;n<e;n++)for(t[n*e+n]=1/t[n*e+n],r=n+1;r<e;r++){for(o=0,i=n;i<r;i++)o-=t[r*e+i]*t[i*e+n];t[r*e+n]=o/t[r*e+r]}for(n=0;n<e;n++)for(r=n+1;r<e;r++)t[n*e+r]=0;for(n=0;n<e;n++){for(t[n*e+n]*=t[n*e+n],i=n+1;i<e;i++)t[n*e+n]+=t[i*e+n]*t[i*e+n];for(r=n+1;r<e;r++)for(i=r;i<e;i++)t[n*e+r]+=t[i*e+n]*t[i*e+r]}for(n=0;n<e;n++)for(r=0;r<n;r++)t[n*e+r]=t[r*e+n]}function iw(t,e){var n,r,i,o,s,a,u,l,c,h=e,f=Array(e*e),p=Array(e),d=Array(e),g=Array(e),y=0,v=0;for(n=0;n<e;n++)for(r=0;r<e;r++)f[n*e+r]=n===r?1:0;for(r=0;r<e;r++)g[r]=0;for(n=0;n<e;n++){for(a=0,r=0;r<e;r++)if(1!==g[r])for(i=0;i<e;i++)0===g[i]&&Math.abs(t[r*e+i])>=a&&(a=Math.abs(t[r*e+i]),v=r,y=i);if(++g[y],v!==y){for(o=0;o<e;o++)c=t[v*e+o],t[v*e+o]=t[y*e+o],t[y*e+o]=c;for(o=0;o<h;o++)c=f[v*e+o],f[v*e+o]=f[y*e+o],f[y*e+o]=c}if(d[n]=v,p[n]=y,0===t[y*e+y])return!1;for(l=1/t[y*e+y],t[y*e+y]=1,o=0;o<e;o++)t[y*e+o]*=l;for(o=0;o<h;o++)f[y*e+o]*=l;for(s=0;s<e;s++)if(s!==y){for(u=t[s*e+y],t[s*e+y]=0,o=0;o<e;o++)t[s*e+o]-=t[y*e+o]*u;for(o=0;o<h;o++)f[s*e+o]-=f[y*e+o]*u}}for(o=e-1;o>=0;o--)if(d[o]!==p[o])for(i=0;i<e;i++)c=t[i*e+d[o]],t[i*e+d[o]]=t[i*e+p[o]],t[i*e+p[o]]=c;return!0}function ow(t,e,n,r,i){return e+(r-e)/n*(1-Math.exp(-1/i*Math.pow(t/n,2)))}function sw(t,e,n,r,i){return e+(r-e)/n*(1-Math.exp(-1/i*(t/n)))}function aw(t,e,n,r){return t>n?e+(r-e)/n:e+(r-e)/n*(t/n*1.5-.5*Math.pow(t/n,3))}function uw(t,e,n){var r,i=Array(n.n);for(r=0;r<n.n;r++)i[r]=n.model(Math.pow(Math.pow(t-n.x[r],2)+Math.pow(e-n.y[r],2),.5),n.nugget,n.range,n.sill,n.A);return ew(i,n.M,1,n.n,1)[0]}var lw={train:function(t,e,n,r,i,o){var s,a,u,l,c={t:t,x:e,y:n,nugget:0,range:0,sill:0,A:1/3,n:0,model:sw,K:[],M:[]};switch(r){case"gaussian":c.model=ow;break;case"exponential":default:c.model=sw;break;case"spherical":c.model=aw}var h=t.length,f=Array((h*h-h)/2);for(s=0,u=0;s<h;s++)for(a=0;a<s;a++,u++)f[u]=Array(2),f[u][0]=Math.pow(Math.pow(e[s]-e[a],2)+Math.pow(n[s]-n[a],2),.5),f[u][1]=Math.abs(t[s]-t[a]);f.sort(function(t,e){return t[0]-e[0]}),c.range=f[(h*h-h)/2-1][0];var p=(h*h-h)/2>30?30:(h*h-h)/2,d=c.range/p,g=Kx(0,p),y=Kx(0,p);if(p<30)for(l=0;l<p;l++)g[l]=f[l][0],y[l]=f[l][1];else{for(s=0,a=0,u=0,l=0;s<p&&a<(h*h-h)/2;s++,u=0){for(;f[a][0]<=(s+1)*d&&(g[l]+=f[a][0],y[l]+=f[a][1],u++,!(++a>=(h*h-h)/2)););u>0&&(g[l]/=u,y[l]/=u,l++)}if(l<2)return c}h=l,c.range=g[h-1]-g[0];var v=Kx(1,2*h),_=Array(h),m=c.A;for(s=0;s<h;s++){switch(r){case"gaussian":v[2*s+1]=1-Math.exp(-1/m*Math.pow(g[s]/c.range,2));break;case"exponential":v[2*s+1]=1-Math.exp(-1/m*g[s]/c.range);break;case"spherical":v[2*s+1]=g[s]/c.range*1.5-.5*Math.pow(g[s]/c.range,3)}_[s]=y[s]}var x=Qx(v,h,2),w=ew(x,v,2,h,2),b=(w=tw(w,$x(1/o,2),2,2)).slice(0);nw(w,2)?rw(w,2):(iw(b,2),w=b);var E=ew(ew(w,x,2,2,h),_,2,h,1);c.nugget=E[0],c.sill=E[1]*c.range+c.nugget,c.n=e.length,h=e.length;var C=Array(h*h);for(s=0;s<h;s++){for(a=0;a<s;a++)C[s*h+a]=c.model(Math.pow(Math.pow(e[s]-e[a],2)+Math.pow(n[s]-n[a],2),.5),c.nugget,c.range,c.sill,c.A),C[a*h+s]=C[s*h+a];C[s*h+s]=c.model(0,c.nugget,c.range,c.sill,c.A)}var S=tw(C,$x(i,h),h,h),P=S.slice(0);nw(S,h)?rw(S,h):(iw(P,h),S=P);var I=S.slice(0),M=ew(S,t,h,h,1);return c.K=I,c.M=M,c},predict:uw,variance:function(t,e,n){var r,i=Array(n.n);for(r=0;r<n.n;r++)i[r]=n.model(Math.pow(Math.pow(t-n.x[r],2)+Math.pow(e-n.y[r],2),.5),n.nugget,n.range,n.sill,n.A);var o=ew(ew(i,n.K,1,n.n,n.n),i,1,n.n,1)[0];return n.model(0,n.nugget,n.range,n.sill,n.A)+o},grid:function(t,e,n){var r,i,o,s=t.length;if(0!==s){var a,u,l=[t[0][0][0],t[0][0][0]],c=[t[0][0][1],t[0][0][1]];for(r=0;r<s;r++)for(i=0;i<t[r].length;i++)t[r][i][0]<l[0]&&(l[0]=t[r][i][0]),t[r][i][0]>l[1]&&(l[1]=t[r][i][0]),t[r][i][1]<c[0]&&(c[0]=t[r][i][1]),t[r][i][1]>c[1]&&(c[1]=t[r][i][1]);var h=Array(2),f=Array(2),p=Array(2),d=Array(2),g=Math.ceil((l[1]-l[0])/n),y=Math.ceil((c[1]-c[0])/n),v=Array(g+1);for(r=0;r<=g;r++)v[r]=Array(y+1);for(r=0;r<s;r++){for(p[0]=t[r][0][0],p[1]=p[0],d[0]=t[r][0][1],d[1]=d[0],i=1;i<t[r].length;i++)t[r][i][0]<p[0]&&(p[0]=t[r][i][0]),t[r][i][0]>p[1]&&(p[1]=t[r][i][0]),t[r][i][1]<d[0]&&(d[0]=t[r][i][1]),t[r][i][1]>d[1]&&(d[1]=t[r][i][1]);for(h[0]=Math.floor((p[0]-(p[0]-l[0])%n-l[0])/n),h[1]=Math.ceil((p[1]-(p[1]-l[1])%n-l[0])/n),f[0]=Math.floor((d[0]-(d[0]-c[0])%n-c[0])/n),f[1]=Math.ceil((d[1]-(d[1]-c[1])%n-c[0])/n),i=h[0];i<=h[1];i++)for(o=f[0];o<=f[1];o++)a=l[0]+i*n,u=c[0]+o*n,Jx(t[r],a,u)&&(v[i][o]=uw(a,u,e))}return{xlim:l,ylim:c,width:n,data:v,zlim:[Zx(e.t),Hx(e.t)]}}},plot:function(t,e,n,r,i){var o=t.getContext("2d"),s=e.data,a=e.zlim,u=e.width;if(o){o.clearRect(0,0,t.width,t.height);var l=[n[1]-n[0],r[1]-r[0],a[1]-a[0]],c=void 0,h=void 0,f=void 0,p=void 0,d=void 0,g=s.length,y=s[0].length,v=Math.ceil(u*t.width/(n[1]-n[0])),_=Math.ceil(u*t.height/(r[1]-r[0]));for(c=0;c<g;c++)for(h=0;h<y;h++)void 0!==s[c][h]&&(f=t.width*(c*u+e.xlim[0]-n[0])/l[0],p=t.height*(1-(h*u+e.ylim[0]-r[0])/l[1]),(d=(s[c][h]-a[0])/l[2])<0&&(d=0),d>1&&(d=1),o.fillStyle=i[Math.floor((i.length-1)*d)],o.fillRect(Math.round(f-v/2),Math.round(p-_/2),v,_))}},max:Hx,min:Zx,pip:Jx,rep:Kx,matrixDiag:$x,matrixTranspose:Qx,matrixAdd:tw,matrixMultiply:ew,matrixChol:nw,matrixChol2inv:rw,matrixSolve:iw,variogramGaussian:ow,variogramExponential:sw,variogramSpherical:aw},cw=lw;function hw(t){return hw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hw(t)}function fw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,dw(r.key),r)}}function pw(t,e,n){return(e=dw(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dw(t){var e=function(t,e){if("object"!=hw(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=hw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==hw(e)?e:e+""}var gw=function(){return t=function t(e){var n=this;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),pw(this,"source",void 0),pw(this,"getDataForLonlat",function(t){var e=!1,r=ja(t);if(Array.isArray(n.path[0][0]))e=n.path.some(function(t){var e=Ga([t]);return su(r,e)});else{var i=Ga([n.path]);su(r,i)&&(e=!0)}if(!e)return[];var o=n.variogramList;return null==o?void 0:o.map(function(e){return cw.predict(t[0],t[1],e)})}),this.init(e)},e=[{key:"init",value:function(t){if(!t)return new Yx({source:new Gx});if(!Array.isArray(t.data)||t.data.length.length<3)return console.info("数据量太小。"),new Yx({source:new Gx});if(this.calculateVariogram(t.data),t.colors&&(!Array.isArray(t.colors)||t.colors.length<2))return console.info("颜色组不正确。"),new Yx({source:new Gx});var e={};if(t.colors?e.colors=t.colors:e.colors=["#f5222d","#e6fffb","#1677ff"],t.alpha?t.alpha>1?e.alpha=1:t.alpha<0?e.alpha=0:e.alpha=t.alpha:e.alpha=.8,t.width?e.width=t.width:e.width=.1,e.path=t.path,!Array.isArray(e.path))return console.info("范围不正确。"),new Yx({source:new Gx});try{Array.isArray(e.path[0][0])||(e.path=[e.path])}catch(t){return console.error("路径不正确。"),!1}this.path=e.path;var n=[],r=[],i=[];t.data.forEach(function(t){n.push(parseFloat(t.value)),r.push(parseFloat(t.lon)),i.push(parseFloat(t.lat))});var o=cw.train(n,r,i,"exponential",0,100);this.kriging=cw,this.mode=o;var s=cw.grid(e.path,o,e.width),a=new Gx({canvasFunction:function(t,n,r,i,o){var a=document.createElement("canvas");return a.width=i[0],a.height=i[1],a.style.display="block",cw.plot(a,s,[t[0],t[2]],[t[1],t[3]],e.colors),a},projection:dv});this.source=a;var u=new Yx({name:t.name,source:a,zIndex:t.zIndex,opacity:e.alpha});return u.getDataForLonlat=this.getDataForLonlat,u}},{key:"calculateVariogram",value:function(t){var e=[],n=[],r=[],i=[],o=[],s=[];t.forEach(function(t){e.push(parseFloat(t.value)),r.push(parseFloat(t.currentValue)),n.push(parseFloat(t.hisValue)),i.push(+new Date(t.updateTime)),o.push(parseFloat(t.lon)),s.push(parseFloat(t.lat))});var a=cw.train(r,o,s,"exponential",0,100),u=cw.train(n,o,s,"exponential",0,100),l=cw.train(e,o,s,"exponential",0,100),c=cw.train(i,o,s,"exponential",0,100);this.variogramList=[a,u,l,c]}}],e&&fw(t.prototype,e),n&&fw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),yw={Tile:bx,Vector:pv,KrigingLayer:gw},vw=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_w=0,mw=1,xw=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),render:r.render})||this).dragListenerKeys_=[],n.currentResolution_=void 0,n.direction_=_w,n.dragging_,n.heightLimit_=0,n.widthLimit_=0,n.startX_,n.startY_,n.thumbSize_=null,n.sliderInitialized_=!1,n.duration_=void 0!==r.duration?r.duration:200;var i=void 0!==r.className?r.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=i+"-thumb "+on;var s=n.element;return s.className=i+" "+on+" "+sn,s.appendChild(o),s.addEventListener(ar,n.handleDraggerStart_.bind(n),!1),s.addEventListener(sr,n.handleDraggerDrag_.bind(n),!1),s.addEventListener(ur,n.handleDraggerEnd_.bind(n),!1),s.addEventListener(ne,n.handleContainerClick_.bind(n),!1),o.addEventListener(ne,Ut,!1),n}return vw(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,n=t.offsetHeight;if(0===e&&0===n)return this.sliderInitialized_=!1;var r=getComputedStyle(t);e-=parseFloat(r.paddingRight)+parseFloat(r.paddingLeft),n-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);var i=t.firstElementChild,o=getComputedStyle(i),s=i.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),a=i.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);return this.thumbSize_=[s,a],e>n?(this.direction_=mw,this.widthLimit_=e-s):(this.direction_=_w,this.heightLimit_=n-a),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),n=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),r=this.getResolutionForPosition_(n),i=e.getConstrainedZoom(e.getZoomForResolution(r));e.animateInternal({zoom:i,duration:this.duration_,easing:Gi})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){var n=this.handleDraggerDrag_,r=this.handleDraggerEnd_,i=this.getMap().getOwnerDocument();this.dragListenerKeys_.push(ce(i,sr,n,this),ce(i,ur,r,this))}}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,n=t.clientY-this.startY_,r=this.getRelativePosition_(e,n);this.currentResolution_=this.getResolutionForPosition_(r),this.getMap().getView().setResolution(this.currentResolution_)}},e.prototype.handleDraggerEnd_=function(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(fe),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),n=this.element.firstElementChild;this.direction_==mw?n.style.left=this.widthLimit_*e+"px":n.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return wt(this.direction_===mw?t/this.widthLimit_:e/this.heightLimit_,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){return wt(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},e.prototype.render=function(t){if(t.frameState&&(this.sliderInitialized_||this.initSlider_())){var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},e}(as),ww=xw;function bw(t){return bw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bw(t)}function Ew(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Cw(t,e,n){return(e=Pw(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pw(r.key),r)}}function Pw(t){var e=function(t,e){if("object"!=bw(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=bw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==bw(e)?e:e+""}function Iw(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mw(t,e){return t.get(Ow(t,e))}function Ow(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Lw=new WeakMap,Rw=new WeakSet,kw=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Iw(n=this,r=Rw),r.add(n),function(t,e,n){Iw(t,e),e.set(t,n)}(this,Lw,void 0),this.init(Ow(Rw,this,Tw).call(this,e))},e=[{key:"init",value:function(t){t.zoomBtn&&this.initZoomBtn(t.zoomBtnClassName),t.zoomBar&&this.initZoomBar(t.zoomBarClassName)}},{key:"initZoomBtn",value:function(t){this.zoomBtn=new ys({className:t})}},{key:"initZoomBar",value:function(t){this.zoomBar=new ww({className:t})}},{key:"setMap",value:function(t){var e,n,r;Mw(Lw,this)&&(Mw(Lw,this).map.removeControl(this.zoomBtn),Mw(Lw,this).map.removeControl(this.zoomBar)),t&&(n=this,r=t,(e=Lw).set(Ow(e,n),r),this.zoomBtn&&t.map.addControl(this.zoomBtn),this.zoomBar&&t.map.addControl(this.zoomBar))}},{key:"map",get:function(){return Mw(Lw,this)}}],e&&Sw(t.prototype,e),n&&Sw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Tw(t){var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ew(Object(n),!0).forEach(function(e){Cw(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ew(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({zoomBtn:!0,zoomBar:!1},t);return e}var Nw=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Aw=.75,Dw=.1,Fw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Nw(e,t),e.prototype.createRenderer=function(){return new Bn(this)},e}(is),jw=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).boundHandleRotationChanged_=n.handleRotationChanged_.bind(n),n.collapsed_=void 0===r.collapsed||r.collapsed,n.collapsible_=void 0===r.collapsible||r.collapsible,n.collapsible_||(n.collapsed_=!1),n.rotateWithView_=void 0!==r.rotateWithView&&r.rotateWithView,n.viewExtent_=void 0;var i=void 0!==r.className?r.className:"ol-overviewmap",o=void 0!==r.tipLabel?r.tipLabel:"Overview map",s=void 0!==r.collapseLabel?r.collapseLabel:"‹";"string"==typeof s?(n.collapseLabel_=document.createElement("span"),n.collapseLabel_.textContent=s):n.collapseLabel_=s;var a=void 0!==r.label?r.label:"›";"string"==typeof a?(n.label_=document.createElement("span"),n.label_.textContent=a):n.label_=a;var u=n.collapsible_&&!n.collapsed_?n.collapseLabel_:n.label_,l=document.createElement("button");l.setAttribute("type","button"),l.title=o,l.appendChild(u),l.addEventListener(ne,n.handleClick_.bind(n),!1),n.ovmapDiv_=document.createElement("div"),n.ovmapDiv_.className="ol-overviewmap-map",n.view_=r.view,n.ovmap_=new Fw({view:r.view});var c=n.ovmap_;r.layers&&r.layers.forEach(function(t){c.addLayer(t)});var h=document.createElement("div");h.className="ol-overviewmap-box",h.style.boxSizing="border-box",n.boxOverlay_=new Vy({position:[0,0],positioning:"center-center",element:h}),n.ovmap_.addOverlay(n.boxOverlay_);var f=i+" "+on+" "+sn+(n.collapsed_&&n.collapsible_?" "+an:"")+(n.collapsible_?"":" ol-uncollapsible"),p=n.element;p.className=f,p.appendChild(n.ovmapDiv_),p.appendChild(l);var d=n,g=n.boxOverlay_,y=n.boxOverlay_.getElement(),v=function(t){var e,n={clientX:(e=t).clientX,clientY:e.clientY},r=c.getEventCoordinateInternal(n);g.setPosition(r)},_=function(t){var e=c.getEventCoordinateInternal(t);d.getMap().getView().setCenterInternal(e),window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",_)};return y.addEventListener("mousedown",function(){window.addEventListener("mousemove",v),window.addEventListener("mouseup",_)}),n}return Nw(e,t),e.prototype.setMap=function(e){var n=this.getMap();if(e!==n){if(n){var r=n.getView();r&&this.unbindView_(r),this.ovmap_.setTarget(null)}if(t.prototype.setMap.call(this,e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(ce(e,Xt,this.handleMapPropertyChange_,this));var i=e.getView();i&&(this.bindView_(i),i.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}},e.prototype.handleMapPropertyChange_=function(t){if(t.key===xr){var e=t.oldValue;e&&this.unbindView_(e);var n=this.getMap().getView();this.bindView_(n)}else this.ovmap_.isRendered()||t.key!==mr&&t.key!==_r||this.ovmap_.updateSize()},e.prototype.bindView_=function(t){if(!this.view_){var e=new Jo({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(Fr.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()},e.prototype.unbindView_=function(t){t.removeChangeListener(Fr.ROTATION,this.boundHandleRotationChanged_)},e.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},e.prototype.validateExtent_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var n=t.getSize(),r=t.getView().calculateExtentInternal(n);if(!this.viewExtent_||!$(r,this.viewExtent_)){this.viewExtent_=r;var i=e.getSize(),o=e.getView().calculateExtentInternal(i),s=e.getPixelFromCoordinateInternal(pt(r)),a=e.getPixelFromCoordinateInternal(st(r)),u=Math.abs(s[0]-a[0]),l=Math.abs(s[1]-a[1]),c=i[0],h=i[1];u<c*Dw||l<h*Dw||u>c*Aw||l>h*Aw?this.resetExtent_():W(o,r)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,n=t.getSize(),r=t.getView().calculateExtentInternal(n),i=e.getView(),o=Math.log(7.5)/Math.LN2;_t(r,1/(Math.pow(2,o/2)*Dw)),i.fitInternal(Wo(r))},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,n=t.getView();e.getView().setCenterInternal(n.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var n=t.getSize(),r=t.getView(),i=e.getView(),o=this.rotateWithView_?0:-r.getRotation(),s=this.boxOverlay_,a=this.boxOverlay_.getElement(),u=r.getCenterInternal(),l=r.getResolution(),c=i.getResolution(),h=n[0]*l/c,f=n[1]*l/c;if(s.setPosition(u),a){a.style.width=h+"px",a.style.height=f+"px";var p="rotate("+o+"rad)";a.style.transform=p}}},e.prototype.updateBoxAfterOvmapIsRendered_=function(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=he(this.ovmap_,fr,function(t){delete this.ovmapPostrenderKey_,this.updateBox_()},this))},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(an),this.collapsed_?gn(this.collapseLabel_,this.label_):gn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getRotateWithView=function(){return this.rotateWithView_},e.prototype.setRotateWithView=function(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},e.prototype.getOverviewMap=function(){return this.ovmap_},e.prototype.render=function(t){this.validateExtent_(),this.updateBox_()},e}(as),Gw=jw;function Bw(t){return Bw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bw(t)}function zw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Vw(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zw(Object(n),!0).forEach(function(e){Uw(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zw(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Uw(t,e,n){return(e=Xw(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ww(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xw(r.key),r)}}function Xw(t){var e=function(t,e){if("object"!=Bw(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Bw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Bw(e)?e:e+""}function qw(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yw(t,e){return t.get(Hw(t,e))}function Hw(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Zw=new WeakMap,Kw=new WeakSet,Jw=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),qw(n=this,r=Kw),r.add(n),function(t,e,n){qw(t,e),e.set(t,n)}(this,Zw,void 0),this.init(Hw(Kw,this,$w).call(this,e))},e=[{key:"init",value:function(t){this.opts=t}},{key:"setMap",value:function(t){var e,n,r;Yw(Zw,this)&&Yw(Zw,this).map.removeControl(this.overView),this.overView&&(this.overView.setMap(null),this.overView=void 0),t&&(n=this,r=t,(e=Zw).set(Hw(e,n),r),this.overView=new Gw(Vw(Vw({},this.opts),{},{layers:t.layers.map(function(t){return new ey({source:t.getSource()})})})),t.map.addControl(this.overView))}},{key:"map",get:function(){return Yw(Zw,this)}},{key:"isCollapsed",value:function(){return this.overView.getCollapsed()}},{key:"setCollapsed",value:function(t){this.overView.setCollapsed(t)}}],e&&Ww(t.prototype,e),n&&Ww(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function $w(t){return Vw({},t)}var Qw=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),tb="units",eb="degrees",nb="imperial",rb="nautical",ib="metric",ob="us",sb=[1,2,5],ab=25.4/.28,ub=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,n.once,n.un,n.innerElement_=document.createElement("div"),n.innerElement_.className=i+"-inner",n.element.className=i+" "+on,n.element.appendChild(n.innerElement_),n.viewState_=null,n.minWidth_=void 0!==r.minWidth?r.minWidth:64,n.maxWidth_=r.maxWidth,n.renderedVisible_=!1,n.renderedWidth_=void 0,n.renderedHTML_="",n.addChangeListener(tb,n.handleUnitsChanged_),n.setUnits(r.units||ib),n.scaleBar_=r.bar||!1,n.scaleBarSteps_=r.steps||4,n.scaleBarText_=r.text||!1,n.dpi_=r.dpi||void 0,n}return Qw(e,t),e.prototype.getUnits=function(){return this.get(tb)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(tb,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,n=t.projection,r=this.getUnits(),i=r==eb?Nr.DEGREES:Nr.METERS,o=pi(n,t.resolution,e,i),s=this.minWidth_*(this.dpi_||ab)/ab,a=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||ab)/ab:void 0,u=s*o,l="";if(r==eb){var c=Tr[Nr.DEGREES];(u*=c)<c/60?(l="″",o*=3600):u<c?(l="′",o*=60):l="°"}else r==nb?u<.9144?(l="in",o/=.0254):u<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):r==rb?(o/=1852,l="NM"):r==ib?u<.001?(l="μm",o*=1e6):u<1?(l="mm",o*=1e3):u<1e3?l="m":(l="km",o/=1e3):r==ob?u<.9144?(l="in",o*=39.37):u<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):P(!1,33);for(var h,f,p,d,g,y,v,_=3*Math.floor(Math.log(s*o)/Math.log(10));;){p=Math.floor(_/3);var m=Math.pow(10,p);if(h=sb[(_%3+3)%3]*m,f=Math.round(h/o),isNaN(f))return this.element.style.display="none",void(this.renderedVisible_=!1);if(void 0!==a&&f>=a){h=d,f=g,p=y;break}if(f>=s)break;d=h,g=f,y=p,++_}v=this.scaleBar_?this.createScaleBar(f,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=v&&(this.innerElement_.innerHTML=v,this.renderedHTML_=v),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+"px",this.renderedWidth_=f),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,n){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,s="ol-scale-singlebar-odd",a=0;a<this.scaleBarSteps_;a++)0===a&&i.push(this.createMarker("absolute",a)),i.push('<div><div class="ol-scale-singlebar '+s+'" style="width: '+o+'px;"></div>'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,n):"")+"</div>"),a===this.scaleBarSteps_-1&&i.push(this.createStepText(a+1,t,!0,e,n)),s="ol-scale-singlebar-odd"===s?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+r+"</div>":"")+i.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,n,r,i){var o=(0===t?0:Math.round(r/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(n?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=pi(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Nr.METERS),e=this.dpi_||ab;return parseFloat(t.toString())*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(as),lb=ub;function cb(t){return cb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cb(t)}function hb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function fb(t,e,n){return(e=db(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,db(r.key),r)}}function db(t){var e=function(t,e){if("object"!=cb(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=cb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==cb(e)?e:e+""}function gb(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yb(t,e){return t.get(vb(t,e))}function vb(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var _b=new WeakMap,mb=new WeakSet,xb=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),gb(n=this,r=mb),r.add(n),function(t,e,n){gb(t,e),e.set(t,n)}(this,_b,void 0),this.init(vb(mb,this,wb).call(this,e))},e=[{key:"init",value:function(t){this.scale=new lb(t)}},{key:"setMap",value:function(t){var e,n,r;yb(_b,this)&&yb(_b,this).map.removeControl(this.scale),t&&(n=this,r=t,(e=_b).set(vb(e,n),r),t.map.addControl(this.scale))}},{key:"map",get:function(){return yb(_b,this)}}],e&&pb(t.prototype,e),n&&pb(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function wb(t){var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?hb(Object(n),!0).forEach(function(e){fb(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hb(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t);return e}var bb={ZoomTool:kw,OverView:Jw,Scale:xb},Eb=n(2031),Cb={};Cb.styleTagTransform=tv(),Cb.setAttributes=Ky(),Cb.insert=Hy().bind(null,"head"),Cb.domAPI=qy(),Cb.insertStyleElement=$y();Wy()(Eb.A,Cb),Eb.A&&Eb.A.locals&&Eb.A.locals;var Sb=n.p+"assets/46ac1bfe350f7f38e22c.png",Pb=n.p+"assets/50157e3bd0227aa82a75.png",Ib=n.p+"assets/2a84d048717fc397253c.png",Mb=n.p+"assets/17094eba52722bdefd71.png";function Ob(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Lb(t){return Lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lb(t)}function Rb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Tb(r.key),r)}}function kb(t,e,n){return(e=Tb(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tb(t){var e=function(t,e){if("object"!=Lb(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Lb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Lb(e)?e:e+""}function Nb(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ab(t,e,n){return t.set(Fb(t,e),n),n}function Db(t,e){return t.get(Fb(t,e))}function Fb(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var jb={0:"#03C5FF",1:"#00FF80",2:"#00FF80",3:"#03C5FF",4:"#03C5FF"},Gb={0:Sb,1:Pb},Bb=new WeakMap,zb=new WeakSet,Vb=function(){return t=function t(e){var n,r,i=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Nb(n=this,r=zb),r.add(n),function(t,e,n){Nb(t,e),e.set(t,n)}(this,Bb,!0),kb(this,"playBtnCallback",function(){Db(Bb,i)?i.pauseMove():i.resumeMove()}),kb(this,"dragDot",function(t){i.pauseMove(),t=t||window.event,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&t.touches&&(t=t.touches[0]);var e=i.sliderDot.offsetLeft,n=i.sliderDot.offsetWidth,r=t.clientX,o=i.sliderRunway.offsetWidth,s=function(t){t=t||window.event,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?t=t.touches[0]:t.preventDefault&&t.preventDefault();var s=t.clientX-r,a=e+s;a<0&&(a=0),a>=o-n&&(a=o-n);var u=a/o*100;Fb(zb,i,Ub).call(i,u)},a=i;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?(window.addEventListener("touchmove",s),window.addEventListener("touchend",function(){window.removeEventListener("touchmove",s),a.resumeMove()},{once:!0})):(window.addEventListener("mousemove",s),window.addEventListener("mouseup",function(){window.removeEventListener("mousemove",s),a.resumeMove()},{once:!0}))}),kb(this,"setFraction",function(t){t=t||window.event,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(t=t.touches[0]);var e=i.sliderRunway.offsetWidth,n=i.sliderDot.offsetWidth,r=t.clientX-i.sliderRunway.offsetLeft-n/2-i.dom.getBoundingClientRect().left;r<0&&(r=0),r>=e-n&&(r=e-n);var o=r/e*100;Fb(zb,i,Ub).call(i,o),i.dragDot(t)}),kb(this,"playFinish",function(){i.updatePlayRatio(1),i.pauseMove(),"function"===Lb(i.options.playFinishCallback).toLocaleLowerCase()&&i.options.playFinishCallback()}),kb(this,"updatePlayRatio",function(t){var e,n=t*(null!==(e=i.baseFraction)&&void 0!==e?e:1)*100;Fb(zb,i,Ub).call(i,n)}),!e.data)throw new Error("data error.");this.options=e,this.findLastPointCB=e.findLastPointCB,this.initDom(),this.eventListener(),this.initMap(),this.formatData(),this.initTrack(),this.initCamera(),this.initCalcData()},e=[{key:"initCalcData",value:function(){var t,e=this.options.data;this.points=null!==(t=e.flat().map(function(t){return t.path}).flat())&&void 0!==t?t:[],this.totalLength=0,this.points[0].accLength=0;for(var n=0;n<this.points.length-1;n++){var r=uu(ja(this.points[n]),ja(this.points[n+1]));this.totalLength+=r,this.points[n+1][3]=this.totalLength}console.log("test data",this.points)}},{key:"findLastPoint",value:function(t){for(var e=this.totalLength*(t/100),n=0,r=this.points.length-1;n<r;){var i=Math.floor((n+r)/2);this.points[i][3]<e?n=i+1:r=i}this.findLastPointCB&&this.findLastPointCB(this.points[n][2])}},{key:"initDom",value:function(){var t=document.createElement("div");t.className="track_replay_box",this.dom=t;var e=document.createElement("div");e.className="track_map_box",e.id="tract_map_box",this.mapBox=e,t.appendChild(e);var n=document.createElement("div");n.className="track_set_box",t.appendChild(n);var r=document.createElement("div");r.className="track_time_slider_box",n.appendChild(r);var i=document.createElement("div");i.className="track_time_slider_playbtn",this.playBtn=i,r.appendChild(i);var o=document.createElement("div");o.className="track_time_slider_runway",r.appendChild(o),this.sliderRunway=o;var s=document.createElement("div");s.className="track_time_slider_bar",o.appendChild(s),this.sliderBar=s;var a=document.createElement("div");a.className="track_time_slider_dot",o.appendChild(a),this.sliderDot=a;var u=document.createElement("ul");u.className="track_time_slider_point_list",this.timeSliderPointList=u,o.appendChild(u);var l=document.createElement("div");l.className="track_btn_box",this.openBtnBox=l,n.appendChild(l)}},{key:"updateMap",value:function(){if(!this.map)return!1;this.map.updateSize()}},{key:"eventListener",value:function(){this.playBtn.addEventListener("click",this.playBtnCallback),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?(this.sliderDot.addEventListener("touchstart",this.dragDot),this.sliderRunway.addEventListener("touchstart",this.setFraction)):(this.sliderDot.addEventListener("mousedown",this.dragDot),this.sliderRunway.addEventListener("mousedown",this.setFraction));var t=this;new ResizeObserver(function(e){var n=t.sliderRunway.offsetWidth,r=t.sliderDot.offsetWidth;t.baseFraction=(n-r)/n,t.updateMap();var i=new rg(t.route.flat());t.map.setFitForGeom(i,{avoid:[20,20,60,20]})}).observe(this.dom)}},{key:"pauseMove",value:function(){if(!Db(Bb,this))return!1;Ab(Bb,this,!1),this.playBtn.className=(this.playBtn.className.replace(/playing/g,"")+" pause").replace(/\s+/," "),this.machine.pauseMove()}},{key:"resumeMove",value:function(){if(Db(Bb,this))return!1;Ab(Bb,this,!0),this.playBtn.className=(this.playBtn.className.replace(/pause/g,"")+" playing").replace(/\s+/," "),this.machine.resumeMove()}},{key:"initMap",value:function(){var t,e=this,n={target:this.mapBox,zoom:8,zooms:[1,20],center:[100,33],controls:{zoom:!0},tileMax:this.options.tileMax,layers:this.options.layers};this.options.layers&&(t=this.options.layers.map(function(t,n){var r;return new bx({zooms:[0,null!==(r=e.options.tileMax)&&void 0!==r?r:20],tileUrl:t,zIndex:n+1}).layer})),t&&(n.layerConfig={default:!1,layers:t}),this.map=new wm(n);var r=this,i=!1;r.map.on("loadend",function t(){if(i)return r.map.off("loadend",t),!1;var e=document.querySelector(".track_map_box .ol-zoom-out");e||setTimeout(t,1e3);var n=document.createElement("div");n.className="ol-zoom-number",n.innerHTML=Math.round(r.map.getZoom()).toString(),e.parentNode.insertBefore(n,e),r.map.map.getView().on("change:resolution",function(){n.innerHTML=Math.round(r.map.getZoom()).toString()}),i=!0})}},{key:"formatData",value:function(){var t=this,e=this.options.data,n=[],r=[],i=e.map(function(t){return n.push(t[0].path[0]),r.push(t.map(function(t){return t.path})),t.map(function(t){return t.path}).flat()});this.route=i,this.markerPos=n,this.polylineOptsList=e.map(function(t){return t.flat()}).map(function(t){return t.map(function(t,e,n){return n[e+1]&&t.path.push(n[e+1].path[0]),t})});var o=wu(Va(this.route),{units:"kilometers"}),s=0;r.forEach(function(e){var n=wu(Ba(e.flat(1)),{units:"kilometers"}),r=document.createElement("li");r.style.left=s+"%",t.timeSliderPointList.appendChild(r),s+=n/o*100})}},{key:"initTrack",value:function(){var t,e=this;this.machine=new Wm({map:this.map,position:this.route[0][0],autoRotation:!0,src:Gb[null!==(t=this.options.machine)&&void 0!==t?t:0],rotation:Math.atan2(1,0),scale:.5,anchor:[.5,1]}),this.machine.moveAlong(this.route,10,this.playFinish,this.updatePlayRatio),this.pauseMove();var n=Rv();this.trackPolylines=this.polylineOptsList.map(function(t){return t.map(function(t){return new x_({map:e.map,group:n,path:t.path,color:jb[t.status],borderWidth:0})})}),this.trackPoints=this.markerPos.map(function(t,n){return new Wm({map:e.map,position:t,scale:.4375,anchor:[.5,1],src:Mb,text:"".concat(n+1),fontSize:28})});var r=S_().throttle(function(){var t=e.map.getZoom();switch(!0){case t>=18:e.trackPoints.forEach(function(t){t.setScale(.4375),t.setTextFontSize(14)});break;case t<18&&t>=17:e.trackPoints.forEach(function(t){t.setScale(.375),t.setTextFontSize(12)});break;case t<17&&t>=16:e.trackPoints.forEach(function(t){t.setScale(.3125),t.setTextFontSize(9)});break;case t<16:e.trackPoints.forEach(function(t){t.setScale(.25),t.setTextFontSize(7)});break;default:e.trackPoints.forEach(function(t){t.setScale(.4375),t.setTextFontSize(14)})}},600);this.map.map.getView().on("change:resolution",r)}},{key:"setMoveMultiply",value:function(t){this.machine.setMoveMultiply(t)}},{key:"getMoveMultiply",value:function(){return this.machine.moveMultiply}},{key:"initCamera",value:function(){if(!this.options.cameraList)return!1;var t=this;this.cameraList=this.options.cameraList.map(function(e){var n=new Wm({map:t.map,position:[e.lon,e.lat],src:Ib,scale:.5});return n.on("click",function(){t.clickCamera(e.did)}),n})}},{key:"clickCamera",value:function(t){"function"===Lb(this.options.clickCameraCallback).toLocaleLowerCase()&&this.options.clickCameraCallback(t,this.showCameraInfo)}},{key:"showCameraInfo",value:function(t){var e=t.position,n=t.dom;if(!e||!n)return!1;var r=new ox(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ob(Object(n),!0).forEach(function(e){kb(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ob(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({anchor:[.5,1]},t));return r.setMap(this.map),r}}],e&&Rb(t.prototype,e),n&&Rb(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Ub(t){var e,n=this.sliderRunway.offsetWidth,r=this.sliderDot.offsetWidth,i=(n-r)/n,o=r/2/n*100;this.fraction=t/i,this.sliderBar.style.width="".concat(t+o,"%"),this.sliderDot.style.left="".concat(t,"%");var s=null!==(e=this.baseFraction)&&void 0!==e?e:1;this.machine&&this.machine.setMoveRatio(t/s/100),this.findLastPoint(t)}function Wb(t){return Wb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wb(t)}function Xb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yb(r.key),r)}}function qb(t,e,n){return(e=Yb(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yb(t){var e=function(t,e){if("object"!=Wb(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Wb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Wb(e)?e:e+""}function Hb(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function Zb(t,e){return t.get(Jb(t,e))}function Kb(t,e,n){return t.set(Jb(t,e),n),n}function Jb(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var $b=new WeakMap,Qb=new WeakMap,tE=new WeakMap,eE=function(){return t=function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Hb(this,$b,void 0),qb(this,"featureName",void 0),Hb(this,Qb,void 0),Hb(this,tE,void 0),qb(this,"corerGeom",function(t){var e=n.getPath()[0];kl(Ga(e),Ga([t.path]))?(t.geom.openEdit(),n.core=t.geom):(t.geom.setMap(null),e.push(t.path),n.layer.getSource().getFeatures()[0].getGeometry().setCoordinates(e))}),qb(this,"condition",function(t){return console.log("condition",t),n.conditionCallback(t.coordinate)}),qb(this,"defaultCondition",function(t){var e=Ga(n.getPath()[0]);return su(ja(t),e)}),qb(this,"finishRemoveCore",function(){if(!n.core)return!1;var t=n.getPath()[0],e=n.core.getPath();if(kl(Ga(t),Ga([e])))return!1;t.push(n.core.getPath()),n.layer.getSource().getFeatures()[0].getGeometry().setCoordinates(t),n.core.closeEdit(),n.core.setMap(null),n.core=void 0}),this.init(this.formatOptions(e))},e=[{key:"formatOptions",value:function(t){var e,n,r;return t.path?(t.borderWidth=null!==(e=t.borderWidth)&&void 0!==e?e:3,t.strokeColor=null!==(n=t.strokeColor)&&void 0!==n?n:"#3366ff66",t.fillColor=null!==(r=t.fillColor)&&void 0!==r?r:"#1199ffaa",t):(console.error("path is error."),!1)}},{key:"init",value:function(t){var e=this;console.log("complex polygon options",t);var n=!1;try{n=Array.isArray(t.path[0][0][0])}catch(t){return console.error("path error."),!1}this.featureName=Rv(),n?(Kb($b,this,[]),t.path.forEach(function(t){Zb($b,e).push(new Na({type:"polygon",geometry:new Uo(t),name:e.featureName}))})):Kb($b,this,new Na({type:"polygon",geometry:new Uo(t.path),name:this.featureName})),this.style=new Vf({stroke:new Df({width:t.borderWidth,color:t.strokeColor}),fill:new Nf({color:t.fillColor})}),Array.isArray(Zb($b,this))?(Zb($b,this).forEach(function(t){t.setStyle(e.style)}),this.layer=new pv(Zb($b,this))):(Zb($b,this).setStyle(this.style),this.layer=new pv([Zb($b,this)])),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return Zb($b,this)}},{key:"getPath",value:function(){return this.layer.getSource().getFeatures().map(function(t){return t.getGeometry().getCoordinates()})}},{key:"isVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){Zb(Qb,this)&&Zb(Qb,this).removeFeature(this.layer),t?(t.addFeature(this.layer),Kb(Qb,this,t),Kb(tE,this,new Mv(this,Zb(Qb,this).map))):Zb(Qb,this)&&Zb(Qb,this).removeFeature(this.layer)}},{key:"map",get:function(){return Zb(Qb,this)}},{key:"eventList",get:function(){return Zb(tE,this).eventList}},{key:"on",value:function(t,e){return Zb(tE,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return Zb(tE,this).off(t,e,Fv)}},{key:"openEdit",value:function(){Zb(Qb,this).editGeom(this)}},{key:"closeEdit",value:function(){return!!Zb(Qb,this).getEditGeom(this)&&Zb(Qb,this).closeEditGeom(this)}},{key:"getArea",value:function(){return this.getPath().reduce(function(t,e){return t+e.reduce(function(t,e){return t-kv(e)},2*kv(e[0]))},0)}},{key:"getRegion",value:function(){return this.getPath().reduce(function(t,e){return t+kv(e[0])},0)}},{key:"useCorer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultCondition;return!!this.map&&!this.core&&(this.conditionCallback=t,void this.map.startDraw("polygon",this.corerGeom,this.condition))}}],e&&Xb(t.prototype,e),n&&Xb(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function nE(t){return nE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nE(t)}function rE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function iE(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?rE(Object(n),!0).forEach(function(e){uE(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rE(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function oE(t){return function(t){if(Array.isArray(t))return sE(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return sE(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sE(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sE(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function aE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,lE(r.key),r)}}function uE(t,e,n){return(e=lE(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lE(t){var e=function(t,e){if("object"!=nE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=nE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nE(e)?e:e+""}function cE(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function hE(t,e){return t.get(pE(t,e))}function fE(t,e,n){return t.set(pE(t,e),n),n}function pE(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var dE=new Vf({image:new kf({fill:new Nf({color:"#18a058"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),zIndex:9}),gE=new kf({fill:new Nf({color:"#e59810"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),yE=new Vf({image:gE,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new lg(e)}}),vE=new Vf({zIndex:5,image:gE,geometry:function(t){var e=t.getGeometry().getCoordinates();return new lg(e)}}),_E={base:[new Vf({fill:new Nf({color:"#9ffbc74d"}),stroke:new Df({color:"#16e96f",width:2})})],select:[new Vf({fill:new Nf({color:"#ff7f1db3"}),stroke:new Df({color:"#ff7f1d",width:2})})],draw:[dE,new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#e59810",width:2,lineDash:[10,10]})}),vE],edit:[new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#e59810",width:2})}),yE],error:[new Vf({fill:new Nf({color:"#ff492480"}),stroke:new Df({color:"#e59810",width:2})}),yE]},mE={base:[new Vf({fill:new Nf({color:"#ff7f1d4d"}),stroke:new Df({color:"#ffffff",width:2})})],select:[new Vf({fill:new Nf({color:"#ff7f1db3"}),stroke:new Df({color:"#ff7f1d",width:1})})],draw:[dE,new Vf({fill:new Nf({color:"#e5981099"}),stroke:new Df({color:"#ffffff",width:1,lineDash:[6,10]})}),vE],edit:[new Vf({fill:new Nf({color:"#e5981099"}),stroke:new Df({color:"#ffffff",width:1})}),yE],error:[new Vf({fill:new Nf({color:"#ff492480"}),stroke:new Df({color:"#e59810",width:2})}),yE]},xE=new WeakMap,wE=new WeakMap,bE=new WeakMap,EE=function(){return t=function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),cE(this,xE,void 0),cE(this,wE,void 0),cE(this,bE,void 0),uE(this,"textList",[]),uE(this,"isShowLength",!1),uE(this,"tempShowLenFnCB",function(t){n.showLengthFn(t.target)}),uE(this,"active",!1),uE(this,"clickCorePointCB",function(t){if(!t)return n.hideClickPoint(),n.changeSelectPoint&&n.changeSelectPoint(),!1;switch(t.type){case"modifystart":return n.hideClickPoint(),void(n.changeSelectPoint&&n.changeSelectPoint());case"modifyend":return void n.changeCoreErrorStatus(n.coreStatusIsError());default:console.info("click point",t)}var e=ja(t.coordinate),r=Ba(n.core.getPath());return su(e,uf(r,.001))?(n.selectPoint?(n.selectPoint.show(),n.selectPoint.setPosition(t.coordinate)):n.selectPoint=new Wm({map:n.map,position:t.coordinate,color:"#18a058",borderColor:"#ffffff",borderWidth:1}),n.changeSelectPoint&&n.changeSelectPoint(n.selectPoint),n.changeCoreErrorStatus(n.coreStatusIsError()),!0):(n.hideClickPoint(),n.changeSelectPoint&&n.changeSelectPoint(),n.changeCoreErrorStatus(n.coreStatusIsError()),!1)}),uE(this,"clickPointCB",function(t){if(console.log("clickPointCB 被调用",null==t?void 0:t.type),console.log("点击的坐标",null==t?void 0:t.coordinate,t),!t)return n.hideClickPoint(),n.changeSelectPoint&&n.changeSelectPoint(),!1;switch(t.type){case"modifystart":return n.hideClickPoint(),void(n.changeSelectPoint&&n.changeSelectPoint());case"modifyend":return void n.changeErrorStatus(n.statusIsError());default:console.info("click point",t)}var e=ja(t.coordinate),r=Ba(n.getPath()[0]);return su(e,uf(r,.001))?(n.selectPoint?(n.selectPoint.show(),n.selectPoint.setPosition(t.coordinate)):n.selectPoint=new Wm({map:n.map,position:t.coordinate,color:"#18a058",borderColor:"#ffffff",borderWidth:1}),n.changeSelectPoint&&n.changeSelectPoint(n.selectPoint),n.changeErrorStatus(n.statusIsError()),!0):(n.hideClickPoint(),n.changeSelectPoint&&n.changeSelectPoint(),n.changeErrorStatus(n.statusIsError()),!1)}),uE(this,"corerGeom",function(t){n.finishCoreDrawCB&&n.finishCoreDrawCB();var e,r,i=oE(n.getPath());n.core=t.geom,n.core.setSourceStyle(mE.base),n.coreList?(i.push.apply(i,oE(null===(e=n.coreList)||void 0===e?void 0:e.map(function(t){return t.getPath()}))),null!==(r=n.coreList)&&void 0!==r&&r.some(function(t){return t===n.core})||n.coreList.push(n.core)):n.coreList=[n.core],kl(Ga(i),Ga(t.path)),hE(wE,n).editGeom(t.geom,mE.edit,dE,n.clickCorePointCB),t.geom.setActiveStyle(mE.select),n.changeCoreErrorStatus(n.coreStatusIsError())}),uE(this,"selectCoreCB",function(t){if(t.target.isActive())return t.target.setActive(!1),!1;n.coreList.forEach(function(t){return t.setActive(!1)}),t.target.setActive(!0)}),uE(this,"condition",function(t){return console.log("condition",t),n.conditionCallback(t.coordinate)}),uE(this,"defaultCondition",function(t){var e=Ga(n.getPath()),r=su(ja(t),e);return r||n.outOfBoundsCB&&n.outOfBoundsCB(),r}),uE(this,"finishRemoveCore",function(){return!!n.core&&(!n.coreStatusIsError()&&(n.coreList?null!==(t=n.coreList)&&void 0!==t&&t.some(function(t){return t===n.core})||n.coreList.push(n.core):n.coreList=[n.core],hE(wE,n).getEditGeom(n.core)&&(n.hideClickPoint(),hE(wE,n).closeEditGeom(n.core)),void(n.core=void 0)));var t}),e.changeSelectPoint&&(this.changeSelectPoint=e.changeSelectPoint),e.isError&&(this.isError=e.isError),e.changeAreaCB&&(this.changeAreaCB=e.changeAreaCB),e.outOfBoundsCB&&(this.outOfBoundsCB=e.outOfBoundsCB),this.finishDrawCB=e.finishDrawCB,this.finishCoreDrawCB=e.finishCoreDrawCB,this.init(this.formatOptions(e))},e=[{key:"formatOptions",value:function(t){return t}},{key:"init",value:function(t){console.log("smart polygon options",t),this.featureName=Rv(),t.path&&(fE(xE,this,new Na({type:"polygon",geometry:new Uo(t.path),name:this.featureName})),this.style=_E.base,hE(xE,this).setStyle(this.style),this.layer=new pv({features:[hE(xE,this)],zIndex:999}),this.initPath=t.path),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return hE(xE,this)}},{key:"startDraw",value:function(){var t;if(hE(xE,this))return!1;var e=this;return null===(t=hE(wE,this))||void 0===t||t.startDraw("smartPolygon",function(t){e.setPath(t.path,!0),e.finishDrawCB&&e.finishDrawCB(),t.geom.setMap()},function(t){return!0},_E.draw),!0}},{key:"hideLength",value:function(){this.isShowLength=!1,this.textList.length>0&&(this.textList.forEach(function(t){return t.destroy()}),this.textList=[]),hE(xE,this)&&hE(xE,this).getGeometry().un("change",this.tempShowLenFnCB)}},{key:"showLength",value:function(){var t;this.isShowLength=!0,hE(xE,this)&&this.showLengthFn(null===(t=hE(xE,this))||void 0===t?void 0:t.getGeometry()),hE(xE,this)&&hE(xE,this).getGeometry().on("change",this.tempShowLenFnCB)}},{key:"showLengthFn",value:function(t){var e=this,n=[];t.getCoordinates()[0].reduce(function(t,e){if(!t)return e;var r=[(t[0]+e[0])/2,(t[1]+e[1])/2],i=wu(Ba([t,e]));i=i<1?Math.round(1e3*i*100)/100+" m":Math.round(100*i)/100+" km";var o=Math.atan2(t[0]-e[0],t[1]-e[1])+Math.PI/2;return n.push({position:r,content:i,rotation:o}),e},!1),n.forEach(function(t,n){var r=e.textList[n];r?(r.setRotation(t.rotation),r.setText(t.content),r.setPosition(t.position)):(r=new H_(iE(iE({},t),{},{textBaseline:"bottom",fill:"#ffffff",stroke:"#2b2b2b",borderWidth:4,fontSize:"16px",map:e.map})),e.textList[n]=r)})}},{key:"setPath",value:function(t,e){console.log("path",t,e,hE(xE,this)),hE(xE,this)?hE(xE,this).getGeometry().setCoordinates(t):(fE(xE,this,new Na({type:"polygon",geometry:new Uo(t),name:this.featureName})),this.style=_E.base,hE(xE,this).setStyle(this.style),this.layer=new pv({features:[hE(xE,this)],zIndex:999}),console.log("path",t,this.layer),hE(wE,this).addFeature(this.layer),this.isShowLength&&this.showLength()),e&&(this.openEdit(),this.changeErrorStatus(this.statusIsError()))}},{key:"setActive",value:function(t){"boolean"!==nE(t).toLocaleString()&&(t=!!t),this.active=t,t?hE(xE,this).setStyle(_E.select):hE(xE,this).setStyle(_E.base)}},{key:"isActive",value:function(){return!!this.active}},{key:"getPath",value:function(){var t;if(hE(xE,this))return null===(t=this.layer)||void 0===t?void 0:t.getSource().getFeatures().map(function(t){return t.getGeometry().getCoordinates()})[0]}},{key:"isVisible",value:function(){var t;return null===(t=this.layer)||void 0===t?void 0:t.getVisible()}},{key:"show",value:function(){var t;null===(t=this.layer)||void 0===t||t.setVisible(!0)}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.setVisible(!1)}},{key:"setMap",value:function(t){hE(wE,this)&&this.layer&&hE(wE,this).removeFeature(this.layer),t?(this.layer&&t.addFeature(this.layer),fE(wE,this,t),fE(bE,this,new Mv(this,hE(wE,this).map))):fE(wE,this,void 0)}},{key:"map",get:function(){return hE(wE,this)}},{key:"eventList",get:function(){return hE(bE,this).eventList}},{key:"on",value:function(t,e){return hE(bE,this).featureOn(t,e,yv)}},{key:"off",value:function(t,e){return hE(bE,this).off(t,e,yv)}},{key:"hideClickPoint",value:function(){var t;null===(t=this.selectPoint)||void 0===t||t.hide()}},{key:"deleteSelectPoint",value:function(){if(!this.selectPoint)return!1;this.hideClickPoint(),this.changeSelectPoint&&this.changeSelectPoint(void 0),this.core?(this.map.deletePointForGeom(this.core),this.changeCoreErrorStatus(this.coreStatusIsError())):(this.map.deletePointForGeom(this),this.changeErrorStatus(this.statusIsError()))}},{key:"openEdit",value:function(){var t=this;if(this.initPath){this.setPath([this.initPath[0]]),hE(wE,this).editGeom(this,_E.edit,dE,this.clickPointCB),this.initPath.shift();var e=this;this.initPath.forEach(function(n){var r=new r_({path:[n],map:t.map,borderWidth:1,strokeColor:"#ffffff",fillColor:"#ff7f1d4d"});e.corerGeom({path:[n],geom:r}),e.finishRemoveCore()}),this.initPath=void 0}this.layer&&hE(wE,this).editGeom(this,_E.edit,dE,this.clickPointCB)}},{key:"closeEdit",value:function(){return!!hE(wE,this).getEditGeom(this)&&(this.hideClickPoint(),hE(wE,this).closeEditGeom(this))}},{key:"coreStatusIsError",value:function(){var t=this,e=this.core.getPath();if(mu(Ga([e])).features.length>0)return this.isError&&this.isError("kinks"),!0;if(!this.core)return!1;var n,r=oE(this.getPath()),i=!1,o=Ga([e]);return this.coreList&&r.push.apply(r,oE(null===(n=this.coreList)||void 0===n?void 0:n.filter(function(e){return e!==t.core}).map(function(t){var e=t.getPath(),n=Ga([e]);return(Il(o,n)||Il(n,o))&&(i=!0),e}))),kl(Ga(r),o)||i?(this.isError&&this.isError("outBounds"),this.outOfBoundsCB&&this.outOfBoundsCB(),!0):(this.isError(!1),!1)}},{key:"statusIsError",value:function(){return mu(Ga(this.getPath())).features.length>0?(this.isError&&this.isError("kinks"),!0):(this.isError(!1),!1)}},{key:"changeErrorStatus",value:function(t){var e=hE(xE,this);t?e.setStyle(_E.error):e.setStyle(_E.edit)}},{key:"changeCoreErrorStatus",value:function(t){var e=this.core.feature;Array.isArray(e)&&(e=e[0]),t?e.setStyle(mE.error):e.setStyle(mE.edit)}},{key:"deletePolygon",value:function(){this.closeEdit(),this.map.removeFeature(this.layer),fE(xE,this,void 0)}},{key:"getArea",value:function(){var t,e;return kv(this.getPath()[0])-(null!==(t=null===(e=this.coreList)||void 0===e?void 0:e.map(function(t){return t.getPath()}))&&void 0!==t?t:[]).reduce(function(t,e){return t+kv(e)},0)}},{key:"getRegion",value:function(){return kv(this.getPath()[0])}},{key:"useCorer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultCondition;return!!this.map&&(this.closeEdit(),!this.core&&(this.conditionCallback=t,void this.map.startDraw("smartPolygon",this.corerGeom,this.condition,mE.draw)))}},{key:"openSelectCore",value:function(){var t=this;this.closeEdit(),this.coreList.forEach(function(e){e.on("click",t.selectCoreCB)})}},{key:"closeSelectCore",value:function(){var t=this;this.openEdit(),this.coreList.forEach(function(e){e.off("click",t.selectCoreCB)}),this.coreList.forEach(function(t){return t.setActive(!1)})}},{key:"openCoreEdit",value:function(){this.core=this.coreList.find(function(t){return t.active}),this.coreList.forEach(function(t){return t.setActive(!1)}),this.tempCorePath=this.core.getPath(),hE(wE,this).editGeom(this.core,mE.edit,dE,this.clickCorePointCB)}},{key:"cancelCoreEdit",value:function(){if(!this.tempCorePath)return!1;this.core&&(hE(wE,this).getEditGeom(this.core)&&(this.hideClickPoint(),hE(wE,this).closeEditGeom(this.core)),this.core.setPath(this.tempCorePath))}},{key:"deleteCore",value:function(){var t;if(this.core=(null===(t=this.coreList)||void 0===t?void 0:t.find(function(t){return t.active}))||this.core,!this.core)return!1;var e=this.coreList.findIndex(function(t){return t.active});this.coreList.splice(e,1),this.core&&(hE(wE,this).getEditGeom(this.core)&&(this.hideClickPoint(),hE(wE,this).closeEditGeom(this.core)),this.core.hide()),this.tempCore=this.core,this.core=void 0}},{key:"cancelDeleteCore",value:function(){if(!this.tempCore)return!1;this.coreList?this.coreList.push(this.tempCore):this.coreList=[this.tempCore],this.tempCore.show(),this.core=this.tempCore}},{key:"clearCore",value:function(){this.coreList.forEach(function(t){t.destroy()}),this.coreList=void 0}},{key:"getCorePaths",value:function(){var t,e;return(null===(t=this.coreList)||void 0===t?void 0:t.length)>0?[[this.getPath()[0]].concat(oE(null===(e=this.coreList)||void 0===e?void 0:e.map(function(t){return t.getPath()})))]:this.getPath()?[this.getPath()]:[]}},{key:"getLength",value:function(){return 1e3*wu(Ba(this.getPath()[0]),{units:"kilometers"})}}],e&&aE(t.prototype,e),n&&aE(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function CE(t){return CE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},CE(t)}function SE(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return PE(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?PE(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PE(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function IE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,OE(r.key),r)}}function ME(t,e,n){return(e=OE(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OE(t){var e=function(t,e){if("object"!=CE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=CE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==CE(e)?e:e+""}function LE(t,e,n){RE(t,e),e.set(t,n)}function RE(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kE(t,e){return t.get(NE(t,e))}function TE(t,e,n){return t.set(NE(t,e),n),n}function NE(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var AE=new Vf({image:new kf({fill:new Nf({color:"#18a058"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),zIndex:9}),DE=new kf({fill:new Nf({color:"#e59810"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),FE=new Vf({image:DE,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new lg(e)}}),jE=new Vf({zIndex:5,image:DE,geometry:function(t){var e=t.getGeometry().getCoordinates();return new lg(e)}}),GE={select:[new Vf({fill:new Nf({color:"#fff42799"}),stroke:new Df({color:"#fff427",width:2})})],base:[new Vf({fill:new Nf({color:"#ff7f1d99"}),stroke:new Df({color:"#e59810ff",width:2})})],draw:[AE,new Vf({fill:new Nf({color:"#ff74ae99"}),stroke:new Df({color:"#ffffff",width:1,lineDash:[10,10]})}),jE],edit:[new Vf({fill:new Nf({color:"#ff74ae99"}),stroke:new Df({color:"#ffffff",width:1})}),FE],error:[new Vf({fill:new Nf({color:"#ff492480"}),stroke:new Df({color:"#e59810ff",width:1})}),FE]},BE=new WeakMap,zE=new WeakMap,VE=new WeakMap,UE=new WeakMap,WE=new WeakMap,XE=new WeakSet,qE=function(){return t=function t(e){var n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),RE(n=this,r=XE),r.add(n),LE(this,BE,{}),LE(this,zE,void 0),LE(this,VE,void 0),ME(this,"editList",{}),LE(this,UE,void 0),LE(this,WE,void 0),ME(this,"clickPointCB",function(t){if(!t)return i.hideClickPoint(),!1;switch(t.type){case"modifystart":return i.hideClickPoint(),void(i.changeSelectPoint&&i.changeSelectPoint());case"modifyend":return i.hideClickPoint(),i.changeSelectPoint&&i.changeSelectPoint(),void i.changeErrorStatus(i.statusIsError());default:console.info("click point",t)}var e=ja(t.coordinate),n=Ba(i.getPath()[0]);return su(e,uf(n,.001))?(i.selectPoint?(i.selectPoint.show(),i.selectPoint.setPosition(t.coordinate)):i.selectPoint=new Wm({map:i.map,position:t.coordinate,color:"#18a058",borderColor:"#ffffff",borderWidth:1}),i.changeSelectPoint&&i.changeSelectPoint(i.selectPoint),i.changeErrorStatus(i.statusIsError()),!0):(i.hideClickPoint(),!1)}),console.log("change select point",this.changeSelectPoint),e.changeSelectPoint&&(this.changeSelectPoint=e.changeSelectPoint),console.log("isError",this.isError,e.isError),e.isError&&(this.isError=e.isError),console.log("changeSelectIdCB",this.changeSelectIdCB,e.changeSelectIdCB),e.changeSelectIdCB&&(this.changeSelectIdCB=e.changeSelectIdCB),this.init(NE(XE,this,YE).call(this,e))},e=[{key:"init",value:function(t){if(console.log("isolation options: ",t),TE(VE,this,Rv()),null!=t&&t.map&&this.setMap(t.map),null!=t&&t.path){if(!Array.isArray(t.path))return console.error("path is error."),!1;if(!Array.isArray(t.path[0][0]))return console.error("path is error."),!1;var e=this;t.path.forEach(function(t,n){e.addPath([t],!0)})}}},{key:"feature",get:function(){return Object.values(kE(BE,this)).map(function(t){return t.polygon})}},{key:"isolation",get:function(){return Object.values(kE(BE,this))}},{key:"selectId",get:function(){return kE(UE,this)}},{key:"statusIsError",value:function(){var t=kE(UE,this),e=kE(BE,this)[t].feature.getGeometry().getCoordinates();if(mu(Ga(e)).features.length>0)return this.isError&&this.isError("kinks"),!0;var n=Object.values(kE(BE,this)).filter(function(e){return e.id!==t}).map(function(t){return t.feature.getGeometry().getCoordinates()}),r=Ga(e),i=n.some(function(t){var e=Ga(t);return kl(r,e)});return i?(this.isError&&this.isError("overlap"),!0):(this.isError&&this.isError(!1),!1)}},{key:"getPath",value:function(){return Object.values(kE(BE,this)).map(function(t){return t.layer.getSource().getFeatures()[0].getGeometry().getCoordinates()[0]})}},{key:"addPath",value:function(t,e){var n=Object.values(kE(BE,this)).length,r=kE(VE,this)+n,i=new Na({type:"polygon",geometry:new Uo(t),name:r});i.setStyle(GE.base);var o=new pv([i]);if(kE(BE,this)[r]={id:r,style:GE.base,feature:i,polygon:i,layer:o},kE(zE,this)&&kE(zE,this).addFeature(o),TE(UE,this,r),e)return!0;this.changeSelectIdCB&&this.changeSelectIdCB(kE(UE,this)),this.openEdit(r);var s=Object.values(kE(BE,this)).map(function(t){return t.feature.getGeometry().getCoordinates()}),a=Ga(t),u=s.some(function(t){var e=Ga(t);return kl(a,e)});u&&this.changeErrorStatus(!0),this.changeErrorStatus(this.statusIsError()),console.log("test isolation selectId",kE(UE,this),kE(BE,this))}},{key:"changeErrorStatus",value:function(t){var e=kE(UE,this),n=kE(BE,this)[e];t?n.feature.setStyle(GE.error):n.feature.setStyle(GE.edit)}},{key:"isVisible",value:function(){return Object.values(kE(BE,this)).every(function(t){return t.layer.getVisible()})}},{key:"show",value:function(){Object.values(kE(BE,this)).forEach(function(t){return t.layer.setVisible(!0)})}},{key:"hide",value:function(){Object.values(kE(BE,this)).forEach(function(t){return t.layer.setVisible(!1)})}},{key:"setMap",value:function(t){var e=kE(zE,this);e&&Object.values(kE(BE,this)).forEach(function(t){return e.removeFeature(t.layer)}),t?(Object.values(kE(BE,this)).forEach(function(e){return t.addFeature(e.layer)}),TE(zE,this,t),TE(WE,this,new Mv(this,kE(zE,this).map))):kE(zE,this)&&Object.values(kE(BE,this)).forEach(function(t){return e.removeFeature(t.layer)})}},{key:"map",get:function(){return kE(zE,this)}},{key:"eventList",get:function(){return kE(WE,this).eventList}},{key:"on",value:function(t,e){return kE(WE,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return kE(WE,this).off(t,e,Fv)}},{key:"startDraw",value:function(){var t;if(!kE(zE,this))return console.error("Missing the necessary map object."),!1;var e=this,n=Object.values(kE(BE,this)).map(function(t){return t.feature.getGeometry().getCoordinates()});return null===(t=kE(zE,this))||void 0===t||t.startDraw("smartPolygon",function(t){e.addPath(t.path),t.geom.setMap()},function(t){var e=ja(t.coordinate);return n.every(function(t){var n=Ga(t);return!su(e,n)})},GE.draw),!0}},{key:"getIdByLonlat",value:function(t){var e=this;return Object.keys(kE(BE,this)).find(function(n){var r=kE(BE,e)[n].feature.getGeometry().getCoordinates();return su(ja(t),Ga(r))})}},{key:"openEdit",value:function(t){t=null!=t?t:this.selectId,console.log("test open edit",t);var e=new Vf({image:new kf({fill:new Nf({color:"#18a058"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),zIndex:9});this.editList[t]=kE(BE,this)[t],kE(zE,this).editGeom(kE(BE,this)[t],GE.edit,e,this.clickPointCB)}},{key:"closeEdit",value:function(t,e){if(t=null!=t?t:this.selectId,this.statusIsError()&&!e)return!1;if(this.selectPoint&&(this.selectPoint.setMap(),this.selectPoint=null,this.changeSelectPoint&&this.changeSelectPoint(null)),t&&kE(BE,this)[t]){var n=Object.values(kE(BE,this)).filter(function(e){return e.name!==t}).map(function(t){return t.feature.getGeometry().getCoordinates()}),r=Ga(kE(BE,this)[t].feature.getGeometry().getCoordinates()),i=n.some(function(t){var e=Ga(t);return kl(r,e)});return!i&&(delete this.editList[t],kE(zE,this).closeEditGeom(kE(BE,this)[t]))}var o=this;return Object.keys(this.editList).forEach(function(t){o.closeEdit(t)}),!0}},{key:"hideClickPoint",value:function(){var t;null===(t=this.selectPoint)||void 0===t||t.hide()}},{key:"deleteSelectPoint",value:function(){if(!this.selectPoint)return!1;var t=kE(UE,this),e=kE(BE,this)[t];this.map.deletePointForGeom(e),this.changeErrorStatus(this.statusIsError())}},{key:"selectIsolation",value:function(t){var e,n;return!(Object.keys(this.editList).length>0||(console.log("ttttt",null===(e=kE(BE,this)[kE(UE,this)])||void 0===e?void 0:e.feature),null===(n=kE(BE,this)[kE(UE,this)])||void 0===n||n.feature.setStyle(GE.base),kE(BE,this)[t].feature.setStyle(GE.select),TE(UE,this,t),this.changeSelectIdCB&&this.changeSelectIdCB(kE(UE,this)),0))}},{key:"deleteIsolation",value:function(t){t=t||this.selectId;var e=kE(BE,this)[t];kE(zE,this).removeFeature(e.layer),this.closeEdit(this.selectId,!0),delete kE(BE,this)[t]}},{key:"getArea",value:function(){return this.getPath().reduce(function(t,e){return t+kv(e)},0)}},{key:"getHighByCoordinate",value:function(t){var e=.017453292519943295,n=111319.49079327357,r=0;if(t.length<3)return 0;for(var i=0;i<t.length-1;i++){var o=SE(t[i].map(parseFloat),2),s=o[0],a=o[1],u=SE(t[i+1].map(parseFloat),2),l=u[0],c=u[1],h=a*n;r+=s*n*Math.cos(a*e)*c*n-l*n*Math.cos(c*e)*h}var f=SE(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=SE(t[0].map(parseFloat),2),y=g[0],v=g[1],_=d*n;return r+=p*n*Math.cos(d*e)*v*n-y*n*Math.cos(v*e)*_,.5*Math.abs(r)}},{key:"destroy",value:function(){var t=this;return!!kE(zE,this)&&(Object.values(kE(BE,this)).forEach(function(e){return kE(zE,t).removeFeature(e.layer)}),!0)}}],e&&IE(t.prototype,e),n&&IE(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function YE(t){return t}function HE(t){return HE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HE(t)}function ZE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,JE(r.key),r)}}function KE(t,e,n){return(e=JE(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JE(t){var e=function(t,e){if("object"!=HE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=HE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==HE(e)?e:e+""}function $E(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function QE(t,e){return t.get(eC(t,e))}function tC(t,e,n){return t.set(eC(t,e),n),n}function eC(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var nC=new WeakMap,rC=new WeakMap,iC=new WeakMap,oC=new WeakMap,sC=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$E(this,nC,void 0),$E(this,rC,void 0),$E(this,iC,void 0),$E(this,oC,void 0),KE(this,"draggable",!1),KE(this,"modify",void 0),this.init(e)},e=[{key:"init",value:function(t){if(!t)return!1;tC(iC,this,Rv()),tC(nC,this,new Na({geometry:new lg(t.data.map(function(t){return t.lonlat})),name:QE(iC,this)})),this.data=t.data;var e=[];if(t.styles){var n=t.styles;if(!Array.isArray(n))return console.error("styles is error."),!1;n.forEach(function(n,r){var i=t.data.filter(function(t){return t.styleIndex===r});e.push(new Vf({image:new cd({anchor:t.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:n.src,offset:t.offset,rotation:t.rotation,scale:t.scale}),geometry:new lg(i.map(function(t){return t.lonlat}))}))})}else{var r=new Nf({color:"rgba(37, 165, 247,0.6)"}),i=new Df({color:"#ffeeff",width:2});e.push(new Vf({image:new kf({fill:r,stroke:i,radius:5})}))}this.style=e,this.options=t,QE(nC,this).setStyle(e),this.layer=new pv({features:[QE(nC,this)],zIndex:(t.zIndex||0)+1e4}),t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable)}},{key:"feature",get:function(){return QE(nC,this)}},{key:"getClosestPoint",value:function(t){var e=QE(nC,this).getGeometry().getClosestPoint(t);return this.data.find(function(t){return t.lonlat[0]===e[0]&&t.lonlat[1]===e[1]})}},{key:"getVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){QE(rC,this)&&QE(rC,this).removeFeature(this.layer),t?(t.addFeature(this.layer),tC(rC,this,t),tC(oC,this,new Mv(this,QE(rC,this).map))):QE(rC,this)&&QE(rC,this).removeFeature(this.layer)}},{key:"map",get:function(){return QE(rC,this)}},{key:"eventList",get:function(){return QE(oC,this).eventList}},{key:"on",value:function(t,e){return console.log("t123"),QE(oC,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return QE(oC,this).off(t,e,Fv)}},{key:"setDraggable",value:function(t){if(this.draggable=t,t)this.modify||(this.modify=new Wd({hitDetection:this.layer,source:this.layer.getSource()})),QE(rC,this).map.addInteraction(this.modify);else{if(!this.modify)return;QE(rC,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"destroy",value:function(){return!!QE(rC,this)&&(QE(rC,this).removeFeature(this.layer),!0)}}],e&&ZE(t.prototype,e),n&&ZE(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),aC=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uC=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,wrapX:e.wrapX})||this;return n.resolution=void 0,n.distance=void 0!==e.distance?e.distance:20,n.minDistance=e.minDistance||0,n.interpolationRatio=0,n.features=[],n.geometryFunction=e.geometryFunction||function(t){var e=t.getGeometry();return P("Point"==e.getType(),10),e},n.createCustomCluster_=e.createCluster,n.source=null,n.boundRefresh_=n.refresh.bind(n),n.updateDistance(n.distance,n.minDistance),n.setSource(e.source||null),n}return aC(e,t),e.prototype.clear=function(e){this.features.length=0,t.prototype.clear.call(this,e)},e.prototype.getDistance=function(){return this.distance},e.prototype.getSource=function(){return this.source},e.prototype.loadFeatures=function(t,e,n){this.source.loadFeatures(t,e,n),e!==this.resolution&&(this.resolution=e,this.refresh())},e.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},e.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},e.prototype.getMinDistance=function(){return this.minDistance},e.prototype.setSource=function(t){this.source&&this.source.removeEventListener(Qt,this.boundRefresh_),this.source=t,t&&t.addEventListener(Qt,this.boundRefresh_),this.refresh()},e.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},e.prototype.updateDistance=function(t,e){var n=0===t?0:Math.min(e,t)/t,r=t!==this.distance||this.interpolationRatio!==n;this.distance=t,this.minDistance=e,this.interpolationRatio=n,r&&this.refresh()},e.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=[1/0,1/0,-1/0,-1/0],e=this.distance*this.resolution,n=this.source.getFeatures(),r={},i=0,o=n.length;i<o;i++){var s=n[i];if(!(p(s)in r)){var a=this.geometryFunction(s);if(a){K(a.getCoordinates(),t),B(t,e,t);var u=this.source.getFeaturesInExtent(t).filter(function(t){var e=p(t);return!(e in r)&&(r[e]=!0,!0)});this.features.push(this.createCluster(u,t))}}}},e.prototype.createCluster=function(t,e){for(var n=[0,0],r=t.length-1;r>=0;--r){var i=this.geometryFunction(t[r]);i?Ve(n,i.getCoordinates()):t.splice(r,1)}Ye(n,1/t.length);var o=at(e),s=this.interpolationRatio,a=new Io([n[0]*(1-s)+o[0]*s,n[1]*(1-s)+o[1]*s]);return this.createCustomCluster_?this.createCustomCluster_(a,t):new Na({geometry:a,features:t})},e}(kd),lC=uC;function cC(t){return cC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cC(t)}function hC(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pC(r.key),r)}}function fC(t,e,n){return(e=pC(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pC(t){var e=function(t,e){if("object"!=cC(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=cC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==cC(e)?e:e+""}function dC(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function gC(t,e){return t.get(vC(t,e))}function yC(t,e,n){return t.set(vC(t,e),n),n}function vC(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var _C=new WeakMap,mC=new WeakMap,xC=new WeakMap,wC=new WeakMap,bC=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),dC(this,_C,void 0),dC(this,mC,void 0),dC(this,xC,void 0),dC(this,wC,void 0),fC(this,"draggable",!1),fC(this,"modify",void 0),this.init(e)},e=[{key:"init",value:function(t){if(!t)return!1;yC(xC,this,Rv()),yC(_C,this,t.data.map(function(t){return new Na(new Io(t.lonlat))})),this.data=t.data;var e=new kd({features:gC(_C,this)}),n=new lC({distance:parseInt("40",10),minDistance:parseInt("2",10),source:e}),r={};this.layer=new wd({source:n,zIndex:1e3,style:function(t){var e=t.get("features").length,n=r[e];return n||(n=new Vf({image:new kf({radius:10,stroke:new Df({color:"#fff"}),fill:new Nf({color:"#3399CC"})}),text:new E_({text:e.toString(),fill:new Nf({color:"#fff"})})}),r[e]=n),n}}),this.options=t,t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable)}},{key:"feature",get:function(){return gC(_C,this)}},{key:"getClosestPoint",value:function(t){var e=gC(_C,this).getGeometry().getClosestPoint(t);return this.data.find(function(t){return t.lonlat[0]===e[0]&&t.lonlat[1]===e[1]})}},{key:"getVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){gC(mC,this)&&gC(mC,this).removeFeature(this.layer),t?(t.addFeature(this.layer),yC(mC,this,t),yC(wC,this,new Mv(this,gC(mC,this).map))):gC(mC,this)&&gC(mC,this).removeFeature(this.layer)}},{key:"map",get:function(){return gC(mC,this)}},{key:"eventList",get:function(){return gC(wC,this).eventList}},{key:"on",value:function(t,e){return console.log("t123"),gC(wC,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return gC(wC,this).off(t,e,Fv)}},{key:"setDraggable",value:function(t){if(this.draggable=t,t)this.modify||(this.modify=new Wd({hitDetection:this.layer,source:this.layer.getSource()})),gC(mC,this).map.addInteraction(this.modify);else{if(!this.modify)return;gC(mC,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"destroy",value:function(){return!!gC(mC,this)&&(gC(mC,this).removeFeature(this.layer),!0)}}],e&&hC(t.prototype,e),n&&hC(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function EC(t){return EC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},EC(t)}function CC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function SC(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?CC(Object(n),!0).forEach(function(e){OC(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):CC(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function PC(t){return function(t){if(Array.isArray(t))return IC(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return IC(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IC(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IC(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function MC(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,LC(r.key),r)}}function OC(t,e,n){return(e=LC(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LC(t){var e=function(t,e){if("object"!=EC(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=EC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==EC(e)?e:e+""}function RC(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function kC(t,e){return t.get(NC(t,e))}function TC(t,e,n){return t.set(NC(t,e),n),n}function NC(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var AC=new Vf({image:new kf({fill:new Nf({color:"#18a058"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),zIndex:9}),DC=new kf({fill:new Nf({color:"#e59810"}),stroke:new Df({color:"#ffffff",width:1}),radius:5}),FC=new Vf({image:DC,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new lg(e)}}),jC=new Vf({zIndex:5,image:DC,geometry:function(t){var e=t.getGeometry().getCoordinates();return new lg(e)}}),GC={base:[new Vf({fill:new Nf({color:"#9ffbc74d"}),stroke:new Df({color:"#16e96f",width:2})})],select:[new Vf({fill:new Nf({color:"#ff7f1db3"}),stroke:new Df({color:"#ff7f1d",width:2})})],draw:[AC,new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#e59810",width:2,lineDash:[10,10]})}),jC],edit:[new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#e59810",width:2})}),FC],error:[new Vf({fill:new Nf({color:"#ff492480"}),stroke:new Df({color:"#e59810",width:2})}),FC]},BC={base:[new Vf({fill:new Nf({color:"#ffbdb299"}),stroke:new Df({color:"#eb7272",width:2})})],base2:[new Vf({fill:new Nf({color:"#ff252599"}),stroke:new Df({color:"#ff7676",width:2})})],select:[new Vf({fill:new Nf({color:"#ff7f1db3"}),stroke:new Df({color:"#ff7f1d",width:1})})],draw:[AC,new Vf({fill:new Nf({color:"#ffbdb299"}),stroke:new Df({color:"#ffffff",width:1,lineDash:[6,10]})}),jC],edit:[new Vf({fill:new Nf({color:"#ffbdb299"}),stroke:new Df({color:"#eb7272",width:1})}),FC],edit2:[new Vf({fill:new Nf({color:"#ff252599"}),stroke:new Df({color:"#ff7676",width:1})}),FC],error:[new Vf({fill:new Nf({color:"#ff492480"}),stroke:new Df({color:"#e59810",width:2})}),FC]},zC=new WeakMap,VC=new WeakMap,UC=new WeakMap,WC=function(){return t=function t(e){var n,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),RC(this,zC,void 0),RC(this,VC,void 0),RC(this,UC,void 0),OC(this,"textList",[]),OC(this,"isShowLength",!1),OC(this,"tempShowLenFnCB",function(t){r.showLengthFn(t.target)}),OC(this,"active",!1),OC(this,"clickPointCB",function(t){if(!t)return r.hideClickPoint(),!1;switch(t.type){case"modifystart":return r.hideClickPoint(),void(r.changeSelectPoint&&r.changeSelectPoint());case"modifyend":return void r.changeRiskAreaErrorStatus(r.riskAreaStatusIsError());default:console.info("click point",t)}var e=ja(t.coordinate),n=Ba(r.activeRiskArea.getPath());return su(e,uf(n,.001))?(r.selectPoint?(r.selectPoint.show(),r.selectPoint.setPosition(t.coordinate)):r.selectPoint=new Wm({map:r.map,position:t.coordinate,color:"#18a058",borderColor:"#ffffff",borderWidth:1}),r.changeSelectPoint&&r.changeSelectPoint(r.selectPoint),r.changeRiskAreaErrorStatus(r.riskAreaStatusIsError()),!0):(r.hideClickPoint(),!1)}),OC(this,"activeRiskAreaGeom",function(t){var e,n,i=PC(r.getPath());r.activeRiskArea=t.geom,r.activeRiskArea.setSourceStyle(BC.base),r.activeRiskArea.setExtData({riskLevel:1}),r.riskAreaList?(i.push.apply(i,PC(null===(e=r.riskAreaList)||void 0===e?void 0:e.map(function(t){return t.getPath()}))),null!==(n=r.riskAreaList)&&void 0!==n&&n.some(function(t){return t===r.activeRiskArea})||r.riskAreaList.push(r.activeRiskArea)):r.riskAreaList=[r.activeRiskArea],kC(VC,r).editGeom(t.geom,BC.edit,AC,r.clickPointCB),t.geom.setActiveStyle(BC.select),r.changeRiskAreaErrorStatus(r.riskAreaStatusIsError()),r.finishRiskDrawCB&&r.finishRiskDrawCB()}),OC(this,"defaultCondition",function(t){var e=Ga(r.getPath()),n=su(ja(t),e);return n||r.outOfBoundsCB&&r.outOfBoundsCB(),n}),OC(this,"condition",function(t){return console.log("condition",t),r.conditionCallback(t.coordinate)}),OC(this,"selectRiskCB",function(t){var e;if(t.target.isActive())return t.target.setActive(!1),r.changeActiveRiskCB&&r.changeActiveRiskCB(),!1;null===(e=r.riskAreaList)||void 0===e||e.forEach(function(t){return t.setActive(!1)}),t.target.setActive(!0),r.changeActiveRiskCB&&r.changeActiveRiskCB(t.target)}),OC(this,"isOpenSelect",!1),OC(this,"finishEditRisk",function(){return!!r.activeRiskArea&&!r.riskAreaStatusIsError()&&(r.riskAreaList?r.riskAreaList.some(function(t){return t===r.activeRiskArea})||r.riskAreaList.push(r.activeRiskArea):r.riskAreaList=[r.activeRiskArea],kC(VC,r).getEditGeom(r.activeRiskArea)&&(r.hideClickPoint(),kC(VC,r).closeEditGeom(r.activeRiskArea)),void(r.activeRiskArea=void 0))});var i=null!==(n=e.callbacks)&&void 0!==n?n:{},o=i.changeSelectPoint,s=i.isError,a=i.outOfBoundsCB,u=i.finishRiskDrawCB,l=i.changeActiveRiskCB;this.changeSelectPoint=o,this.isError=s,this.outOfBoundsCB=a,this.finishRiskDrawCB=u,this.changeActiveRiskCB=l,console.log("test cb",this.changeSelectPoint,this.isError,this.outOfBoundsCB,this.finishRiskDrawCB),this.init(this.formatOptions(e))},e=[{key:"formatOptions",value:function(t){return t.path?t.map?t:(console.error("map is error."),!1):(console.error("path is error."),!1)}},{key:"init",value:function(t){var e=this;if(console.log("risk area options",t),this.featureName=Rv(),this.areaPath=t.path,TC(zC,this,new Na({type:"polygon",geometry:new Uo(t.path),name:this.featureName})),this.style=GC.base,kC(zC,this).setStyle(this.style),this.layer=new pv({features:[kC(zC,this)],zIndex:999}),this.initPath=t.path,this.setMap(t.map),t.riskAreaList){var n={1:"#ffbdb299",2:"#ff252599"},r={1:"#eb7272",2:"#ff7676"};this.riskAreaList=t.riskAreaList.map(function(t){var i=t.level,o=1===parseInt(t.isAll),s=new r_({path:o?t.path:t.path[0],map:e.map,borderWidth:1,strokeColor:r[i],fillColor:n[i],extData:SC({riskLevel:i},t),isGeomPolygon:o});return o&&(e.isAllRisk=!0),s.setActiveStyle(BC.select),s})}}},{key:"feature",get:function(){return kC(zC,this)}},{key:"hideLength",value:function(){this.isShowLength=!1,this.textList.length>0&&(this.textList.forEach(function(t){return t.destroy()}),this.textList=[]),kC(zC,this).getGeometry().un("change",this.tempShowLenFnCB)}},{key:"showLength",value:function(){this.isShowLength=!0,this.showLengthFn(kC(zC,this).getGeometry()),kC(zC,this).getGeometry().on("change",this.tempShowLenFnCB)}},{key:"showLengthFn",value:function(t){var e=this,n=[];t.getCoordinates()[0].reduce(function(t,e){if(!t)return e;var r=[(t[0]+e[0])/2,(t[1]+e[1])/2],i=wu(Ba([t,e]));i=i<1?Math.round(1e3*i*100)/100+" m":Math.round(100*i)/100+" km";var o=Math.atan2(t[0]-e[0],t[1]-e[1])+Math.PI/2;return n.push({position:r,content:i,rotation:o}),e},!1),n.forEach(function(t,n){var r=e.textList[n];r?(r.setRotation(t.rotation),r.setText(t.content),r.setPosition(t.position)):(r=new H_(SC(SC({},t),{},{textBaseline:"bottom",fill:"#ffffff",stroke:"#2b2b2b",borderWidth:4,fontSize:"16px",map:kC(VC,e)})),e.textList[n]=r)})}},{key:"getPath",value:function(){var t;if(kC(zC,this))return null===(t=this.layer)||void 0===t?void 0:t.getSource().getFeatures().map(function(t){return t.getGeometry().getCoordinates()})[0]}},{key:"setActive",value:function(t){"boolean"!==EC(t).toLocaleString()&&(t=!!t),this.active=t,t?kC(zC,this).setStyle(GC.select):kC(zC,this).setStyle(GC.base)}},{key:"isActive",value:function(){return!!this.active}},{key:"isVisible",value:function(){var t;return null===(t=this.layer)||void 0===t?void 0:t.getVisible()}},{key:"show",value:function(){var t;null===(t=this.layer)||void 0===t||t.setVisible(!0)}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.setVisible(!1)}},{key:"setMap",value:function(t){kC(VC,this)&&this.layer&&kC(VC,this).removeFeature(this.layer),t?(this.layer&&t.addFeature(this.layer),TC(VC,this,t),TC(UC,this,new Mv(this,kC(VC,this).map))):TC(VC,this,void 0)}},{key:"map",get:function(){return kC(VC,this)}},{key:"eventList",get:function(){return kC(UC,this).eventList}},{key:"on",value:function(t,e){return kC(UC,this).featureOn(t,e,yv)}},{key:"off",value:function(t,e){return kC(UC,this).off(t,e,yv)}},{key:"hideClickPoint",value:function(){var t;null===(t=this.selectPoint)||void 0===t||t.hide()}},{key:"deleteSelectPoint",value:function(){return!!this.selectPoint&&!!this.activeRiskArea&&(this.hideClickPoint(),this.changeSelectPoint&&this.changeSelectPoint(void 0),this.map.deletePointForGeom(this.activeRiskArea),void this.changeRiskAreaErrorStatus(this.riskAreaStatusIsError()))}},{key:"riskAreaStatusIsError",value:function(){var t=this;if(!this.activeRiskArea)return!1;if(this.isAllRisk)return!1;var e=Ga([this.activeRiskArea.getPath()]);if(mu(e).features.length>0)return this.isError&&this.isError("kinks"),!0;var n,r=PC(this.getPath()),i=r.some(function(t,n){return 0!==n&&Il(e,Ga([t]))}),o=!1;if(this.riskAreaList&&r.push.apply(r,PC(null===(n=this.riskAreaList)||void 0===n?void 0:n.filter(function(e){return e!==t.activeRiskArea}).map(function(t){var n=t.getPath(),r=Ga([n]);return(Il(e,r)||kl(r,e))&&(o=!0),n}))),o)return this.isError&&this.isError("overlap"),this.outOfBoundsCB&&this.outOfBoundsCB(),!0;var s=Ga(r);return kl(s,e)||!Il(s,e)||i?(this.isError&&this.isError("outBounds"),this.outOfBoundsCB&&this.outOfBoundsCB(),!0):(this.isError&&this.isError(!1),!1)}},{key:"changeRiskAreaErrorStatus",value:function(t){var e=this.activeRiskArea.feature;if(Array.isArray(e)&&(e=e[0]),t)e.setStyle(BC.error);else{var n,r,i=null===(n=this.activeRiskArea.extData)||void 0===n?void 0:n.riskLevel;switch(parseInt(i)){case 1:default:r=BC.edit;break;case 2:r=BC.edit2}e.setStyle(r)}}},{key:"drawRisk",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultCondition;return!this.isAllRisk&&!!this.map&&(this.finishEditRisk(),!this.activeRiskArea&&(this.conditionCallback=t,void this.map.startDraw("riskArea",this.activeRiskAreaGeom,this.condition,BC.draw)))}},{key:"openSelect",value:function(){var t;if(this.isOpenSelect)return!1;var e=this;this.isOpenSelect=!0,null===(t=this.riskAreaList)||void 0===t||t.forEach(function(t){t.on("click",e.selectRiskCB)})}},{key:"setActiveRiskLevel",value:function(t){var e,n=null===(e=this.riskAreaList)||void 0===e?void 0:e.find(function(t){return t.active});null==n||n.setExtData({riskLevel:t});var r=1===t?BC.base:BC.base2;n.setSourceStyle(r)}},{key:"closeSelect",value:function(){var t,e;this.isOpenSelect=!1;var n=this;null===(t=this.riskAreaList)||void 0===t||t.forEach(function(t){t.off("click",n.selectRiskCB)}),null===(e=this.riskAreaList)||void 0===e||e.forEach(function(t){return t.setActive(!1)}),this.changeActiveRiskCB&&this.changeActiveRiskCB()}},{key:"openRiskEdit",value:function(){var t,e,n,r;if(this.activeRiskArea=null===(t=this.riskAreaList)||void 0===t?void 0:t.find(function(t){return t.active}),this.closeSelect(),!this.activeRiskArea)return!1;null===(e=this.riskAreaList)||void 0===e||e.forEach(function(t){return t.setActive(!1)}),this.tempRiskPath=this.activeRiskArea.getPath();var i,o=null!==(n=null===(r=this.activeRiskArea.extData)||void 0===r?void 0:r.riskLevel)&&void 0!==n?n:1;switch(parseInt(o)){case 1:default:i=BC.edit;break;case 2:i=BC.edit2}kC(VC,this).editGeom(this.activeRiskArea,i,AC,this.clickPointCB)}},{key:"cancelRiskEdit",value:function(){if(!this.tempRiskPath)return!1;this.activeRiskArea&&(kC(VC,this).getEditGeom(this.activeRiskArea)&&(this.hideClickPoint(),kC(VC,this).closeEditGeom(this.activeRiskArea)),this.activeRiskArea.setPath(this.tempRiskPath))}},{key:"deleteRisk",value:function(){var t,e,n;if(this.activeRiskArea=(null===(t=this.riskAreaList)||void 0===t?void 0:t.find(function(t){return t.active}))||this.activeRiskArea,!this.activeRiskArea)return!1;var r=null===(e=this.riskAreaList)||void 0===e?void 0:e.findIndex(function(t){return t.active});null===(n=this.riskAreaList)||void 0===n||n.splice(r,1),this.activeRiskArea&&(kC(VC,this).getEditGeom(this.activeRiskArea)&&(this.hideClickPoint(),kC(VC,this).closeEditGeom(this.activeRiskArea)),this.activeRiskArea.hide()),this.tempRisk=this.activeRiskArea,this.activeRiskArea=void 0,this.isAllRisk&&(this.isAllRisk=!1)}},{key:"cancelDeleteRisk",value:function(){if(!this.tempRisk)return!1;this.riskAreaList?this.riskAreaList.push(this.tempRisk):this.riskAreaList=[this.tempRisk],this.tempRisk.show(),this.activeRiskArea=this.tempRisk,this.tempRisk=void 0}},{key:"setAllRisk",value:function(){this.isAllRisk=!0;var t=new r_({path:this.areaPath,isGeomPolygon:!0,map:this.map,borderWidth:1,strokeColor:"#eb7272",fillColor:"#ffbdb299",extData:{riskLevel:1}});t.setActiveStyle(BC.select),this.riskAreaList=[t]}}],e&&MC(t.prototype,e),n&&MC(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),XC={Logger:{prefix:"[MapSDK]",info:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=console).log.apply(e,["".concat(this.prefix," [INFO] ").concat(t)].concat(r))},error:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=console).error.apply(e,["".concat(this.prefix," [ERROR] ").concat(t)].concat(r))},warn:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=console).warn.apply(e,["".concat(this.prefix," [WARN] ").concat(t)].concat(r))}},ErrorHandler:{handle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return XC.Logger.error("[Error".concat(e?" - "+e:"","]:"),t),!1},validateMap:function(t,e){return!!t||(this.handle(new Error("地图未初始化"),e),!1)}},debounce:function(t,e){var n=null;return function(){for(var r=this,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];clearTimeout(n),n=setTimeout(function(){return t.apply(r,o)},e)}},throttle:function(t,e){var n;return function(){if(!n){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];t.apply(this,i),n=!0,setTimeout(function(){return n=!1},e)}}}},qC=XC;function YC(t){return YC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},YC(t)}function HC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function ZC(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?HC(Object(n),!0).forEach(function(e){KC(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):HC(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function KC(t,e,n){return(e=tS(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JC(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return $C(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$C(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $C(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function QC(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tS(r.key),r)}}function tS(t){var e=function(t,e){if("object"!=YC(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=YC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==YC(e)?e:e+""}var eS=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:MUTEX_CONFIG;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e,this.currentScenario=e.defaultScenario,this.activeFeatures=new Map,this.eventListeners=new Map},e=[{key:"switchScenario",value:function(t){var e=this;if(!this.config.scenarios[t])return qC.Logger.warn("[Mutex] 场景不存在:".concat(t)),!1;this.config.scenarios[this.currentScenario];var n=this.config.scenarios[t];return this.activeFeatures.forEach(function(t,r){var i=e.config.featureMap[r];if(i){var o,s,a=i.group;(null!==(o=n.disabledGroups)&&void 0!==o&&o.includes(a)||null===(s=n.enabledGroups)||void 0===s||!s.includes(a))&&e.deactivate(r)}}),this.currentScenario=t,qC.Logger.info("[Mutex] 场景切换:".concat(this.currentScenario)),!0}},{key:"activate",value:function(t,e,n){var r,i,o=this.config.featureMap[t];if(!o)return qC.Logger.info("[Mutex] 无互斥规则,直接激活:".concat(t)),e(),this.activeFeatures.set(t,{closeFn:n,timestamp:Date.now()}),this._emit("activate",t),!0;var s=o.group,a=o.id,u=this.config.groups[s],l=this.config.scenarios[this.currentScenario];if(null!==(r=l.disabledGroups)&&void 0!==r&&r.includes(s)||null===(i=l.enabledGroups)||void 0===i||!i.includes(s))return qC.Logger.warn("[Mutex] 场景禁用该功能组:".concat(s)),!1;if(null!=u&&u.exclusive&&this._closeGroupExcept(s,a),l.customRules){var c=l.customRules.filter(function(t){var e;return null===(e=t.blocks)||void 0===e?void 0:e.includes(a)}).map(function(t){return t.from});if(c.length>0)return qC.Logger.warn("[Mutex] 自定义规则阻止激活:".concat(t),c),!1}return e(),this.activeFeatures.set(a,{closeFn:n,timestamp:Date.now(),featureName:t,group:s}),qC.Logger.info("[Mutex] 激活:".concat(t," (组:").concat(s,", ID:").concat(a,")")),this._emit("activate",t,a),!0}},{key:"deactivate",value:function(t){var e=this.config.featureMap[t],n=(null==e?void 0:e.id)||t,r=this.activeFeatures.get(n);return!(!r||!r.closeFn||(r.closeFn(),this.activeFeatures.delete(n),qC.Logger.info("[Mutex] 关闭:".concat(t)),this._emit("deactivate",t,n),0))}},{key:"deactivateGroup",value:function(t){var e=this;return!!this.config.groups[t]&&(this.activeFeatures.forEach(function(n,r){n.group===t&&(n.closeFn&&n.closeFn(),e.activeFeatures.delete(r),qC.Logger.info("[Mutex] 关闭组功能:".concat(r)))}),this._emit("deactivateGroup",t),!0)}},{key:"getActiveFeatures",value:function(){return Array.from(this.activeFeatures.entries()).map(function(t){var e=JC(t,2),n=e[0],r=e[1];return{id:n,featureName:r.featureName,group:r.group,timestamp:r.timestamp}})}},{key:"isActive",value:function(t){var e=this.config.featureMap[t],n=(null==e?void 0:e.id)||t;return this.activeFeatures.has(n)}},{key:"getCurrentScenario",value:function(){return this.currentScenario}},{key:"on",value:function(t,e){this.eventListeners.has(t)||this.eventListeners.set(t,[]),this.eventListeners.get(t).push(e)}},{key:"off",value:function(t,e){var n=this.eventListeners.get(t);if(n){var r=n.indexOf(e);r>-1&&n.splice(r,1)}}},{key:"_emit",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=this.eventListeners.get(t);i&&i.forEach(function(t){return t.apply(void 0,n)})}},{key:"_closeGroupExcept",value:function(t,e){var n=this;this.activeFeatures.forEach(function(r,i){r.group===t&&i!==e&&(r.closeFn&&(r.closeFn(),qC.Logger.info("[Mutex] 互斥关闭:".concat(i))),n.activeFeatures.delete(i),n._emit("mutexClose",i,t))})}},{key:"clear",value:function(){this.activeFeatures.forEach(function(t,e){t.closeFn&&t.closeFn()}),this.activeFeatures.clear(),qC.Logger.info("[Mutex] 所有状态已清理"),this._emit("clear")}},{key:"addGroup",value:function(t,e){this.config.groups[t]=e,qC.Logger.info("[Mutex] 添加互斥组:".concat(t))}},{key:"addFeature",value:function(t,e){this.config.featureMap[t]=e,qC.Logger.info("[Mutex] 添加功能映射:".concat(t))}},{key:"addScenario",value:function(t,e){this.config.scenarios[t]=e,qC.Logger.info("[Mutex] 添加场景:".concat(t))}},{key:"updateConfig",value:function(t){this.config=ZC(ZC({},this.config),t),qC.Logger.info("[Mutex] 配置已更新")}}],e&&QC(t.prototype,e),n&&QC(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),nS=eS,rS={groups:{draw:{name:"绘制功能",features:["drawPolygon","drawPolyline","drawIsolation","drawRisk","drawSmartPolygon"],exclusive:!0},edit:{name:"编辑功能",features:["editPolygon","editIsolation","editRisk","editSmartPolygon"],exclusive:!0},measure:{name:"测量功能",features:["measureLength","measureArea"],exclusive:!0},annotation:{name:"标注功能",features:["addText","addMarker","addInfoWindow"],exclusive:!1},layer:{name:"图层功能",features:["addLayer","addKrigingLayer","addPolygonLayer"],exclusive:!1}},featureMap:{toggleDraw:{group:"draw",id:"drawPolygon"},startDrawIsolation:{group:"draw",id:"drawIsolation"},startDrawRisk:{group:"draw",id:"drawRisk"},startDrawSmartPolygon:{group:"draw",id:"drawSmartPolygon"},togglePolygonEdit:{group:"edit",id:"editPolygon"},openEditIsolation:{group:"edit",id:"editIsolation"},openEditRisk:{group:"edit",id:"editRisk"},openEditCore:{group:"edit",id:"editSmartPolygon"},length:{group:"measure",id:"measureLength"},area:{group:"measure",id:"measureArea"},addText:{group:"annotation",id:"addText"},addMarker:{group:"annotation",id:"addMarker"},addInfoWindow:{group:"annotation",id:"addInfoWindow"},addLayer:{group:"layer",id:"addLayer"},addKrigingLayer:{group:"layer",id:"addKrigingLayer"},addPolygonLayer:{group:"layer",id:"addPolygonLayer"}},scenarios:{default:{enabledGroups:["draw","edit","measure","annotation","layer"],description:"默认场景,所有互斥规则生效"},editMode:{enabledGroups:["draw","edit"],disabledGroups:["measure"],description:"编辑模式,只启用绘制和编辑互斥"},viewMode:{enabledGroups:["layer","annotation"],disabledGroups:["draw","edit","measure"],description:"查看模式,禁用所有编辑功能"},emergency:{enabledGroups:["draw","annotation"],customRules:[{from:"drawRisk",blocks:["drawIsolation"]}],description:"应急指挥场景,自定义互斥规则"}},defaultScenario:"default"},iS={MAP:{TARGET:"mapbox",TARGET_1:"mapbox1",DEFAULT_ZOOM:2,DEFAULT_ZOOM_1:15,ZOOMS:[1,18],CENTER:[116.3974,39.9093],CENTER_1:[120.566032634,33.355905081],PROJECTION:"EPSG:3857"},LAYER:{KRIGING:{NAME:"BZ",Z_INDEX:102,ALPHA:.7,WIDTH:.01},TILE:{Z_INDEX:100,Z_INDEX_1:101}},URLS:{TILE_1:"https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",TILE_2:"https://webst04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",ICON_1:"https://openlayers.org/en/v6.15.1/examples/data/icon.png",ICON_2:"https://openlayers.org/en/v6.15.1/apidoc/logo-70x70.png"},GROUP:{DEFAULT:"ttt",MASS:"mass",POLYLINE:"aa"}};function oS(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return sS(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sS(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sS(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function aS(t){return aS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aS(t)}function uS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lS(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hS(r.key),r)}}function cS(t,e,n){return e&&lS(t.prototype,e),n&&lS(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function hS(t){var e=function(t,e){if("object"!=aS(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=aS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==aS(e)?e:e+""}var fS=function(){return cS(function t(){var e=this;uS(this,t),this.mapManager=new pS,this.layerManager=new dS(this.mapManager),this.markerManager=new gS(this.mapManager),this.controlManager=new yS(this.mapManager),this.textManager=new vS(this.mapManager),this.infoWindowManager=new _S(this.mapManager),this.drawManager=new mS(this.mapManager,this.layerManager),this.eventManager=new xS(this.mapManager,this.markerManager),this.isolationManager=new wS(this.mapManager),this.riskManager=new bS(this.mapManager),this.smartEditManager=new ES(this.mapManager),this.trackManager=new CS,this.mutexManager=new nS(rS),this.mutexManager.on("activate",function(){return e._updateUIState()}),this.mutexManager.on("deactivate",function(){return e._updateUIState()}),this.mutexManager.on("mutexClose",function(){return e._updateUIState()}),this.mutexManager.on("scenarioChange",function(){return e._updateUIState()}),qC.Logger.info("MapService 初始化完成")},[{key:"initMap",value:function(){return this.mapManager.initMap()}},{key:"addKrigingLayer",value:function(){return this.layerManager.addKrigingLayer()}},{key:"addPolygon",value:function(){return this.layerManager.addPolygon()}},{key:"addComplexPolygon",value:function(){return this.layerManager.addComplexPolygon()}},{key:"addPolyline",value:function(){return this.layerManager.addPolyline()}},{key:"addMarker",value:function(){return this.markerManager.addMarker()}},{key:"addMarker1",value:function(){return this.markerManager.addMarker1()}},{key:"addMassMarker",value:function(){return this.markerManager.addMassMarker()}},{key:"addMassMarker1",value:function(){return this.markerManager.addMassMarker1()}},{key:"addClustersMarker1",value:function(){return this.markerManager.addClustersMarker1()}},{key:"toggleMarker",value:function(){return this.markerManager.toggleMarker()}},{key:"toggleMarkerDrag",value:function(){return this.markerManager.toggleMarkerDrag()}},{key:"openMoveMarker",value:function(){return this.markerManager.openMoveMarker()}},{key:"pauseMoveMarker",value:function(){return this.markerManager.pauseMoveMarker()}},{key:"addControlOverView",value:function(){return this.controlManager.addControlOverView()}},{key:"addControlScale",value:function(){return this.controlManager.addControlScale()}},{key:"addControlZoomTool",value:function(){return this.controlManager.addControlZoomTool()}},{key:"addText",value:function(){return this.textManager.addText()}},{key:"addInfoWindow",value:function(){return this.infoWindowManager.addInfoWindow()}},{key:"toggleInfoWindowVisible",value:function(){return this.infoWindowManager.toggleInfoWindowVisible()}},{key:"toggleDraw",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polygon";return this.mutexManager.activate("toggleDraw",function(){return t.drawManager.toggleDraw(e)},function(){return t.drawManager.toggleDraw(e)})}},{key:"undoDraw",value:function(){return this.drawManager.undoDraw()}},{key:"endDraw",value:function(){return this.drawManager.endDraw()}},{key:"startDrawIsolation",value:function(){var t=this;return this.mutexManager.activate("startDrawIsolation",function(){return t.isolationManager.startDrawIsolation()},function(){return t.isolationManager.closeEditIsolation()})}},{key:"startDrawRisk",value:function(){var t=this;return this.mutexManager.activate("startDrawRisk",function(){return t.riskManager.startDrawRisk()},function(){})}},{key:"startDrawSmartPolygon",value:function(){var t=this;return this.mutexManager.activate("startDrawSmartPolygon",function(){return t.smartEditManager.startDrawSmartPolygon()},function(){return t.smartEditManager.closeEditSmartPolygon()})}},{key:"togglePolygonEdit",value:function(){var t=this;return this.mutexManager.activate("togglePolygonEdit",function(){return t.drawManager.togglePolygonEdit()},function(){return t.drawManager.togglePolygonEdit()})}},{key:"togglePolygonVisible",value:function(){return this.drawManager.togglePolygonVisible()}},{key:"openEditIsolation",value:function(){var t=this;return this.mutexManager.activate("openEditIsolation",function(){return t.isolationManager.openEditIsolation()},function(){return t.isolationManager.closeEditIsolation()})}},{key:"openEditRisk",value:function(){var t=this;return this.mutexManager.activate("openEditRisk",function(){return t.riskManager.openEditRisk()},function(){})}},{key:"openEditCore",value:function(){var t=this;return this.mutexManager.activate("openEditCore",function(){return t.smartEditManager.openEditCore()},function(){return t.smartEditManager.closeEditCore()})}},{key:"openEditSmartPolygon",value:function(){return this.smartEditManager.openEditSmartPolygon()}},{key:"closeEditSmartPolygon",value:function(){return this.smartEditManager.closeEditSmartPolygon()}},{key:"length",value:function(){var t=this;return this.mutexManager.activate("length",function(){return t.drawManager.length()},function(){})}},{key:"newIsolation",value:function(){return this.isolationManager.newIsolation()}},{key:"selectIsolation",value:function(){return this.isolationManager.selectIsolation()}},{key:"closeEditIsolation",value:function(){return this.isolationManager.closeEditIsolation()}},{key:"newRiskArea",value:function(){return this.riskManager.newRiskArea()}},{key:"finishEditRisk",value:function(){return this.riskManager.finishEditRisk()}},{key:"openSelectRisk",value:function(){return this.riskManager.openSelectRisk()}},{key:"newSmartPolygon",value:function(){return this.smartEditManager.newSmartPolygon()}},{key:"useCorer",value:function(){return this.smartEditManager.useCorer()}},{key:"closeEditCore",value:function(){return this.smartEditManager.closeEditCore()}},{key:"showPopup",value:function(){return this.trackManager.showPopup()}},{key:"mapOnEvent",value:function(){return this.eventManager.mapOnEvent()}},{key:"mapOffEvent",value:function(){return this.eventManager.mapOffEvent()}},{key:"markerOnEvent",value:function(){return this.eventManager.markerOnEvent()}},{key:"markerOffEvent",value:function(){return this.eventManager.markerOffEvent()}},{key:"switchScenario",value:function(t){return this.mutexManager.switchScenario(t)}},{key:"getActiveFeatures",value:function(){return this.mutexManager.getActiveFeatures()}},{key:"getCurrentScenario",value:function(){return this.mutexManager.getCurrentScenario()}},{key:"clearAllFeatures",value:function(){this.mutexManager.clear(),this._updateUIState()}},{key:"_updateUIState",value:function(){var t=this,e=document.getElementById("scenario-indicator");e&&(e.textContent="场景:".concat(this.getCurrentScenario()));var n=this.getActiveFeatures(),r=document.getElementById("active-count"),i=document.getElementById("active-features-list");r&&(r.textContent="激活功能:".concat(n.length)),i&&(0===n.length?i.innerHTML='<p class="empty-tip">暂无激活功能</p>':i.innerHTML=n.map(function(t){return'<span class="feature-item">'.concat(t.featureName," (").concat(t.group||"无组",")</span>")}).join("")),document.querySelectorAll(".btn-tool").forEach(function(e){var n=e.getAttribute("data-feature");if(n){var r=t.mutexManager.isActive(n);e.classList.toggle("active",r)}}),document.querySelectorAll("[data-scenario]").forEach(function(e){var n=e.getAttribute("data-scenario");e.classList.toggle("btn-primary",n===t.getCurrentScenario()),e.classList.toggle("btn-secondary",n!==t.getCurrentScenario())})}},{key:"destroy",value:function(){try{this.mutexManager.clear(),this.eventManager.cleanup(),this.trackManager.destroy(),this.smartEditManager.destroy(),this.riskManager.destroy(),this.isolationManager.destroy(),this.infoWindowManager.destroy(),this.textManager.destroy(),this.controlManager.destroy(),this.drawManager.destroy(),this.markerManager.destroy(),this.layerManager.destroy(),this.mapManager.destroy(),qC.Logger.info("✅ 所有资源已销毁")}catch(t){qC.ErrorHandler.handle(t,"MapService.destroy")}}},{key:"getLayerManager",value:function(){return this.layerManager}},{key:"getMapManager",value:function(){return this.mapManager}},{key:"getMarkerManager",value:function(){return this.markerManager}}])}(),pS=function(){return cS(function t(){uS(this,t),this.map=null,this.map1=null,this.controlObj={}},[{key:"initMap",value:function(){try{var t={target:iS.MAP.TARGET,zoom:iS.MAP.DEFAULT_ZOOM,zooms:iS.MAP.ZOOMS,center:iS.MAP.CENTER,controls:{attribution:!1,zoom:!0,rotate:!1},undoDrawCB:function(t){qC.Logger.info("example undoDrawCB count:",t)}};return this.map=new XNOM.Map(t),this.map.on("loadend",PS),qC.Logger.info("主地图初始化成功"),this.map}catch(t){return qC.ErrorHandler.handle(t,"MapManager.initMap")}}},{key:"getMap",value:function(){return this.map}},{key:"getControlObj",value:function(){return this.controlObj}},{key:"setControlObj",value:function(t){this.controlObj=t}},{key:"destroy",value:function(){try{this.map&&"function"==typeof this.map.destroy&&(this.map.destroy(),this.map=null),this.map1&&"function"==typeof this.map1.destroy&&(this.map1.destroy(),this.map1=null),this.controlObj={},qC.Logger.info("地图资源已销毁")}catch(t){qC.ErrorHandler.handle(t,"MapManager.destroy")}}}])}(),dS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.layers={},this.krigingLayer=null,this.polygon=null,this.complexPolygon=null,this.polyline=null},[{key:"addKrigingLayer",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"LayerManager.addKrigingLayer")&&(this.krigingLayer=new XNOM.KrigingLayer({name:iS.LAYER.KRIGING.NAME,zIndex:iS.LAYER.KRIGING.Z_INDEX,alpha:iS.LAYER.KRIGING.ALPHA,width:iS.LAYER.KRIGING.WIDTH,data:[{id:1660,lat:"28.8",lon:"88.5",value:"-15"},{id:1661,lat:"29.1",lon:"88.8",value:"-8"},{id:1662,lat:"29.4",lon:"89.1",value:"-5.68"},{id:1663,lat:"29.1",lon:"88.5",value:"-8.66"},{id:1664,lat:"29.3",lon:"88.8",value:"10.290001"},{id:1665,lat:"29.6",lon:"89.1",value:"5.68"},{id:1666,lat:"29.8",lon:"89.3",value:"8.66"},{id:1667,lat:"30.1",lon:"89.7",value:"15"},{id:1668,lat:"30.5",lon:"90",value:"-5.68"}],path:[[89.591517,30.735206],[90.245204,30.070533],[90.091395,29.043311],[89.261927,28.719214],[88.344569,29.153174],[88.251185,30.043067],[88.899379,30.702247],[89.591517,30.735206]],colors:["#ff4400","#ff7c4c","#ffb499","#ffece5","#ffffff","#b9dcff","#84c2ff","#56a7fd","#2189ff"]}),t.map&&t.map.addLayer(this.krigingLayer),this.layers.kriging=this.krigingLayer,this.krigingLayer)}catch(t){return qC.ErrorHandler.handle(t,"LayerManager.addKrigingLayer")}}},{key:"addPolygon",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"LayerManager.addPolygon"))return!1;var e={group:iS.GROUP.DEFAULT,path:[[[89.591517,30.735206],[90.245204,30.070533],[90.091395,29.043311],[89.261927,28.719214],[88.344569,29.153174],[88.251185,30.043067],[88.899379,30.702247],[89.591517,30.735206]],[[88.591517,30.735206],[91.245204,30.070533],[91.091395,29.043311],[88.591517,30.735206]]],map:t};return this.polygon=new XNOM.Polygon(e),this.layers.polygon=this.polygon,this.polygon}catch(t){return qC.ErrorHandler.handle(t,"LayerManager.addPolygon")}}},{key:"addComplexPolygon",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"LayerManager.addComplexPolygon"))return!1;var e={path:[[[87.8883927613539,29.2847665670185],[88.88301011920525,29.253306650590112],[88.86849015777676,28.520048598451524],[88.60229086492117,28.31192915130988],[88.09167222135272,28.32886910630978],[87.74319314706904,28.59264840559396],[87.78191304421166,28.972587396306032],[87.8883927613539,29.2847665670185]]],map:t};return this.complexPolygon=new XNOM.ComplexPolygon(e),this.layers.complexPolygon=this.complexPolygon,this.complexPolygon}catch(t){return qC.ErrorHandler.handle(t,"LayerManager.addComplexPolygon")}}},{key:"addPolyline",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"LayerManager.addPolyline"))return!1;var e={path:[[88.8883927613539,30.2847665670185],[89.88301011920525,30.253306650590112],[89.86849015777676,29.520048598451524],[89.60229086492117,29.31192915130988],[89.09167222135272,29.32886910630978],[88.74319314706904,29.59264840559396],[88.78191304421166,29.972587396306032]],map:t,group:iS.GROUP.POLYLINE};this.polyline=new XNOM.Polyline(e);var n={path:[[89.8883927613539,30.2847665670185],[90.88301011920525,30.253306650590112],[90.86849015777676,29.520048598451524],[90.60229086492117,29.31192915130988],[90.09167222135272,29.32886910630978],[89.74319314706904,29.59264840559396],[89.78191304421166,29.972587396306032]],borderWidth:0,map:t,group:iS.GROUP.POLYLINE},r=new XNOM.Polyline(n);return this.layers.polyline=this.polyline,this.layers.polyline1=r,this.polyline}catch(t){return qC.ErrorHandler.handle(t,"LayerManager.addPolyline")}}},{key:"getPolygon",value:function(){return this.polygon}},{key:"getPolyline",value:function(){return this.polyline}},{key:"destroy",value:function(){try{Object.values(this.layers).forEach(function(t){t&&"function"==typeof t.destroy&&t.destroy()}),this.layers={},this.krigingLayer=null,this.polygon=null,this.complexPolygon=null,this.polyline=null,qC.Logger.info("图层资源已清理")}catch(t){qC.ErrorHandler.handle(t,"LayerManager.destroy")}}}])}(),gS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.markers={},this.massMarkers={},this.clustersMarkers={},this.isPause=!1},[{key:"addMarker",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"MarkerManager.addMarker"))return!1;var e={position:[89.3,29],src:iS.URLS.ICON_1,activeSrc:iS.URLS.ICON_2,rotation:Math.atan2(1,0),autoRotation:!0,anchor:[.5,1],map:t},n=new XNOM.Marker(e);return n.setMap(t),this.markers.main=n,n}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.addMarker")}}},{key:"addMarker1",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"MarkerManager.addMarker1"))return!1;var e={position:[120.566032634,33.355905081],src:iS.URLS.ICON_1,anchor:[1,1],rotation:Math.atan2(1,0),map:t},n=new XNOM.Marker(e);return this.markers.marker1=n,n}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.addMarker1")}}},{key:"addMassMarker",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"MarkerManager.addMassMarker"))return!1;var e=[];return[[82.2,30.1],[82.2,30.2],[82.3,30.1],[82.3,30.2],[82.3,30.3],[82.3,30.4],[82.4,30.1],[82.4,30.2]].forEach(function(n){var r={position:n,anchor:[.5,.5],group:iS.GROUP.MASS,map:t},i=new XNOM.Marker(r);i.setMap(t),e.push(i)}),this.massMarkers.mass1=e,e}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.addMassMarker")}}},{key:"addMassMarker1",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"MarkerManager.addMassMarker1"))return!1;var e={data:this._getMassMarkerData(),styles:[{src:iS.URLS.ICON_1},{src:iS.URLS.ICON_2}],map:t},n=new XNOM.MassMarker(e);return this.massMarkers.mass2=n,n.on("click",function(t){var e=t.lnglat,r=n.getClosestPoint(e);qC.Logger.info("海量标记点点击",r)}),n}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.addMassMarker1")}}},{key:"_getMassMarkerData",value:function(){for(var t=[],e=82.2;e<=83.6;e+=.1)for(var n=29.2;n<=31.7;n+=.1)t.push({lonlat:[parseFloat(e.toFixed(1)),parseFloat(n.toFixed(1))],styleIndex:Math.random()>.5?0:1,extData:"tttt"});return t.slice(0,200)}},{key:"addClustersMarker1",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"MarkerManager.addClustersMarker1"))return!1;var e={data:this._getMassMarkerData(),styles:[{src:iS.URLS.ICON_1},{src:iS.URLS.ICON_2}],map:t},n=new XNOM.ClustersMarker(e);return this.clustersMarkers.clusters1=n,n}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.addClustersMarker1")}}},{key:"getMarker",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"main";return this.markers[t]}},{key:"toggleMarker",value:function(){try{var t=this.markers.main;return t?(t.getVisible()?t.hide():t.show(),!0):(qC.Logger.warn("标记点不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.toggleMarker")}}},{key:"toggleMarkerDrag",value:function(){try{var t=this.markers.main;return t?(t.getDraggable()?t.setDraggable(!1):t.setDraggable(!0),!0):(qC.Logger.warn("标记点不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.toggleMarkerDrag")}}},{key:"openMoveMarker",value:function(){try{var t=this.markers.main;if(!t)return qC.Logger.warn("标记点不存在"),!1;var e=this._getMovePath();return t.moveAlong(e,10),this.isPause=!1,!0}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.openMoveMarker")}}},{key:"_getMovePath",value:function(){return[["117.917594333","36.9623245"],["117.917867167","36.961468167"],["117.91759","36.961894"]].map(function(t){return t.map(function(t){return parseFloat(t)})})}},{key:"pauseMoveMarker",value:function(){try{var t=this.markers.main;return t?(this.isPause?t.resumeMove():t.pauseMove(),this.isPause=!this.isPause,!0):(qC.Logger.warn("标记点不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"MarkerManager.pauseMoveMarker")}}},{key:"getIsPause",value:function(){return this.isPause}},{key:"destroy",value:function(){try{Object.values(this.markers).forEach(function(t){t&&"function"==typeof t.destroy&&t.destroy()}),this.markers={},this.massMarkers={},this.clustersMarkers={},this.isPause=!1,qC.Logger.info("标记点资源已清理")}catch(t){qC.ErrorHandler.handle(t,"MarkerManager.destroy")}}}])}(),yS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.controls={}},[{key:"addControlOverView",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"ControlManager.addControlOverView"))return!1;var e=new XNOM.Control.OverView;return this.controls.overView=e,e.setMap(t),this.mapManager.getControlObj().overView=e,e}catch(t){return qC.ErrorHandler.handle(t,"ControlManager.addControlOverView")}}},{key:"addControlScale",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"ControlManager.addControlScale"))return!1;var e=new XNOM.Control.Scale;return this.controls.scale=e,e.setMap(t),this.mapManager.getControlObj().scale=e,e}catch(t){return qC.ErrorHandler.handle(t,"ControlManager.addControlScale")}}},{key:"addControlZoomTool",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"ControlManager.addControlZoomTool"))return!1;var e=new XNOM.Control.ZoomTool;return this.controls.zoomTool=e,e.setMap(t),this.mapManager.getControlObj().zoomTool=e,e}catch(t){return qC.ErrorHandler.handle(t,"ControlManager.addControlZoomTool")}}},{key:"destroy",value:function(){this.controls={}}}])}(),vS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.texts={}},[{key:"addText",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"TextManager.addText"))return!1;var e={position:[89.3,29],content:"测试文字",fontSize:"48px",fill:"#000",stroke:"#fff",borderWidth:3,map:t,group:iS.GROUP.DEFAULT},n=new XNOM.Text(e);return this.texts.text1=n,[n]}catch(t){return qC.ErrorHandler.handle(t,"TextManager.addText")}}},{key:"destroy",value:function(){this.texts={}}}])}(),_S=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.infoWindow=null},[{key:"addInfoWindow",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"InfoWindowManager.addInfoWindow"))return!1;var e={position:[120.566032634,33.355905081],anchor:[.5,1],dom:"infobox",map:t};return this.infoWindow=new XNOM.InfoWindow(e),this.infoWindow.setMap(t),this.infoWindow}catch(t){return qC.ErrorHandler.handle(t,"InfoWindowManager.addInfoWindow")}}},{key:"toggleInfoWindowVisible",value:function(){try{return this.infoWindow?(this.infoWindow.isVisible()?this.infoWindow.hide():this.infoWindow.show(),!0):(qC.Logger.warn("弹窗未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"InfoWindowManager.toggleInfoWindowVisible")}}},{key:"getInfoWindow",value:function(){return this.infoWindow}},{key:"destroy",value:function(){this.infoWindow&&"function"==typeof this.infoWindow.destroy&&this.infoWindow.destroy(),this.infoWindow=null}}])}(),mS=function(){return cS(function t(e,n){uS(this,t),this.mapManager=e,this.layerManager=n,this.isDraw=!1,this.drawList=[],this.editPoly=!1,this.editPolyline=!1,this.isMeasureOpen=!1,this.measureDblClickHandler=null},[{key:"toggleDraw",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polygon";try{var n=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(n,"DrawManager.toggleDraw")&&(this.isDraw?(n.stopDraw(),this.isDraw=!1):(n.startDraw(e),n.on("drawend",function(e){qC.Logger.info("drawend",e),e.geom.openEdit(),t.drawList.push(e.geom),t.isDraw=!1}),this.isDraw=!0),!0)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.toggleDraw")}}},{key:"undoDraw",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"DrawManager.undoDraw")&&(t.undoDraw(),!0)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.undoDraw")}}},{key:"endDraw",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"DrawManager.endDraw")&&(t.endDraw(),!0)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.endDraw")}}},{key:"togglePolygonEdit",value:function(){try{var t=this.layerManager?this.layerManager.getPolygon():this.mapManager.getLayerManager().getPolygon();return t?(this.editPoly?t.closeEdit():t.openEdit(),this.editPoly=!this.editPoly,!0):(qC.Logger.warn("多边形不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.togglePolygonEdit")}}},{key:"togglePolygonVisible",value:function(){try{var t=this.layerManager?this.layerManager.getPolygon():this.mapManager.getLayerManager().getPolygon();return t?(t.isVisible()?t.hide():t.show(),!0):(qC.Logger.warn("多边形不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.togglePolygonVisible")}}},{key:"length",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"DrawManager.length")&&(t.openMeasure("length"),!0)}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.length")}}},{key:"showPopup",value:function(){try{var t=document.getElementById("track-box");return t&&(t.style.display="none"===t.style.display?"block":"none"),!0}catch(t){return qC.ErrorHandler.handle(t,"DrawManager.showPopup")}}},{key:"destroy",value:function(){this.drawList=[],this.isDraw=!1,this.editPoly=!1,this.editPolyline=!1}}])}(),xS=function(){return cS(function t(e,n){uS(this,t),this.mapManager=e,this.markerManager=n,this.eventListeners=[]},[{key:"mapOnEvent",value:function(){try{var t=this.mapManager.getMap();if(!qC.ErrorHandler.validateMap(t,"EventManager.mapOnEvent"))return!1;var e=t.on(["click"],IS);return this.eventListeners.push({type:"mapClick",listener:e,target:t}),qC.Logger.info("地图点击事件已绑定"),!0}catch(t){return qC.ErrorHandler.handle(t,"EventManager.mapOnEvent")}}},{key:"mapOffEvent",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"EventManager.mapOffEvent")&&(t.off("click",IS),qC.Logger.info("地图点击事件已解绑"),!0)}catch(t){return qC.ErrorHandler.handle(t,"EventManager.mapOffEvent")}}},{key:"markerOnEvent",value:function(){try{var t=this.markerManager.getMarker();if(!t)return qC.Logger.warn("标记点不存在"),!1;var e=t.on("pointermove",MS);return this.eventListeners.push({type:"markerMove",listener:e,target:t}),qC.Logger.info("标记点经过事件已绑定"),!0}catch(t){return qC.ErrorHandler.handle(t,"EventManager.markerOnEvent")}}},{key:"markerOffEvent",value:function(){try{var t=this.markerManager.getMarker();return t?(t.off("pointermove",MS),qC.Logger.info("标记点经过事件已解绑"),!0):(qC.Logger.warn("标记点不存在"),!1)}catch(t){return qC.ErrorHandler.handle(t,"EventManager.markerOffEvent")}}},{key:"cleanup",value:function(){try{this.eventListeners.forEach(function(t){var e=t.type,n=t.listener,r=t.target;r&&r.off&&r.off(e,n)}),this.eventListeners=[],qC.Logger.info("事件监听器已清理")}catch(t){qC.ErrorHandler.handle(t,"EventManager.cleanup")}}}])}(),wS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.isolation=null,this.selectIsolationId=null},[{key:"newIsolation",value:function(){var t=this;try{var e=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(e,"IsolationManager.newIsolation")&&(this.isolation=new XNOM.Isolation({map:e,isError:function(t){return qC.Logger.info("is error",t)},changeSelectPoint:function(t){return qC.Logger.info("change select point",t)},changeSelectIdCB:function(e){qC.Logger.info("change select id",e),t.selectIsolationId=e}}),this.isolation)}catch(t){return qC.ErrorHandler.handle(t,"IsolationManager.newIsolation")}}},{key:"startDrawIsolation",value:function(){try{return this.isolation?(this.isolation.startDraw(),!0):(qC.Logger.warn("隔离区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"IsolationManager.startDrawIsolation")}}},{key:"openEditIsolation",value:function(){try{return this.isolation?(this.isolation.openEdit(),!0):(qC.Logger.warn("隔离区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"IsolationManager.openEditIsolation")}}},{key:"closeEditIsolation",value:function(){try{return this.isolation?(this.isolation.closeEdit(),!0):(qC.Logger.warn("隔离区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"IsolationManager.closeEditIsolation")}}},{key:"selectIsolation",value:function(){try{return!!this.isolation||(qC.Logger.warn("隔离区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"IsolationManager.selectIsolation")}}},{key:"getIsolation",value:function(){return this.isolation}},{key:"getSelectIsolationId",value:function(){return this.selectIsolationId}},{key:"destroy",value:function(){this.isolation&&"function"==typeof this.isolation.destroy&&this.isolation.destroy(),this.isolation=null,this.selectIsolationId=null}}])}(),bS=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.riskArea=null},[{key:"newRiskArea",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"RiskManager.newRiskArea")&&(this.riskArea=new XNOM.RiskArea({map:t,callbacks:{changeSelectPoint:function(t){return qC.Logger.info("change select point",t)},isError:function(t){return qC.Logger.info("isError type:",t)},outOfBoundsCB:function(){return qC.Logger.info("test outOfBoundsCB")},finishRiskDrawCB:function(){return qC.Logger.info("test finishRiskDrawCB")}},path:[[[87.29903773963875,30.790137660768504],[87.25875431299633,29.321631577876087],[88.59542445838875,29.303321142759795],[88.45992596447891,30.720557470884795],[87.29903773963875,30.790137660768504]],[[87.89229945838875,30.270118017759795],[87.69820743799633,29.662207749751087],[88.26949650049633,29.647559535768504],[87.89229945838875,30.270118017759795]]],riskAreaList1:[{path:[[[87.29903773963875,30.790137660768504],[87.25875431299633,29.321631577876087],[88.59542445838875,29.303321142759795],[88.45992596447891,30.720557470884795],[87.29903773963875,30.790137660768504]]],level:1,isAll:1}]}),this.riskArea)}catch(t){return qC.ErrorHandler.handle(t,"RiskManager.newRiskArea")}}},{key:"startDrawRisk",value:function(){try{return this.riskArea?(this.riskArea.drawRisk(),!0):(qC.Logger.warn("风险区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"RiskManager.startDrawRisk")}}},{key:"finishEditRisk",value:function(){try{return this.riskArea?(this.riskArea.finishEditRisk(),!0):(qC.Logger.warn("风险区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"RiskManager.finishEditRisk")}}},{key:"openSelectRisk",value:function(){try{return this.riskArea?(this.riskArea.openSelect(),!0):(qC.Logger.warn("风险区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"RiskManager.openSelectRisk")}}},{key:"openEditRisk",value:function(){try{return this.riskArea?(this.riskArea.openRiskEdit(),!0):(qC.Logger.warn("风险区未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"RiskManager.openEditRisk")}}},{key:"destroy",value:function(){this.riskArea&&"function"==typeof this.riskArea.destroy&&this.riskArea.destroy(),this.riskArea=null}}])}(),ES=function(){return cS(function t(e){uS(this,t),this.mapManager=e,this.smartPolygon=null},[{key:"newSmartPolygon",value:function(){try{var t=this.mapManager.getMap();return!!qC.ErrorHandler.validateMap(t,"SmartEditManager.newSmartPolygon")&&(this.smartPolygon=new XNOM.SmartPolygon({map:t,isError:function(t){return qC.Logger.info("isError type:",t)},changeSelectPoint:function(t){return qC.Logger.info("change select point",t)},finishCoreDrawCB:function(){return qC.Logger.info("ttt finishCoreDrawCB")},outOfBoundsCB:function(){return qC.Logger.info("test outOfBoundsCB")},finishDrawCB:function(){return qC.Logger.info("test finishDrawCB")}}),this.smartPolygon)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.newSmartPolygon")}}},{key:"startDrawSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.startDraw(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.startDrawSmartPolygon")}}},{key:"useCorer",value:function(){try{return this.smartPolygon?(this.smartPolygon.useCorer(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.useCorer")}}},{key:"openEditCore",value:function(){try{return this.smartPolygon?(this.smartPolygon.openCoreEdit(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.openEditCore")}}},{key:"closeEditCore",value:function(){try{return this.smartPolygon?(this.smartPolygon.finishRemoveCore(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.closeEditCore")}}},{key:"openEditSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.openEdit(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.openEditSmartPolygon")}}},{key:"closeEditSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.closeEdit(),!0):(qC.Logger.warn("智能多边形未初始化"),!1)}catch(t){return qC.ErrorHandler.handle(t,"SmartEditManager.closeEditSmartPolygon")}}},{key:"destroy",value:function(){this.smartPolygon&&"function"==typeof this.smartPolygon.destroy&&this.smartPolygon.destroy(),this.smartPolygon=null}}])}(),CS=function(){return cS(function t(){uS(this,t),this.trackReplay=null,this.resultArr=this._parseTrackData()},[{key:"_parseTrackData",value:function(){try{var t="2023-10-13 07:43:57,117.917594333,36.9623245,10.0,1,1;2023-10-13 07:44:02,117.917606667,36.962418167,10.0,1,1".split(";").map(function(t){var e=oS(t.split(","),6);return{time:e[0],lon:e[1],lat:e[2],deep:e[3],status:e[4],group:e[5]}}).reduce(function(t,e){var n=e.group;return n in t?t[n].push(e):t[n]=[e],t},{}),e=Object.keys(t).map(function(e){return t[e].reduce(function(t,e){var n=e.status,r=e.deep,i=e.lon,o=e.lat;return n!==t[t.length-1].status&&new Set(["0","1","2"]).has(n)&&t.push({status:n,deep:r,lon:i,lat:o}),t},[{status:"",deep:"",lon:"",lat:""}])});return e}catch(t){return qC.ErrorHandler.handle(t,"TrackManager._parseTrackData"),[]}}},{key:"showPopup",value:function(){try{this.trackReplay=new XNOM.TrackReplay({machine:1,data:this.resultArr,cameraList:[],clickCameraCallback:function(){},playFinishCallback:function(){},findLastPointCB:function(t){return qC.Logger.info("test point info:",t)},layers:[iS.URLS.TILE_1,iS.URLS.TILE_2]});var t=document.querySelector("#track-box");return t&&t.appendChild(this.trackReplay.dom),this.trackReplay}catch(t){return qC.ErrorHandler.handle(t,"TrackManager.showPopup")}}},{key:"destroy",value:function(){this.trackReplay&&"function"==typeof this.trackReplay.destroy&&this.trackReplay.destroy(),this.trackReplay=null}}])}(),SS=new fS;function PS(t){qC.Logger.info("地图加载完成",t)}function IS(t){qC.Logger.info("drag map",t)}function MS(t){qC.Logger.info("move marker",t,t.lnglat)}function OS(t){return OS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},OS(t)}function LS(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function RS(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?LS(Object(n),!0).forEach(function(e){kS(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):LS(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function kS(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=OS(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=OS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==OS(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}"undefined"!=typeof window&&(window.mapService=SS,window.initMap=function(){return SS.initMap()},window.initMap1=function(){return SS.initMap1()},window.addKrigingLayer=function(){return SS.addKrigingLayer()},window.addPolygon=function(){return SS.addPolygon()},window.addComplexPolygon=function(){return SS.addComplexPolygon()},window.addPolyline=function(){return SS.addPolyline()},window.addMarker=function(){return SS.addMarker()},window.addMarker1=function(){return SS.addMarker1()},window.addMassMarker=function(){return SS.addMassMarker()},window.addMassMarker1=function(){return SS.addMassMarker1()},window.addClustersMarker1=function(){return SS.addClustersMarker1()},window.toggleMarker=function(){return SS.toggleMarker()},window.toggleMarkerDrag=function(){return SS.toggleMarkerDrag()},window.openMoveMarker=function(){return SS.openMoveMarker()},window.pauseMoveMarker=function(){return SS.pauseMoveMarker()},window.addControlOverView=function(){return SS.addControlOverView()},window.addControlScale=function(){return SS.addControlScale()},window.addControlZoomTool=function(){return SS.addControlZoomTool()},window.addText=function(){return SS.addText()},window.addInfoWindow=function(){return SS.addInfoWindow()},window.toggleInfoWindowVisible=function(){return SS.toggleInfoWindowVisible()},window.toggleDraw=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polygon";return SS.toggleDraw(t)},window.undoDraw=function(){return SS.undoDraw()},window.endDraw=function(){return SS.endDraw()},window.togglePolygonEdit=function(){return SS.togglePolygonEdit()},window.togglePolygonVisible=function(){return SS.togglePolygonVisible()},window.length=function(){return SS.length()},window.newIsolation=function(){return SS.newIsolation()},window.startDrawIsolation=function(){return SS.startDrawIsolation()},window.selectIsolation=function(){return SS.selectIsolation()},window.openEditIsolation=function(){return SS.openEditIsolation()},window.closeEditIsolation=function(){return SS.closeEditIsolation()},window.newRiskArea=function(){return SS.newRiskArea()},window.startDrawRisk=function(){return SS.startDrawRisk()},window.finishEditRisk=function(){return SS.finishEditRisk()},window.openSelectRisk=function(){return SS.openSelectRisk()},window.openEditRisk=function(){return SS.openEditRisk()},window.newSmartPolygon=function(){return SS.newSmartPolygon()},window.startDrawSmartPolygon=function(){return SS.startDrawSmartPolygon()},window.useCorer=function(){return SS.useCorer()},window.openEditCore=function(){return SS.openEditCore()},window.closeEditCore=function(){return SS.closeEditCore()},window.openEditSmartPolygon=function(){return SS.openEditSmartPolygon()},window.closeEditSmartPolygon=function(){return SS.closeEditSmartPolygon()},window.showPopup=function(){return SS.showPopup()},window.mapOnEvent=function(){return SS.mapOnEvent()},window.mapOffEvent=function(){return SS.mapOffEvent()},window.markerOnEvent=function(){return SS.markerOnEvent()},window.markerOffEvent=function(){return SS.markerOffEvent()},window.switchScenario=function(t){return SS.switchScenario(t)},window.clearAllFeatures=function(){return SS.clearAllFeatures()},console.log("✅ MapService 方法已注册到 window 对象"),window.onload=function(){console.log("🚀 页面加载完成,开始初始化地图..."),initMap()});var TS=RS(RS({Map:wm,Marker:Wm,Text:H_,Polygon:r_,Polyline:x_,InfoWindow:ox},yw),{},{Control:bb,TrackReplay:Vb,ComplexPolygon:eE,SmartPolygon:EE,Isolation:qE,MassMarker:sC,ClustersMarker:bC,RiskArea:WC,MapService:fS,mapServiceInstance:SS});"undefined"!=typeof window&&(window.XNOM=TS),console.log("window.XNOM",TS);var NS=TS}(),r=r.default}()});
|
package/dist/sdk.esm.js
CHANGED
|
@@ -109352,7 +109352,7 @@ function MapService_toPrimitive(t, r) { if ("object" != MapService_typeof(t) ||
|
|
|
109352
109352
|
// ============================================================================
|
|
109353
109353
|
// MapService 主服务类
|
|
109354
109354
|
// ============================================================================
|
|
109355
|
-
var
|
|
109355
|
+
var MapService = /*#__PURE__*/function () {
|
|
109356
109356
|
function MapService() {
|
|
109357
109357
|
var _this = this;
|
|
109358
109358
|
MapService_classCallCheck(this, MapService);
|
|
@@ -111154,7 +111154,7 @@ var TrackManager = /*#__PURE__*/function () {
|
|
|
111154
111154
|
}(); // ============================================================================
|
|
111155
111155
|
// 全局函数(保持 HTML onclick 兼容)
|
|
111156
111156
|
// ============================================================================
|
|
111157
|
-
var mapService = new
|
|
111157
|
+
var mapService = new MapService();
|
|
111158
111158
|
function loadEnd(ev) {
|
|
111159
111159
|
utils.Logger.info('地图加载完成', ev);
|
|
111160
111160
|
}
|
|
@@ -111360,7 +111360,9 @@ if (typeof window !== 'undefined') {
|
|
|
111360
111360
|
initMap();
|
|
111361
111361
|
};
|
|
111362
111362
|
}
|
|
111363
|
-
|
|
111363
|
+
|
|
111364
|
+
// 改为命名导出,不占用默认导出,保留原有全局window挂载逻辑不变
|
|
111365
|
+
|
|
111364
111366
|
;// ./src/index.js
|
|
111365
111367
|
function src_typeof(o) { "@babel/helpers - typeof"; return src_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, src_typeof(o); }
|
|
111366
111368
|
function src_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -111391,6 +111393,7 @@ function src_toPrimitive(t, r) { if ("object" != src_typeof(t) || !t) return t;
|
|
|
111391
111393
|
|
|
111392
111394
|
|
|
111393
111395
|
|
|
111396
|
+
// 导入命名导出的 mapService 单例 和 MapService 类
|
|
111394
111397
|
|
|
111395
111398
|
|
|
111396
111399
|
/**
|
|
@@ -111421,15 +111424,17 @@ var src_XNOM = src_objectSpread(src_objectSpread({
|
|
|
111421
111424
|
Isolation: Isolation,
|
|
111422
111425
|
MassMarker: MassMarker,
|
|
111423
111426
|
ClustersMarker: ClustersMarker,
|
|
111424
|
-
RiskArea: RiskArea
|
|
111425
|
-
|
|
111427
|
+
RiskArea: RiskArea,
|
|
111428
|
+
MapService: MapService,
|
|
111429
|
+
mapServiceInstance: mapService
|
|
111430
|
+
});
|
|
111426
111431
|
|
|
111427
111432
|
// 浏览器全局挂载不变,兼容script直接引入调试
|
|
111428
111433
|
if (typeof window !== 'undefined') {
|
|
111429
111434
|
window.XNOM = src_XNOM;
|
|
111430
111435
|
// 保留原有 window 上所有全局方法、初始化逻辑(原mapService里挂的window方法原样有效)
|
|
111431
111436
|
}
|
|
111432
|
-
|
|
111437
|
+
console.log('window.XNOM', src_XNOM);
|
|
111433
111438
|
// 【关键】默认导出永远导出完整 XNOM 根对象
|
|
111434
111439
|
/* harmony default export */ var src = (src_XNOM);
|
|
111435
111440
|
export { src as default };
|