@zhnyfe/zhnyfe_xnom 0.0.0-alpha.41 → 0.0.0-alpha.42

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.
@@ -78,4 +78,4 @@ object-assign
78
78
  * LICENSE: MIT
79
79
  * (c) 2019-2019 https://github.com/sakitam-gis/kriging.js
80
80
  */
81
- function bI(t){return Math.max.apply(null,t)}function EI(t){return Math.min.apply(null,t)}function SI(t,e){for(var n=[],r=0;r<e;r++)n.push(t);return n}function CI(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 PI(t,e){for(var n=0,r=SI(0,e*e);n<e;n++)r[n*e+n]=t;return r}function II(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 MI(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 OI(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 LI(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 kI(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 RI(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 TI(t,e,n,r,i){return e+(r-e)/n*(1-Math.exp(-1/i*Math.pow(t/n,2)))}function AI(t,e,n,r,i){return e+(r-e)/n*(1-Math.exp(-1/i*(t/n)))}function NI(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 FI(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 OI(i,n.M,1,n.n,1)[0]}var DI={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:AI,K:[],M:[]};switch(r){case"gaussian":c.model=TI;break;case"exponential":default:c.model=AI;break;case"spherical":c.model=NI}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=SI(0,p),y=SI(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=SI(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=II(v,h,2),w=OI(x,v,2,h,2),b=(w=MI(w,PI(1/o,2),2,2)).slice(0);LI(w,2)?kI(w,2):(RI(b,2),w=b);var E=OI(OI(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 S=Array(h*h);for(s=0;s<h;s++){for(a=0;a<s;a++)S[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),S[a*h+s]=S[s*h+a];S[s*h+s]=c.model(0,c.nugget,c.range,c.sill,c.A)}var C=MI(S,PI(i,h),h,h),P=C.slice(0);LI(C,h)?kI(C,h):(RI(P,h),C=P);var I=C.slice(0),M=OI(C,t,h,h,1);return c.K=I,c.M=M,c},predict:FI,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=OI(OI(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,CI(t[r],a,u)&&(v[i][o]=FI(a,u,e))}return{xlim:l,ylim:c,width:n,data:v,zlim:[EI(e.t),bI(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:bI,min:EI,pip:CI,rep:SI,matrixDiag:PI,matrixTranspose:II,matrixAdd:MI,matrixMultiply:OI,matrixChol:LI,matrixChol2inv:kI,matrixSolve:RI,variogramGaussian:TI,variogramExponential:AI,variogramSpherical:NI},jI=DI;function GI(t){return GI="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},GI(t)}function BI(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,VI(r.key),r)}}function zI(t,e,n){return(e=VI(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VI(t){var e=function(t,e){if("object"!=GI(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=GI(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==GI(e)?e:e+""}var UI=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),zI(this,"source",void 0),zI(this,"getDataForLonlat",function(t){var e=!1,r=Za(t);if(Array.isArray(n.path[0][0]))e=n.path.some(function(t){var e=Ja([t]);return Jl(r,e)});else{var i=Ja([n.path]);Jl(r,i)&&(e=!0)}if(!e)return[];var o=n.variogramList;return null==o?void 0:o.map(function(e){return jI.predict(t[0],t[1],e)})}),this.init(e)},e=[{key:"init",value:function(t){if(!t)return new WP({source:new wI});if(!Array.isArray(t.data)||t.data.length.length<3)return console.info("数据量太小。"),new WP({source:new wI});if(this.calculateVariogram(t.data),t.colors&&(!Array.isArray(t.colors)||t.colors.length<2))return console.info("颜色组不正确。"),new WP({source:new wI});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 WP({source:new wI});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=jI.train(n,r,i,"exponential",0,100);this.kriging=jI,this.mode=o;var s=jI.grid(e.path,o,e.width),a=new wI({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",jI.plot(a,s,[t[0],t[2]],[t[1],t[3]],e.colors),a},projection:ME});this.source=a;var u=new WP({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=jI.train(r,o,s,"exponential",0,100),u=jI.train(n,o,s,"exponential",0,100),l=jI.train(e,o,s,"exponential",0,100),c=jI.train(i,o,s,"exponential",0,100);this.variogramList=[a,u,l,c]}}],e&&BI(t.prototype,e),n&&BI(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),XI=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)}}(),qI=function(t){function e(e){var n=this,r=void 0!==e.crossOrigin?e.crossOrigin:null,i=void 0!==e.imageLoadFunction?e.imageLoadFunction:nI,o=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(o=e.interpolate),(n=t.call(this,{attributions:e.attributions,interpolate:o,projection:xi(e.projection)})||this).url_=e.url,n.imageExtent_=e.imageExtent,n.image_=new _x(n.imageExtent_,void 0,1,n.url_,r,i),n.imageSize_=e.imageSize?e.imageSize:null,n.image_.addEventListener(ae,n.handleImageChange.bind(n)),n}return XI(e,t),e.prototype.getImageExtent=function(){return this.imageExtent_},e.prototype.getImageInternal=function(t,e,n,r){return Et(t,this.image_.getExtent())?this.image_:null},e.prototype.getUrl=function(){return this.url_},e.prototype.handleImageChange=function(e){if(this.image_.getState()==T_){var n=this.image_.getExtent(),r=this.image_.getImage(),i=void 0,o=void 0;this.imageSize_?(i=this.imageSize_[0],o=this.imageSize_[1]):(i=r.width,o=r.height);var s=bt(n),a=_t(n),u=s/i,l=a/o,c=i,h=o;if(u>l?c=Math.round(s/l):h=Math.round(a/u),c!==i||h!==o){var f=mn(c,h);this.getInterpolate()||te(f,$w);var p=f.canvas;f.drawImage(r,0,0,i,o,0,0,p.width,p.height),this.image_.setImage(p)}}t.prototype.handleImageChange.call(this,e)},e}(rI),WI=qI,YI={addRemoteImageLayer:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.url,r=e.extent,i=e.zIndex,o=void 0===i?999:i,s=e.name,a=void 0===s?"yaogan":s,u=new WI({url:n,imageExtent:r,crossOrigin:"anonymous"});u.set("name",a);var l=new WP({source:u,zIndex:o});return t.addLayer(l),l},addRemoteWMSLayer:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.url,r=e.layers,i=e.cql,o=e.token,s=e.zIndex,a=void 0===s?105:s,u=e.name,l=void 0===u?"vectorLayerAbnormal":u,c=new lI({url:n,crossOrigin:"anonymous",ratio:1,params:{LAYERS:r,SRS:"EPSG:4326",FORMAT:"image/png",TRANSPARENT:"true",token:o,CQL_FILTER:i}}),h=new WP({source:c,zIndex:a});return h.set("name",l),t.addLayer(h),h},addRemoteVectorLayer:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.strokeColor,i=void 0===r?"red":r,o=n.fillColor,s=void 0===o?"rgba(216,255,0,0)":o,a=n.zIndex,u=void 0===a?99:a,l=n.name,c=void 0===l?"vectorLayerAbnormalZT":l,h=new Va({geometry:new Jo([e])});h.setStyle(new tm({stroke:new H_({width:1,color:i}),fill:new W_({color:s})}));var f=new Wx({features:[h]}),p=new Nx({source:f,zIndex:u});return p.set("name",c),t.addLayer(p),p},removeLayerByName:function(t,e){t.getLayers().forEach(function(n){n.get("name")===e&&t.removeLayer(n)})},clearLayerList:function(t,e){e.forEach(function(e){return t.removeLayer(e)}),e.length=0}},HI={createRadarLayer:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).zIndex||105,n=new WP({zIndex:e});return t.addLayer(n),n},updateRadarImage:function(t,e){var n=e.url,r=e.extent,i=new WI({url:n,imageExtent:r,crossOrigin:"anonymous"});t.setSource(i)},clearLayerList:function(t,e){e.forEach(function(e){t.removeLayer(e)}),e.length=0}},ZI={Tile:DP,Vector:IE,KrigingLayer:UI,WmsImage:gI,RemoteSense:YI,Weather:HI},KI=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)}}(),JI=0,$I=1,QI=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_=JI,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 "+pn;var s=n.element;return s.className=i+" "+pn+" "+dn,s.appendChild(o),s.addEventListener(gr,n.handleDraggerStart_.bind(n),!1),s.addEventListener(dr,n.handleDraggerDrag_.bind(n),!1),s.addEventListener(yr,n.handleDraggerEnd_.bind(n),!1),s.addEventListener(ce,n.handleContainerClick_.bind(n),!1),o.addEventListener(ce,Jt,!1),n}return KI(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_=$I,this.widthLimit_=e-s):(this.direction_=JI,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:Yi})},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(_e(i,dr,n,this),_e(i,yr,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(xe),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),n=this.element.firstElementChild;this.direction_==$I?n.style.left=this.widthLimit_*e+"px":n.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return Mt(this.direction_===$I?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 Mt(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}(gs),tM=QI;function eM(t){return eM="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},eM(t)}function nM(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 rM(t,e,n){return(e=oM(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iM(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,oM(r.key),r)}}function oM(t){var e=function(t,e){if("object"!=eM(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=eM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==eM(e)?e:e+""}function sM(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function aM(t,e){return t.get(uM(t,e))}function uM(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 lM=new WeakMap,cM=new WeakSet,hM=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),sM(n=this,r=cM),r.add(n),function(t,e,n){sM(t,e),e.set(t,n)}(this,lM,void 0),this.init(uM(cM,this,fM).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 Ss({className:t})}},{key:"initZoomBar",value:function(t){this.zoomBar=new tM({className:t})}},{key:"setMap",value:function(t){var e,n,r;aM(lM,this)&&(aM(lM,this).map.removeControl(this.zoomBtn),aM(lM,this).map.removeControl(this.zoomBar)),t&&(n=this,r=t,(e=lM).set(uM(e,n),r),this.zoomBtn&&t.map.addControl(this.zoomBtn),this.zoomBar&&t.map.addControl(this.zoomBar))}},{key:"map",get:function(){return aM(lM,this)}}],e&&iM(t.prototype,e),n&&iM(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function fM(t){var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nM(Object(n),!0).forEach(function(e){rM(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nM(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({zoomBtn:!0,zoomBar:!1},t);return e}var pM=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)}}(),dM=.75,gM=.1,yM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return pM(e,t),e.prototype.createRenderer=function(){return new Hn(this)},e}(fs),vM=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(ce,n.handleClick_.bind(n),!1),n.ovmapDiv_=document.createElement("div"),n.ovmapDiv_.className="ol-overviewmap-map",n.view_=r.view,n.ovmap_=new yM({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 nE({position:[0,0],positioning:"center-center",element:h}),n.ovmap_.addOverlay(n.boxOverlay_);var f=i+" "+pn+" "+dn+(n.collapsed_&&n.collapsible_?" "+gn:"")+(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 pM(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(_e(e,Qt,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===Mr){var e=t.oldValue;e&&this.unbindView_(e);var n=this.getMap().getView();this.bindView_(n)}else this.ovmap_.isRendered()||t.key!==Ir&&t.key!==Pr||this.ovmap_.updateSize()},e.prototype.bindView_=function(t){if(!this.view_){var e=new os({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(qr.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()},e.prototype.unbindView_=function(t){t.removeChangeListener(qr.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_||!ot(r,this.viewExtent_)){this.viewExtent_=r;var i=e.getSize(),o=e.getView().calculateExtentInternal(i),s=e.getPixelFromCoordinateInternal(xt(r)),a=e.getPixelFromCoordinateInternal(pt(r)),u=Math.abs(s[0]-a[0]),l=Math.abs(s[1]-a[1]),c=i[0],h=i[1];u<c*gM||l<h*gM||u>c*dM||l>h*dM?this.resetExtent_():J(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;Ct(r,1/(Math.pow(2,o/2)*gM)),i.fitInternal($o(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_=me(this.ovmap_,xr,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(gn),this.collapsed_?En(this.collapseLabel_,this.label_):En(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}(gs),_M=vM;function mM(t){return mM="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},mM(t)}function xM(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 wM(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xM(Object(n),!0).forEach(function(e){bM(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xM(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function bM(t,e,n){return(e=SM(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function EM(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,SM(r.key),r)}}function SM(t){var e=function(t,e){if("object"!=mM(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=mM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==mM(e)?e:e+""}function CM(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function PM(t,e){return t.get(IM(t,e))}function IM(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 MM=new WeakMap,OM=new WeakSet,LM=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),CM(n=this,r=OM),r.add(n),function(t,e,n){CM(t,e),e.set(t,n)}(this,MM,void 0),this.init(IM(OM,this,kM).call(this,e))},e=[{key:"init",value:function(t){this.opts=t}},{key:"setMap",value:function(t){var e,n,r;PM(MM,this)&&PM(MM,this).map.removeControl(this.overView),this.overView&&(this.overView.setMap(null),this.overView=void 0),t&&(n=this,r=t,(e=MM).set(IM(e,n),r),this.overView=new _M(wM(wM({},this.opts),{},{layers:t.layers.map(function(t){return new gb({source:t.getSource()})})})),t.map.addControl(this.overView))}},{key:"map",get:function(){return PM(MM,this)}},{key:"isCollapsed",value:function(){return this.overView.getCollapsed()}},{key:"setCollapsed",value:function(t){this.overView.setCollapsed(t)}}],e&&EM(t.prototype,e),n&&EM(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function kM(t){return wM({},t)}var RM=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)}}(),TM="units",AM="degrees",NM="imperial",FM="nautical",DM="metric",jM="us",GM=[1,2,5],BM=25.4/.28,zM=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+" "+pn,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(TM,n.handleUnitsChanged_),n.setUnits(r.units||DM),n.scaleBar_=r.bar||!1,n.scaleBarSteps_=r.steps||4,n.scaleBarText_=r.text||!1,n.dpi_=r.dpi||void 0,n}return RM(e,t),e.prototype.getUnits=function(){return this.get(TM)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(TM,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==AM?Vr.DEGREES:Vr.METERS,o=wi(n,t.resolution,e,i),s=this.minWidth_*(this.dpi_||BM)/BM,a=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||BM)/BM:void 0,u=s*o,l="";if(r==AM){var c=zr[Vr.DEGREES];(u*=c)<c/60?(l="″",o*=3600):u<c?(l="′",o*=60):l="°"}else r==NM?u<.9144?(l="in",o/=.0254):u<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):r==FM?(o/=1852,l="NM"):r==DM?u<.001?(l="μm",o*=1e6):u<1?(l="mm",o*=1e3):u<1e3?l="m":(l="km",o/=1e3):r==jM?u<.9144?(l="in",o*=39.37):u<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):T(!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=GM[(_%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=wi(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Vr.METERS),e=this.dpi_||BM;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}(gs),VM=zM;function UM(t){return UM="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},UM(t)}function XM(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 qM(t,e,n){return(e=YM(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WM(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,YM(r.key),r)}}function YM(t){var e=function(t,e){if("object"!=UM(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=UM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==UM(e)?e:e+""}function HM(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ZM(t,e){return t.get(KM(t,e))}function KM(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 JM=new WeakMap,$M=new WeakSet,QM=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),HM(n=this,r=$M),r.add(n),function(t,e,n){HM(t,e),e.set(t,n)}(this,JM,void 0),this.init(KM($M,this,tO).call(this,e))},e=[{key:"init",value:function(t){this.scale=new VM(t)}},{key:"setMap",value:function(t){var e,n,r;ZM(JM,this)&&ZM(JM,this).map.removeControl(this.scale),t&&(n=this,r=t,(e=JM).set(KM(e,n),r),t.map.addControl(this.scale))}},{key:"map",get:function(){return ZM(JM,this)}}],e&&WM(t.prototype,e),n&&WM(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function tO(t){var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?XM(Object(n),!0).forEach(function(e){qM(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t);return e}var eO={ZoomTool:hM,OverView:LM,Scale:QM},nO=n(3510),rO={};rO.styleTagTransform=dE(),rO.setAttributes=cE(),rO.insert=uE().bind(null,"head"),rO.domAPI=sE(),rO.insertStyleElement=fE();iE()(nO.A,rO),nO.A&&nO.A.locals&&nO.A.locals;var iO=n.p+"assets/46ac1bfe350f7f38e22c.png",oO=n.p+"assets/50157e3bd0227aa82a75.png",sO=n.p+"assets/2a84d048717fc397253c.png",aO=n.p+"assets/17094eba52722bdefd71.png";function uO(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 lO(t){return lO="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},lO(t)}function cO(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,fO(r.key),r)}}function hO(t,e,n){return(e=fO(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fO(t){var e=function(t,e){if("object"!=lO(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=lO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==lO(e)?e:e+""}function pO(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dO(t,e,n){return t.set(yO(t,e),n),n}function gO(t,e){return t.get(yO(t,e))}function yO(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 vO={0:"#03C5FF",1:"#00FF80",2:"#00FF80",3:"#03C5FF",4:"#03C5FF"},_O={0:iO,1:oO},mO=new WeakMap,xO=new WeakSet,wO=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),pO(n=this,r=xO),r.add(n),function(t,e,n){pO(t,e),e.set(t,n)}(this,mO,!0),hO(this,"playBtnCallback",function(){gO(mO,i)?i.pauseMove():i.resumeMove()}),hO(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;yO(xO,i,bO).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}))}),hO(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;yO(xO,i,bO).call(i,o),i.dragDot(t)}),hO(this,"playFinish",function(){i.updatePlayRatio(1),i.pauseMove(),"function"===lO(i.options.playFinishCallback).toLocaleLowerCase()&&i.options.playFinishCallback()}),hO(this,"updatePlayRatio",function(t){var e,n=t*(null!==(e=i.baseFraction)&&void 0!==e?e:1)*100;yO(xO,i,bO).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=tc(Za(this.points[n]),Za(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 vw(t.route.flat());t.map.setFitForGeom(i,{avoid:[20,20,60,20]})}).observe(this.dom)}},{key:"pauseMove",value:function(){if(!gO(mO,this))return!1;dO(mO,this,!1),this.playBtn.className=(this.playBtn.className.replace(/playing/g,"")+" pause").replace(/\s+/," "),this.machine.pauseMove()}},{key:"resumeMove",value:function(){if(gO(mO,this))return!1;dO(mO,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 DP({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 FC(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=Bh(nu(this.route),{units:"kilometers"}),s=0;r.forEach(function(e){var n=Bh(Qa(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 oP({map:this.map,position:this.route[0][0],autoRotation:!0,src:_O[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=qE();this.trackPolylines=this.polylineOptsList.map(function(t){return t.map(function(t){return new AS({map:e.map,group:n,path:t.path,color:vO[t.status],borderWidth:0})})}),this.trackPoints=this.markerPos.map(function(t,n){return new oP({map:e.map,position:t,scale:.4375,anchor:[.5,1],src:aO,text:"".concat(n+1),fontSize:28})});var r=GS().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 oP({map:t.map,position:[e.lon,e.lat],src:sO,scale:.5});return n.on("click",function(){t.clickCamera(e.did)}),n})}},{key:"clickCamera",value:function(t){"function"===lO(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 xP(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?uO(Object(n),!0).forEach(function(e){hO(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):uO(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&&cO(t.prototype,e),n&&cO(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function bO(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 EO(t){return EO="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},EO(t)}function SO(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,PO(r.key),r)}}function CO(t,e,n){return(e=PO(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function PO(t){var e=function(t,e){if("object"!=EO(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=EO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==EO(e)?e:e+""}function IO(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 MO(t,e){return t.get(LO(t,e))}function OO(t,e,n){return t.set(LO(t,e),n),n}function LO(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 kO=new WeakMap,RO=new WeakMap,TO=new WeakMap,AO=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),IO(this,kO,void 0),CO(this,"featureName",void 0),IO(this,RO,void 0),IO(this,TO,void 0),CO(this,"corerGeom",function(t){var e=n.getPath()[0];Dd(Ja(e),Ja([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))}),CO(this,"condition",function(t){return console.log("condition",t),n.conditionCallback(t.coordinate)}),CO(this,"defaultCondition",function(t){var e=Ja(n.getPath()[0]);return Jl(Za(t),e)}),CO(this,"finishRemoveCore",function(){if(!n.core)return!1;var t=n.getPath()[0],e=n.core.getPath();if(Dd(Ja(t),Ja([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=qE(),n?(OO(kO,this,[]),t.path.forEach(function(t){MO(kO,e).push(new Va({type:"polygon",geometry:new Jo(t),name:e.featureName}))})):OO(kO,this,new Va({type:"polygon",geometry:new Jo(t.path),name:this.featureName})),this.style=new tm({stroke:new H_({width:t.borderWidth,color:t.strokeColor}),fill:new W_({color:t.fillColor})}),Array.isArray(MO(kO,this))?(MO(kO,this).forEach(function(t){t.setStyle(e.style)}),this.layer=new IE(MO(kO,this))):(MO(kO,this).setStyle(this.style),this.layer=new IE([MO(kO,this)])),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return MO(kO,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){MO(RO,this)&&MO(RO,this).removeFeature(this.layer),t?(t.addFeature(this.layer),OO(RO,this,t),OO(TO,this,new VE(this,MO(RO,this).map))):MO(RO,this)&&MO(RO,this).removeFeature(this.layer)}},{key:"map",get:function(){return MO(RO,this)}},{key:"eventList",get:function(){return MO(TO,this).eventList}},{key:"on",value:function(t,e){return MO(TO,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return MO(TO,this).off(t,e,JE)}},{key:"openEdit",value:function(){MO(RO,this).editGeom(this)}},{key:"closeEdit",value:function(){return!!MO(RO,this).getEditGeom(this)&&MO(RO,this).closeEditGeom(this)}},{key:"getArea",value:function(){return this.getPath().reduce(function(t,e){return t+e.reduce(function(t,e){return t-WE(e)},2*WE(e[0]))},0)}},{key:"getRegion",value:function(){return this.getPath().reduce(function(t,e){return t+WE(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&&SO(t.prototype,e),n&&SO(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function NO(t){return NO="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},NO(t)}function FO(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 DO(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?FO(Object(n),!0).forEach(function(e){zO(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):FO(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function jO(t){return function(t){if(Array.isArray(t))return GO(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 GO(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)?GO(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 GO(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 BO(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,VO(r.key),r)}}function zO(t,e,n){return(e=VO(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VO(t){var e=function(t,e){if("object"!=NO(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=NO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==NO(e)?e:e+""}function UO(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 XO(t,e){return t.get(WO(t,e))}function qO(t,e,n){return t.set(WO(t,e),n),n}function WO(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 YO=new tm({image:new X_({fill:new W_({color:"#18a058"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),zIndex:9}),HO=new X_({fill:new W_({color:"#e59810"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),ZO=new tm({image:HO,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new Ew(e)}}),KO=new tm({zIndex:5,image:HO,geometry:function(t){var e=t.getGeometry().getCoordinates();return new Ew(e)}}),JO={base:[new tm({fill:new W_({color:"#9ffbc74d"}),stroke:new H_({color:"#16e96f",width:2})})],select:[new tm({fill:new W_({color:"#ff7f1db3"}),stroke:new H_({color:"#ff7f1d",width:2})})],draw:[YO,new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#e59810",width:2,lineDash:[10,10]})}),KO],edit:[new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#e59810",width:2})}),ZO],error:[new tm({fill:new W_({color:"#ff492480"}),stroke:new H_({color:"#e59810",width:2})}),ZO]},$O={base:[new tm({fill:new W_({color:"#ff7f1d4d"}),stroke:new H_({color:"#ffffff",width:2})})],select:[new tm({fill:new W_({color:"#ff7f1db3"}),stroke:new H_({color:"#ff7f1d",width:1})})],draw:[YO,new tm({fill:new W_({color:"#e5981099"}),stroke:new H_({color:"#ffffff",width:1,lineDash:[6,10]})}),KO],edit:[new tm({fill:new W_({color:"#e5981099"}),stroke:new H_({color:"#ffffff",width:1})}),ZO],error:[new tm({fill:new W_({color:"#ff492480"}),stroke:new H_({color:"#e59810",width:2})}),ZO]},QO=new WeakMap,tL=new WeakMap,eL=new WeakMap,nL=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),UO(this,QO,void 0),UO(this,tL,void 0),UO(this,eL,void 0),zO(this,"textList",[]),zO(this,"isShowLength",!1),zO(this,"tempShowLenFnCB",function(t){n.showLengthFn(t.target)}),zO(this,"active",!1),zO(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=Za(t.coordinate),r=Qa(n.core.getPath());return Jl(e,u_(r,.001))?(n.selectPoint?(n.selectPoint.show(),n.selectPoint.setPosition(t.coordinate)):n.selectPoint=new oP({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)}),zO(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=Za(t.coordinate),r=Qa(n.getPath()[0]);return Jl(e,u_(r,.001))?(n.selectPoint?(n.selectPoint.show(),n.selectPoint.setPosition(t.coordinate)):n.selectPoint=new oP({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)}),zO(this,"corerGeom",function(t){n.finishCoreDrawCB&&n.finishCoreDrawCB();var e,r,i=jO(n.getPath());n.core=t.geom,n.core.setSourceStyle($O.base),n.coreList?(i.push.apply(i,jO(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],Dd(Ja(i),Ja(t.path)),XO(tL,n).editGeom(t.geom,$O.edit,YO,n.clickCorePointCB),t.geom.setActiveStyle($O.select),n.changeCoreErrorStatus(n.coreStatusIsError())}),zO(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)}),zO(this,"condition",function(t){return console.log("condition",t),n.conditionCallback(t.coordinate)}),zO(this,"defaultCondition",function(t){var e=Ja(n.getPath()),r=Jl(Za(t),e);return r||n.outOfBoundsCB&&n.outOfBoundsCB(),r}),zO(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],XO(tL,n).getEditGeom(n.core)&&(n.hideClickPoint(),XO(tL,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=qE(),t.path&&(qO(QO,this,new Va({type:"polygon",geometry:new Jo(t.path),name:this.featureName})),this.style=JO.base,XO(QO,this).setStyle(this.style),this.layer=new IE({features:[XO(QO,this)],zIndex:999}),this.initPath=t.path),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return XO(QO,this)}},{key:"startDraw",value:function(){var t;if(XO(QO,this))return!1;var e=this;return null===(t=XO(tL,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},JO.draw),!0}},{key:"hideLength",value:function(){this.isShowLength=!1,this.textList.length>0&&(this.textList.forEach(function(t){return t.destroy()}),this.textList=[]),XO(QO,this)&&XO(QO,this).getGeometry().un("change",this.tempShowLenFnCB)}},{key:"showLength",value:function(){var t;this.isShowLength=!0,XO(QO,this)&&this.showLengthFn(null===(t=XO(QO,this))||void 0===t?void 0:t.getGeometry()),XO(QO,this)&&XO(QO,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=Bh(Qa([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 uC(DO(DO({},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,XO(QO,this)),XO(QO,this)?XO(QO,this).getGeometry().setCoordinates(t):(qO(QO,this,new Va({type:"polygon",geometry:new Jo(t),name:this.featureName})),this.style=JO.base,XO(QO,this).setStyle(this.style),this.layer=new IE({features:[XO(QO,this)],zIndex:999}),console.log("path",t,this.layer),XO(tL,this).addFeature(this.layer),this.isShowLength&&this.showLength()),e&&(this.openEdit(),this.changeErrorStatus(this.statusIsError()))}},{key:"setActive",value:function(t){"boolean"!==NO(t).toLocaleString()&&(t=!!t),this.active=t,t?XO(QO,this).setStyle(JO.select):XO(QO,this).setStyle(JO.base)}},{key:"isActive",value:function(){return!!this.active}},{key:"getPath",value:function(){var t;if(XO(QO,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){XO(tL,this)&&this.layer&&XO(tL,this).removeFeature(this.layer),t?(this.layer&&t.addFeature(this.layer),qO(tL,this,t),qO(eL,this,new VE(this,XO(tL,this).map))):qO(tL,this,void 0)}},{key:"map",get:function(){return XO(tL,this)}},{key:"eventList",get:function(){return XO(eL,this).eventList}},{key:"on",value:function(t,e){return XO(eL,this).featureOn(t,e,LE)}},{key:"off",value:function(t,e){return XO(eL,this).off(t,e,LE)}},{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]]),XO(tL,this).editGeom(this,JO.edit,YO,this.clickPointCB),this.initPath.shift();var e=this;this.initPath.forEach(function(n){var r=new vS({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&&XO(tL,this).editGeom(this,JO.edit,YO,this.clickPointCB)}},{key:"closeEdit",value:function(){return!!XO(tL,this).getEditGeom(this)&&(this.hideClickPoint(),XO(tL,this).closeEditGeom(this))}},{key:"coreStatusIsError",value:function(){var t=this,e=this.core.getPath();if(Lh(Ja([e])).features.length>0)return this.isError&&this.isError("kinks"),!0;if(!this.core)return!1;var n,r=jO(this.getPath()),i=!1,o=Ja([e]);return this.coreList&&r.push.apply(r,jO(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=Ja([e]);return(Id(o,n)||Id(n,o))&&(i=!0),e}))),Dd(Ja(r),o)||i?(this.isError&&this.isError("outBounds"),this.outOfBoundsCB&&this.outOfBoundsCB(),!0):(this.isError(!1),!1)}},{key:"statusIsError",value:function(){return Lh(Ja(this.getPath())).features.length>0?(this.isError&&this.isError("kinks"),!0):(this.isError(!1),!1)}},{key:"changeErrorStatus",value:function(t){var e=XO(QO,this);t?e.setStyle(JO.error):e.setStyle(JO.edit)}},{key:"changeCoreErrorStatus",value:function(t){var e=this.core.feature;Array.isArray(e)&&(e=e[0]),t?e.setStyle($O.error):e.setStyle($O.edit)}},{key:"deletePolygon",value:function(){this.closeEdit(),this.map.removeFeature(this.layer),qO(QO,this,void 0)}},{key:"getArea",value:function(){var t,e;return WE(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+WE(e)},0)}},{key:"getRegion",value:function(){return WE(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,$O.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(),XO(tL,this).editGeom(this.core,$O.edit,YO,this.clickCorePointCB)}},{key:"cancelCoreEdit",value:function(){if(!this.tempCorePath)return!1;this.core&&(XO(tL,this).getEditGeom(this.core)&&(this.hideClickPoint(),XO(tL,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&&(XO(tL,this).getEditGeom(this.core)&&(this.hideClickPoint(),XO(tL,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(jO(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*Bh(Qa(this.getPath()[0]),{units:"kilometers"})}}],e&&BO(t.prototype,e),n&&BO(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function rL(t){return rL="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},rL(t)}function iL(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 oL(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)?oL(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 oL(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 sL(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,uL(r.key),r)}}function aL(t,e,n){return(e=uL(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uL(t){var e=function(t,e){if("object"!=rL(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=rL(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==rL(e)?e:e+""}function lL(t,e,n){cL(t,e),e.set(t,n)}function cL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hL(t,e){return t.get(pL(t,e))}function fL(t,e,n){return t.set(pL(t,e),n),n}function pL(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 dL=new tm({image:new X_({fill:new W_({color:"#18a058"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),zIndex:9}),gL=new X_({fill:new W_({color:"#e59810"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),yL=new tm({image:gL,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new Ew(e)}}),vL=new tm({zIndex:5,image:gL,geometry:function(t){var e=t.getGeometry().getCoordinates();return new Ew(e)}}),_L={select:[new tm({fill:new W_({color:"#fff42799"}),stroke:new H_({color:"#fff427",width:2})})],base:[new tm({fill:new W_({color:"#ff7f1d99"}),stroke:new H_({color:"#e59810ff",width:2})})],draw:[dL,new tm({fill:new W_({color:"#ff74ae99"}),stroke:new H_({color:"#ffffff",width:1,lineDash:[10,10]})}),vL],edit:[new tm({fill:new W_({color:"#ff74ae99"}),stroke:new H_({color:"#ffffff",width:1})}),yL],error:[new tm({fill:new W_({color:"#ff492480"}),stroke:new H_({color:"#e59810ff",width:1})}),yL]},mL=new WeakMap,xL=new WeakMap,wL=new WeakMap,bL=new WeakMap,EL=new WeakMap,SL=new WeakSet,CL=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),cL(n=this,r=SL),r.add(n),lL(this,mL,{}),lL(this,xL,void 0),lL(this,wL,void 0),aL(this,"editList",{}),lL(this,bL,void 0),lL(this,EL,void 0),aL(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=Za(t.coordinate),n=Qa(i.getPath()[0]);return Jl(e,u_(n,.001))?(i.selectPoint?(i.selectPoint.show(),i.selectPoint.setPosition(t.coordinate)):i.selectPoint=new oP({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(pL(SL,this,PL).call(this,e))},e=[{key:"init",value:function(t){if(console.log("isolation options: ",t),fL(wL,this,qE()),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(hL(mL,this)).map(function(t){return t.polygon})}},{key:"isolation",get:function(){return Object.values(hL(mL,this))}},{key:"selectId",get:function(){return hL(bL,this)}},{key:"statusIsError",value:function(){var t=hL(bL,this),e=hL(mL,this)[t].feature.getGeometry().getCoordinates();if(Lh(Ja(e)).features.length>0)return this.isError&&this.isError("kinks"),!0;var n=Object.values(hL(mL,this)).filter(function(e){return e.id!==t}).map(function(t){return t.feature.getGeometry().getCoordinates()}),r=Ja(e);return n.some(function(t){var e=Ja(t);return Dd(r,e)})?(this.isError&&this.isError("overlap"),!0):(this.isError&&this.isError(!1),!1)}},{key:"getPath",value:function(){return Object.values(hL(mL,this)).map(function(t){return t.layer.getSource().getFeatures()[0].getGeometry().getCoordinates()[0]})}},{key:"addPath",value:function(t,e){var n=Object.values(hL(mL,this)).length,r=hL(wL,this)+n,i=new Va({type:"polygon",geometry:new Jo(t),name:r});i.setStyle(_L.base);var o=new IE([i]);if(hL(mL,this)[r]={id:r,style:_L.base,feature:i,polygon:i,layer:o},hL(xL,this)&&hL(xL,this).addFeature(o),fL(bL,this,r),e)return!0;this.changeSelectIdCB&&this.changeSelectIdCB(hL(bL,this)),this.openEdit(r);var s=Object.values(hL(mL,this)).map(function(t){return t.feature.getGeometry().getCoordinates()}),a=Ja(t),u=s.some(function(t){var e=Ja(t);return Dd(a,e)});u&&this.changeErrorStatus(!0),this.changeErrorStatus(this.statusIsError()),console.log("test isolation selectId",hL(bL,this),hL(mL,this))}},{key:"changeErrorStatus",value:function(t){var e=hL(bL,this),n=hL(mL,this)[e];t?n.feature.setStyle(_L.error):n.feature.setStyle(_L.edit)}},{key:"isVisible",value:function(){return Object.values(hL(mL,this)).every(function(t){return t.layer.getVisible()})}},{key:"show",value:function(){Object.values(hL(mL,this)).forEach(function(t){return t.layer.setVisible(!0)})}},{key:"hide",value:function(){Object.values(hL(mL,this)).forEach(function(t){return t.layer.setVisible(!1)})}},{key:"setMap",value:function(t){var e=hL(xL,this);e&&Object.values(hL(mL,this)).forEach(function(t){return e.removeFeature(t.layer)}),t?(Object.values(hL(mL,this)).forEach(function(e){return t.addFeature(e.layer)}),fL(xL,this,t),fL(EL,this,new VE(this,hL(xL,this).map))):hL(xL,this)&&Object.values(hL(mL,this)).forEach(function(t){return e.removeFeature(t.layer)})}},{key:"map",get:function(){return hL(xL,this)}},{key:"eventList",get:function(){return hL(EL,this).eventList}},{key:"on",value:function(t,e){return hL(EL,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return hL(EL,this).off(t,e,JE)}},{key:"startDraw",value:function(){var t;if(!hL(xL,this))return console.error("Missing the necessary map object."),!1;var e=this,n=Object.values(hL(mL,this)).map(function(t){return t.feature.getGeometry().getCoordinates()});return null===(t=hL(xL,this))||void 0===t||t.startDraw("smartPolygon",function(t){e.addPath(t.path),t.geom.setMap()},function(t){var e=Za(t.coordinate);return n.every(function(t){var n=Ja(t);return!Jl(e,n)})},_L.draw),!0}},{key:"getIdByLonlat",value:function(t){var e=this;return Object.keys(hL(mL,this)).find(function(n){var r=hL(mL,e)[n].feature.getGeometry().getCoordinates();return Jl(Za(t),Ja(r))})}},{key:"openEdit",value:function(t){t=null!=t?t:this.selectId,console.log("test open edit",t);var e=new tm({image:new X_({fill:new W_({color:"#18a058"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),zIndex:9});this.editList[t]=hL(mL,this)[t],hL(xL,this).editGeom(hL(mL,this)[t],_L.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&&hL(mL,this)[t]){var n=Object.values(hL(mL,this)).filter(function(e){return e.name!==t}).map(function(t){return t.feature.getGeometry().getCoordinates()}),r=Ja(hL(mL,this)[t].feature.getGeometry().getCoordinates());return!n.some(function(t){var e=Ja(t);return Dd(r,e)})&&(delete this.editList[t],hL(xL,this).closeEditGeom(hL(mL,this)[t]))}var i=this;return Object.keys(this.editList).forEach(function(t){i.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=hL(bL,this),e=hL(mL,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=hL(mL,this)[hL(bL,this)])||void 0===e?void 0:e.feature),null===(n=hL(mL,this)[hL(bL,this)])||void 0===n||n.feature.setStyle(_L.base),hL(mL,this)[t].feature.setStyle(_L.select),fL(bL,this,t),this.changeSelectIdCB&&this.changeSelectIdCB(hL(bL,this)),0))}},{key:"deleteIsolation",value:function(t){t=t||this.selectId;var e=hL(mL,this)[t];hL(xL,this).removeFeature(e.layer),this.closeEdit(this.selectId,!0),delete hL(mL,this)[t]}},{key:"getArea",value:function(){return this.getPath().reduce(function(t,e){return t+WE(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=iL(t[i].map(parseFloat),2),s=o[0],a=o[1],u=iL(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=iL(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=iL(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!!hL(xL,this)&&(Object.values(hL(mL,this)).forEach(function(e){return hL(xL,t).removeFeature(e.layer)}),!0)}}],e&&sL(t.prototype,e),n&&sL(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function PL(t){return t}function IL(t){return IL="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},IL(t)}function ML(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,LL(r.key),r)}}function OL(t,e,n){return(e=LL(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LL(t){var e=function(t,e){if("object"!=IL(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=IL(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==IL(e)?e:e+""}function kL(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 RL(t,e){return t.get(AL(t,e))}function TL(t,e,n){return t.set(AL(t,e),n),n}function AL(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 NL=new WeakMap,FL=new WeakMap,DL=new WeakMap,jL=new WeakMap,GL=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),kL(this,NL,void 0),kL(this,FL,void 0),kL(this,DL,void 0),kL(this,jL,void 0),OL(this,"draggable",!1),OL(this,"modify",void 0),this.init(e)},e=[{key:"init",value:function(t){if(!t)return!1;TL(DL,this,qE()),TL(NL,this,new Va({geometry:new Ew(t.data.map(function(t){return t.lonlat})),name:RL(DL,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 tm({image:new Sx({anchor:t.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:n.src,offset:t.offset,rotation:t.rotation,scale:t.scale}),geometry:new Ew(i.map(function(t){return t.lonlat}))}))})}else{var r=new W_({color:"rgba(37, 165, 247,0.6)"}),i=new H_({color:"#ffeeff",width:2});e.push(new tm({image:new X_({fill:r,stroke:i,radius:5})}))}this.style=e,this.options=t,RL(NL,this).setStyle(e),this.layer=new IE({features:[RL(NL,this)],zIndex:(t.zIndex||0)+1e4}),t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable)}},{key:"feature",get:function(){return RL(NL,this)}},{key:"getClosestPoint",value:function(t){var e=RL(NL,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){RL(FL,this)&&RL(FL,this).removeFeature(this.layer),t?(t.addFeature(this.layer),TL(FL,this,t),TL(jL,this,new VE(this,RL(FL,this).map))):RL(FL,this)&&RL(FL,this).removeFeature(this.layer)}},{key:"map",get:function(){return RL(FL,this)}},{key:"eventList",get:function(){return RL(jL,this).eventList}},{key:"on",value:function(t,e){return console.log("t123"),RL(jL,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return RL(jL,this).off(t,e,JE)}},{key:"setDraggable",value:function(t){if(this.draggable=t,t)this.modify||(this.modify=new iw({hitDetection:this.layer,source:this.layer.getSource()})),RL(FL,this).map.addInteraction(this.modify);else{if(!this.modify)return;RL(FL,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"destroy",value:function(){return!!RL(FL,this)&&(RL(FL,this).removeFeature(this.layer),!0)}}],e&&ML(t.prototype,e),n&&ML(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),BL=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)}}(),zL=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 T("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 BL(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(ae,this.boundRefresh_),this.source=t,t&&t.addEventListener(ae,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(!(x(s)in r)){var a=this.geometryFunction(s);if(a){rt(a.getCoordinates(),t),Y(t,e,t);var u=this.source.getFeaturesInExtent(t).filter(function(t){var e=x(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?Ke(n,i.getCoordinates()):t.splice(r,1)}en(n,1/t.length);var o=dt(e),s=this.interpolationRatio,a=new No([n[0]*(1-s)+o[0]*s,n[1]*(1-s)+o[1]*s]);return this.createCustomCluster_?this.createCustomCluster_(a,t):new Va({geometry:a,features:t})},e}(Wx),VL=zL;function UL(t){return UL="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},UL(t)}function XL(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,WL(r.key),r)}}function qL(t,e,n){return(e=WL(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WL(t){var e=function(t,e){if("object"!=UL(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=UL(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==UL(e)?e:e+""}function YL(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 HL(t,e){return t.get(KL(t,e))}function ZL(t,e,n){return t.set(KL(t,e),n),n}function KL(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 JL=new WeakMap,$L=new WeakMap,QL=new WeakMap,tk=new WeakMap,ek=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),YL(this,JL,void 0),YL(this,$L,void 0),YL(this,QL,void 0),YL(this,tk,void 0),qL(this,"draggable",!1),qL(this,"modify",void 0),this.init(e)},e=[{key:"init",value:function(t){if(!t)return!1;ZL(QL,this,qE()),ZL(JL,this,t.data.map(function(t){return new Va(new No(t.lonlat))})),this.data=t.data;var e=new Wx({features:HL(JL,this)}),n=new VL({distance:parseInt("40",10),minDistance:parseInt("2",10),source:e}),r={};this.layer=new Nx({source:n,zIndex:1e3,style:function(t){var e=t.get("features").length,n=r[e];return n||(n=new tm({image:new X_({radius:10,stroke:new H_({color:"#fff"}),fill:new W_({color:"#3399CC"})}),text:new DS({text:e.toString(),fill:new W_({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 HL(JL,this)}},{key:"getClosestPoint",value:function(t){var e=HL(JL,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){HL($L,this)&&HL($L,this).removeFeature(this.layer),t?(t.addFeature(this.layer),ZL($L,this,t),ZL(tk,this,new VE(this,HL($L,this).map))):HL($L,this)&&HL($L,this).removeFeature(this.layer)}},{key:"map",get:function(){return HL($L,this)}},{key:"eventList",get:function(){return HL(tk,this).eventList}},{key:"on",value:function(t,e){return console.log("t123"),HL(tk,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return HL(tk,this).off(t,e,JE)}},{key:"setDraggable",value:function(t){if(this.draggable=t,t)this.modify||(this.modify=new iw({hitDetection:this.layer,source:this.layer.getSource()})),HL($L,this).map.addInteraction(this.modify);else{if(!this.modify)return;HL($L,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"destroy",value:function(){return!!HL($L,this)&&(HL($L,this).removeFeature(this.layer),!0)}}],e&&XL(t.prototype,e),n&&XL(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function nk(t){return nk="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},nk(t)}function rk(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 ik(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?rk(Object(n),!0).forEach(function(e){uk(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rk(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function ok(t){return function(t){if(Array.isArray(t))return sk(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 sk(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)?sk(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 sk(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 ak(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,lk(r.key),r)}}function uk(t,e,n){return(e=lk(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lk(t){var e=function(t,e){if("object"!=nk(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=nk(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nk(e)?e:e+""}function ck(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 hk(t,e){return t.get(pk(t,e))}function fk(t,e,n){return t.set(pk(t,e),n),n}function pk(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 dk=new tm({image:new X_({fill:new W_({color:"#18a058"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),zIndex:9}),gk=new X_({fill:new W_({color:"#e59810"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),yk=new tm({image:gk,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new Ew(e)}}),vk=new tm({zIndex:5,image:gk,geometry:function(t){var e=t.getGeometry().getCoordinates();return new Ew(e)}}),_k={base:[new tm({fill:new W_({color:"#9ffbc74d"}),stroke:new H_({color:"#16e96f",width:2})})],select:[new tm({fill:new W_({color:"#ff7f1db3"}),stroke:new H_({color:"#ff7f1d",width:2})})],draw:[dk,new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#e59810",width:2,lineDash:[10,10]})}),vk],edit:[new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#e59810",width:2})}),yk],error:[new tm({fill:new W_({color:"#ff492480"}),stroke:new H_({color:"#e59810",width:2})}),yk]},mk={base:[new tm({fill:new W_({color:"#ffbdb299"}),stroke:new H_({color:"#eb7272",width:2})})],base2:[new tm({fill:new W_({color:"#ff252599"}),stroke:new H_({color:"#ff7676",width:2})})],select:[new tm({fill:new W_({color:"#ff7f1db3"}),stroke:new H_({color:"#ff7f1d",width:1})})],draw:[dk,new tm({fill:new W_({color:"#ffbdb299"}),stroke:new H_({color:"#ffffff",width:1,lineDash:[6,10]})}),vk],edit:[new tm({fill:new W_({color:"#ffbdb299"}),stroke:new H_({color:"#eb7272",width:1})}),yk],edit2:[new tm({fill:new W_({color:"#ff252599"}),stroke:new H_({color:"#ff7676",width:1})}),yk],error:[new tm({fill:new W_({color:"#ff492480"}),stroke:new H_({color:"#e59810",width:2})}),yk]},xk=new WeakMap,wk=new WeakMap,bk=new WeakMap,Ek=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),ck(this,xk,void 0),ck(this,wk,void 0),ck(this,bk,void 0),uk(this,"textList",[]),uk(this,"isShowLength",!1),uk(this,"tempShowLenFnCB",function(t){r.showLengthFn(t.target)}),uk(this,"active",!1),uk(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=Za(t.coordinate),n=Qa(r.activeRiskArea.getPath());return Jl(e,u_(n,.001))?(r.selectPoint?(r.selectPoint.show(),r.selectPoint.setPosition(t.coordinate)):r.selectPoint=new oP({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)}),uk(this,"activeRiskAreaGeom",function(t){var e,n,i=ok(r.getPath());r.activeRiskArea=t.geom,r.activeRiskArea.setSourceStyle(mk.base),r.activeRiskArea.setExtData({riskLevel:1}),r.riskAreaList?(i.push.apply(i,ok(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],hk(wk,r).editGeom(t.geom,mk.edit,dk,r.clickPointCB),t.geom.setActiveStyle(mk.select),r.changeRiskAreaErrorStatus(r.riskAreaStatusIsError()),r.finishRiskDrawCB&&r.finishRiskDrawCB()}),uk(this,"defaultCondition",function(t){var e=Ja(r.getPath()),n=Jl(Za(t),e);return n||r.outOfBoundsCB&&r.outOfBoundsCB(),n}),uk(this,"condition",function(t){return console.log("condition",t),r.conditionCallback(t.coordinate)}),uk(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)}),uk(this,"isOpenSelect",!1),uk(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],hk(wk,r).getEditGeom(r.activeRiskArea)&&(r.hideClickPoint(),hk(wk,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=qE(),this.areaPath=t.path,fk(xk,this,new Va({type:"polygon",geometry:new Jo(t.path),name:this.featureName})),this.style=_k.base,hk(xk,this).setStyle(this.style),this.layer=new IE({features:[hk(xk,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 vS({path:o?t.path:t.path[0],map:e.map,borderWidth:1,strokeColor:r[i],fillColor:n[i],extData:ik({riskLevel:i},t),isGeomPolygon:o});return o&&(e.isAllRisk=!0),s.setActiveStyle(mk.select),s})}}},{key:"feature",get:function(){return hk(xk,this)}},{key:"hideLength",value:function(){this.isShowLength=!1,this.textList.length>0&&(this.textList.forEach(function(t){return t.destroy()}),this.textList=[]),hk(xk,this).getGeometry().un("change",this.tempShowLenFnCB)}},{key:"showLength",value:function(){this.isShowLength=!0,this.showLengthFn(hk(xk,this).getGeometry()),hk(xk,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=Bh(Qa([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 uC(ik(ik({},t),{},{textBaseline:"bottom",fill:"#ffffff",stroke:"#2b2b2b",borderWidth:4,fontSize:"16px",map:hk(wk,e)})),e.textList[n]=r)})}},{key:"getPath",value:function(){var t;if(hk(xk,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"!==nk(t).toLocaleString()&&(t=!!t),this.active=t,t?hk(xk,this).setStyle(_k.select):hk(xk,this).setStyle(_k.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){hk(wk,this)&&this.layer&&hk(wk,this).removeFeature(this.layer),t?(this.layer&&t.addFeature(this.layer),fk(wk,this,t),fk(bk,this,new VE(this,hk(wk,this).map))):fk(wk,this,void 0)}},{key:"map",get:function(){return hk(wk,this)}},{key:"eventList",get:function(){return hk(bk,this).eventList}},{key:"on",value:function(t,e){return hk(bk,this).featureOn(t,e,LE)}},{key:"off",value:function(t,e){return hk(bk,this).off(t,e,LE)}},{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=Ja([this.activeRiskArea.getPath()]);if(Lh(e).features.length>0)return this.isError&&this.isError("kinks"),!0;var n,r=ok(this.getPath()),i=r.some(function(t,n){return 0!==n&&Id(e,Ja([t]))}),o=!1;if(this.riskAreaList&&r.push.apply(r,ok(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=Ja([n]);return(Id(e,r)||Dd(r,e))&&(o=!0),n}))),o)return this.isError&&this.isError("overlap"),this.outOfBoundsCB&&this.outOfBoundsCB(),!0;var s=Ja(r);return Dd(s,e)||!Id(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(mk.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=mk.edit;break;case 2:r=mk.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,mk.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?mk.base:mk.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=mk.edit;break;case 2:i=mk.edit2}hk(wk,this).editGeom(this.activeRiskArea,i,dk,this.clickPointCB)}},{key:"cancelRiskEdit",value:function(){if(!this.tempRiskPath)return!1;this.activeRiskArea&&(hk(wk,this).getEditGeom(this.activeRiskArea)&&(this.hideClickPoint(),hk(wk,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&&(hk(wk,this).getEditGeom(this.activeRiskArea)&&(this.hideClickPoint(),hk(wk,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 vS({path:this.areaPath,isGeomPolygon:!0,map:this.map,borderWidth:1,strokeColor:"#eb7272",fillColor:"#ffbdb299",extData:{riskLevel:1}});t.setActiveStyle(mk.select),this.riskAreaList=[t]}}],e&&ak(t.prototype,e),n&&ak(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),Sk={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 Sk.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)}}}},Ck=Sk;function Pk(t){return Pk="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},Pk(t)}function Ik(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 Mk(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ik(Object(n),!0).forEach(function(e){Ok(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ik(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Ok(t,e,n){return(e=Tk(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lk(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 kk(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)?kk(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 kk(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 Rk(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,Tk(r.key),r)}}function Tk(t){var e=function(t,e){if("object"!=Pk(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Pk(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Pk(e)?e:e+""}var Ak=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 Ck.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,Ck.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 Ck.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 Ck.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 Ck.Logger.warn("[Mutex] 自定义规则阻止激活:".concat(t),c),!1}return e(),this.activeFeatures.set(a,{closeFn:n,timestamp:Date.now(),featureName:t,group:s}),Ck.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),Ck.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),Ck.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=Lk(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(),Ck.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(),Ck.Logger.info("[Mutex] 所有状态已清理"),this._emit("clear")}},{key:"addGroup",value:function(t,e){this.config.groups[t]=e,Ck.Logger.info("[Mutex] 添加互斥组:".concat(t))}},{key:"addFeature",value:function(t,e){this.config.featureMap[t]=e,Ck.Logger.info("[Mutex] 添加功能映射:".concat(t))}},{key:"addScenario",value:function(t,e){this.config.scenarios[t]=e,Ck.Logger.info("[Mutex] 添加场景:".concat(t))}},{key:"updateConfig",value:function(t){this.config=Mk(Mk({},this.config),t),Ck.Logger.info("[Mutex] 配置已更新")}}],e&&Rk(t.prototype,e),n&&Rk(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),Nk=Ak,Fk={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"},Dk={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 jk(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 Gk(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)?Gk(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 Gk(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 Bk(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 zk(t,e,n){return(e=Wk(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vk(t){return Vk="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},Vk(t)}function Uk(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xk(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,Wk(r.key),r)}}function qk(t,e,n){return e&&Xk(t.prototype,e),n&&Xk(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wk(t){var e=function(t,e){if("object"!=Vk(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Vk(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Vk(e)?e:e+""}var Yk=function(){return qk(function t(e){var n=this;Uk(this,t),this.XNOM=e,this.mapManager=new Hk(this.XNOM),this.layerManager=new Zk(this.XNOM,this.mapManager),this.markerManager=new Kk(this.XNOM,this.mapManager),this.controlManager=new Jk(this.XNOM,this.mapManager),this.textManager=new $k(this.XNOM,this.mapManager),this.infoWindowManager=new Qk(this.XNOM,this.mapManager),this.drawManager=new tR(this.XNOM,this.mapManager,this.layerManager),this.eventManager=new eR(this.XNOM,this.mapManager,this.markerManager),this.isolationManager=new nR(this.XNOM,this.mapManager),this.riskManager=new rR(this.XNOM,this.mapManager),this.smartEditManager=new iR(this.XNOM,this.mapManager),this.trackManager=new oR(this.XNOM),this.mutexManager=new Nk(Fk),this.mutexManager.on("activate",function(){return n._updateUIState()}),this.mutexManager.on("deactivate",function(){return n._updateUIState()}),this.mutexManager.on("mutexClose",function(){return n._updateUIState()}),this.mutexManager.on("scenarioChange",function(){return n._updateUIState()})},[{key:"initMap",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mapManager.initMap(t)}},{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.addMarker1()}},{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(),Ck.Logger.info("✅ 所有资源已销毁")}catch(t){Ck.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}}])}(),Hk=function(){return qk(function t(e){Uk(this,t),this.XNOM=e,this.map=null,this.map1=null,this.controlObj={}},[{key:"initMap",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bk(Object(n),!0).forEach(function(e){zk(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bk(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({target:Dk.MAP.TARGET,zoom:Dk.MAP.DEFAULT_ZOOM,zooms:Dk.MAP.ZOOMS,center:Dk.MAP.CENTER,controls:{attribution:!1,zoom:!1,rotate:!1},undoDrawCB:function(t){Ck.Logger.info("example undoDrawCB count:",t)}},t);return this.map=new this.XNOM.Map(e),this.map.on("loadend",function(){Ck.Logger.info("地图加载完成")}),Ck.Logger.info("主地图初始化成功",this.map),this.map}catch(t){return Ck.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={},Ck.Logger.info("地图资源已销毁")}catch(t){Ck.ErrorHandler.handle(t,"MapManager.destroy")}}}])}(),Zk=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,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!!Ck.ErrorHandler.validateMap(t,"LayerManager.addKrigingLayer")&&(this.krigingLayer=new this.XNOM.KrigingLayer({name:Dk.LAYER.KRIGING.NAME,zIndex:Dk.LAYER.KRIGING.Z_INDEX,alpha:Dk.LAYER.KRIGING.ALPHA,width:Dk.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 Ck.ErrorHandler.handle(t,"LayerManager.addKrigingLayer")}}},{key:"addPolygon",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"LayerManager.addPolygon"))return!1;var e={group:Dk.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 this.XNOM.Polygon(e),this.layers.polygon=this.polygon,this.polygon}catch(t){return Ck.ErrorHandler.handle(t,"LayerManager.addPolygon")}}},{key:"addComplexPolygon",value:function(){try{var t=this.mapManager.getMap();if(!Ck.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 this.XNOM.ComplexPolygon(e),this.layers.complexPolygon=this.complexPolygon,this.complexPolygon}catch(t){return Ck.ErrorHandler.handle(t,"LayerManager.addComplexPolygon")}}},{key:"addPolyline",value:function(){try{var t=this.mapManager.getMap();if(!Ck.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:Dk.GROUP.POLYLINE};this.polyline=new this.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:Dk.GROUP.POLYLINE},r=new this.XNOM.Polyline(n);return this.layers.polyline=this.polyline,this.layers.polyline1=r,this.polyline}catch(t){return Ck.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,Ck.Logger.info("图层资源已清理")}catch(t){Ck.ErrorHandler.handle(t,"LayerManager.destroy")}}}])}(),Kk=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.markers={},this.massMarkers={},this.clustersMarkers={},this.isPause=!1},[{key:"addMarker",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"MarkerManager.addMarker"))return!1;var e={position:[89.3,29],src:Dk.URLS.ICON_1,activeSrc:Dk.URLS.ICON_2,rotation:Math.atan2(1,0),autoRotation:!0,anchor:[.5,1],map:t},n=new this.XNOM.Marker(e);return n.setMap(t),this.markers.main=n,n}catch(t){return Ck.ErrorHandler.handle(t,"MarkerManager.addMarker")}}},{key:"addMarker1",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"MarkerManager.addMarker1"))return!1;var e={position:[120.566032634,33.355905081],src:Dk.URLS.ICON_1,anchor:[1,1],rotation:Math.atan2(1,0),map:t},n=new this.XNOM.Marker(e);return this.markers.marker1=n,n}catch(t){return Ck.ErrorHandler.handle(t,"MarkerManager.addMarker1")}}},{key:"addMassMarker",value:function(){var t=this;try{var e=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(e,"MarkerManager.addMassMarker"))return!1;var n=[];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(r){var i={position:r,anchor:[.5,.5],group:Dk.GROUP.MASS,map:e},o=new t.XNOM.Marker(i);o.setMap(e),n.push(o)}),this.massMarkers.mass1=n,n}catch(t){return Ck.ErrorHandler.handle(t,"MarkerManager.addMassMarker")}}},{key:"addMassMarker1",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"MarkerManager.addMassMarker1"))return!1;var e={data:this._getMassMarkerData(),styles:[{src:Dk.URLS.ICON_1},{src:Dk.URLS.ICON_2}],map:t},n=new this.XNOM.MassMarker(e);return this.massMarkers.mass2=n,n.on("click",function(t){var e=t.lnglat,r=n.getClosestPoint(e);Ck.Logger.info("海量标记点点击",r)}),n}catch(t){return Ck.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(!Ck.ErrorHandler.validateMap(t,"MarkerManager.addClustersMarker1"))return!1;var e={data:this._getMassMarkerData(),styles:[{src:Dk.URLS.ICON_1},{src:Dk.URLS.ICON_2}],map:t},n=new this.XNOM.ClustersMarker(e);return this.clustersMarkers.clusters1=n,n}catch(t){return Ck.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):(Ck.Logger.warn("标记点不存在"),!1)}catch(t){return Ck.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):(Ck.Logger.warn("标记点不存在"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"MarkerManager.toggleMarkerDrag")}}},{key:"openMoveMarker",value:function(){try{var t=this.markers.main;if(!t)return Ck.Logger.warn("标记点不存在"),!1;var e=[["117.917594333","36.9623245"],["117.917867167","36.961468167"],["117.91759","36.961894"]].map(function(t){return t.map(Number)});return t.moveAlong(e,10),this.isPause=!1,!0}catch(t){return Ck.ErrorHandler.handle(t,"MarkerManager.openMoveMarker")}}},{key:"pauseMoveMarker",value:function(){try{var t=this.markers.main;return t?(this.isPause?t.resumeMove():t.pauseMove(),this.isPause=!this.isPause,!0):(Ck.Logger.warn("标记点不存在"),!1)}catch(t){return Ck.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,Ck.Logger.info("标记点资源已清理")}catch(t){Ck.ErrorHandler.handle(t,"MarkerManager.destroy")}}}])}(),Jk=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.controls={}},[{key:"addControlOverView",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"ControlManager.addControlOverView"))return!1;var e=new this.XNOM.Control.OverView;return this.controls.overView=e,e.setMap(t),this.mapManager.getControlObj().overView=e,e}catch(t){return Ck.ErrorHandler.handle(t,"ControlManager.addControlOverView")}}},{key:"addControlScale",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"ControlManager.addControlScale"))return!1;var e=new this.XNOM.Control.Scale;return this.controls.scale=e,e.setMap(t),this.mapManager.getControlObj().scale=e,e}catch(t){return Ck.ErrorHandler.handle(t,"ControlManager.addControlScale")}}},{key:"addControlZoomTool",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"ControlManager.addControlZoomTool"))return!1;var e=new this.XNOM.Control.ZoomTool;return this.controls.zoomTool=e,e.setMap(t),this.mapManager.getControlObj().zoomTool=e,e}catch(t){return Ck.ErrorHandler.handle(t,"ControlManager.addControlZoomTool")}}},{key:"destroy",value:function(){this.controls={}}}])}(),$k=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.texts={}},[{key:"addText",value:function(){try{var t=this.mapManager.getMap();if(!Ck.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:Dk.GROUP.DEFAULT},n=new this.XNOM.Text(e);return this.texts.text1=n,[n]}catch(t){return Ck.ErrorHandler.handle(t,"TextManager.addText")}}},{key:"destroy",value:function(){this.texts={}}}])}(),Qk=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.infoWindow=null},[{key:"addInfoWindow",value:function(){try{var t=this.mapManager.getMap();if(!Ck.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 this.XNOM.InfoWindow(e),this.infoWindow.setMap(t),this.infoWindow}catch(t){return Ck.ErrorHandler.handle(t,"InfoWindowManager.addInfoWindow")}}},{key:"toggleInfoWindowVisible",value:function(){try{return this.infoWindow?(this.infoWindow.isVisible()?this.infoWindow.hide():this.infoWindow.show(),!0):(Ck.Logger.warn("弹窗未初始化"),!1)}catch(t){return Ck.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}}])}(),tR=function(){return qk(function t(e,n,r){Uk(this,t),this.XNOM=e,this.mapManager=n,this.layerManager=r,this.isDraw=!1,this.drawList=[],this.editPoly=!1,this.editPolyline=!1,this.isMeasureOpen=!1},[{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!!Ck.ErrorHandler.validateMap(n,"DrawManager.toggleDraw")&&(this.isDraw?(n.stopDraw(),this.isDraw=!1):(n.startDraw(e),n.on("drawend",function(e){Ck.Logger.info("drawend",e),e.geom.openEdit(),t.drawList.push(e.geom),t.isDraw=!1}),this.isDraw=!0),!0)}catch(t){return Ck.ErrorHandler.handle(t,"DrawManager.toggleDraw")}}},{key:"undoDraw",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"DrawManager.undoDraw")&&(t.undoDraw(),!0)}catch(t){return Ck.ErrorHandler.handle(t,"DrawManager.undoDraw")}}},{key:"endDraw",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"DrawManager.endDraw")&&(t.endDraw(),!0)}catch(t){return Ck.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):(Ck.Logger.warn("多边形不存在"),!1)}catch(t){return Ck.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):(Ck.Logger.warn("多边形不存在"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"DrawManager.togglePolygonVisible")}}},{key:"length",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"DrawManager.length")&&(t.openMeasure("length"),!0)}catch(t){return Ck.ErrorHandler.handle(t,"DrawManager.length")}}},{key:"destroy",value:function(){this.drawList=[],this.isDraw=!1,this.editPoly=!1,this.editPolyline=!1}}])}(),eR=function(){return qk(function t(e,n,r){Uk(this,t),this.XNOM=e,this.mapManager=n,this.markerManager=r,this.eventListeners=[]},[{key:"mapOnEvent",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"EventManager.mapOnEvent"))return!1;var e=t.on(["click"],function(t){Ck.Logger.info("map click",t)});return this.eventListeners.push({type:"mapClick",listener:e,target:t}),Ck.Logger.info("地图点击事件已绑定"),!0}catch(t){return Ck.ErrorHandler.handle(t,"EventManager.mapOnEvent")}}},{key:"mapOffEvent",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"EventManager.mapOffEvent")&&(t.off("click"),Ck.Logger.info("地图点击事件已解绑"),!0)}catch(t){return Ck.ErrorHandler.handle(t,"EventManager.mapOffEvent")}}},{key:"markerOnEvent",value:function(){try{var t=this.markerManager.getMarker();if(!t)return Ck.Logger.warn("标记点不存在"),!1;var e=t.on("pointermove",function(t){Ck.Logger.info("marker move",t)});return this.eventListeners.push({type:"markerMove",listener:e,target:t}),Ck.Logger.info("标记点经过事件已绑定"),!0}catch(t){return Ck.ErrorHandler.handle(t,"EventManager.markerOnEvent")}}},{key:"markerOffEvent",value:function(){try{var t=this.markerManager.getMarker();return t?(t.off("pointermove"),Ck.Logger.info("标记点经过事件已解绑"),!0):(Ck.Logger.warn("标记点不存在"),!1)}catch(t){return Ck.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=[],Ck.Logger.info("事件监听器已清理")}catch(t){Ck.ErrorHandler.handle(t,"EventManager.cleanup")}}}])}(),nR=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.isolation=null,this.selectIsolationId=null},[{key:"newIsolation",value:function(){var t=this;try{var e=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(e,"IsolationManager.newIsolation")&&(this.isolation=new this.XNOM.Isolation({map:e,isError:function(t){return Ck.Logger.info("is error",t)},changeSelectPoint:function(t){return Ck.Logger.info("change select point",t)},changeSelectIdCB:function(e){Ck.Logger.info("change select id",e),t.selectIsolationId=e}}),this.isolation)}catch(t){return Ck.ErrorHandler.handle(t,"IsolationManager.newIsolation")}}},{key:"startDrawIsolation",value:function(){try{return this.isolation?(this.isolation.startDraw(),!0):(Ck.Logger.warn("隔离区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"IsolationManager.startDrawIsolation")}}},{key:"openEditIsolation",value:function(){try{return this.isolation?(this.isolation.openEdit(),!0):(Ck.Logger.warn("隔离区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"IsolationManager.openEditIsolation")}}},{key:"closeEditIsolation",value:function(){try{return this.isolation?(this.isolation.closeEdit(),!0):(Ck.Logger.warn("隔离区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"IsolationManager.closeEditIsolation")}}},{key:"selectIsolation",value:function(){try{return!!this.isolation||(Ck.Logger.warn("隔离区未初始化"),!1)}catch(t){return Ck.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}}])}(),rR=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.riskArea=null},[{key:"newRiskArea",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"RiskManager.newRiskArea")&&(this.riskArea=new this.XNOM.RiskArea({map:t,callbacks:{changeSelectPoint:function(t){return Ck.Logger.info("change select point",t)},isError:function(t){return Ck.Logger.info("isError type:",t)},outOfBoundsCB:function(){return Ck.Logger.info("test outOfBoundsCB")},finishRiskDrawCB:function(){return Ck.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 Ck.ErrorHandler.handle(t,"RiskManager.newRiskArea")}}},{key:"startDrawRisk",value:function(){try{return this.riskArea?(this.riskArea.drawRisk(),!0):(Ck.Logger.warn("风险区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"RiskManager.startDrawRisk")}}},{key:"finishEditRisk",value:function(){try{return this.riskArea?(this.riskArea.finishEditRisk(),!0):(Ck.Logger.warn("风险区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"RiskManager.finishEditRisk")}}},{key:"openSelectRisk",value:function(){try{return this.riskArea?(this.riskArea.openSelect(),!0):(Ck.Logger.warn("风险区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"RiskManager.openSelectRisk")}}},{key:"openEditRisk",value:function(){try{return this.riskArea?(this.riskArea.openRiskEdit(),!0):(Ck.Logger.warn("风险区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"RiskManager.openEditRisk")}}},{key:"destroy",value:function(){this.riskArea&&"function"==typeof this.riskArea.destroy&&this.riskArea.destroy(),this.riskArea=null}}])}(),iR=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.smartPolygon=null},[{key:"newSmartPolygon",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"SmartEditManager.newSmartPolygon")&&(this.smartPolygon=new this.XNOM.SmartPolygon({map:t,isError:function(t){return Ck.Logger.info("isError type:",t)},changeSelectPoint:function(t){return Ck.Logger.info("change select point",t)},finishCoreDrawCB:function(){return Ck.Logger.info("ttt finishCoreDrawCB")},outOfBoundsCB:function(){return Ck.Logger.info("test outOfBoundsCB")},finishDrawCB:function(){return Ck.Logger.info("test finishDrawCB")}}),this.smartPolygon)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.newSmartPolygon")}}},{key:"startDrawSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.startDraw(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.startDrawSmartPolygon")}}},{key:"useCorer",value:function(){try{return this.smartPolygon?(this.smartPolygon.useCorer(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.useCorer")}}},{key:"openEditCore",value:function(){try{return this.smartPolygon?(this.smartPolygon.openCoreEdit(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.openEditCore")}}},{key:"closeEditCore",value:function(){try{return this.smartPolygon?(this.smartPolygon.finishRemoveCore(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.closeEditCore")}}},{key:"openEditSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.openEdit(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.openEditSmartPolygon")}}},{key:"closeEditSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.closeEdit(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.closeEditSmartPolygon")}}},{key:"destroy",value:function(){this.smartPolygon&&"function"==typeof this.smartPolygon.destroy&&this.smartPolygon.destroy(),this.smartPolygon=null}}])}(),oR=function(){return qk(function t(e){Uk(this,t),this.XNOM=e,this.trackReplay=null,this.resultArr=this._parseTrackData()},[{key:"_parseTrackData",value:function(){try{return"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=jk(t.split(","),6);return{time:e[0],lon:e[1],lat:e[2],deep:e[3],status:e[4],group:e[5]}})}catch(t){return Ck.ErrorHandler.handle(t,"TrackManager._parseTrackData"),[]}}},{key:"showPopup",value:function(){try{this.trackReplay=new this.XNOM.TrackReplay({machine:1,data:this.resultArr,cameraList:[],clickCameraCallback:function(){},playFinishCallback:function(){},findLastPointCB:function(t){return Ck.Logger.info("test point info:",t)},layers:[Dk.URLS.TILE_1,Dk.URLS.TILE_2]});var t=document.querySelector("#track-box");return t&&t.appendChild(this.trackReplay.dom),this.trackReplay}catch(t){return Ck.ErrorHandler.handle(t,"TrackManager.showPopup")}}},{key:"destroy",value:function(){this.trackReplay&&"function"==typeof this.trackReplay.destroy&&this.trackReplay.destroy(),this.trackReplay=null}}])}();function sR(t){return sR="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},sR(t)}function aR(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 uR(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?aR(Object(n),!0).forEach(function(e){lR(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):aR(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function lR(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=sR(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=sR(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==sR(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var cR=uR(uR({turf:u,Map:FC,Marker:oP,Text:uC,Polygon:vS,Polyline:AS,InfoWindow:xP},ZI),{},{Control:eO,TrackReplay:wO,ComplexPolygon:AO,SmartPolygon:nL,Isolation:CL,MassMarker:GL,ClustersMarker:ek,RiskArea:Ek,MapService:Yk}),hR=new Yk(cR);cR.mapServiceInstance=hR,"undefined"!=typeof window&&(window.XNOM=cR),console.log("✅ XNOM 加载完成",cR);var fR=cR}(),r=r.default}()});
81
+ function bI(t){return Math.max.apply(null,t)}function EI(t){return Math.min.apply(null,t)}function SI(t,e){for(var n=[],r=0;r<e;r++)n.push(t);return n}function CI(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 PI(t,e){for(var n=0,r=SI(0,e*e);n<e;n++)r[n*e+n]=t;return r}function II(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 MI(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 OI(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 LI(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 kI(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 RI(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 TI(t,e,n,r,i){return e+(r-e)/n*(1-Math.exp(-1/i*Math.pow(t/n,2)))}function AI(t,e,n,r,i){return e+(r-e)/n*(1-Math.exp(-1/i*(t/n)))}function NI(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 FI(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 OI(i,n.M,1,n.n,1)[0]}var DI={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:AI,K:[],M:[]};switch(r){case"gaussian":c.model=TI;break;case"exponential":default:c.model=AI;break;case"spherical":c.model=NI}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=SI(0,p),y=SI(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=SI(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=II(v,h,2),w=OI(x,v,2,h,2),b=(w=MI(w,PI(1/o,2),2,2)).slice(0);LI(w,2)?kI(w,2):(RI(b,2),w=b);var E=OI(OI(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 S=Array(h*h);for(s=0;s<h;s++){for(a=0;a<s;a++)S[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),S[a*h+s]=S[s*h+a];S[s*h+s]=c.model(0,c.nugget,c.range,c.sill,c.A)}var C=MI(S,PI(i,h),h,h),P=C.slice(0);LI(C,h)?kI(C,h):(RI(P,h),C=P);var I=C.slice(0),M=OI(C,t,h,h,1);return c.K=I,c.M=M,c},predict:FI,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=OI(OI(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,CI(t[r],a,u)&&(v[i][o]=FI(a,u,e))}return{xlim:l,ylim:c,width:n,data:v,zlim:[EI(e.t),bI(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:bI,min:EI,pip:CI,rep:SI,matrixDiag:PI,matrixTranspose:II,matrixAdd:MI,matrixMultiply:OI,matrixChol:LI,matrixChol2inv:kI,matrixSolve:RI,variogramGaussian:TI,variogramExponential:AI,variogramSpherical:NI},jI=DI;function GI(t){return GI="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},GI(t)}function BI(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,VI(r.key),r)}}function zI(t,e,n){return(e=VI(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VI(t){var e=function(t,e){if("object"!=GI(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=GI(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==GI(e)?e:e+""}var UI=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),zI(this,"source",void 0),zI(this,"getDataForLonlat",function(t){var e=!1,r=Za(t);if(Array.isArray(n.path[0][0]))e=n.path.some(function(t){var e=Ja([t]);return Jl(r,e)});else{var i=Ja([n.path]);Jl(r,i)&&(e=!0)}if(!e)return[];var o=n.variogramList;return null==o?void 0:o.map(function(e){return jI.predict(t[0],t[1],e)})}),this.init(e)},e=[{key:"init",value:function(t){if(!t)return new WP({source:new wI});if(!Array.isArray(t.data)||t.data.length.length<3)return console.info("数据量太小。"),new WP({source:new wI});if(this.calculateVariogram(t.data),t.colors&&(!Array.isArray(t.colors)||t.colors.length<2))return console.info("颜色组不正确。"),new WP({source:new wI});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 WP({source:new wI});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=jI.train(n,r,i,"exponential",0,100);this.kriging=jI,this.mode=o;var s=jI.grid(e.path,o,e.width),a=new wI({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",jI.plot(a,s,[t[0],t[2]],[t[1],t[3]],e.colors),a},projection:ME});this.source=a;var u=new WP({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=jI.train(r,o,s,"exponential",0,100),u=jI.train(n,o,s,"exponential",0,100),l=jI.train(e,o,s,"exponential",0,100),c=jI.train(i,o,s,"exponential",0,100);this.variogramList=[a,u,l,c]}}],e&&BI(t.prototype,e),n&&BI(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),XI=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)}}(),qI=function(t){function e(e){var n=this,r=void 0!==e.crossOrigin?e.crossOrigin:null,i=void 0!==e.imageLoadFunction?e.imageLoadFunction:nI,o=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(o=e.interpolate),(n=t.call(this,{attributions:e.attributions,interpolate:o,projection:xi(e.projection)})||this).url_=e.url,n.imageExtent_=e.imageExtent,n.image_=new _x(n.imageExtent_,void 0,1,n.url_,r,i),n.imageSize_=e.imageSize?e.imageSize:null,n.image_.addEventListener(ae,n.handleImageChange.bind(n)),n}return XI(e,t),e.prototype.getImageExtent=function(){return this.imageExtent_},e.prototype.getImageInternal=function(t,e,n,r){return Et(t,this.image_.getExtent())?this.image_:null},e.prototype.getUrl=function(){return this.url_},e.prototype.handleImageChange=function(e){if(this.image_.getState()==T_){var n=this.image_.getExtent(),r=this.image_.getImage(),i=void 0,o=void 0;this.imageSize_?(i=this.imageSize_[0],o=this.imageSize_[1]):(i=r.width,o=r.height);var s=bt(n),a=_t(n),u=s/i,l=a/o,c=i,h=o;if(u>l?c=Math.round(s/l):h=Math.round(a/u),c!==i||h!==o){var f=mn(c,h);this.getInterpolate()||te(f,$w);var p=f.canvas;f.drawImage(r,0,0,i,o,0,0,p.width,p.height),this.image_.setImage(p)}}t.prototype.handleImageChange.call(this,e)},e}(rI),WI=qI,YI={addRemoteImageLayer:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.url,r=e.extent,i=e.zIndex,o=void 0===i?999:i,s=e.name,a=void 0===s?"yaogan":s,u=e.crossOrigin,l=new WI({url:n,imageExtent:r,crossOrigin:void 0===u?void 0:u});l.set("name",a);var c=new WP({source:l,zIndex:o});return t.addLayer(c),c},addRemoteWMSLayer:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.url,r=e.layers,i=e.cql,o=e.token,s=e.zIndex,a=void 0===s?105:s,u=e.name,l=void 0===u?"vectorLayerAbnormal":u,c=e.crossOrigin,h=new lI({url:n,crossOrigin:void 0===c?void 0:c,ratio:1,params:{LAYERS:r,SRS:"EPSG:4326",FORMAT:"image/png",TRANSPARENT:"true",token:o,CQL_FILTER:i}}),f=new WP({source:h,zIndex:a});return f.set("name",l),t.addLayer(f),f},addRemoteVectorLayer:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.strokeColor,i=void 0===r?"red":r,o=n.fillColor,s=void 0===o?"rgba(216,255,0,0)":o,a=n.zIndex,u=void 0===a?99:a,l=n.name,c=void 0===l?"vectorLayerAbnormalZT":l,h=new Va({geometry:new Jo([e])});h.setStyle(new tm({stroke:new H_({width:1,color:i}),fill:new W_({color:s})}));var f=new Wx({features:[h]}),p=new Nx({source:f,zIndex:u});return p.set("name",c),t.addLayer(p),p},removeLayerByName:function(t,e){t.getLayers().forEach(function(n){n.get("name")===e&&t.removeLayer(n)})},clearLayerList:function(t,e){e.forEach(function(e){return t.removeLayer(e)}),e.length=0}},HI={createRadarLayer:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).zIndex||105,n=new WP({zIndex:e});return t.addLayer(n),n},updateRadarImage:function(t,e){var n=e.url,r=e.extent,i=new WI({url:n,imageExtent:r,crossOrigin:"anonymous"});t.setSource(i)},clearLayerList:function(t,e){e.forEach(function(e){t.removeLayer(e)}),e.length=0}},ZI={Tile:DP,Vector:IE,KrigingLayer:UI,WmsImage:gI,RemoteSense:YI,Weather:HI},KI=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)}}(),JI=0,$I=1,QI=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_=JI,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 "+pn;var s=n.element;return s.className=i+" "+pn+" "+dn,s.appendChild(o),s.addEventListener(gr,n.handleDraggerStart_.bind(n),!1),s.addEventListener(dr,n.handleDraggerDrag_.bind(n),!1),s.addEventListener(yr,n.handleDraggerEnd_.bind(n),!1),s.addEventListener(ce,n.handleContainerClick_.bind(n),!1),o.addEventListener(ce,Jt,!1),n}return KI(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_=$I,this.widthLimit_=e-s):(this.direction_=JI,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:Yi})},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(_e(i,dr,n,this),_e(i,yr,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(xe),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),n=this.element.firstElementChild;this.direction_==$I?n.style.left=this.widthLimit_*e+"px":n.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return Mt(this.direction_===$I?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 Mt(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}(gs),tM=QI;function eM(t){return eM="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},eM(t)}function nM(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 rM(t,e,n){return(e=oM(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iM(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,oM(r.key),r)}}function oM(t){var e=function(t,e){if("object"!=eM(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=eM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==eM(e)?e:e+""}function sM(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function aM(t,e){return t.get(uM(t,e))}function uM(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 lM=new WeakMap,cM=new WeakSet,hM=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),sM(n=this,r=cM),r.add(n),function(t,e,n){sM(t,e),e.set(t,n)}(this,lM,void 0),this.init(uM(cM,this,fM).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 Ss({className:t})}},{key:"initZoomBar",value:function(t){this.zoomBar=new tM({className:t})}},{key:"setMap",value:function(t){var e,n,r;aM(lM,this)&&(aM(lM,this).map.removeControl(this.zoomBtn),aM(lM,this).map.removeControl(this.zoomBar)),t&&(n=this,r=t,(e=lM).set(uM(e,n),r),this.zoomBtn&&t.map.addControl(this.zoomBtn),this.zoomBar&&t.map.addControl(this.zoomBar))}},{key:"map",get:function(){return aM(lM,this)}}],e&&iM(t.prototype,e),n&&iM(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function fM(t){var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nM(Object(n),!0).forEach(function(e){rM(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nM(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({zoomBtn:!0,zoomBar:!1},t);return e}var pM=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)}}(),dM=.75,gM=.1,yM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return pM(e,t),e.prototype.createRenderer=function(){return new Hn(this)},e}(fs),vM=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(ce,n.handleClick_.bind(n),!1),n.ovmapDiv_=document.createElement("div"),n.ovmapDiv_.className="ol-overviewmap-map",n.view_=r.view,n.ovmap_=new yM({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 nE({position:[0,0],positioning:"center-center",element:h}),n.ovmap_.addOverlay(n.boxOverlay_);var f=i+" "+pn+" "+dn+(n.collapsed_&&n.collapsible_?" "+gn:"")+(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 pM(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(_e(e,Qt,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===Mr){var e=t.oldValue;e&&this.unbindView_(e);var n=this.getMap().getView();this.bindView_(n)}else this.ovmap_.isRendered()||t.key!==Ir&&t.key!==Pr||this.ovmap_.updateSize()},e.prototype.bindView_=function(t){if(!this.view_){var e=new os({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(qr.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()},e.prototype.unbindView_=function(t){t.removeChangeListener(qr.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_||!ot(r,this.viewExtent_)){this.viewExtent_=r;var i=e.getSize(),o=e.getView().calculateExtentInternal(i),s=e.getPixelFromCoordinateInternal(xt(r)),a=e.getPixelFromCoordinateInternal(pt(r)),u=Math.abs(s[0]-a[0]),l=Math.abs(s[1]-a[1]),c=i[0],h=i[1];u<c*gM||l<h*gM||u>c*dM||l>h*dM?this.resetExtent_():J(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;Ct(r,1/(Math.pow(2,o/2)*gM)),i.fitInternal($o(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_=me(this.ovmap_,xr,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(gn),this.collapsed_?En(this.collapseLabel_,this.label_):En(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}(gs),_M=vM;function mM(t){return mM="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},mM(t)}function xM(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 wM(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xM(Object(n),!0).forEach(function(e){bM(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xM(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function bM(t,e,n){return(e=SM(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function EM(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,SM(r.key),r)}}function SM(t){var e=function(t,e){if("object"!=mM(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=mM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==mM(e)?e:e+""}function CM(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function PM(t,e){return t.get(IM(t,e))}function IM(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 MM=new WeakMap,OM=new WeakSet,LM=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),CM(n=this,r=OM),r.add(n),function(t,e,n){CM(t,e),e.set(t,n)}(this,MM,void 0),this.init(IM(OM,this,kM).call(this,e))},e=[{key:"init",value:function(t){this.opts=t}},{key:"setMap",value:function(t){var e,n,r;PM(MM,this)&&PM(MM,this).map.removeControl(this.overView),this.overView&&(this.overView.setMap(null),this.overView=void 0),t&&(n=this,r=t,(e=MM).set(IM(e,n),r),this.overView=new _M(wM(wM({},this.opts),{},{layers:t.layers.map(function(t){return new gb({source:t.getSource()})})})),t.map.addControl(this.overView))}},{key:"map",get:function(){return PM(MM,this)}},{key:"isCollapsed",value:function(){return this.overView.getCollapsed()}},{key:"setCollapsed",value:function(t){this.overView.setCollapsed(t)}}],e&&EM(t.prototype,e),n&&EM(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function kM(t){return wM({},t)}var RM=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)}}(),TM="units",AM="degrees",NM="imperial",FM="nautical",DM="metric",jM="us",GM=[1,2,5],BM=25.4/.28,zM=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+" "+pn,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(TM,n.handleUnitsChanged_),n.setUnits(r.units||DM),n.scaleBar_=r.bar||!1,n.scaleBarSteps_=r.steps||4,n.scaleBarText_=r.text||!1,n.dpi_=r.dpi||void 0,n}return RM(e,t),e.prototype.getUnits=function(){return this.get(TM)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(TM,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==AM?Vr.DEGREES:Vr.METERS,o=wi(n,t.resolution,e,i),s=this.minWidth_*(this.dpi_||BM)/BM,a=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||BM)/BM:void 0,u=s*o,l="";if(r==AM){var c=zr[Vr.DEGREES];(u*=c)<c/60?(l="″",o*=3600):u<c?(l="′",o*=60):l="°"}else r==NM?u<.9144?(l="in",o/=.0254):u<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):r==FM?(o/=1852,l="NM"):r==DM?u<.001?(l="μm",o*=1e6):u<1?(l="mm",o*=1e3):u<1e3?l="m":(l="km",o/=1e3):r==jM?u<.9144?(l="in",o*=39.37):u<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):T(!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=GM[(_%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=wi(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Vr.METERS),e=this.dpi_||BM;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}(gs),VM=zM;function UM(t){return UM="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},UM(t)}function XM(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 qM(t,e,n){return(e=YM(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WM(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,YM(r.key),r)}}function YM(t){var e=function(t,e){if("object"!=UM(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=UM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==UM(e)?e:e+""}function HM(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ZM(t,e){return t.get(KM(t,e))}function KM(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 JM=new WeakMap,$M=new WeakSet,QM=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),HM(n=this,r=$M),r.add(n),function(t,e,n){HM(t,e),e.set(t,n)}(this,JM,void 0),this.init(KM($M,this,tO).call(this,e))},e=[{key:"init",value:function(t){this.scale=new VM(t)}},{key:"setMap",value:function(t){var e,n,r;ZM(JM,this)&&ZM(JM,this).map.removeControl(this.scale),t&&(n=this,r=t,(e=JM).set(KM(e,n),r),t.map.addControl(this.scale))}},{key:"map",get:function(){return ZM(JM,this)}}],e&&WM(t.prototype,e),n&&WM(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function tO(t){var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?XM(Object(n),!0).forEach(function(e){qM(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t);return e}var eO={ZoomTool:hM,OverView:LM,Scale:QM},nO=n(3510),rO={};rO.styleTagTransform=dE(),rO.setAttributes=cE(),rO.insert=uE().bind(null,"head"),rO.domAPI=sE(),rO.insertStyleElement=fE();iE()(nO.A,rO),nO.A&&nO.A.locals&&nO.A.locals;var iO=n.p+"assets/46ac1bfe350f7f38e22c.png",oO=n.p+"assets/50157e3bd0227aa82a75.png",sO=n.p+"assets/2a84d048717fc397253c.png",aO=n.p+"assets/17094eba52722bdefd71.png";function uO(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 lO(t){return lO="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},lO(t)}function cO(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,fO(r.key),r)}}function hO(t,e,n){return(e=fO(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fO(t){var e=function(t,e){if("object"!=lO(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=lO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==lO(e)?e:e+""}function pO(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dO(t,e,n){return t.set(yO(t,e),n),n}function gO(t,e){return t.get(yO(t,e))}function yO(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 vO={0:"#03C5FF",1:"#00FF80",2:"#00FF80",3:"#03C5FF",4:"#03C5FF"},_O={0:iO,1:oO},mO=new WeakMap,xO=new WeakSet,wO=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),pO(n=this,r=xO),r.add(n),function(t,e,n){pO(t,e),e.set(t,n)}(this,mO,!0),hO(this,"playBtnCallback",function(){gO(mO,i)?i.pauseMove():i.resumeMove()}),hO(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;yO(xO,i,bO).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}))}),hO(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;yO(xO,i,bO).call(i,o),i.dragDot(t)}),hO(this,"playFinish",function(){i.updatePlayRatio(1),i.pauseMove(),"function"===lO(i.options.playFinishCallback).toLocaleLowerCase()&&i.options.playFinishCallback()}),hO(this,"updatePlayRatio",function(t){var e,n=t*(null!==(e=i.baseFraction)&&void 0!==e?e:1)*100;yO(xO,i,bO).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=tc(Za(this.points[n]),Za(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 vw(t.route.flat());t.map.setFitForGeom(i,{avoid:[20,20,60,20]})}).observe(this.dom)}},{key:"pauseMove",value:function(){if(!gO(mO,this))return!1;dO(mO,this,!1),this.playBtn.className=(this.playBtn.className.replace(/playing/g,"")+" pause").replace(/\s+/," "),this.machine.pauseMove()}},{key:"resumeMove",value:function(){if(gO(mO,this))return!1;dO(mO,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 DP({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 FC(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=Bh(nu(this.route),{units:"kilometers"}),s=0;r.forEach(function(e){var n=Bh(Qa(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 oP({map:this.map,position:this.route[0][0],autoRotation:!0,src:_O[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=qE();this.trackPolylines=this.polylineOptsList.map(function(t){return t.map(function(t){return new AS({map:e.map,group:n,path:t.path,color:vO[t.status],borderWidth:0})})}),this.trackPoints=this.markerPos.map(function(t,n){return new oP({map:e.map,position:t,scale:.4375,anchor:[.5,1],src:aO,text:"".concat(n+1),fontSize:28})});var r=GS().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 oP({map:t.map,position:[e.lon,e.lat],src:sO,scale:.5});return n.on("click",function(){t.clickCamera(e.did)}),n})}},{key:"clickCamera",value:function(t){"function"===lO(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 xP(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?uO(Object(n),!0).forEach(function(e){hO(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):uO(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&&cO(t.prototype,e),n&&cO(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function bO(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 EO(t){return EO="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},EO(t)}function SO(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,PO(r.key),r)}}function CO(t,e,n){return(e=PO(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function PO(t){var e=function(t,e){if("object"!=EO(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=EO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==EO(e)?e:e+""}function IO(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 MO(t,e){return t.get(LO(t,e))}function OO(t,e,n){return t.set(LO(t,e),n),n}function LO(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 kO=new WeakMap,RO=new WeakMap,TO=new WeakMap,AO=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),IO(this,kO,void 0),CO(this,"featureName",void 0),IO(this,RO,void 0),IO(this,TO,void 0),CO(this,"corerGeom",function(t){var e=n.getPath()[0];Dd(Ja(e),Ja([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))}),CO(this,"condition",function(t){return console.log("condition",t),n.conditionCallback(t.coordinate)}),CO(this,"defaultCondition",function(t){var e=Ja(n.getPath()[0]);return Jl(Za(t),e)}),CO(this,"finishRemoveCore",function(){if(!n.core)return!1;var t=n.getPath()[0],e=n.core.getPath();if(Dd(Ja(t),Ja([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=qE(),n?(OO(kO,this,[]),t.path.forEach(function(t){MO(kO,e).push(new Va({type:"polygon",geometry:new Jo(t),name:e.featureName}))})):OO(kO,this,new Va({type:"polygon",geometry:new Jo(t.path),name:this.featureName})),this.style=new tm({stroke:new H_({width:t.borderWidth,color:t.strokeColor}),fill:new W_({color:t.fillColor})}),Array.isArray(MO(kO,this))?(MO(kO,this).forEach(function(t){t.setStyle(e.style)}),this.layer=new IE(MO(kO,this))):(MO(kO,this).setStyle(this.style),this.layer=new IE([MO(kO,this)])),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return MO(kO,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){MO(RO,this)&&MO(RO,this).removeFeature(this.layer),t?(t.addFeature(this.layer),OO(RO,this,t),OO(TO,this,new VE(this,MO(RO,this).map))):MO(RO,this)&&MO(RO,this).removeFeature(this.layer)}},{key:"map",get:function(){return MO(RO,this)}},{key:"eventList",get:function(){return MO(TO,this).eventList}},{key:"on",value:function(t,e){return MO(TO,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return MO(TO,this).off(t,e,JE)}},{key:"openEdit",value:function(){MO(RO,this).editGeom(this)}},{key:"closeEdit",value:function(){return!!MO(RO,this).getEditGeom(this)&&MO(RO,this).closeEditGeom(this)}},{key:"getArea",value:function(){return this.getPath().reduce(function(t,e){return t+e.reduce(function(t,e){return t-WE(e)},2*WE(e[0]))},0)}},{key:"getRegion",value:function(){return this.getPath().reduce(function(t,e){return t+WE(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&&SO(t.prototype,e),n&&SO(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function NO(t){return NO="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},NO(t)}function FO(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 DO(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?FO(Object(n),!0).forEach(function(e){zO(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):FO(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function jO(t){return function(t){if(Array.isArray(t))return GO(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 GO(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)?GO(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 GO(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 BO(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,VO(r.key),r)}}function zO(t,e,n){return(e=VO(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VO(t){var e=function(t,e){if("object"!=NO(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=NO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==NO(e)?e:e+""}function UO(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 XO(t,e){return t.get(WO(t,e))}function qO(t,e,n){return t.set(WO(t,e),n),n}function WO(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 YO=new tm({image:new X_({fill:new W_({color:"#18a058"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),zIndex:9}),HO=new X_({fill:new W_({color:"#e59810"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),ZO=new tm({image:HO,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new Ew(e)}}),KO=new tm({zIndex:5,image:HO,geometry:function(t){var e=t.getGeometry().getCoordinates();return new Ew(e)}}),JO={base:[new tm({fill:new W_({color:"#9ffbc74d"}),stroke:new H_({color:"#16e96f",width:2})})],select:[new tm({fill:new W_({color:"#ff7f1db3"}),stroke:new H_({color:"#ff7f1d",width:2})})],draw:[YO,new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#e59810",width:2,lineDash:[10,10]})}),KO],edit:[new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#e59810",width:2})}),ZO],error:[new tm({fill:new W_({color:"#ff492480"}),stroke:new H_({color:"#e59810",width:2})}),ZO]},$O={base:[new tm({fill:new W_({color:"#ff7f1d4d"}),stroke:new H_({color:"#ffffff",width:2})})],select:[new tm({fill:new W_({color:"#ff7f1db3"}),stroke:new H_({color:"#ff7f1d",width:1})})],draw:[YO,new tm({fill:new W_({color:"#e5981099"}),stroke:new H_({color:"#ffffff",width:1,lineDash:[6,10]})}),KO],edit:[new tm({fill:new W_({color:"#e5981099"}),stroke:new H_({color:"#ffffff",width:1})}),ZO],error:[new tm({fill:new W_({color:"#ff492480"}),stroke:new H_({color:"#e59810",width:2})}),ZO]},QO=new WeakMap,tL=new WeakMap,eL=new WeakMap,nL=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),UO(this,QO,void 0),UO(this,tL,void 0),UO(this,eL,void 0),zO(this,"textList",[]),zO(this,"isShowLength",!1),zO(this,"tempShowLenFnCB",function(t){n.showLengthFn(t.target)}),zO(this,"active",!1),zO(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=Za(t.coordinate),r=Qa(n.core.getPath());return Jl(e,u_(r,.001))?(n.selectPoint?(n.selectPoint.show(),n.selectPoint.setPosition(t.coordinate)):n.selectPoint=new oP({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)}),zO(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=Za(t.coordinate),r=Qa(n.getPath()[0]);return Jl(e,u_(r,.001))?(n.selectPoint?(n.selectPoint.show(),n.selectPoint.setPosition(t.coordinate)):n.selectPoint=new oP({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)}),zO(this,"corerGeom",function(t){n.finishCoreDrawCB&&n.finishCoreDrawCB();var e,r,i=jO(n.getPath());n.core=t.geom,n.core.setSourceStyle($O.base),n.coreList?(i.push.apply(i,jO(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],Dd(Ja(i),Ja(t.path)),XO(tL,n).editGeom(t.geom,$O.edit,YO,n.clickCorePointCB),t.geom.setActiveStyle($O.select),n.changeCoreErrorStatus(n.coreStatusIsError())}),zO(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)}),zO(this,"condition",function(t){return console.log("condition",t),n.conditionCallback(t.coordinate)}),zO(this,"defaultCondition",function(t){var e=Ja(n.getPath()),r=Jl(Za(t),e);return r||n.outOfBoundsCB&&n.outOfBoundsCB(),r}),zO(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],XO(tL,n).getEditGeom(n.core)&&(n.hideClickPoint(),XO(tL,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=qE(),t.path&&(qO(QO,this,new Va({type:"polygon",geometry:new Jo(t.path),name:this.featureName})),this.style=JO.base,XO(QO,this).setStyle(this.style),this.layer=new IE({features:[XO(QO,this)],zIndex:999}),this.initPath=t.path),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return XO(QO,this)}},{key:"startDraw",value:function(){var t;if(XO(QO,this))return!1;var e=this;return null===(t=XO(tL,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},JO.draw),!0}},{key:"hideLength",value:function(){this.isShowLength=!1,this.textList.length>0&&(this.textList.forEach(function(t){return t.destroy()}),this.textList=[]),XO(QO,this)&&XO(QO,this).getGeometry().un("change",this.tempShowLenFnCB)}},{key:"showLength",value:function(){var t;this.isShowLength=!0,XO(QO,this)&&this.showLengthFn(null===(t=XO(QO,this))||void 0===t?void 0:t.getGeometry()),XO(QO,this)&&XO(QO,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=Bh(Qa([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 uC(DO(DO({},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,XO(QO,this)),XO(QO,this)?XO(QO,this).getGeometry().setCoordinates(t):(qO(QO,this,new Va({type:"polygon",geometry:new Jo(t),name:this.featureName})),this.style=JO.base,XO(QO,this).setStyle(this.style),this.layer=new IE({features:[XO(QO,this)],zIndex:999}),console.log("path",t,this.layer),XO(tL,this).addFeature(this.layer),this.isShowLength&&this.showLength()),e&&(this.openEdit(),this.changeErrorStatus(this.statusIsError()))}},{key:"setActive",value:function(t){"boolean"!==NO(t).toLocaleString()&&(t=!!t),this.active=t,t?XO(QO,this).setStyle(JO.select):XO(QO,this).setStyle(JO.base)}},{key:"isActive",value:function(){return!!this.active}},{key:"getPath",value:function(){var t;if(XO(QO,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){XO(tL,this)&&this.layer&&XO(tL,this).removeFeature(this.layer),t?(this.layer&&t.addFeature(this.layer),qO(tL,this,t),qO(eL,this,new VE(this,XO(tL,this).map))):qO(tL,this,void 0)}},{key:"map",get:function(){return XO(tL,this)}},{key:"eventList",get:function(){return XO(eL,this).eventList}},{key:"on",value:function(t,e){return XO(eL,this).featureOn(t,e,LE)}},{key:"off",value:function(t,e){return XO(eL,this).off(t,e,LE)}},{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]]),XO(tL,this).editGeom(this,JO.edit,YO,this.clickPointCB),this.initPath.shift();var e=this;this.initPath.forEach(function(n){var r=new vS({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&&XO(tL,this).editGeom(this,JO.edit,YO,this.clickPointCB)}},{key:"closeEdit",value:function(){return!!XO(tL,this).getEditGeom(this)&&(this.hideClickPoint(),XO(tL,this).closeEditGeom(this))}},{key:"coreStatusIsError",value:function(){var t=this,e=this.core.getPath();if(Lh(Ja([e])).features.length>0)return this.isError&&this.isError("kinks"),!0;if(!this.core)return!1;var n,r=jO(this.getPath()),i=!1,o=Ja([e]);return this.coreList&&r.push.apply(r,jO(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=Ja([e]);return(Id(o,n)||Id(n,o))&&(i=!0),e}))),Dd(Ja(r),o)||i?(this.isError&&this.isError("outBounds"),this.outOfBoundsCB&&this.outOfBoundsCB(),!0):(this.isError(!1),!1)}},{key:"statusIsError",value:function(){return Lh(Ja(this.getPath())).features.length>0?(this.isError&&this.isError("kinks"),!0):(this.isError(!1),!1)}},{key:"changeErrorStatus",value:function(t){var e=XO(QO,this);t?e.setStyle(JO.error):e.setStyle(JO.edit)}},{key:"changeCoreErrorStatus",value:function(t){var e=this.core.feature;Array.isArray(e)&&(e=e[0]),t?e.setStyle($O.error):e.setStyle($O.edit)}},{key:"deletePolygon",value:function(){this.closeEdit(),this.map.removeFeature(this.layer),qO(QO,this,void 0)}},{key:"getArea",value:function(){var t,e;return WE(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+WE(e)},0)}},{key:"getRegion",value:function(){return WE(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,$O.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(),XO(tL,this).editGeom(this.core,$O.edit,YO,this.clickCorePointCB)}},{key:"cancelCoreEdit",value:function(){if(!this.tempCorePath)return!1;this.core&&(XO(tL,this).getEditGeom(this.core)&&(this.hideClickPoint(),XO(tL,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&&(XO(tL,this).getEditGeom(this.core)&&(this.hideClickPoint(),XO(tL,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(jO(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*Bh(Qa(this.getPath()[0]),{units:"kilometers"})}}],e&&BO(t.prototype,e),n&&BO(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function rL(t){return rL="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},rL(t)}function iL(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 oL(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)?oL(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 oL(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 sL(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,uL(r.key),r)}}function aL(t,e,n){return(e=uL(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uL(t){var e=function(t,e){if("object"!=rL(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=rL(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==rL(e)?e:e+""}function lL(t,e,n){cL(t,e),e.set(t,n)}function cL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hL(t,e){return t.get(pL(t,e))}function fL(t,e,n){return t.set(pL(t,e),n),n}function pL(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 dL=new tm({image:new X_({fill:new W_({color:"#18a058"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),zIndex:9}),gL=new X_({fill:new W_({color:"#e59810"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),yL=new tm({image:gL,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new Ew(e)}}),vL=new tm({zIndex:5,image:gL,geometry:function(t){var e=t.getGeometry().getCoordinates();return new Ew(e)}}),_L={select:[new tm({fill:new W_({color:"#fff42799"}),stroke:new H_({color:"#fff427",width:2})})],base:[new tm({fill:new W_({color:"#ff7f1d99"}),stroke:new H_({color:"#e59810ff",width:2})})],draw:[dL,new tm({fill:new W_({color:"#ff74ae99"}),stroke:new H_({color:"#ffffff",width:1,lineDash:[10,10]})}),vL],edit:[new tm({fill:new W_({color:"#ff74ae99"}),stroke:new H_({color:"#ffffff",width:1})}),yL],error:[new tm({fill:new W_({color:"#ff492480"}),stroke:new H_({color:"#e59810ff",width:1})}),yL]},mL=new WeakMap,xL=new WeakMap,wL=new WeakMap,bL=new WeakMap,EL=new WeakMap,SL=new WeakSet,CL=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),cL(n=this,r=SL),r.add(n),lL(this,mL,{}),lL(this,xL,void 0),lL(this,wL,void 0),aL(this,"editList",{}),lL(this,bL,void 0),lL(this,EL,void 0),aL(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=Za(t.coordinate),n=Qa(i.getPath()[0]);return Jl(e,u_(n,.001))?(i.selectPoint?(i.selectPoint.show(),i.selectPoint.setPosition(t.coordinate)):i.selectPoint=new oP({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(pL(SL,this,PL).call(this,e))},e=[{key:"init",value:function(t){if(console.log("isolation options: ",t),fL(wL,this,qE()),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(hL(mL,this)).map(function(t){return t.polygon})}},{key:"isolation",get:function(){return Object.values(hL(mL,this))}},{key:"selectId",get:function(){return hL(bL,this)}},{key:"statusIsError",value:function(){var t=hL(bL,this),e=hL(mL,this)[t].feature.getGeometry().getCoordinates();if(Lh(Ja(e)).features.length>0)return this.isError&&this.isError("kinks"),!0;var n=Object.values(hL(mL,this)).filter(function(e){return e.id!==t}).map(function(t){return t.feature.getGeometry().getCoordinates()}),r=Ja(e);return n.some(function(t){var e=Ja(t);return Dd(r,e)})?(this.isError&&this.isError("overlap"),!0):(this.isError&&this.isError(!1),!1)}},{key:"getPath",value:function(){return Object.values(hL(mL,this)).map(function(t){return t.layer.getSource().getFeatures()[0].getGeometry().getCoordinates()[0]})}},{key:"addPath",value:function(t,e){var n=Object.values(hL(mL,this)).length,r=hL(wL,this)+n,i=new Va({type:"polygon",geometry:new Jo(t),name:r});i.setStyle(_L.base);var o=new IE([i]);if(hL(mL,this)[r]={id:r,style:_L.base,feature:i,polygon:i,layer:o},hL(xL,this)&&hL(xL,this).addFeature(o),fL(bL,this,r),e)return!0;this.changeSelectIdCB&&this.changeSelectIdCB(hL(bL,this)),this.openEdit(r);var s=Object.values(hL(mL,this)).map(function(t){return t.feature.getGeometry().getCoordinates()}),a=Ja(t),u=s.some(function(t){var e=Ja(t);return Dd(a,e)});u&&this.changeErrorStatus(!0),this.changeErrorStatus(this.statusIsError()),console.log("test isolation selectId",hL(bL,this),hL(mL,this))}},{key:"changeErrorStatus",value:function(t){var e=hL(bL,this),n=hL(mL,this)[e];t?n.feature.setStyle(_L.error):n.feature.setStyle(_L.edit)}},{key:"isVisible",value:function(){return Object.values(hL(mL,this)).every(function(t){return t.layer.getVisible()})}},{key:"show",value:function(){Object.values(hL(mL,this)).forEach(function(t){return t.layer.setVisible(!0)})}},{key:"hide",value:function(){Object.values(hL(mL,this)).forEach(function(t){return t.layer.setVisible(!1)})}},{key:"setMap",value:function(t){var e=hL(xL,this);e&&Object.values(hL(mL,this)).forEach(function(t){return e.removeFeature(t.layer)}),t?(Object.values(hL(mL,this)).forEach(function(e){return t.addFeature(e.layer)}),fL(xL,this,t),fL(EL,this,new VE(this,hL(xL,this).map))):hL(xL,this)&&Object.values(hL(mL,this)).forEach(function(t){return e.removeFeature(t.layer)})}},{key:"map",get:function(){return hL(xL,this)}},{key:"eventList",get:function(){return hL(EL,this).eventList}},{key:"on",value:function(t,e){return hL(EL,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return hL(EL,this).off(t,e,JE)}},{key:"startDraw",value:function(){var t;if(!hL(xL,this))return console.error("Missing the necessary map object."),!1;var e=this,n=Object.values(hL(mL,this)).map(function(t){return t.feature.getGeometry().getCoordinates()});return null===(t=hL(xL,this))||void 0===t||t.startDraw("smartPolygon",function(t){e.addPath(t.path),t.geom.setMap()},function(t){var e=Za(t.coordinate);return n.every(function(t){var n=Ja(t);return!Jl(e,n)})},_L.draw),!0}},{key:"getIdByLonlat",value:function(t){var e=this;return Object.keys(hL(mL,this)).find(function(n){var r=hL(mL,e)[n].feature.getGeometry().getCoordinates();return Jl(Za(t),Ja(r))})}},{key:"openEdit",value:function(t){t=null!=t?t:this.selectId,console.log("test open edit",t);var e=new tm({image:new X_({fill:new W_({color:"#18a058"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),zIndex:9});this.editList[t]=hL(mL,this)[t],hL(xL,this).editGeom(hL(mL,this)[t],_L.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&&hL(mL,this)[t]){var n=Object.values(hL(mL,this)).filter(function(e){return e.name!==t}).map(function(t){return t.feature.getGeometry().getCoordinates()}),r=Ja(hL(mL,this)[t].feature.getGeometry().getCoordinates());return!n.some(function(t){var e=Ja(t);return Dd(r,e)})&&(delete this.editList[t],hL(xL,this).closeEditGeom(hL(mL,this)[t]))}var i=this;return Object.keys(this.editList).forEach(function(t){i.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=hL(bL,this),e=hL(mL,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=hL(mL,this)[hL(bL,this)])||void 0===e?void 0:e.feature),null===(n=hL(mL,this)[hL(bL,this)])||void 0===n||n.feature.setStyle(_L.base),hL(mL,this)[t].feature.setStyle(_L.select),fL(bL,this,t),this.changeSelectIdCB&&this.changeSelectIdCB(hL(bL,this)),0))}},{key:"deleteIsolation",value:function(t){t=t||this.selectId;var e=hL(mL,this)[t];hL(xL,this).removeFeature(e.layer),this.closeEdit(this.selectId,!0),delete hL(mL,this)[t]}},{key:"getArea",value:function(){return this.getPath().reduce(function(t,e){return t+WE(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=iL(t[i].map(parseFloat),2),s=o[0],a=o[1],u=iL(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=iL(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=iL(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!!hL(xL,this)&&(Object.values(hL(mL,this)).forEach(function(e){return hL(xL,t).removeFeature(e.layer)}),!0)}}],e&&sL(t.prototype,e),n&&sL(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function PL(t){return t}function IL(t){return IL="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},IL(t)}function ML(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,LL(r.key),r)}}function OL(t,e,n){return(e=LL(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LL(t){var e=function(t,e){if("object"!=IL(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=IL(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==IL(e)?e:e+""}function kL(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 RL(t,e){return t.get(AL(t,e))}function TL(t,e,n){return t.set(AL(t,e),n),n}function AL(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 NL=new WeakMap,FL=new WeakMap,DL=new WeakMap,jL=new WeakMap,GL=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),kL(this,NL,void 0),kL(this,FL,void 0),kL(this,DL,void 0),kL(this,jL,void 0),OL(this,"draggable",!1),OL(this,"modify",void 0),this.init(e)},e=[{key:"init",value:function(t){if(!t)return!1;TL(DL,this,qE()),TL(NL,this,new Va({geometry:new Ew(t.data.map(function(t){return t.lonlat})),name:RL(DL,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 tm({image:new Sx({anchor:t.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:n.src,offset:t.offset,rotation:t.rotation,scale:t.scale}),geometry:new Ew(i.map(function(t){return t.lonlat}))}))})}else{var r=new W_({color:"rgba(37, 165, 247,0.6)"}),i=new H_({color:"#ffeeff",width:2});e.push(new tm({image:new X_({fill:r,stroke:i,radius:5})}))}this.style=e,this.options=t,RL(NL,this).setStyle(e),this.layer=new IE({features:[RL(NL,this)],zIndex:(t.zIndex||0)+1e4}),t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable)}},{key:"feature",get:function(){return RL(NL,this)}},{key:"getClosestPoint",value:function(t){var e=RL(NL,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){RL(FL,this)&&RL(FL,this).removeFeature(this.layer),t?(t.addFeature(this.layer),TL(FL,this,t),TL(jL,this,new VE(this,RL(FL,this).map))):RL(FL,this)&&RL(FL,this).removeFeature(this.layer)}},{key:"map",get:function(){return RL(FL,this)}},{key:"eventList",get:function(){return RL(jL,this).eventList}},{key:"on",value:function(t,e){return console.log("t123"),RL(jL,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return RL(jL,this).off(t,e,JE)}},{key:"setDraggable",value:function(t){if(this.draggable=t,t)this.modify||(this.modify=new iw({hitDetection:this.layer,source:this.layer.getSource()})),RL(FL,this).map.addInteraction(this.modify);else{if(!this.modify)return;RL(FL,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"destroy",value:function(){return!!RL(FL,this)&&(RL(FL,this).removeFeature(this.layer),!0)}}],e&&ML(t.prototype,e),n&&ML(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),BL=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)}}(),zL=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 T("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 BL(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(ae,this.boundRefresh_),this.source=t,t&&t.addEventListener(ae,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(!(x(s)in r)){var a=this.geometryFunction(s);if(a){rt(a.getCoordinates(),t),Y(t,e,t);var u=this.source.getFeaturesInExtent(t).filter(function(t){var e=x(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?Ke(n,i.getCoordinates()):t.splice(r,1)}en(n,1/t.length);var o=dt(e),s=this.interpolationRatio,a=new No([n[0]*(1-s)+o[0]*s,n[1]*(1-s)+o[1]*s]);return this.createCustomCluster_?this.createCustomCluster_(a,t):new Va({geometry:a,features:t})},e}(Wx),VL=zL;function UL(t){return UL="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},UL(t)}function XL(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,WL(r.key),r)}}function qL(t,e,n){return(e=WL(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WL(t){var e=function(t,e){if("object"!=UL(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=UL(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==UL(e)?e:e+""}function YL(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 HL(t,e){return t.get(KL(t,e))}function ZL(t,e,n){return t.set(KL(t,e),n),n}function KL(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 JL=new WeakMap,$L=new WeakMap,QL=new WeakMap,tk=new WeakMap,ek=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),YL(this,JL,void 0),YL(this,$L,void 0),YL(this,QL,void 0),YL(this,tk,void 0),qL(this,"draggable",!1),qL(this,"modify",void 0),this.init(e)},e=[{key:"init",value:function(t){if(!t)return!1;ZL(QL,this,qE()),ZL(JL,this,t.data.map(function(t){return new Va(new No(t.lonlat))})),this.data=t.data;var e=new Wx({features:HL(JL,this)}),n=new VL({distance:parseInt("40",10),minDistance:parseInt("2",10),source:e}),r={};this.layer=new Nx({source:n,zIndex:1e3,style:function(t){var e=t.get("features").length,n=r[e];return n||(n=new tm({image:new X_({radius:10,stroke:new H_({color:"#fff"}),fill:new W_({color:"#3399CC"})}),text:new DS({text:e.toString(),fill:new W_({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 HL(JL,this)}},{key:"getClosestPoint",value:function(t){var e=HL(JL,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){HL($L,this)&&HL($L,this).removeFeature(this.layer),t?(t.addFeature(this.layer),ZL($L,this,t),ZL(tk,this,new VE(this,HL($L,this).map))):HL($L,this)&&HL($L,this).removeFeature(this.layer)}},{key:"map",get:function(){return HL($L,this)}},{key:"eventList",get:function(){return HL(tk,this).eventList}},{key:"on",value:function(t,e){return console.log("t123"),HL(tk,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return HL(tk,this).off(t,e,JE)}},{key:"setDraggable",value:function(t){if(this.draggable=t,t)this.modify||(this.modify=new iw({hitDetection:this.layer,source:this.layer.getSource()})),HL($L,this).map.addInteraction(this.modify);else{if(!this.modify)return;HL($L,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"destroy",value:function(){return!!HL($L,this)&&(HL($L,this).removeFeature(this.layer),!0)}}],e&&XL(t.prototype,e),n&&XL(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function nk(t){return nk="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},nk(t)}function rk(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 ik(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?rk(Object(n),!0).forEach(function(e){uk(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rk(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function ok(t){return function(t){if(Array.isArray(t))return sk(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 sk(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)?sk(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 sk(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 ak(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,lk(r.key),r)}}function uk(t,e,n){return(e=lk(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lk(t){var e=function(t,e){if("object"!=nk(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=nk(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nk(e)?e:e+""}function ck(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 hk(t,e){return t.get(pk(t,e))}function fk(t,e,n){return t.set(pk(t,e),n),n}function pk(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 dk=new tm({image:new X_({fill:new W_({color:"#18a058"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),zIndex:9}),gk=new X_({fill:new W_({color:"#e59810"}),stroke:new H_({color:"#ffffff",width:1}),radius:5}),yk=new tm({image:gk,geometry:function(t){var e=t.getGeometry().getCoordinates()[0];return new Ew(e)}}),vk=new tm({zIndex:5,image:gk,geometry:function(t){var e=t.getGeometry().getCoordinates();return new Ew(e)}}),_k={base:[new tm({fill:new W_({color:"#9ffbc74d"}),stroke:new H_({color:"#16e96f",width:2})})],select:[new tm({fill:new W_({color:"#ff7f1db3"}),stroke:new H_({color:"#ff7f1d",width:2})})],draw:[dk,new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#e59810",width:2,lineDash:[10,10]})}),vk],edit:[new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#e59810",width:2})}),yk],error:[new tm({fill:new W_({color:"#ff492480"}),stroke:new H_({color:"#e59810",width:2})}),yk]},mk={base:[new tm({fill:new W_({color:"#ffbdb299"}),stroke:new H_({color:"#eb7272",width:2})})],base2:[new tm({fill:new W_({color:"#ff252599"}),stroke:new H_({color:"#ff7676",width:2})})],select:[new tm({fill:new W_({color:"#ff7f1db3"}),stroke:new H_({color:"#ff7f1d",width:1})})],draw:[dk,new tm({fill:new W_({color:"#ffbdb299"}),stroke:new H_({color:"#ffffff",width:1,lineDash:[6,10]})}),vk],edit:[new tm({fill:new W_({color:"#ffbdb299"}),stroke:new H_({color:"#eb7272",width:1})}),yk],edit2:[new tm({fill:new W_({color:"#ff252599"}),stroke:new H_({color:"#ff7676",width:1})}),yk],error:[new tm({fill:new W_({color:"#ff492480"}),stroke:new H_({color:"#e59810",width:2})}),yk]},xk=new WeakMap,wk=new WeakMap,bk=new WeakMap,Ek=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),ck(this,xk,void 0),ck(this,wk,void 0),ck(this,bk,void 0),uk(this,"textList",[]),uk(this,"isShowLength",!1),uk(this,"tempShowLenFnCB",function(t){r.showLengthFn(t.target)}),uk(this,"active",!1),uk(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=Za(t.coordinate),n=Qa(r.activeRiskArea.getPath());return Jl(e,u_(n,.001))?(r.selectPoint?(r.selectPoint.show(),r.selectPoint.setPosition(t.coordinate)):r.selectPoint=new oP({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)}),uk(this,"activeRiskAreaGeom",function(t){var e,n,i=ok(r.getPath());r.activeRiskArea=t.geom,r.activeRiskArea.setSourceStyle(mk.base),r.activeRiskArea.setExtData({riskLevel:1}),r.riskAreaList?(i.push.apply(i,ok(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],hk(wk,r).editGeom(t.geom,mk.edit,dk,r.clickPointCB),t.geom.setActiveStyle(mk.select),r.changeRiskAreaErrorStatus(r.riskAreaStatusIsError()),r.finishRiskDrawCB&&r.finishRiskDrawCB()}),uk(this,"defaultCondition",function(t){var e=Ja(r.getPath()),n=Jl(Za(t),e);return n||r.outOfBoundsCB&&r.outOfBoundsCB(),n}),uk(this,"condition",function(t){return console.log("condition",t),r.conditionCallback(t.coordinate)}),uk(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)}),uk(this,"isOpenSelect",!1),uk(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],hk(wk,r).getEditGeom(r.activeRiskArea)&&(r.hideClickPoint(),hk(wk,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=qE(),this.areaPath=t.path,fk(xk,this,new Va({type:"polygon",geometry:new Jo(t.path),name:this.featureName})),this.style=_k.base,hk(xk,this).setStyle(this.style),this.layer=new IE({features:[hk(xk,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 vS({path:o?t.path:t.path[0],map:e.map,borderWidth:1,strokeColor:r[i],fillColor:n[i],extData:ik({riskLevel:i},t),isGeomPolygon:o});return o&&(e.isAllRisk=!0),s.setActiveStyle(mk.select),s})}}},{key:"feature",get:function(){return hk(xk,this)}},{key:"hideLength",value:function(){this.isShowLength=!1,this.textList.length>0&&(this.textList.forEach(function(t){return t.destroy()}),this.textList=[]),hk(xk,this).getGeometry().un("change",this.tempShowLenFnCB)}},{key:"showLength",value:function(){this.isShowLength=!0,this.showLengthFn(hk(xk,this).getGeometry()),hk(xk,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=Bh(Qa([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 uC(ik(ik({},t),{},{textBaseline:"bottom",fill:"#ffffff",stroke:"#2b2b2b",borderWidth:4,fontSize:"16px",map:hk(wk,e)})),e.textList[n]=r)})}},{key:"getPath",value:function(){var t;if(hk(xk,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"!==nk(t).toLocaleString()&&(t=!!t),this.active=t,t?hk(xk,this).setStyle(_k.select):hk(xk,this).setStyle(_k.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){hk(wk,this)&&this.layer&&hk(wk,this).removeFeature(this.layer),t?(this.layer&&t.addFeature(this.layer),fk(wk,this,t),fk(bk,this,new VE(this,hk(wk,this).map))):fk(wk,this,void 0)}},{key:"map",get:function(){return hk(wk,this)}},{key:"eventList",get:function(){return hk(bk,this).eventList}},{key:"on",value:function(t,e){return hk(bk,this).featureOn(t,e,LE)}},{key:"off",value:function(t,e){return hk(bk,this).off(t,e,LE)}},{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=Ja([this.activeRiskArea.getPath()]);if(Lh(e).features.length>0)return this.isError&&this.isError("kinks"),!0;var n,r=ok(this.getPath()),i=r.some(function(t,n){return 0!==n&&Id(e,Ja([t]))}),o=!1;if(this.riskAreaList&&r.push.apply(r,ok(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=Ja([n]);return(Id(e,r)||Dd(r,e))&&(o=!0),n}))),o)return this.isError&&this.isError("overlap"),this.outOfBoundsCB&&this.outOfBoundsCB(),!0;var s=Ja(r);return Dd(s,e)||!Id(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(mk.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=mk.edit;break;case 2:r=mk.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,mk.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?mk.base:mk.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=mk.edit;break;case 2:i=mk.edit2}hk(wk,this).editGeom(this.activeRiskArea,i,dk,this.clickPointCB)}},{key:"cancelRiskEdit",value:function(){if(!this.tempRiskPath)return!1;this.activeRiskArea&&(hk(wk,this).getEditGeom(this.activeRiskArea)&&(this.hideClickPoint(),hk(wk,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&&(hk(wk,this).getEditGeom(this.activeRiskArea)&&(this.hideClickPoint(),hk(wk,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 vS({path:this.areaPath,isGeomPolygon:!0,map:this.map,borderWidth:1,strokeColor:"#eb7272",fillColor:"#ffbdb299",extData:{riskLevel:1}});t.setActiveStyle(mk.select),this.riskAreaList=[t]}}],e&&ak(t.prototype,e),n&&ak(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),Sk={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 Sk.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)}}}},Ck=Sk;function Pk(t){return Pk="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},Pk(t)}function Ik(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 Mk(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ik(Object(n),!0).forEach(function(e){Ok(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ik(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Ok(t,e,n){return(e=Tk(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lk(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 kk(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)?kk(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 kk(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 Rk(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,Tk(r.key),r)}}function Tk(t){var e=function(t,e){if("object"!=Pk(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Pk(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Pk(e)?e:e+""}var Ak=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 Ck.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,Ck.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 Ck.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 Ck.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 Ck.Logger.warn("[Mutex] 自定义规则阻止激活:".concat(t),c),!1}return e(),this.activeFeatures.set(a,{closeFn:n,timestamp:Date.now(),featureName:t,group:s}),Ck.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),Ck.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),Ck.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=Lk(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(),Ck.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(),Ck.Logger.info("[Mutex] 所有状态已清理"),this._emit("clear")}},{key:"addGroup",value:function(t,e){this.config.groups[t]=e,Ck.Logger.info("[Mutex] 添加互斥组:".concat(t))}},{key:"addFeature",value:function(t,e){this.config.featureMap[t]=e,Ck.Logger.info("[Mutex] 添加功能映射:".concat(t))}},{key:"addScenario",value:function(t,e){this.config.scenarios[t]=e,Ck.Logger.info("[Mutex] 添加场景:".concat(t))}},{key:"updateConfig",value:function(t){this.config=Mk(Mk({},this.config),t),Ck.Logger.info("[Mutex] 配置已更新")}}],e&&Rk(t.prototype,e),n&&Rk(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),Nk=Ak,Fk={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"},Dk={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 jk(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 Gk(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)?Gk(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 Gk(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 Bk(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 zk(t,e,n){return(e=Wk(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vk(t){return Vk="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},Vk(t)}function Uk(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xk(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,Wk(r.key),r)}}function qk(t,e,n){return e&&Xk(t.prototype,e),n&&Xk(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wk(t){var e=function(t,e){if("object"!=Vk(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Vk(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Vk(e)?e:e+""}var Yk=function(){return qk(function t(e){var n=this;Uk(this,t),this.XNOM=e,this.mapManager=new Hk(this.XNOM),this.layerManager=new Zk(this.XNOM,this.mapManager),this.markerManager=new Kk(this.XNOM,this.mapManager),this.controlManager=new Jk(this.XNOM,this.mapManager),this.textManager=new $k(this.XNOM,this.mapManager),this.infoWindowManager=new Qk(this.XNOM,this.mapManager),this.drawManager=new tR(this.XNOM,this.mapManager,this.layerManager),this.eventManager=new eR(this.XNOM,this.mapManager,this.markerManager),this.isolationManager=new nR(this.XNOM,this.mapManager),this.riskManager=new rR(this.XNOM,this.mapManager),this.smartEditManager=new iR(this.XNOM,this.mapManager),this.trackManager=new oR(this.XNOM),this.mutexManager=new Nk(Fk),this.mutexManager.on("activate",function(){return n._updateUIState()}),this.mutexManager.on("deactivate",function(){return n._updateUIState()}),this.mutexManager.on("mutexClose",function(){return n._updateUIState()}),this.mutexManager.on("scenarioChange",function(){return n._updateUIState()})},[{key:"initMap",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mapManager.initMap(t)}},{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.addMarker1()}},{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(),Ck.Logger.info("✅ 所有资源已销毁")}catch(t){Ck.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}}])}(),Hk=function(){return qk(function t(e){Uk(this,t),this.XNOM=e,this.map=null,this.map1=null,this.controlObj={}},[{key:"initMap",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bk(Object(n),!0).forEach(function(e){zk(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bk(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({target:Dk.MAP.TARGET,zoom:Dk.MAP.DEFAULT_ZOOM,zooms:Dk.MAP.ZOOMS,center:Dk.MAP.CENTER,controls:{attribution:!1,zoom:!1,rotate:!1},undoDrawCB:function(t){Ck.Logger.info("example undoDrawCB count:",t)}},t);return this.map=new this.XNOM.Map(e),this.map.on("loadend",function(){Ck.Logger.info("地图加载完成")}),Ck.Logger.info("主地图初始化成功",this.map),this.map}catch(t){return Ck.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={},Ck.Logger.info("地图资源已销毁")}catch(t){Ck.ErrorHandler.handle(t,"MapManager.destroy")}}}])}(),Zk=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,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!!Ck.ErrorHandler.validateMap(t,"LayerManager.addKrigingLayer")&&(this.krigingLayer=new this.XNOM.KrigingLayer({name:Dk.LAYER.KRIGING.NAME,zIndex:Dk.LAYER.KRIGING.Z_INDEX,alpha:Dk.LAYER.KRIGING.ALPHA,width:Dk.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 Ck.ErrorHandler.handle(t,"LayerManager.addKrigingLayer")}}},{key:"addPolygon",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"LayerManager.addPolygon"))return!1;var e={group:Dk.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 this.XNOM.Polygon(e),this.layers.polygon=this.polygon,this.polygon}catch(t){return Ck.ErrorHandler.handle(t,"LayerManager.addPolygon")}}},{key:"addComplexPolygon",value:function(){try{var t=this.mapManager.getMap();if(!Ck.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 this.XNOM.ComplexPolygon(e),this.layers.complexPolygon=this.complexPolygon,this.complexPolygon}catch(t){return Ck.ErrorHandler.handle(t,"LayerManager.addComplexPolygon")}}},{key:"addPolyline",value:function(){try{var t=this.mapManager.getMap();if(!Ck.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:Dk.GROUP.POLYLINE};this.polyline=new this.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:Dk.GROUP.POLYLINE},r=new this.XNOM.Polyline(n);return this.layers.polyline=this.polyline,this.layers.polyline1=r,this.polyline}catch(t){return Ck.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,Ck.Logger.info("图层资源已清理")}catch(t){Ck.ErrorHandler.handle(t,"LayerManager.destroy")}}}])}(),Kk=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.markers={},this.massMarkers={},this.clustersMarkers={},this.isPause=!1},[{key:"addMarker",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"MarkerManager.addMarker"))return!1;var e={position:[89.3,29],src:Dk.URLS.ICON_1,activeSrc:Dk.URLS.ICON_2,rotation:Math.atan2(1,0),autoRotation:!0,anchor:[.5,1],map:t},n=new this.XNOM.Marker(e);return n.setMap(t),this.markers.main=n,n}catch(t){return Ck.ErrorHandler.handle(t,"MarkerManager.addMarker")}}},{key:"addMarker1",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"MarkerManager.addMarker1"))return!1;var e={position:[120.566032634,33.355905081],src:Dk.URLS.ICON_1,anchor:[1,1],rotation:Math.atan2(1,0),map:t},n=new this.XNOM.Marker(e);return this.markers.marker1=n,n}catch(t){return Ck.ErrorHandler.handle(t,"MarkerManager.addMarker1")}}},{key:"addMassMarker",value:function(){var t=this;try{var e=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(e,"MarkerManager.addMassMarker"))return!1;var n=[];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(r){var i={position:r,anchor:[.5,.5],group:Dk.GROUP.MASS,map:e},o=new t.XNOM.Marker(i);o.setMap(e),n.push(o)}),this.massMarkers.mass1=n,n}catch(t){return Ck.ErrorHandler.handle(t,"MarkerManager.addMassMarker")}}},{key:"addMassMarker1",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"MarkerManager.addMassMarker1"))return!1;var e={data:this._getMassMarkerData(),styles:[{src:Dk.URLS.ICON_1},{src:Dk.URLS.ICON_2}],map:t},n=new this.XNOM.MassMarker(e);return this.massMarkers.mass2=n,n.on("click",function(t){var e=t.lnglat,r=n.getClosestPoint(e);Ck.Logger.info("海量标记点点击",r)}),n}catch(t){return Ck.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(!Ck.ErrorHandler.validateMap(t,"MarkerManager.addClustersMarker1"))return!1;var e={data:this._getMassMarkerData(),styles:[{src:Dk.URLS.ICON_1},{src:Dk.URLS.ICON_2}],map:t},n=new this.XNOM.ClustersMarker(e);return this.clustersMarkers.clusters1=n,n}catch(t){return Ck.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):(Ck.Logger.warn("标记点不存在"),!1)}catch(t){return Ck.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):(Ck.Logger.warn("标记点不存在"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"MarkerManager.toggleMarkerDrag")}}},{key:"openMoveMarker",value:function(){try{var t=this.markers.main;if(!t)return Ck.Logger.warn("标记点不存在"),!1;var e=[["117.917594333","36.9623245"],["117.917867167","36.961468167"],["117.91759","36.961894"]].map(function(t){return t.map(Number)});return t.moveAlong(e,10),this.isPause=!1,!0}catch(t){return Ck.ErrorHandler.handle(t,"MarkerManager.openMoveMarker")}}},{key:"pauseMoveMarker",value:function(){try{var t=this.markers.main;return t?(this.isPause?t.resumeMove():t.pauseMove(),this.isPause=!this.isPause,!0):(Ck.Logger.warn("标记点不存在"),!1)}catch(t){return Ck.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,Ck.Logger.info("标记点资源已清理")}catch(t){Ck.ErrorHandler.handle(t,"MarkerManager.destroy")}}}])}(),Jk=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.controls={}},[{key:"addControlOverView",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"ControlManager.addControlOverView"))return!1;var e=new this.XNOM.Control.OverView;return this.controls.overView=e,e.setMap(t),this.mapManager.getControlObj().overView=e,e}catch(t){return Ck.ErrorHandler.handle(t,"ControlManager.addControlOverView")}}},{key:"addControlScale",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"ControlManager.addControlScale"))return!1;var e=new this.XNOM.Control.Scale;return this.controls.scale=e,e.setMap(t),this.mapManager.getControlObj().scale=e,e}catch(t){return Ck.ErrorHandler.handle(t,"ControlManager.addControlScale")}}},{key:"addControlZoomTool",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"ControlManager.addControlZoomTool"))return!1;var e=new this.XNOM.Control.ZoomTool;return this.controls.zoomTool=e,e.setMap(t),this.mapManager.getControlObj().zoomTool=e,e}catch(t){return Ck.ErrorHandler.handle(t,"ControlManager.addControlZoomTool")}}},{key:"destroy",value:function(){this.controls={}}}])}(),$k=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.texts={}},[{key:"addText",value:function(){try{var t=this.mapManager.getMap();if(!Ck.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:Dk.GROUP.DEFAULT},n=new this.XNOM.Text(e);return this.texts.text1=n,[n]}catch(t){return Ck.ErrorHandler.handle(t,"TextManager.addText")}}},{key:"destroy",value:function(){this.texts={}}}])}(),Qk=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.infoWindow=null},[{key:"addInfoWindow",value:function(){try{var t=this.mapManager.getMap();if(!Ck.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 this.XNOM.InfoWindow(e),this.infoWindow.setMap(t),this.infoWindow}catch(t){return Ck.ErrorHandler.handle(t,"InfoWindowManager.addInfoWindow")}}},{key:"toggleInfoWindowVisible",value:function(){try{return this.infoWindow?(this.infoWindow.isVisible()?this.infoWindow.hide():this.infoWindow.show(),!0):(Ck.Logger.warn("弹窗未初始化"),!1)}catch(t){return Ck.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}}])}(),tR=function(){return qk(function t(e,n,r){Uk(this,t),this.XNOM=e,this.mapManager=n,this.layerManager=r,this.isDraw=!1,this.drawList=[],this.editPoly=!1,this.editPolyline=!1,this.isMeasureOpen=!1},[{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!!Ck.ErrorHandler.validateMap(n,"DrawManager.toggleDraw")&&(this.isDraw?(n.stopDraw(),this.isDraw=!1):(n.startDraw(e),n.on("drawend",function(e){Ck.Logger.info("drawend",e),e.geom.openEdit(),t.drawList.push(e.geom),t.isDraw=!1}),this.isDraw=!0),!0)}catch(t){return Ck.ErrorHandler.handle(t,"DrawManager.toggleDraw")}}},{key:"undoDraw",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"DrawManager.undoDraw")&&(t.undoDraw(),!0)}catch(t){return Ck.ErrorHandler.handle(t,"DrawManager.undoDraw")}}},{key:"endDraw",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"DrawManager.endDraw")&&(t.endDraw(),!0)}catch(t){return Ck.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):(Ck.Logger.warn("多边形不存在"),!1)}catch(t){return Ck.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):(Ck.Logger.warn("多边形不存在"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"DrawManager.togglePolygonVisible")}}},{key:"length",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"DrawManager.length")&&(t.openMeasure("length"),!0)}catch(t){return Ck.ErrorHandler.handle(t,"DrawManager.length")}}},{key:"destroy",value:function(){this.drawList=[],this.isDraw=!1,this.editPoly=!1,this.editPolyline=!1}}])}(),eR=function(){return qk(function t(e,n,r){Uk(this,t),this.XNOM=e,this.mapManager=n,this.markerManager=r,this.eventListeners=[]},[{key:"mapOnEvent",value:function(){try{var t=this.mapManager.getMap();if(!Ck.ErrorHandler.validateMap(t,"EventManager.mapOnEvent"))return!1;var e=t.on(["click"],function(t){Ck.Logger.info("map click",t)});return this.eventListeners.push({type:"mapClick",listener:e,target:t}),Ck.Logger.info("地图点击事件已绑定"),!0}catch(t){return Ck.ErrorHandler.handle(t,"EventManager.mapOnEvent")}}},{key:"mapOffEvent",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"EventManager.mapOffEvent")&&(t.off("click"),Ck.Logger.info("地图点击事件已解绑"),!0)}catch(t){return Ck.ErrorHandler.handle(t,"EventManager.mapOffEvent")}}},{key:"markerOnEvent",value:function(){try{var t=this.markerManager.getMarker();if(!t)return Ck.Logger.warn("标记点不存在"),!1;var e=t.on("pointermove",function(t){Ck.Logger.info("marker move",t)});return this.eventListeners.push({type:"markerMove",listener:e,target:t}),Ck.Logger.info("标记点经过事件已绑定"),!0}catch(t){return Ck.ErrorHandler.handle(t,"EventManager.markerOnEvent")}}},{key:"markerOffEvent",value:function(){try{var t=this.markerManager.getMarker();return t?(t.off("pointermove"),Ck.Logger.info("标记点经过事件已解绑"),!0):(Ck.Logger.warn("标记点不存在"),!1)}catch(t){return Ck.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=[],Ck.Logger.info("事件监听器已清理")}catch(t){Ck.ErrorHandler.handle(t,"EventManager.cleanup")}}}])}(),nR=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.isolation=null,this.selectIsolationId=null},[{key:"newIsolation",value:function(){var t=this;try{var e=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(e,"IsolationManager.newIsolation")&&(this.isolation=new this.XNOM.Isolation({map:e,isError:function(t){return Ck.Logger.info("is error",t)},changeSelectPoint:function(t){return Ck.Logger.info("change select point",t)},changeSelectIdCB:function(e){Ck.Logger.info("change select id",e),t.selectIsolationId=e}}),this.isolation)}catch(t){return Ck.ErrorHandler.handle(t,"IsolationManager.newIsolation")}}},{key:"startDrawIsolation",value:function(){try{return this.isolation?(this.isolation.startDraw(),!0):(Ck.Logger.warn("隔离区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"IsolationManager.startDrawIsolation")}}},{key:"openEditIsolation",value:function(){try{return this.isolation?(this.isolation.openEdit(),!0):(Ck.Logger.warn("隔离区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"IsolationManager.openEditIsolation")}}},{key:"closeEditIsolation",value:function(){try{return this.isolation?(this.isolation.closeEdit(),!0):(Ck.Logger.warn("隔离区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"IsolationManager.closeEditIsolation")}}},{key:"selectIsolation",value:function(){try{return!!this.isolation||(Ck.Logger.warn("隔离区未初始化"),!1)}catch(t){return Ck.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}}])}(),rR=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.riskArea=null},[{key:"newRiskArea",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"RiskManager.newRiskArea")&&(this.riskArea=new this.XNOM.RiskArea({map:t,callbacks:{changeSelectPoint:function(t){return Ck.Logger.info("change select point",t)},isError:function(t){return Ck.Logger.info("isError type:",t)},outOfBoundsCB:function(){return Ck.Logger.info("test outOfBoundsCB")},finishRiskDrawCB:function(){return Ck.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 Ck.ErrorHandler.handle(t,"RiskManager.newRiskArea")}}},{key:"startDrawRisk",value:function(){try{return this.riskArea?(this.riskArea.drawRisk(),!0):(Ck.Logger.warn("风险区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"RiskManager.startDrawRisk")}}},{key:"finishEditRisk",value:function(){try{return this.riskArea?(this.riskArea.finishEditRisk(),!0):(Ck.Logger.warn("风险区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"RiskManager.finishEditRisk")}}},{key:"openSelectRisk",value:function(){try{return this.riskArea?(this.riskArea.openSelect(),!0):(Ck.Logger.warn("风险区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"RiskManager.openSelectRisk")}}},{key:"openEditRisk",value:function(){try{return this.riskArea?(this.riskArea.openRiskEdit(),!0):(Ck.Logger.warn("风险区未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"RiskManager.openEditRisk")}}},{key:"destroy",value:function(){this.riskArea&&"function"==typeof this.riskArea.destroy&&this.riskArea.destroy(),this.riskArea=null}}])}(),iR=function(){return qk(function t(e,n){Uk(this,t),this.XNOM=e,this.mapManager=n,this.smartPolygon=null},[{key:"newSmartPolygon",value:function(){try{var t=this.mapManager.getMap();return!!Ck.ErrorHandler.validateMap(t,"SmartEditManager.newSmartPolygon")&&(this.smartPolygon=new this.XNOM.SmartPolygon({map:t,isError:function(t){return Ck.Logger.info("isError type:",t)},changeSelectPoint:function(t){return Ck.Logger.info("change select point",t)},finishCoreDrawCB:function(){return Ck.Logger.info("ttt finishCoreDrawCB")},outOfBoundsCB:function(){return Ck.Logger.info("test outOfBoundsCB")},finishDrawCB:function(){return Ck.Logger.info("test finishDrawCB")}}),this.smartPolygon)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.newSmartPolygon")}}},{key:"startDrawSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.startDraw(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.startDrawSmartPolygon")}}},{key:"useCorer",value:function(){try{return this.smartPolygon?(this.smartPolygon.useCorer(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.useCorer")}}},{key:"openEditCore",value:function(){try{return this.smartPolygon?(this.smartPolygon.openCoreEdit(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.openEditCore")}}},{key:"closeEditCore",value:function(){try{return this.smartPolygon?(this.smartPolygon.finishRemoveCore(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.closeEditCore")}}},{key:"openEditSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.openEdit(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.openEditSmartPolygon")}}},{key:"closeEditSmartPolygon",value:function(){try{return this.smartPolygon?(this.smartPolygon.closeEdit(),!0):(Ck.Logger.warn("智能多边形未初始化"),!1)}catch(t){return Ck.ErrorHandler.handle(t,"SmartEditManager.closeEditSmartPolygon")}}},{key:"destroy",value:function(){this.smartPolygon&&"function"==typeof this.smartPolygon.destroy&&this.smartPolygon.destroy(),this.smartPolygon=null}}])}(),oR=function(){return qk(function t(e){Uk(this,t),this.XNOM=e,this.trackReplay=null,this.resultArr=this._parseTrackData()},[{key:"_parseTrackData",value:function(){try{return"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=jk(t.split(","),6);return{time:e[0],lon:e[1],lat:e[2],deep:e[3],status:e[4],group:e[5]}})}catch(t){return Ck.ErrorHandler.handle(t,"TrackManager._parseTrackData"),[]}}},{key:"showPopup",value:function(){try{this.trackReplay=new this.XNOM.TrackReplay({machine:1,data:this.resultArr,cameraList:[],clickCameraCallback:function(){},playFinishCallback:function(){},findLastPointCB:function(t){return Ck.Logger.info("test point info:",t)},layers:[Dk.URLS.TILE_1,Dk.URLS.TILE_2]});var t=document.querySelector("#track-box");return t&&t.appendChild(this.trackReplay.dom),this.trackReplay}catch(t){return Ck.ErrorHandler.handle(t,"TrackManager.showPopup")}}},{key:"destroy",value:function(){this.trackReplay&&"function"==typeof this.trackReplay.destroy&&this.trackReplay.destroy(),this.trackReplay=null}}])}();function sR(t){return sR="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},sR(t)}function aR(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 uR(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?aR(Object(n),!0).forEach(function(e){lR(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):aR(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function lR(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=sR(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=sR(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==sR(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var cR=uR(uR({turf:u,Map:FC,Marker:oP,Text:uC,Polygon:vS,Polyline:AS,InfoWindow:xP},ZI),{},{Control:eO,TrackReplay:wO,ComplexPolygon:AO,SmartPolygon:nL,Isolation:CL,MassMarker:GL,ClustersMarker:ek,RiskArea:Ek,MapService:Yk}),hR=new Yk(cR);cR.mapServiceInstance=hR,"undefined"!=typeof window&&(window.XNOM=cR),console.log("✅ XNOM 加载完成",cR);var fR=cR}(),r=r.default}()});
package/dist/sdk.esm.js CHANGED
@@ -104433,7 +104433,7 @@ var RemoteSense = {
104433
104433
  /**
104434
104434
  * 1. 添加遥感静态影像图层
104435
104435
  * @param {ol.Map} map - 地图实例
104436
- * @param {Object} opts - { url, extent, zIndex, name }
104436
+ * @param {Object} opts - { url, extent, zIndex, name, crossOrigin }
104437
104437
  * @returns {ol.layer.Image}
104438
104438
  */
104439
104439
  addRemoteImageLayer: function addRemoteImageLayer(map) {
@@ -104443,11 +104443,13 @@ var RemoteSense = {
104443
104443
  _opts$zIndex = opts.zIndex,
104444
104444
  zIndex = _opts$zIndex === void 0 ? 999 : _opts$zIndex,
104445
104445
  _opts$name = opts.name,
104446
- name = _opts$name === void 0 ? 'yaogan' : _opts$name;
104446
+ name = _opts$name === void 0 ? 'yaogan' : _opts$name,
104447
+ _opts$crossOrigin = opts.crossOrigin,
104448
+ crossOrigin = _opts$crossOrigin === void 0 ? undefined : _opts$crossOrigin;
104447
104449
  var source = new ImageStatic({
104448
104450
  url: url,
104449
104451
  imageExtent: extent,
104450
- crossOrigin: 'anonymous'
104452
+ crossOrigin: crossOrigin // 使用传入参数,默认undefined
104451
104453
  });
104452
104454
  source.set('name', name);
104453
104455
  var layer = new layer_Image({
@@ -104460,7 +104462,7 @@ var RemoteSense = {
104460
104462
  /**
104461
104463
  * 2. 添加遥感 WMS 异常图层
104462
104464
  * @param {ol.Map} map
104463
- * @param {Object} opts - { url, layers, cql, token, zIndex, name }
104465
+ * @param {Object} opts - { url, layers, cql, token, zIndex, name, crossOrigin }
104464
104466
  * @returns {ol.layer.Image}
104465
104467
  */
104466
104468
  addRemoteWMSLayer: function addRemoteWMSLayer(map) {
@@ -104472,10 +104474,13 @@ var RemoteSense = {
104472
104474
  _opts$zIndex2 = opts.zIndex,
104473
104475
  zIndex = _opts$zIndex2 === void 0 ? 105 : _opts$zIndex2,
104474
104476
  _opts$name2 = opts.name,
104475
- name = _opts$name2 === void 0 ? 'vectorLayerAbnormal' : _opts$name2;
104477
+ name = _opts$name2 === void 0 ? 'vectorLayerAbnormal' : _opts$name2,
104478
+ _opts$crossOrigin2 = opts.crossOrigin,
104479
+ crossOrigin = _opts$crossOrigin2 === void 0 ? undefined : _opts$crossOrigin2;
104476
104480
  var source = new source_ImageWMS({
104477
104481
  url: url,
104478
- crossOrigin: 'anonymous',
104482
+ crossOrigin: crossOrigin,
104483
+ // 默认undefined,消除跨域预检
104479
104484
  ratio: 1,
104480
104485
  params: {
104481
104486
  LAYERS: layers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhnyfe/zhnyfe_xnom",
3
- "version": "0.0.0-alpha.41",
3
+ "version": "0.0.0-alpha.42",
4
4
  "description": "先农数科前端团队openlayers功能相关的SDK,目标:所有前端Gis地图相关模块的唯一官方指定SDK",
5
5
  "main": "dist/sdk.common.js",
6
6
  "module": "dist/sdk.esm.js",