@zhnyfe/zhnyfe_xnom 0.0.0-alpha.40 → 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.
- package/dist/sdk.common.js +2 -2
- package/dist/sdk.esm.js +16 -8
- package/package.json +1 -1
package/dist/sdk.common.js
CHANGED
|
@@ -70,7 +70,7 @@ object-assign
|
|
|
70
70
|
*
|
|
71
71
|
* You should have received a copy of the GNU Affero General Public License
|
|
72
72
|
* along with MarchingSquaresJS. If not, see <http://www.gnu.org/licenses/>.
|
|
73
|
-
*/(t,r),s=[],a=0;a<o.length;a++){for(var u=o[a],l=[],c=0;c<u.length;c++){var h=u[c];h.properties[n]?l.push(h.properties[n]):l.push(0),!0===i&&(h.properties.matrixPosition=[a,c])}s.push(l)}return s}var tp={successCallback:null,verbose:!1,polygons:!1},ep={};function np(t,e,n,r){r=r||{};for(var i=Object.keys(tp),o=0;o<i.length;o++){var s=i[o],a=r[s];a=null!=a?a:tp[s],ep[s]=a}ep.verbose&&console.log("MarchingSquaresJS-isoBands: computing isobands for ["+e+":"+(e+n)+"]");var u,l=function(t,e,n){for(var r=t.length-1,i=t[0].length-1,o={rows:r,cols:i,cells:[]},s=e+Math.abs(n),a=0;a<r;++a){o.cells[a]=[];for(var u=0;u<i;++u){var l=0,c=t[a+1][u],h=t[a+1][u+1],f=t[a][u+1],p=t[a][u];if(!(isNaN(c)||isNaN(h)||isNaN(f)||isNaN(p))){l|=c<e?0:c>s?128:64,l|=h<e?0:h>s?32:16,l|=f<e?0:f>s?8:4;var d=+(l|=p<e?0:p>s?2:1),g=0;if(17===l||18===l||33===l||34===l||38===l||68===l||72===l||98===l||102===l||132===l||136===l||137===l||152===l||153===l){var y=(c+h+f+p)/4;g=y>s?2:y<e?0:1,34===l?1===g?l=35:0===g&&(l=136):136===l?1===g?(l=35,g=4):0===g&&(l=34):17===l?1===g?(l=155,g=4):0===g&&(l=153):68===l?1===g?(l=103,g=4):0===g&&(l=102):153===l?1===g&&(l=155):102===l?1===g&&(l=103):152===l?g<2&&(l=156,g=1):137===l?g<2&&(l=139,g=1):98===l?g<2&&(l=99,g=1):38===l?g<2&&(l=39,g=1):18===l?g>0?(l=156,g=4):l=152:33===l?g>0?(l=139,g=4):l=137:72===l?g>0?(l=99,g=4):l=98:132===l&&(g>0?(l=39,g=4):l=38)}if(0!=l&&170!=l){var v,_,m,x,w,b,E,S;v=_=m=x=w=b=E=S=.5;var C=[];1===l?(m=1-Hp(e,f,p),S=1-Hp(e,c,p),C.push(Vp[l])):169===l?(m=Hp(s,p,f),S=Hp(s,p,c),C.push(Vp[l])):4===l?(b=1-Hp(e,h,f),x=Hp(e,p,f),C.push(Bp[l])):166===l?(b=Hp(s,f,h),x=1-Hp(s,f,p),C.push(Bp[l])):16===l?(w=Hp(e,f,h),_=Hp(e,c,h),C.push(Gp[l])):154===l?(w=1-Hp(s,h,f),_=1-Hp(s,h,c),C.push(Gp[l])):64===l?(E=Hp(e,p,c),v=1-Hp(e,h,c),C.push(Xp[l])):106===l?(E=1-Hp(s,c,p),v=Hp(s,c,h),C.push(Xp[l])):168===l?(x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),C.push(zp[l]),C.push(Vp[l])):2===l?(x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),C.push(zp[l]),C.push(Vp[l])):162===l?(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),C.push(zp[l]),C.push(Vp[l])):8===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),C.push(Gp[l]),C.push(Bp[l])):138===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(Gp[l]),C.push(Bp[l])):32===l?(w=Hp(s,f,h),b=Hp(e,f,h),v=Hp(e,c,h),_=Hp(s,c,h),C.push(Gp[l]),C.push(Bp[l])):42===l?(S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h),C.push(Up[l]),C.push(Xp[l])):128===l&&(S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(Up[l]),C.push(Xp[l])),5===l?(b=1-Hp(e,h,f),S=1-Hp(e,c,p),C.push(Bp[l])):165===l?(b=Hp(s,f,h),S=Hp(s,p,c),C.push(Bp[l])):20===l?(x=Hp(e,p,f),_=Hp(e,c,h),C.push(zp[l])):150===l?(x=1-Hp(s,f,p),_=1-Hp(s,h,c),C.push(zp[l])):80===l?(w=Hp(e,f,h),E=Hp(e,p,c),C.push(Gp[l])):90===l?(w=1-Hp(s,h,f),E=1-Hp(s,c,p),C.push(Gp[l])):65===l?(m=1-Hp(e,f,p),v=1-Hp(e,h,c),C.push(Vp[l])):105===l?(m=Hp(s,p,f),v=Hp(s,c,h),C.push(Vp[l])):160===l?(w=Hp(s,f,h),b=Hp(e,f,h),S=Hp(e,p,c),E=Hp(s,p,c),C.push(Gp[l]),C.push(Bp[l])):10===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),S=1-Hp(s,c,p),E=1-Hp(e,c,p),C.push(Gp[l]),C.push(Bp[l])):130===l?(x=1-Hp(e,f,p),m=1-Hp(s,f,p),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(zp[l]),C.push(Vp[l])):40===l?(x=Hp(s,p,f),m=Hp(e,p,f),v=Hp(e,c,h),_=Hp(s,c,h),C.push(zp[l]),C.push(Vp[l])):101===l?(b=Hp(s,f,h),v=Hp(s,c,h),C.push(Bp[l])):69===l?(b=1-Hp(e,h,f),v=1-Hp(e,h,c),C.push(Bp[l])):149===l?(S=Hp(s,p,c),_=1-Hp(s,h,c),C.push(Up[l])):21===l?(S=1-Hp(e,c,p),_=Hp(e,c,h),C.push(Up[l])):86===l?(x=1-Hp(s,f,p),E=1-Hp(s,c,p),C.push(zp[l])):84===l?(x=Hp(e,p,f),E=Hp(e,p,c),C.push(zp[l])):89===l?(w=1-Hp(s,h,f),m=Hp(s,p,f),C.push(Vp[l])):81===l?(w=Hp(e,f,h),m=1-Hp(e,f,p),C.push(Vp[l])):96===l?(w=Hp(s,f,h),b=Hp(e,f,h),E=Hp(e,p,c),v=Hp(s,c,h),C.push(Gp[l]),C.push(Bp[l])):74===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),E=1-Hp(s,c,p),v=1-Hp(e,h,c),C.push(Gp[l]),C.push(Bp[l])):24===l?(w=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),_=Hp(e,c,h),C.push(Gp[l]),C.push(Vp[l])):146===l?(w=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),_=1-Hp(s,h,c),C.push(Gp[l]),C.push(Vp[l])):6===l?(b=1-Hp(e,h,f),x=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),C.push(Bp[l]),C.push(zp[l])):164===l?(b=Hp(s,f,h),x=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),C.push(Bp[l]),C.push(zp[l])):129===l?(m=1-Hp(e,f,p),S=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(Vp[l]),C.push(Up[l])):41===l?(m=Hp(s,p,f),S=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h),C.push(Vp[l]),C.push(Up[l])):66===l?(x=1-Hp(e,f,p),m=1-Hp(s,f,p),E=1-Hp(s,c,p),v=1-Hp(e,h,c),C.push(zp[l]),C.push(Vp[l])):104===l?(x=Hp(s,p,f),m=Hp(e,p,f),E=Hp(e,p,c),v=Hp(s,c,h),C.push(Vp[l]),C.push(qp[l])):144===l?(w=Hp(e,f,h),S=Hp(e,p,c),E=Hp(s,p,c),_=1-Hp(s,h,c),C.push(Gp[l]),C.push(Xp[l])):26===l?(w=1-Hp(s,h,f),S=1-Hp(s,c,p),E=1-Hp(e,c,p),_=Hp(e,c,h),C.push(Gp[l]),C.push(Xp[l])):36===l?(b=Hp(s,f,h),x=Hp(e,p,f),v=Hp(e,c,h),_=Hp(s,c,h),C.push(Bp[l]),C.push(zp[l])):134===l?(b=1-Hp(e,h,f),x=1-Hp(s,f,p),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(Bp[l]),C.push(zp[l])):9===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),m=Hp(s,p,f),S=1-Hp(e,c,p),C.push(Gp[l]),C.push(Bp[l])):161===l?(w=Hp(s,f,h),b=Hp(e,f,h),m=1-Hp(e,f,p),S=Hp(s,p,c),C.push(Gp[l]),C.push(Bp[l])):37===l?(b=Hp(s,f,h),S=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h),C.push(Bp[l]),C.push(Up[l])):133===l?(b=1-Hp(e,h,f),S=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(Bp[l]),C.push(Up[l])):148===l?(x=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),_=1-Hp(s,h,c),C.push(zp[l]),C.push(Xp[l])):22===l?(x=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),_=Hp(e,c,h),C.push(zp[l]),C.push(Xp[l])):82===l?(w=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),E=1-Hp(s,c,p),C.push(Gp[l]),C.push(Vp[l])):88===l?(w=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),E=Hp(e,p,c),C.push(Gp[l]),C.push(Vp[l])):73===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),m=Hp(s,p,f),v=1-Hp(e,h,c),C.push(Gp[l]),C.push(Bp[l])):97===l?(w=Hp(s,f,h),b=Hp(e,f,h),m=1-Hp(e,f,p),v=Hp(s,c,h),C.push(Gp[l]),C.push(Bp[l])):145===l?(w=Hp(e,f,h),m=1-Hp(e,f,p),S=Hp(s,p,c),_=1-Hp(s,h,c),C.push(Gp[l]),C.push(Up[l])):25===l?(w=1-Hp(s,h,f),m=Hp(s,p,f),S=1-Hp(e,c,p),_=Hp(e,c,h),C.push(Gp[l]),C.push(Up[l])):70===l?(b=1-Hp(e,h,f),x=1-Hp(s,f,p),E=1-Hp(s,c,p),v=1-Hp(e,h,c),C.push(Bp[l]),C.push(zp[l])):100===l?(b=Hp(s,f,h),x=Hp(e,p,f),E=Hp(e,p,c),v=Hp(s,c,h),C.push(Bp[l]),C.push(zp[l])):34===l?(0===g?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)):(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)),C.push(Gp[l]),C.push(Bp[l]),C.push(Up[l]),C.push(Xp[l])):35===l?(4===g?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)):(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)),C.push(Gp[l]),C.push(Bp[l]),C.push(Vp[l]),C.push(Xp[l])):136===l?(0===g?(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)):(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)),C.push(Gp[l]),C.push(Bp[l]),C.push(Up[l]),C.push(Xp[l])):153===l?(0===g?(w=Hp(e,f,h),m=1-Hp(e,f,p),S=1-Hp(e,c,p),_=Hp(e,c,h)):(w=1-Hp(s,h,f),m=Hp(s,p,f),S=Hp(s,p,c),_=1-Hp(s,h,c)),C.push(Gp[l]),C.push(Vp[l])):102===l?(0===g?(b=1-Hp(e,h,f),x=Hp(e,p,f),E=Hp(e,p,c),v=1-Hp(e,h,c)):(b=Hp(s,f,h),x=1-Hp(s,f,p),E=1-Hp(s,c,p),v=Hp(s,c,h)),C.push(Bp[l]),C.push(Xp[l])):155===l?(4===g?(w=Hp(e,f,h),m=1-Hp(e,f,p),S=1-Hp(e,c,p),_=Hp(e,c,h)):(w=1-Hp(s,h,f),m=Hp(s,p,f),S=Hp(s,p,c),_=1-Hp(s,h,c)),C.push(Gp[l]),C.push(Up[l])):103===l?(4===g?(b=1-Hp(e,h,f),x=Hp(e,p,f),E=Hp(e,p,c),v=1-Hp(e,h,c)):(b=Hp(s,f,h),x=1-Hp(s,f,p),E=1-Hp(s,c,p),v=Hp(s,c,h)),C.push(Bp[l]),C.push(zp[l])):152===l?(0===g?(w=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),_=Hp(e,c,h)):(w=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),_=1-Hp(s,h,c)),C.push(Gp[l]),C.push(zp[l]),C.push(Vp[l])):156===l?(4===g?(w=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),_=Hp(e,c,h)):(w=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),_=1-Hp(s,h,c)),C.push(Gp[l]),C.push(Vp[l]),C.push(Xp[l])):137===l?(0===g?(w=Hp(s,f,h),b=Hp(e,f,h),m=1-Hp(e,f,p),S=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)):(w=1-Hp(e,h,f),b=1-Hp(s,h,f),m=Hp(s,p,f),S=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)),C.push(Gp[l]),C.push(Bp[l]),C.push(Vp[l])):139===l?(4===g?(w=Hp(s,f,h),b=Hp(e,f,h),m=1-Hp(e,f,p),S=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)):(w=1-Hp(e,h,f),b=1-Hp(s,h,f),m=Hp(s,p,f),S=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)),C.push(Gp[l]),C.push(Bp[l]),C.push(Up[l])):98===l?(0===g?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),E=Hp(e,p,c),v=1-Hp(e,h,c)):(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),E=1-Hp(s,c,p),v=Hp(s,c,h)),C.push(Gp[l]),C.push(Bp[l]),C.push(Xp[l])):99===l?(4===g?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),E=Hp(e,p,c),v=1-Hp(e,h,c)):(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),E=1-Hp(s,c,p),v=Hp(s,c,h)),C.push(Gp[l]),C.push(Bp[l]),C.push(Vp[l])):38===l?(0===g?(b=1-Hp(e,h,f),x=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)):(b=Hp(s,f,h),x=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)),C.push(Bp[l]),C.push(Up[l]),C.push(Xp[l])):39===l?(4===g?(b=1-Hp(e,h,f),x=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)):(b=Hp(s,f,h),x=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)),C.push(Bp[l]),C.push(zp[l]),C.push(Xp[l])):85===l&&(w=1,b=0,x=1,m=0,S=0,E=1,v=0,_=1),(v<0||v>1||_<0||_>1||w<0||w>1||x<0||x>1||S<0||S>1||E<0||E>1)&&console.log("MarchingSquaresJS-isoBands: "+l+" "+d+" "+c+","+h+","+f+","+p+" "+g+" "+v+" "+_+" "+w+" "+b+" "+x+" "+m+" "+S+" "+E),o.cells[a][u]={cval:l,cval_real:d,flipped:g,topleft:v,topright:_,righttop:w,rightbottom:b,bottomright:x,bottomleft:m,leftbottom:S,lefttop:E,edges:C}}}}}return o}(t,e,n);return ep.polygons?(ep.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],n=0;return t.cells.forEach(function(t,r){t.forEach(function(t,i){if(void 0!==t){var o=Yp[t.cval](t);"object"==typeof o&&Zp(o)?"object"==typeof o[0]&&Zp(o[0])?"object"==typeof o[0][0]&&Zp(o[0][0])?o.forEach(function(t){t.forEach(function(t){t[0]+=i,t[1]+=r}),e[n++]=t}):(o.forEach(function(t){t[0]+=i,t[1]+=r}),e[n++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),e}(l)):(ep.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],n=t.rows,r=t.cols,i=[],o=0;o<n;o++)for(var s=0;s<r;s++)if(void 0!==t.cells[o][s]&&t.cells[o][s].edges.length>0){var a=Jp(t.cells[o][s]),u=null,l=s,c=o;null!==a&&i.push([a.p[0]+l,a.p[1]+c]);do{if(null===(u=$p(t.cells[c][l],a.x,a.y,a.o)))break;if(i.push([u.p[0]+l,u.p[1]+c]),l+=u.x,a=u,(c+=u.y)<0||c>=n||l<0||l>=r||void 0===t.cells[c][l]){var h=Kp(t,l-=u.x,c-=u.y,u.x,u.y,u.o);if(null===h)break;h.path.forEach(function(t){i.push(t)}),l=h.i,c=h.j,a=h}}while(void 0!==t.cells[c][l]&&t.cells[c][l].edges.length>0);e.push(i),i=[],t.cells[o][s].edges.length>0&&s--}return e}(l)),"function"==typeof ep.successCallback&&ep.successCallback(u),u}var rp=64,ip=16,op=4,sp=1,ap=[],up=[],lp=[],cp=[],hp=[],fp=[],pp=[],dp=[],gp=[],yp=[],vp=[],_p=[],mp=[],xp=[],wp=[],bp=[],Ep=[],Sp=[],Cp=[],Pp=[],Ip=[],Mp=[],Op=[],Lp=[];pp[85]=yp[85]=-1,dp[85]=vp[85]=0,gp[85]=_p[85]=1,Cp[85]=Mp[85]=1,Pp[85]=Op[85]=0,Ip[85]=Lp[85]=1,ap[85]=cp[85]=0,up[85]=hp[85]=-1,lp[85]=wp[85]=0,bp[85]=mp[85]=0,Ep[85]=xp[85]=1,fp[85]=Sp[85]=1,Mp[1]=Mp[169]=0,Op[1]=Op[169]=-1,Lp[1]=Lp[169]=0,mp[1]=mp[169]=-1,xp[1]=xp[169]=0,wp[1]=wp[169]=0,yp[4]=yp[166]=0,vp[4]=vp[166]=-1,_p[4]=_p[166]=1,bp[4]=bp[166]=1,Ep[4]=Ep[166]=0,Sp[4]=Sp[166]=0,pp[16]=pp[154]=0,dp[16]=dp[154]=1,gp[16]=gp[154]=1,cp[16]=cp[154]=1,hp[16]=hp[154]=0,fp[16]=fp[154]=1,Cp[64]=Cp[106]=0,Pp[64]=Pp[106]=1,Ip[64]=Ip[106]=0,ap[64]=ap[106]=-1,up[64]=up[106]=0,lp[64]=lp[106]=1,Cp[2]=Cp[168]=0,Pp[2]=Pp[168]=-1,Ip[2]=Ip[168]=1,Mp[2]=Mp[168]=0,Op[2]=Op[168]=-1,Lp[2]=Lp[168]=0,mp[2]=mp[168]=-1,xp[2]=xp[168]=0,wp[2]=wp[168]=0,bp[2]=bp[168]=-1,Ep[2]=Ep[168]=0,Sp[2]=Sp[168]=1,pp[8]=pp[162]=0,dp[8]=dp[162]=-1,gp[8]=gp[162]=0,yp[8]=yp[162]=0,vp[8]=vp[162]=-1,_p[8]=_p[162]=1,mp[8]=mp[162]=1,xp[8]=xp[162]=0,wp[8]=wp[162]=1,bp[8]=bp[162]=1,Ep[8]=Ep[162]=0,Sp[8]=Sp[162]=0,pp[32]=pp[138]=0,dp[32]=dp[138]=1,gp[32]=gp[138]=1,yp[32]=yp[138]=0,vp[32]=vp[138]=1,_p[32]=_p[138]=0,ap[32]=ap[138]=1,up[32]=up[138]=0,lp[32]=lp[138]=0,cp[32]=cp[138]=1,hp[32]=hp[138]=0,fp[32]=fp[138]=1,Mp[128]=Mp[42]=0,Op[128]=Op[42]=1,Lp[128]=Lp[42]=1,Cp[128]=Cp[42]=0,Pp[128]=Pp[42]=1,Ip[128]=Ip[42]=0,ap[128]=ap[42]=-1,up[128]=up[42]=0,lp[128]=lp[42]=1,cp[128]=cp[42]=-1,hp[128]=hp[42]=0,fp[128]=fp[42]=0,yp[5]=yp[165]=-1,vp[5]=vp[165]=0,_p[5]=_p[165]=0,Mp[5]=Mp[165]=1,Op[5]=Op[165]=0,Lp[5]=Lp[165]=0,bp[20]=bp[150]=0,Ep[20]=Ep[150]=1,Sp[20]=Sp[150]=1,cp[20]=cp[150]=0,hp[20]=hp[150]=-1,fp[20]=fp[150]=1,pp[80]=pp[90]=-1,dp[80]=dp[90]=0,gp[80]=gp[90]=1,Cp[80]=Cp[90]=1,Pp[80]=Pp[90]=0,Ip[80]=Ip[90]=1,mp[65]=mp[105]=0,xp[65]=xp[105]=1,wp[65]=wp[105]=0,ap[65]=ap[105]=0,up[65]=up[105]=-1,lp[65]=lp[105]=0,pp[160]=pp[10]=-1,dp[160]=dp[10]=0,gp[160]=gp[10]=1,yp[160]=yp[10]=-1,vp[160]=vp[10]=0,_p[160]=_p[10]=0,Mp[160]=Mp[10]=1,Op[160]=Op[10]=0,Lp[160]=Lp[10]=0,Cp[160]=Cp[10]=1,Pp[160]=Pp[10]=0,Ip[160]=Ip[10]=1,bp[130]=bp[40]=0,Ep[130]=Ep[40]=1,Sp[130]=Sp[40]=1,mp[130]=mp[40]=0,xp[130]=xp[40]=1,wp[130]=wp[40]=0,ap[130]=ap[40]=0,up[130]=up[40]=-1,lp[130]=lp[40]=0,cp[130]=cp[40]=0,hp[130]=hp[40]=-1,fp[130]=fp[40]=1,yp[37]=yp[133]=0,vp[37]=vp[133]=1,_p[37]=_p[133]=1,Mp[37]=Mp[133]=0,Op[37]=Op[133]=1,Lp[37]=Lp[133]=0,ap[37]=ap[133]=-1,up[37]=up[133]=0,lp[37]=lp[133]=0,cp[37]=cp[133]=1,hp[37]=hp[133]=0,fp[37]=fp[133]=0,bp[148]=bp[22]=-1,Ep[148]=Ep[22]=0,Sp[148]=Sp[22]=0,Mp[148]=Mp[22]=0,Op[148]=Op[22]=-1,Lp[148]=Lp[22]=1,Cp[148]=Cp[22]=0,Pp[148]=Pp[22]=1,Ip[148]=Ip[22]=1,cp[148]=cp[22]=-1,hp[148]=hp[22]=0,fp[148]=fp[22]=1,pp[82]=pp[88]=0,dp[82]=dp[88]=-1,gp[82]=gp[88]=1,bp[82]=bp[88]=1,Ep[82]=Ep[88]=0,Sp[82]=Sp[88]=1,mp[82]=mp[88]=-1,xp[82]=xp[88]=0,wp[82]=wp[88]=1,Cp[82]=Cp[88]=0,Pp[82]=Pp[88]=-1,Ip[82]=Ip[88]=0,pp[73]=pp[97]=0,dp[73]=dp[97]=1,gp[73]=gp[97]=0,yp[73]=yp[97]=0,vp[73]=vp[97]=-1,_p[73]=_p[97]=0,mp[73]=mp[97]=1,xp[73]=xp[97]=0,wp[73]=wp[97]=0,ap[73]=ap[97]=1,up[73]=up[97]=0,lp[73]=lp[97]=1,pp[145]=pp[25]=0,dp[145]=dp[25]=-1,gp[145]=gp[25]=0,mp[145]=mp[25]=1,xp[145]=xp[25]=0,wp[145]=wp[25]=1,Mp[145]=Mp[25]=0,Op[145]=Op[25]=1,Lp[145]=Lp[25]=1,cp[145]=cp[25]=-1,hp[145]=hp[25]=0,fp[145]=fp[25]=0,yp[70]=yp[100]=0,vp[70]=vp[100]=1,_p[70]=_p[100]=0,bp[70]=bp[100]=-1,Ep[70]=Ep[100]=0,Sp[70]=Sp[100]=1,Cp[70]=Cp[100]=0,Pp[70]=Pp[100]=-1,Ip[70]=Ip[100]=1,ap[70]=ap[100]=1,up[70]=up[100]=0,lp[70]=lp[100]=0,yp[101]=yp[69]=0,vp[101]=vp[69]=1,_p[101]=_p[69]=0,ap[101]=ap[69]=1,up[101]=up[69]=0,lp[101]=lp[69]=0,Mp[149]=Mp[21]=0,Op[149]=Op[21]=1,Lp[149]=Lp[21]=1,cp[149]=cp[21]=-1,hp[149]=hp[21]=0,fp[149]=fp[21]=0,bp[86]=bp[84]=-1,Ep[86]=Ep[84]=0,Sp[86]=Sp[84]=1,Cp[86]=Cp[84]=0,Pp[86]=Pp[84]=-1,Ip[86]=Ip[84]=1,pp[89]=pp[81]=0,dp[89]=dp[81]=-1,gp[89]=gp[81]=0,mp[89]=mp[81]=1,xp[89]=xp[81]=0,wp[89]=wp[81]=1,pp[96]=pp[74]=0,dp[96]=dp[74]=1,gp[96]=gp[74]=0,yp[96]=yp[74]=-1,vp[96]=vp[74]=0,_p[96]=_p[74]=1,Cp[96]=Cp[74]=1,Pp[96]=Pp[74]=0,Ip[96]=Ip[74]=0,ap[96]=ap[74]=1,up[96]=up[74]=0,lp[96]=lp[74]=1,pp[24]=pp[146]=0,dp[24]=dp[146]=-1,gp[24]=gp[146]=1,bp[24]=bp[146]=1,Ep[24]=Ep[146]=0,Sp[24]=Sp[146]=1,mp[24]=mp[146]=0,xp[24]=xp[146]=1,wp[24]=wp[146]=1,cp[24]=cp[146]=0,hp[24]=hp[146]=-1,fp[24]=fp[146]=0,yp[6]=yp[164]=-1,vp[6]=vp[164]=0,_p[6]=_p[164]=1,bp[6]=bp[164]=-1,Ep[6]=Ep[164]=0,Sp[6]=Sp[164]=0,Mp[6]=Mp[164]=0,Op[6]=Op[164]=-1,Lp[6]=Lp[164]=1,Cp[6]=Cp[164]=1,Pp[6]=Pp[164]=0,Ip[6]=Ip[164]=0,mp[129]=mp[41]=0,xp[129]=xp[41]=1,wp[129]=wp[41]=1,Mp[129]=Mp[41]=0,Op[129]=Op[41]=1,Lp[129]=Lp[41]=0,ap[129]=ap[41]=-1,up[129]=up[41]=0,lp[129]=lp[41]=0,cp[129]=cp[41]=0,hp[129]=hp[41]=-1,fp[129]=fp[41]=0,bp[66]=bp[104]=0,Ep[66]=Ep[104]=1,Sp[66]=Sp[104]=0,mp[66]=mp[104]=-1,xp[66]=xp[104]=0,wp[66]=wp[104]=1,Cp[66]=Cp[104]=0,Pp[66]=Pp[104]=-1,Ip[66]=Ip[104]=0,ap[66]=ap[104]=0,up[66]=up[104]=-1,lp[66]=lp[104]=1,pp[144]=pp[26]=-1,dp[144]=dp[26]=0,gp[144]=gp[26]=0,Mp[144]=Mp[26]=1,Op[144]=Op[26]=0,Lp[144]=Lp[26]=1,Cp[144]=Cp[26]=0,Pp[144]=Pp[26]=1,Ip[144]=Ip[26]=1,cp[144]=cp[26]=-1,hp[144]=hp[26]=0,fp[144]=fp[26]=1,yp[36]=yp[134]=0,vp[36]=vp[134]=1,_p[36]=_p[134]=1,bp[36]=bp[134]=0,Ep[36]=Ep[134]=1,Sp[36]=Sp[134]=0,ap[36]=ap[134]=0,up[36]=up[134]=-1,lp[36]=lp[134]=1,cp[36]=cp[134]=1,hp[36]=hp[134]=0,fp[36]=fp[134]=0,pp[9]=pp[161]=-1,dp[9]=dp[161]=0,gp[9]=gp[161]=0,yp[9]=yp[161]=0,vp[9]=vp[161]=-1,_p[9]=_p[161]=0,mp[9]=mp[161]=1,xp[9]=xp[161]=0,wp[9]=wp[161]=0,Mp[9]=Mp[161]=1,Op[9]=Op[161]=0,Lp[9]=Lp[161]=1,pp[136]=0,dp[136]=1,gp[136]=1,yp[136]=0,vp[136]=1,_p[136]=0,bp[136]=-1,Ep[136]=0,Sp[136]=1,mp[136]=-1,xp[136]=0,wp[136]=0,Mp[136]=0,Op[136]=-1,Lp[136]=0,Cp[136]=0,Pp[136]=-1,Ip[136]=1,ap[136]=1,up[136]=0,lp[136]=0,cp[136]=1,hp[136]=0,fp[136]=1,pp[34]=0,dp[34]=-1,gp[34]=0,yp[34]=0,vp[34]=-1,_p[34]=1,bp[34]=1,Ep[34]=0,Sp[34]=0,mp[34]=1,xp[34]=0,wp[34]=1,Mp[34]=0,Op[34]=1,Lp[34]=1,Cp[34]=0,Pp[34]=1,Ip[34]=0,ap[34]=-1,up[34]=0,lp[34]=1,cp[34]=-1,hp[34]=0,fp[34]=0,pp[35]=0,dp[35]=1,gp[35]=1,yp[35]=0,vp[35]=-1,_p[35]=1,bp[35]=1,Ep[35]=0,Sp[35]=0,mp[35]=-1,xp[35]=0,wp[35]=0,Mp[35]=0,Op[35]=-1,Lp[35]=0,Cp[35]=0,Pp[35]=1,Ip[35]=0,ap[35]=-1,up[35]=0,lp[35]=1,cp[35]=1,hp[35]=0,fp[35]=1,pp[153]=0,dp[153]=1,gp[153]=1,mp[153]=-1,xp[153]=0,wp[153]=0,Mp[153]=0,Op[153]=-1,Lp[153]=0,cp[153]=1,hp[153]=0,fp[153]=1,yp[102]=0,vp[102]=-1,_p[102]=1,bp[102]=1,Ep[102]=0,Sp[102]=0,Cp[102]=0,Pp[102]=1,Ip[102]=0,ap[102]=-1,up[102]=0,lp[102]=1,pp[155]=0,dp[155]=-1,gp[155]=0,mp[155]=1,xp[155]=0,wp[155]=1,Mp[155]=0,Op[155]=1,Lp[155]=1,cp[155]=-1,hp[155]=0,fp[155]=0,yp[103]=0,vp[103]=1,_p[103]=0,bp[103]=-1,Ep[103]=0,Sp[103]=1,Cp[103]=0,Pp[103]=-1,Ip[103]=1,ap[103]=1,up[103]=0,lp[103]=0,pp[152]=0,dp[152]=1,gp[152]=1,bp[152]=-1,Ep[152]=0,Sp[152]=1,mp[152]=-1,xp[152]=0,wp[152]=0,Mp[152]=0,Op[152]=-1,Lp[152]=0,Cp[152]=0,Pp[152]=-1,Ip[152]=1,cp[152]=1,hp[152]=0,fp[152]=1,pp[156]=0,dp[156]=-1,gp[156]=1,bp[156]=1,Ep[156]=0,Sp[156]=1,mp[156]=-1,xp[156]=0,wp[156]=0,Mp[156]=0,Op[156]=-1,Lp[156]=0,Cp[156]=0,Pp[156]=1,Ip[156]=1,cp[156]=-1,hp[156]=0,fp[156]=1,pp[137]=0,dp[137]=1,gp[137]=1,yp[137]=0,vp[137]=1,_p[137]=0,mp[137]=-1,xp[137]=0,wp[137]=0,Mp[137]=0,Op[137]=-1,Lp[137]=0,ap[137]=1,up[137]=0,lp[137]=0,cp[137]=1,hp[137]=0,fp[137]=1,pp[139]=0,dp[139]=1,gp[139]=1,yp[139]=0,vp[139]=-1,_p[139]=0,mp[139]=1,xp[139]=0,wp[139]=0,Mp[139]=0,Op[139]=1,Lp[139]=0,ap[139]=-1,up[139]=0,lp[139]=0,cp[139]=1,hp[139]=0,fp[139]=1,pp[98]=0,dp[98]=-1,gp[98]=0,yp[98]=0,vp[98]=-1,_p[98]=1,bp[98]=1,Ep[98]=0,Sp[98]=0,mp[98]=1,xp[98]=0,wp[98]=1,Cp[98]=0,Pp[98]=1,Ip[98]=0,ap[98]=-1,up[98]=0,lp[98]=1,pp[99]=0,dp[99]=1,gp[99]=0,yp[99]=0,vp[99]=-1,_p[99]=1,bp[99]=1,Ep[99]=0,Sp[99]=0,mp[99]=-1,xp[99]=0,wp[99]=1,Cp[99]=0,Pp[99]=-1,Ip[99]=0,ap[99]=1,up[99]=0,lp[99]=1,yp[38]=0,vp[38]=-1,_p[38]=1,bp[38]=1,Ep[38]=0,Sp[38]=0,Mp[38]=0,Op[38]=1,Lp[38]=1,Cp[38]=0,Pp[38]=1,Ip[38]=0,ap[38]=-1,up[38]=0,lp[38]=1,cp[38]=-1,hp[38]=0,fp[38]=0,yp[39]=0,vp[39]=1,_p[39]=1,bp[39]=-1,Ep[39]=0,Sp[39]=0,Mp[39]=0,Op[39]=-1,Lp[39]=1,Cp[39]=0,Pp[39]=1,Ip[39]=0,ap[39]=-1,up[39]=0,lp[39]=1,cp[39]=1,hp[39]=0,fp[39]=0;var kp=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},Rp=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},Tp=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},Ap=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},Np=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},Fp=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},Dp=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},jp=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Gp=[],Bp=[],zp=[],Vp=[],Up=[],Xp=[],qp=[],Wp=[];Vp[1]=Up[1]=18,Vp[169]=Up[169]=18,zp[4]=Bp[4]=12,zp[166]=Bp[166]=12,Gp[16]=Wp[16]=4,Gp[154]=Wp[154]=4,Xp[64]=qp[64]=22,Xp[106]=qp[106]=22,zp[2]=Xp[2]=17,Vp[2]=Up[2]=18,zp[168]=Xp[168]=17,Vp[168]=Up[168]=18,Gp[8]=Vp[8]=9,Bp[8]=zp[8]=12,Gp[162]=Vp[162]=9,Bp[162]=zp[162]=12,Gp[32]=Wp[32]=4,Bp[32]=qp[32]=1,Gp[138]=Wp[138]=4,Bp[138]=qp[138]=1,Up[128]=Wp[128]=21,Xp[128]=qp[128]=22,Up[42]=Wp[42]=21,Xp[42]=qp[42]=22,Bp[5]=Up[5]=14,Bp[165]=Up[165]=14,zp[20]=Wp[20]=6,zp[150]=Wp[150]=6,Gp[80]=Xp[80]=11,Gp[90]=Xp[90]=11,Vp[65]=qp[65]=3,Vp[105]=qp[105]=3,Gp[160]=Xp[160]=11,Bp[160]=Up[160]=14,Gp[10]=Xp[10]=11,Bp[10]=Up[10]=14,zp[130]=Wp[130]=6,Vp[130]=qp[130]=3,zp[40]=Wp[40]=6,Vp[40]=qp[40]=3,Bp[101]=qp[101]=1,Bp[69]=qp[69]=1,Up[149]=Wp[149]=21,Up[21]=Wp[21]=21,zp[86]=Xp[86]=17,zp[84]=Xp[84]=17,Gp[89]=Vp[89]=9,Gp[81]=Vp[81]=9,Gp[96]=qp[96]=0,Bp[96]=Xp[96]=15,Gp[74]=qp[74]=0,Bp[74]=Xp[74]=15,Gp[24]=zp[24]=8,Vp[24]=Wp[24]=7,Gp[146]=zp[146]=8,Vp[146]=Wp[146]=7,Bp[6]=Xp[6]=15,zp[6]=Up[6]=16,Bp[164]=Xp[164]=15,zp[164]=Up[164]=16,Vp[129]=Wp[129]=7,Up[129]=qp[129]=20,Vp[41]=Wp[41]=7,Up[41]=qp[41]=20,zp[66]=qp[66]=2,Vp[66]=Xp[66]=19,zp[104]=qp[104]=2,Vp[104]=Xp[104]=19,Gp[144]=Up[144]=10,Xp[144]=Wp[144]=23,Gp[26]=Up[26]=10,Xp[26]=Wp[26]=23,Bp[36]=Wp[36]=5,zp[36]=qp[36]=2,Bp[134]=Wp[134]=5,zp[134]=qp[134]=2,Gp[9]=Up[9]=10,Bp[9]=Vp[9]=13,Gp[161]=Up[161]=10,Bp[161]=Vp[161]=13,Bp[37]=Wp[37]=5,Up[37]=qp[37]=20,Bp[133]=Wp[133]=5,Up[133]=qp[133]=20,zp[148]=Up[148]=16,Xp[148]=Wp[148]=23,zp[22]=Up[22]=16,Xp[22]=Wp[22]=23,Gp[82]=zp[82]=8,Vp[82]=Xp[82]=19,Gp[88]=zp[88]=8,Vp[88]=Xp[88]=19,Gp[73]=qp[73]=0,Bp[73]=Vp[73]=13,Gp[97]=qp[97]=0,Bp[97]=Vp[97]=13,Gp[145]=Vp[145]=9,Up[145]=Wp[145]=21,Gp[25]=Vp[25]=9,Up[25]=Wp[25]=21,Bp[70]=qp[70]=1,zp[70]=Xp[70]=17,Bp[100]=qp[100]=1,zp[100]=Xp[100]=17,Gp[34]=Vp[34]=9,Bp[34]=zp[34]=12,Up[34]=Wp[34]=21,Xp[34]=qp[34]=22,Gp[136]=Wp[136]=4,Bp[136]=qp[136]=1,zp[136]=Xp[136]=17,Vp[136]=Up[136]=18,Gp[35]=Wp[35]=4,Bp[35]=zp[35]=12,Vp[35]=Up[35]=18,Xp[35]=qp[35]=22,Gp[153]=Wp[153]=4,Vp[153]=Up[153]=18,Bp[102]=zp[102]=12,Xp[102]=qp[102]=22,Gp[155]=Vp[155]=9,Up[155]=Wp[155]=23,Bp[103]=qp[103]=1,zp[103]=Xp[103]=17,Gp[152]=Wp[152]=4,zp[152]=Xp[152]=17,Vp[152]=Up[152]=18,Gp[156]=zp[156]=8,Vp[156]=Up[156]=18,Xp[156]=Wp[156]=23,Gp[137]=Wp[137]=4,Bp[137]=qp[137]=1,Vp[137]=Up[137]=18,Gp[139]=Wp[139]=4,Bp[139]=Vp[139]=13,Up[139]=qp[139]=20,Gp[98]=Vp[98]=9,Bp[98]=zp[98]=12,Xp[98]=qp[98]=22,Gp[99]=qp[99]=0,Bp[99]=zp[99]=12,Vp[99]=Xp[99]=19,Bp[38]=zp[38]=12,Up[38]=Wp[38]=21,Xp[38]=qp[38]=22,Bp[39]=Wp[39]=5,zp[39]=Up[39]=16,Xp[39]=qp[39]=22;var Yp=[];function Hp(t,e,n){return(t-e)/(n-e)}function Zp(t){return t.constructor.toString().indexOf("Array")>-1}function Kp(t,e,n,r,i,o){for(var s=t.cells[n][e],a=s.cval_real,u=e+r,l=n+i,c=[],h=!1;!h;){if(void 0===t.cells[l]||void 0===t.cells[l][u])if(l-=i,u-=r,a=(s=t.cells[l][u]).cval_real,-1===i)if(0===o)if(a&sp)c.push([u,l]),r=-1,i=0,o=0;else{if(!(a&op)){c.push([u+s.bottomright,l]),r=0,i=1,o=1,h=!0;break}c.push([u+1,l]),r=1,i=0,o=0}else{if(!(a&sp)){if(a&op){c.push([u+s.bottomright,l]),r=0,i=1,o=1,h=!0;break}c.push([u+s.bottomleft,l]),r=0,i=1,o=0,h=!0;break}c.push([u,l]),r=-1,i=0,o=0}else if(1===i)if(0===o){if(!(a&ip)){if(a&rp){c.push([u+s.topleft,l+1]),r=0,i=-1,o=0,h=!0;break}c.push([u+s.topright,l+1]),r=0,i=-1,o=1,h=!0;break}c.push([u+1,l+1]),r=1,i=0,o=1}else c.push([u+1,l+1]),r=1,i=0,o=1;else if(-1===r)if(0===o){if(!(a&rp)){if(a&sp){c.push([u,l+s.leftbottom]),r=1,i=0,o=0,h=!0;break}c.push([u,l+s.lefttop]),r=1,i=0,o=1,h=!0;break}c.push([u,l+1]),r=0,i=1,o=0}else{if(!(a&rp)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([u,l+1]),r=0,i=1,o=0}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&op)){c.push([u+1,l+s.rightbottom]),r=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),r=0,i=-1,o=1}else{if(!(a&op)){if(a&ip){c.push([u+1,l+s.righttop]),r=-1,i=0,o=1;break}c.push([u+1,l+s.rightbottom]),r=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),r=0,i=-1,o=1}}else if(a=(s=t.cells[l][u]).cval_real,-1===r)if(0===o)if(void 0!==t.cells[l-1]&&void 0!==t.cells[l-1][u])r=0,i=-1,o=1;else{if(!(a&sp)){c.push([u+s.bottomright,l]),r=0,i=1,o=1,h=!0;break}c.push([u,l])}else{if(!(a&rp)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+l);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===r){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l+1]&&void 0!==t.cells[l+1][u])r=0,i=1,o=0;else{if(!(a&ip)){c.push([u+s.topleft,l+1]),r=0,i=-1,o=0,h=!0;break}c.push([u+1,l+1]),r=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u+1])r=1,i=0,o=1;else{if(!(a&op)){c.push([u+1,l+s.righttop]),r=-1,i=0,o=1,h=!0;break}c.push([u+1,l]),r=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u-1])r=-1,i=0,o=0;else{if(!(a&rp)){c.push([u,l+s.leftbottom]),r=1,i=0,o=0,h=!0;break}c.push([u,l+1]),r=0,i=1,o=0}}if(l+=i,(u+=r)===e&&l===n)break}return{path:c,i:u,j:l,x:r,y:i,o:o}}function Jp(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&ip?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&op?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&op?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&sp?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&ip?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&op?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&op?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&sp?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&op?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&sp?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&sp?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&rp?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&op?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&sp?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&sp?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&rp?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&op?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&rp?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&sp?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&rp?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&rp?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&ip?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&rp?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&ip?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}function $p(t,e,n,r){var i,o,s,a,u,l=t.cval;switch(e){case-1:if(0===r)i=Bp[l],s=yp[l],a=vp[l],u=_p[l];else i=Gp[l],s=pp[l],a=dp[l],u=gp[l];break;case 1:if(0===r)i=Up[l],s=Mp[l],a=Op[l],u=Lp[l];else i=Xp[l],s=Cp[l],a=Pp[l],u=Ip[l];break;default:switch(n){case-1:if(0===r)i=qp[l],s=ap[l],a=up[l],u=lp[l];else i=Wp[l],s=cp[l],a=hp[l],u=fp[l];break;case 1:if(0===r)i=Vp[l],s=mp[l],a=xp[l],u=wp[l];else i=zp[l],s=bp[l],a=Ep[l],u=Sp[l]}}if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var n=e+1;n<t.edges.length;n++)t.edges[n-1]=t.edges[n];t.edges.pop()}(t,o),l=t.cval_real,i){case 0:l&ip?(e=t.topleft,n=1):(e=1,n=t.righttop);break;case 1:l&op?(e=1,n=t.rightbottom):(e=t.topleft,n=1);break;case 2:l&op?(e=t.topleft,n=1):(e=t.bottomright,n=0);break;case 3:l&sp?(e=t.bottomleft,n=0):(e=t.topleft,n=1);break;case 4:l&ip?(e=t.topright,n=1):(e=1,n=t.righttop);break;case 5:l&op?(e=1,n=t.rightbottom):(e=t.topright,n=1);break;case 6:l&op?(e=t.topright,n=1):(e=t.bottomright,n=0);break;case 7:l&sp?(e=t.bottomleft,n=0):(e=t.topright,n=1);break;case 8:l&op?(e=1,n=t.righttop):(e=t.bottomright,n=0);break;case 9:l&sp?(e=t.bottomleft,n=0):(e=1,n=t.righttop);break;case 10:l&sp?(e=1,n=t.righttop):(e=0,n=t.leftbottom);break;case 11:l&rp?(e=0,n=t.lefttop):(e=1,n=t.righttop);break;case 12:l&op?(e=1,n=t.rightbottom):(e=t.bottomright,n=0);break;case 13:l&sp?(e=t.bottomleft,n=0):(e=1,n=t.rightbottom);break;case 14:l&sp?(e=1,n=t.rightbottom):(e=0,n=t.leftbottom);break;case 15:l&rp?(e=0,n=t.lefttop):(e=1,n=t.rightbottom);break;case 16:l&op?(e=0,n=t.leftbottom):(e=t.bottomright,n=0);break;case 17:l&rp?(e=0,n=t.lefttop):(e=t.bottomright,n=0);break;case 18:l&sp?(e=t.bottomleft,n=0):(e=0,n=t.leftbottom);break;case 19:l&rp?(e=0,n=t.lefttop):(e=t.bottomleft,n=0);break;case 20:l&rp?(e=0,n=t.leftbottom):(e=t.topleft,n=1);break;case 21:l&ip?(e=t.topright,n=1):(e=0,n=t.leftbottom);break;case 22:l&rp?(e=0,n=t.lefttop):(e=t.topleft,n=1);break;case 23:l&ip?(e=t.topright,n=1):(e=0,n=t.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t),null}return void 0!==e&&void 0!==n&&void 0!==s&&void 0!==a&&void 0!==u||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(t),console.log(e+" "+n+" "+s+" "+a+" "+u)),{p:[e,n],x:s,y:a,o:u}}function Qp(t){var e=[],n=[];t.forEach(function(t){var r=Nh(Ja([t]));n.push(r),e.push({ring:t,area:r})}),n.sort(function(t,e){return e-t});var r=[];return n.forEach(function(t){for(var n=0;n<e.length;n++)if(e[n].area===t){r.push(e[n].ring),e.splice(n,1);break}}),r}function td(t){for(var e=t.map(function(t){return{lrCoordinates:t,grouped:!1}}),n=[];!nd(e);)for(var r=0;r<e.length;r++)if(!e[r].grouped){var i=[];i.push(e[r].lrCoordinates),e[r].grouped=!0;for(var o=Ja([e[r].lrCoordinates]),s=r+1;s<e.length;s++){if(!e[s].grouped)ed(Ja([e[s].lrCoordinates]),o)&&(i.push(e[s].lrCoordinates),e[s].grouped=!0)}n.push(i)}return n}function ed(t,e){for(var n=dh(t),r=0;r<n.features.length;r++)if(!Jl(n.features[r],e))return!1;return!0}function nd(t){for(var e=0;e<t.length;e++)if(!1===t[e].grouped)return!1;return!0}Yp[1]=Yp[169]=kp,Yp[4]=Yp[166]=Rp,Yp[16]=Yp[154]=Tp,Yp[64]=Yp[106]=Ap,Yp[168]=Yp[2]=Np,Yp[162]=Yp[8]=Fp,Yp[138]=Yp[32]=Dp,Yp[42]=Yp[128]=jp,Yp[5]=Yp[165]=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},Yp[20]=Yp[150]=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},Yp[80]=Yp[90]=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},Yp[65]=Yp[105]=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Yp[160]=Yp[10]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},Yp[130]=Yp[40]=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},Yp[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},Yp[101]=Yp[69]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},Yp[149]=Yp[21]=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},Yp[86]=Yp[84]=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},Yp[89]=Yp[81]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},Yp[96]=Yp[74]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},Yp[24]=Yp[146]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},Yp[6]=Yp[164]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},Yp[129]=Yp[41]=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},Yp[66]=Yp[104]=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Yp[144]=Yp[26]=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Yp[36]=Yp[134]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},Yp[9]=Yp[161]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},Yp[37]=Yp[133]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},Yp[148]=Yp[22]=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Yp[82]=Yp[88]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},Yp[73]=Yp[97]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Yp[145]=Yp[25]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},Yp[70]=Yp[100]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Yp[34]=function(t){return[jp(t),Fp(t)]},Yp[35]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Yp[136]=function(t){return[Dp(t),Np(t)]},Yp[153]=function(t){return[Tp(t),kp(t)]},Yp[102]=function(t){return[Rp(t),Ap(t)]},Yp[155]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},Yp[103]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Yp[152]=function(t){return[Tp(t),Np(t)]},Yp[156]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Yp[137]=function(t){return[Dp(t),kp(t)]},Yp[139]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},Yp[98]=function(t){return[Fp(t),Ap(t)]},Yp[99]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Yp[38]=function(t){return[Rp(t),jp(t)]},Yp[39]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]};var rd=function(t,e,n){if(!yu(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(Uu(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!yu(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(o))throw new Error("breaksProperties is not an Array");var s=Qf(t,{zProperty:r,flip:!0}),a=function(t,e,n){for(var r=[],i=1;i<e.length;i++){var o=+e[i-1],s=+e[i],a=td(Qp(np(t,o,s-o))),u={};u.groupedRings=a,u[n]=o+"-"+s,r.push(u)}return r}(s,e,r);a=function(t,e,n){var r=Du(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,l=e.length-1,c=i/u,h=o/l,f=function(t){t[0]=t[0]*c+s,t[1]=t[1]*h+a};return t.forEach(function(t){t.groupedRings.forEach(function(t){t.forEach(function(t){t.forEach(f)})})}),t}(a,s,t);var u=a.map(function(t,e){if(o[e]&&!yu(o[e]))throw new Error("Each mappedProperty is required to be an Object");var n=Wu({},i,o[e]);return n[r]=t[r],iu(t.groupedRings,n)});return eu(u)};var id=function(t,e,n){if(!yu(n=n||{}))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("angle is required");return 0===e||(r||(r=hh(t)),!1!==i&&void 0!==i||(t=lc(t)),mu(t,function(t){var n=zf(r,t)+e,i=Sh(r,t),o=Gu(Vf(r,i,n));t[0]=o[0],t[1]=o[1]})),t};function od(t,e,n){var r="Point"===qu(t);return n=function(t,e){null==e&&(e="centroid");if(Array.isArray(e)||"object"==typeof e)return ju(e);var n=t.bbox?t.bbox:Du(t),r=n[0],i=n[1],o=n[2],s=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return Za([r,i]);case"se":case"southeast":case"eastsouth":case"bottomright":return Za([o,i]);case"nw":case"northwest":case"westnorth":case"topleft":return Za([r,s]);case"ne":case"northeast":case"eastnorth":case"topright":return Za([o,s]);case"center":return ch(t);case void 0:case null:case"centroid":return hh(t);default:throw new Error("invalid origin")}}(t,n),1===e||r||mu(t,function(t){var r=Sh(n,t),i=zf(n,t),o=Gu(Vf(n,r*e,i));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)}),t}var sd=function(t,e,n){if(!yu(n=n||{}))throw new Error("options is invalid");var r=n.origin,i=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(r)||"object"==typeof r;return!0!==i&&(t=lc(t)),"FeatureCollection"!==t.type||o?od(t,e,r):(Eu(t,function(n,i){t.features[i]=od(n,e,r)}),t)};var ad=function(t,e,n,r){if(!yu(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation,s=r.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0===e&&0===o)return t;if(null==n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n+=180),!1!==s&&void 0!==s||(t=lc(t)),mu(t,function(t){var r=Gu(Vf(t,e,n,{units:i}));t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)}),t};function ud(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function ld(t,e){return t[0]*e[1]-e[0]*t[1]}function cd(t,e){return!function(t,e){return 0===ld(ud(t),ud(e))}(t,e)&&function(t,e){var n,r,i=t[0],o=ud(t),s=e[0],a=ud(e),u=ld(o,a),l=function(t,e){return[t[0]+e[0],t[1]+e[1]]}(i,function(t,e){return[t*e[0],t*e[1]]}(ld((r=i,[(n=s)[0]-r[0],n[1]-r[1]]),a)/u,o));return l}(t,e)}function hd(t,e,n){var r=[],i=lu(e,n),o=Gu(t),s=[];return o.forEach(function(t,e){if(e!==o.length-1){var n=function(t,e,n){var r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=t[0]+n*(e[1]-t[1])/r,o=e[0]+n*(e[1]-t[1])/r,s=t[1]+n*(t[0]-e[0])/r,a=e[1]+n*(t[0]-e[0])/r;return[[i,s],[o,a]]}(t,o[e+1],i);if(r.push(n),e>0){var a=r[e-1],u=cd(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}}),Qa(s,t.properties)}var fd=function(t,e,n){if(!yu(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");var i=qu(t),o=t.properties;switch(i){case"LineString":return hd(t,e,r);case"MultiLineString":var s=[];return Mu(t,function(t){s.push(hd(t,e,r).geometry.coordinates)}),nu(s,o);default:throw new Error("geometry "+i+" is not supported")}};function pd(t,e,n){var r,i=e[0]-t[0],o=e[1]-t[1],s=n[0]-e[0],a=n[1]-e[1];return((r=i*a-s*o)>0)-(r<0)||+r}function dd(t,e){return e.geometry.coordinates[0].every(function(e){return Jl(Za(e),t)})}var gd=function(){function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return t.buildId=function(t){return t.join(",")},t.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},t.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},t.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},t.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]===0&&i.coordinates[0]-t.coordinates[0]===0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=pd(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)},t.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},t.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},t.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},t}(),yd=gd,vd=function(){function t(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return t.prototype.getSymetric=function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric},t.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},t.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},t.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},t.prototype.toLineString=function(){return Qa([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return pd(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}(),_d=function(){function t(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return t.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},t.prototype.get=function(t){return this.edges[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.edges.forEach(t)},t.prototype.map=function(t){return this.edges.map(t)},t.prototype.some=function(t){return this.edges.some(t)},t.prototype.isValid=function(){return!0},t.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e},0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=pd(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},t.prototype.toMultiPoint=function(){return ru(this.edges.map(function(t){return t.from.coordinates}))},t.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Ja([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=ih(this.toPolygon())},t.findEdgeRingContaining=function(t,e){var n,r,i=t.getEnvelope();return e.forEach(function(e){var o,s,a,u,l,c,h=e.getEnvelope();if((r&&(n=r.getEnvelope()),s=i,a=(o=h).geometry.coordinates[0].map(function(t){return t[0]}),u=o.geometry.coordinates[0].map(function(t){return t[1]}),l=s.geometry.coordinates[0].map(function(t){return t[0]}),c=s.geometry.coordinates[0].map(function(t){return t[1]}),Math.max.apply(null,a)!==Math.max.apply(null,l)||Math.max.apply(null,u)!==Math.max.apply(null,c)||Math.min.apply(null,a)!==Math.min.apply(null,l)||Math.min.apply(null,u)!==Math.min.apply(null,c))&&dd(h,i)){for(var f=t.map(function(t){return t.from.coordinates}),p=void 0,d=function(t){e.some(function(e){return n=t,r=e.from.coordinates,n[0]===r[0]&&n[1]===r[1];var n,r})||(p=t)},g=0,y=f;g<y.length;g++){d(y[g])}p&&e.inside(Za(p))&&(r&&!dd(n,h)||(r=e))}}),r},t.prototype.inside=function(t){return Jl(t,this.toPolygon())},t}(),md=_d;var xd=function(){function t(){this.edges=[],this.nodes={}}return t.fromGeoJson=function(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(e);var n=new t;return Mu(e,function(t){Vu(t,"LineString","Graph::fromGeoJson"),xu(t,function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e})}),n},t.prototype.getNode=function(t){var e=yd.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new yd(t)),n},t.prototype.addEdge=function(t,e){var n=new vd(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},t.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},t.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(t){return t.to});this.removeNode(t),n.forEach(function(t){return e._removeIfDangle(t)})}},t.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},t.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach(function(t){return e._computeNextCWEdges(e.nodes[t])}):t.getOuterEdges().forEach(function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e})},t.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,l=void 0;s.label===e&&(u=s),a.label===e&&(l=a),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},t.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}}),t},t.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n,e.label)})});var e=[];return this.edges.forEach(function(n){n.ring||e.push(t._findEdgeRing(n))}),e},t.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++r}),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e},t.prototype._findEdgeRing=function(t){var e=t,n=new md;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},t.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(t){return e.removeEdge(t)}),t.innerEdges.forEach(function(t){return e.removeEdge(t)}),delete this.nodes[t.id]},t.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},t}(),wd=xd;function bd(t){var e=wd.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var n=[],r=[];return e.getEdgeRings().filter(function(t){return t.isValid()}).forEach(function(t){t.isHole()?n.push(t):r.push(t)}),n.forEach(function(t){md.findEdgeRingContaining(t,r)&&r.push(t)}),eu(r.map(function(t){return t.toPolygon()}))}function Ed(t,e){for(var n=0;n<t.coordinates.length-1;n++)if(Cd(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function Sd(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){if(Jl(r[n],t))return!0}return bh(e,Sf(t)).features.length>0}function Cd(t,e,n){var r=n[0]-t[0],i=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return 0===r*s-i*o&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}var Pd=function(t,e){var n=!0;return Mu(t,function(t){Mu(e,function(e){if(!1===n)return!1;n=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return n=t.coordinates,r=e.coordinates,!(n[0]===r[0]&&n[1]===r[1]);case"LineString":return!Ed(e,t);case"Polygon":return!Jl(t,e)}break;case"LineString":switch(e.type){case"Point":return!Ed(t,e);case"LineString":return!function(t,e){if(bh(t,e).features.length>0)return!0;return!1}(t,e);case"Polygon":return!Sd(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Jl(e,t);case"LineString":return!Sd(t,e);case"Polygon":return!function(t,e){for(var n=0,r=t.coordinates[0];n<r.length;n++){if(Jl(r[n],e))return!0}for(var i=0,o=e.coordinates[0];i<o.length;i++){if(Jl(o[i],t))return!0}var s=bh(Sf(t),Sf(e));if(s.features.length>0)return!0;return!1}(e,t)}}var n,r;return!1}(t.geometry,e.geometry)})}),n};function Id(t,e){var n=Xu(t),r=Xu(e),i=n.type,o=r.type,s=n.coordinates,a=r.coordinates;switch(i){case"Point":if("Point"===o)return Od(s,a);throw new Error("feature2 "+o+" geometry not supported");case"MultiPoint":switch(o){case"Point":return function(t,e){var n,r=!1;for(n=0;n<t.coordinates.length;n++)if(Od(t.coordinates[n],e.coordinates)){r=!0;break}return r}(n,r);case"MultiPoint":return function(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){for(var i=r[n],o=!1,s=0,a=t.coordinates;s<a.length;s++){if(Od(i,a[s])){o=!0;break}}if(!o)return!1}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"Point":return Xh(r,n,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var n=!1,r=0,i=e.coordinates;r<i.length;r++){var o=i[r];if(Xh({type:"Point",coordinates:o},t,{ignoreEndVertices:!0})&&(n=!0),!Xh({type:"Point",coordinates:o},t,{ignoreEndVertices:!1}))return!1}return n}(n,r);case"MultiPoint":return function(t,e){for(var n=!1,r=0,i=e.coordinates;r<i.length;r++){var o=i[r];if(Xh(o,t,{ignoreEndVertices:!0})&&(n=!0),!Xh(o,t))return!1}if(n)return!0;return!1}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Point":return Jl(r,n,{ignoreBoundary:!0});case"LineString":return function(t,e){var n=!1,r=0,i=Du(t),o=Du(e);if(!Md(i,o))return!1;for(;r<e.coordinates.length-1;r++){if(Jl({type:"Point",coordinates:Ld(e.coordinates[r],e.coordinates[r+1])},t,{ignoreBoundary:!0})){n=!0;break}}return n}(n,r);case"Polygon":return function(t,e){if("Feature"===t.type&&null===t.geometry)return!1;if("Feature"===e.type&&null===e.geometry)return!1;var n=Du(t),r=Du(e);if(!Md(n,r))return!1;for(var i=Xu(e).coordinates,o=0,s=i;o<s.length;o++)for(var a=0,u=s[o];a<u.length;a++){if(!Jl(u[a],t))return!1}return!0}(n,r);case"MultiPoint":return function(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){if(!Jl(r[n],t,{ignoreBoundary:!0}))return!1}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Md(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function Od(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ld(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}function kd(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o<i&&!n&&!r;){for(var s=0;s<e.coordinates.length-1;s++){var a=!0;0!==s&&s!==e.coordinates.length-2||(a=!1),Ad(e.coordinates[s],e.coordinates[s+1],t.coordinates[o],a)?n=!0:r=!0}o++}return n&&r}function Rd(t,e){var n=Cf(e);return bh(t,n).features.length>0}function Td(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o<i&&(!n||!r);o++)Jl(Za(t.coordinates[o]),e)?n=!0:r=!0;return r&&n}function Ad(t,e,n,r){var i=n[0]-t[0],o=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0===i*a-o*s&&(r?Math.abs(s)>=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]<n[0]&&n[0]<e[0]:e[0]<n[0]&&n[0]<t[0]:a>0?t[1]<n[1]&&n[1]<e[1]:e[1]<n[1]&&n[1]<t[1])}var Nd=function(t,e){var n=Xu(t),r=Xu(e),i=n.type,o=r.type;switch(i){case"MultiPoint":switch(o){case"LineString":return kd(n,r);case"Polygon":return Td(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"MultiPoint":return kd(r,n);case"LineString":return function(t,e){if(bh(t,e).features.length>0)for(var n=0;n<t.coordinates.length-1;n++)for(var r=0;r<e.coordinates.length-1;r++){var i=!0;if(0!==r&&r!==e.coordinates.length-2||(i=!1),Ad(t.coordinates[n],t.coordinates[n+1],e.coordinates[r],i))return!0}return!1}(n,r);case"Polygon":return Rd(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"MultiPoint":return Td(r,n);case"LineString":return Rd(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}},Fd=n(7910);function Dd(t,e){var n=Xu(t),r=Xu(e),i=n.type,o=r.type;if("MultiPoint"===i&&"MultiPoint"!==o||("LineString"===i||"MultiLineString"===i)&&"LineString"!==o&&"MultiLineString"!==o||("Polygon"===i||"MultiPolygon"===i)&&"Polygon"!==o&&"MultiPolygon"!==o)throw new Error("features must be of the same type");if("Point"===i)throw new Error("Point geometry not supported");if(new Fd({precision:6}).compare(t,e))return!1;var s=0;switch(i){case"MultiPoint":for(var a=0;a<n.coordinates.length;a++)for(var u=0;u<r.coordinates.length;u++){var l=n.coordinates[a],c=r.coordinates[u];if(l[0]===c[0]&&l[1]===c[1])return!0}return!1;case"LineString":case"MultiLineString":Lu(t,function(t){Lu(e,function(e){Df(t,e).features.length&&s++})});break;case"Polygon":case"MultiPolygon":Lu(t,function(t){Lu(e,function(e){bh(t,e).features.length&&s++})})}return s>0}var jd=function(t,e){return Xu(t).type===Xu(e).type&&new Fd({precision:6}).compare(Vc(t),Vc(e))};function Gd(t,e){var n=!1;return Mu(t,function(t){Mu(e,function(e){if(!0===n)return!0;n=!Pd(t.geometry,e.geometry)})}),n}var Bd=n(5221);var zd=function(t,e,n){void 0===n&&(n={}),!0!==n.mutate&&(t=lc(t)),n.minPoints=n.minPoints||3;var r=new Bd.DBSCAN,i=r.run(Cu(t),pu(e,n.units),n.minPoints,tc),o=-1;return i.forEach(function(e){o++,e.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster=o,n.properties.dbscan="core"})}),r.noise.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster?n.properties.dbscan="edge":n.properties.dbscan="noise"}),t},Vd=n(8682);var Ud=function(t,e){void 0===e&&(e={});var n=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(n/2)),e.numberOfClusters>n&&(e.numberOfClusters=n),!0!==e.mutate&&(t=lc(t));var r=Cu(t),i=r.slice(0,e.numberOfClusters),o=Vd(r,e.numberOfClusters,i),s={};return o.centroids.forEach(function(t,e){s[e]=t}),Eu(t,function(t,e){var n=o.idxs[e];t.properties.cluster=n,t.properties.centroid=s[n]}),t};function Xd(t,e){return cu(zf(t[0],t[1]))===cu(zf(e[0],e[1]))}function qd(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e)}var Wd=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==qd(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==qd(e,"line2"))throw new Error("line2 must be a LineString");for(var n=mh(Vc(t)).features,r=mh(Vc(e)).features,i=0;i<n.length;i++){var o=n[i].geometry.coordinates;if(!r[i])break;if(!Xd(o,r[i].geometry.coordinates))return!1}return!0};function Yd(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}var Hd={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||Hd.heuristics.manhattan,o=r.closest||!1,s=new Jd(function(t){return t.f}),a=e;for(e.h=i(e,n),s.push(e);s.size()>0;){var u=s.pop();if(u===n)return Yd(u);u.closed=!0;for(var l=t.neighbors(u),c=0,h=l.length;c<h;++c){var f=l[c];if(!f.closed&&!f.isWall()){var p=u.g+f.getCost(u),d=f.visited;(!d||p<f.g)&&(f.visited=!0,f.parent=u,f.h=f.h||i(f,n),f.g=p,f.f=f.g+f.h,t.markDirty(f),o&&(f.h<a.h||f.h===a.h&&f.g<a.g)&&(a=f),d?s.rescoreElement(f):s.push(f))}}}return o?Yd(a):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=null}};function Zd(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n<t.length;n++){this.grid[n]=[];for(var r=0,i=t[n];r<i.length;r++){var o=new Kd(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function Kd(t,e,n){this.x=t,this.y=e,this.weight=n}function Jd(t){this.content=[],this.scoreFunction=t}function $d(t,e){for(var n=0;n<e.features.length;n++)if(Jl(t,e.features[n]))return!0;return!1}Zd.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)Hd.cleanNode(this.nodes[t])},Zd.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)Hd.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},Zd.prototype.markDirty=function(t){this.dirtyNodes.push(t)},Zd.prototype.neighbors=function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e},Zd.prototype.toString=function(){for(var t,e,n,r,i=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,r=(e=o[s]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\n")},Kd.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},Kd.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},Kd.prototype.isWall=function(){return 0===this.weight},Jd.prototype={push:function(t){this.content.push(t),this.sinkDown(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(t){this.sinkDown(this.content.indexOf(t))},sinkDown:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},bubbleUp:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,s=o-1,a=null;if(s<e){var u=this.content[s];(i=this.scoreFunction(u))<r&&(a=s)}if(o<e){var l=this.content[o];this.scoreFunction(l)<(null===a?r:i)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}};var Qd=function(t,e,n){if(!yu(n=n||{}))throw new Error("options is invalid");var r=n.resolution,i=n.minDistance,o=n.obstacles||eu([]);if(!t)throw new Error("start is required");if(!e)throw new Error("end is required");if(r&&!gu(r)||r<=0)throw new Error("options.resolution must be a number, greater than 0");if(i)throw new Error("options.minDistance is not yet implemented");var s=ju(t),a=ju(e);switch(t=Za(s),e=Za(a),qu(o)){case"FeatureCollection":if(0===o.features.length)return Qa([s,a]);break;case"Polygon":o=eu([Ya(Xu(o))]);break;default:throw new Error("invalid obstacles")}var u=o;u.features.push(t),u.features.push(e);var l=Du(sd(rh(Du(u)),1.15));r||(r=tc([l[0],l[1]],[l[2],l[1]],n)/100),u.features.pop(),u.features.pop();for(var c=l[0],h=l[1],f=l[2],p=l[3],d=r/tc([c,h],[f,h],n)*(f-c),g=r/tc([c,h],[c,p],n)*(p-h),y=f-c,v=p-h,_=Math.floor(y/d),m=Math.floor(v/g),x=(y-_*d)/2,w=[],b=[],E=[],S=[],C=1/0,P=1/0,I=p-(v-m*g)/2,M=0;I>=h;){for(var O=[],L=[],k=c+x,R=0;k<=f;){var T=Za([k,I]),A=$d(T,o);O.push(A?0:1),L.push(k+"|"+I);var N=tc(T,t);!A&&N<C&&(C=N,E={x:R,y:M});var F=tc(T,e);!A&&F<P&&(P=F,S={x:R,y:M}),k+=d,R++}b.push(O),w.push(L),I-=g,M++}var D=new Zd(b,{diagonal:!0}),j=D.grid[E.y][E.x],G=D.grid[S.y][S.x],B=Hd.search(D,j,G),z=[s];return B.forEach(function(t){var e=w[t.x][t.y].split("|");z.push([+e[0],+e[1]])}),z.push(a),Vc(Qa(z))};function tg(t){return function(){return t}}function eg(t){return t[0]}function ng(t){return t[1]}function rg(){this._=null}function ig(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function og(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function sg(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function ag(t){for(;t.L;)t=t.L;return t}rg.prototype={constructor:rg,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=ag(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(og(this,n),n=(t=n).U),n.C=!1,r.C=!0,sg(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(sg(this,n),n=(t=n).U),n.C=!1,r.C=!0,og(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,s=t.R;if(n=o?s?ag(s):o:s,i?i.L===t?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=s,s.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,og(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,sg(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,og(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,sg(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,og(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,sg(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var ug=rg;function lg(t,e,n,r){var i=[null,null],o=Tg.push(i)-1;return i.left=t,i.right=e,n&&hg(i,t,e,n),r&&hg(i,e,t,r),kg[t.index].halfedges.push(o),kg[e.index].halfedges.push(o),i}function cg(t,e,n){var r=[e,n];return r.left=t,r}function hg(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function fg(t,e,n,r,i){var o,s=t[0],a=t[1],u=s[0],l=s[1],c=0,h=1,f=a[0]-u,p=a[1]-l;if(o=e-u,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<h&&(h=o)}else if(f>0){if(o>h)return;o>c&&(c=o)}if(o=r-u,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<h&&(h=o)}if(o=n-l,p||!(o>0)){if(o/=p,p<0){if(o<c)return;o<h&&(h=o)}else if(p>0){if(o>h)return;o>c&&(c=o)}if(o=i-l,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o<c)return;o<h&&(h=o)}return!(c>0||h<1)||(c>0&&(t[0]=[u+c*f,l+c*p]),h<1&&(t[1]=[u+h*f,l+h*p]),!0)}}}}}function pg(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],l=t.left,c=t.right,h=l[0],f=l[1],p=c[0],d=c[1],g=(h+p)/2,y=(f+d)/2;if(d===f){if(g<e||g>=r)return;if(h>p){if(u){if(u[1]>=i)return}else u=[g,n];o=[g,i]}else{if(u){if(u[1]<n)return}else u=[g,i];o=[g,n]}}else if(a=y-(s=(h-p)/(d-f))*g,s<-1||s>1)if(h>p){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]<n)return}else u=[(i-a)/s,i];o=[(n-a)/s,n]}else if(f<d){if(u){if(u[0]>=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]<e)return}else u=[r,s*r+a];o=[e,s*e+a]}return t[0]=u,t[1]=o,!0}function dg(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function gg(t,e){return e[+(e.left!==t.site)]}function yg(t,e){return e[+(e.left===t.site)]}var vg,_g=[];function mg(){ig(this),this.x=this.y=this.arc=this.site=this.cy=null}function xg(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var s=i[0],a=i[1],u=r[0]-s,l=r[1]-a,c=o[0]-s,h=o[1]-a,f=2*(u*h-l*c);if(!(f>=-Ng)){var p=u*u+l*l,d=c*c+h*h,g=(h*p-l*d)/f,y=(u*d-c*p)/f,v=_g.pop()||new mg;v.arc=t,v.site=i,v.x=g+s,v.y=(v.cy=y+a)+Math.sqrt(g*g+y*y),t.circle=v;for(var _=null,m=Rg._;m;)if(v.y<m.y||v.y===m.y&&v.x<=m.x){if(!m.L){_=m.P;break}m=m.L}else{if(!m.R){_=m;break}m=m.R}Rg.insert(_,v),_||(vg=v)}}}}function wg(t){var e=t.circle;e&&(e.P||(vg=e.N),Rg.remove(e),_g.push(e),ig(e),t.circle=null)}var bg=[];function Eg(){ig(this),this.edge=this.site=this.circle=null}function Sg(t){var e=bg.pop()||new Eg;return e.site=t,e}function Cg(t){wg(t),Lg.remove(t),bg.push(t),ig(t)}function Pg(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];Cg(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)<Ag&&Math.abs(r-u.circle.cy)<Ag;)o=u.P,a.unshift(u),Cg(u),u=o;a.unshift(u),wg(u);for(var l=s;l.circle&&Math.abs(n-l.circle.x)<Ag&&Math.abs(r-l.circle.cy)<Ag;)s=l.N,a.push(l),Cg(l),l=s;a.push(l),wg(l);var c,h=a.length;for(c=1;c<h;++c)l=a[c],u=a[c-1],hg(l.edge,u.site,l.site,i);u=a[0],(l=a[h-1]).edge=lg(u.site,l.site,null,i),xg(u),xg(l)}function Ig(t){for(var e,n,r,i,o=t[0],s=t[1],a=Lg._;a;)if((r=Mg(a,s)-o)>Ag)a=a.L;else{if(!((i=o-Og(a,s))>Ag)){r>-Ag?(e=a.P,n=a):i>-Ag?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){kg[t.index]={site:t,halfedges:[]}}(t);var u=Sg(t);if(Lg.insert(e,u),e||n){if(e===n)return wg(e),n=Sg(e.site),Lg.insert(u,n),u.edge=n.edge=lg(e.site,u.site),xg(e),void xg(n);if(n){wg(e),wg(n);var l=e.site,c=l[0],h=l[1],f=t[0]-c,p=t[1]-h,d=n.site,g=d[0]-c,y=d[1]-h,v=2*(f*y-p*g),_=f*f+p*p,m=g*g+y*y,x=[(y*_-p*m)/v+c,(f*m-g*_)/v+h];hg(n.edge,l,d,x),u.edge=lg(l,t,null,x),n.edge=lg(t,d,null,x),xg(e),xg(n)}else u.edge=lg(e.site,u.site)}}function Mg(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],l=u-e;if(!l)return a;var c=a-r,h=1/o-1/l,f=c/l;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*l)-u+l/2+i-o/2)))/h+r:(r+a)/2}function Og(t,e){var n=t.N;if(n)return Mg(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var Lg,kg,Rg,Tg,Ag=1e-6,Ng=1e-12;function Fg(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function Dg(t,e){return e[1]-t[1]||e[0]-t[0]}function jg(t,e){var n,r,i,o=t.sort(Dg).pop();for(Tg=[],kg=new Array(t.length),Lg=new ug,Rg=new ug;;)if(i=vg,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===n&&o[1]===r||(Ig(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;Pg(i.arc)}if(function(){for(var t,e,n,r,i=0,o=kg.length;i<o;++i)if((t=kg[i])&&(r=(e=t.halfedges).length)){var s=new Array(r),a=new Array(r);for(n=0;n<r;++n)s[n]=n,a[n]=dg(t,Tg[e[n]]);for(s.sort(function(t,e){return a[e]-a[t]}),n=0;n<r;++n)a[n]=e[s[n]];for(n=0;n<r;++n)e[n]=a[n]}}(),e){var s=+e[0][0],a=+e[0][1],u=+e[1][0],l=+e[1][1];!function(t,e,n,r){for(var i,o=Tg.length;o--;)pg(i=Tg[o],t,e,n,r)&&fg(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>Ag||Math.abs(i[0][1]-i[1][1])>Ag)||delete Tg[o]}(s,a,u,l),function(t,e,n,r){var i,o,s,a,u,l,c,h,f,p,d,g,y=kg.length,v=!0;for(i=0;i<y;++i)if(o=kg[i]){for(s=o.site,a=(u=o.halfedges).length;a--;)Tg[u[a]]||u.splice(a,1);for(a=0,l=u.length;a<l;)d=(p=yg(o,Tg[u[a]]))[0],g=p[1],h=(c=gg(o,Tg[u[++a%l]]))[0],f=c[1],(Math.abs(d-h)>Ag||Math.abs(g-f)>Ag)&&(u.splice(a,0,Tg.push(cg(s,p,Math.abs(d-t)<Ag&&r-g>Ag?[t,Math.abs(h-t)<Ag?f:r]:Math.abs(g-r)<Ag&&n-d>Ag?[Math.abs(f-r)<Ag?h:n,r]:Math.abs(d-n)<Ag&&g-e>Ag?[n,Math.abs(h-n)<Ag?f:e]:Math.abs(g-e)<Ag&&d-t>Ag?[Math.abs(f-e)<Ag?h:t,e]:null))-1),++l);l&&(v=!1)}if(v){var _,m,x,w=1/0;for(i=0,v=null;i<y;++i)(o=kg[i])&&(x=(_=(s=o.site)[0]-t)*_+(m=s[1]-e)*m)<w&&(w=x,v=o);if(v){var b=[t,e],E=[t,r],S=[n,r],C=[n,e];v.halfedges.push(Tg.push(cg(s=v.site,b,E))-1,Tg.push(cg(s,E,S))-1,Tg.push(cg(s,S,C))-1,Tg.push(cg(s,C,b))-1)}}for(i=0;i<y;++i)(o=kg[i])&&(o.halfedges.length||delete kg[i])}(s,a,u,l)}this.edges=Tg,this.cells=kg,Lg=Rg=Tg=kg=null}function Gg(t){return(t=t.slice()).push(t[0]),Ja([t])}jg.prototype={constructor:jg,polygons:function(){var t=this.edges;return this.cells.map(function(e){var n=e.halfedges.map(function(n){return gg(e,t[n])});return n.data=e.site.data,n})},triangles:function(){var t=[],e=this.edges;return this.cells.forEach(function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a=n.site,u=-1,l=e[i[o-1]],c=l.left===a?l.right:l.left;++u<o;)s=c,c=(l=e[i[u]]).left===a?l.right:l.left,s&&c&&r<s.index&&r<c.index&&Fg(a,s,c)<0&&t.push([a.data,s.data,c.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})},find:function(t,e,n){for(var r,i,o=this,s=o._found||0,a=o.cells.length;!(i=o.cells[s]);)if(++s>=a)return null;var u=t-i.site[0],l=e-i.site[1],c=u*u+l*l;do{i=o.cells[r=s],s=null,i.halfedges.forEach(function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],l=e-a[1],h=u*u+l*l;h<c&&(c=h,s=a.index)}})}while(null!==s);return o._found=r,null==n||c<=n*n?i.site:null}};var Bg=function(t,e){if(!yu(e=e||{}))throw new Error("options is invalid");var n=e.bbox||[-180,-85,180,85];if(!t)throw new Error("points is required");if(!Array.isArray(n))throw new Error("bbox is invalid");return Uu(t,"Point","points"),eu(function(){var t=eg,e=ng,n=null;function r(r){return new jg(r.map(function(n,i){var o=[Math.round(t(n,i,r)/Ag)*Ag,Math.round(e(n,i,r)/Ag)*Ag];return o.index=i,o.data=n,o}),n)}return r.polygons=function(t){return r(t).polygons()},r.links=function(t){return r(t).links()},r.triangles=function(t){return r(t).triangles()},r.x=function(e){return arguments.length?(t="function"==typeof e?e:tg(+e),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:tg(+t),r):e},r.extent=function(t){return arguments.length?(n=null==t?null:[[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]],r):n&&[[n[0][0],n[0][1]],[n[1][0],n[1][1]]]},r.size=function(t){return arguments.length?(n=null==t?null:[[0,0],[+t[0],+t[1]]],r):n&&[n[1][0]-n[0][0],n[1][1]-n[0][1]]},r}().x(function(t){return t.geometry.coordinates[0]}).y(function(t){return t.geometry.coordinates[1]}).extent([[n[0],n[1]],[n[2],n[3]]]).polygons(t.features).map(Gg))};function zg(t){var e=t*Math.PI/180;return Math.tan(e)}var Vg=function(t,e,n,r){var i=(r=r||{}).steps||64,o=r.units||"kilometers",s=r.angle||0,a=r.pivot||t,u=r.properties||t.properties||{};if(!t)throw new Error("center is required");if(!e)throw new Error("xSemiAxis is required");if(!n)throw new Error("ySemiAxis is required");if(!yu(r))throw new Error("options must be an object");if(!gu(i))throw new Error("steps must be a number");if(!gu(s))throw new Error("angle must be a number");var l=ju(t);if("degrees"===o)var c=fu(s);else e=Vf(t,e,90,{units:o}),n=Vf(t,n,0,{units:o}),e=ju(e)[0]-l[0],n=ju(n)[1]-l[1];for(var h=[],f=0;f<i;f+=1){var p=-360*f/i,d=e*n/Math.sqrt(Math.pow(n,2)+Math.pow(e,2)*Math.pow(zg(p),2)),g=e*n/Math.sqrt(Math.pow(e,2)+Math.pow(n,2)/Math.pow(zg(p),2));if(p<-90&&p>=-270&&(d=-d),p<-180&&p>=-360&&(g=-g),"degrees"===o){var y=d*Math.cos(c)+g*Math.sin(c),v=g*Math.cos(c)-d*Math.sin(c);d=y,g=v}h.push([d+l[0],g+l[1]])}return h.push(h[0]),"degrees"===o?Ja([h],u):id(Ja([h],u),s,{pivot:a})};var Ug=function(t,e){void 0===e&&(e={});var n=0,r=0,i=0;return Pu(t,function(t,o,s){var a=e.weight?null==s?void 0:s[e.weight]:void 0;if(!gu(a=null==a?1:a))throw new Error("weight value must be a number for feature index "+o);(a=Number(a))>0&&mu(t,function(t){n+=t[0]*a,r+=t[1]*a,i+=a})}),Za([n/i,r/i],e.properties,e)};function Xg(t,e,n,r,i){var o=r.tolerance||.001,s=0,a=0,u=0,l=0;if(Eu(n,function(e){var n,r=null===(n=e.properties)||void 0===n?void 0:n.weight,i=null==r?1:r;if(!gu(i=Number(i)))throw new Error("weight value must be a number");if(i>0){l+=1;var o=i*tc(e,t);0===o&&(o=1);var c=i/o;s+=e.geometry.coordinates[0]*c,a+=e.geometry.coordinates[1]*c,u+=c}}),l<1)throw new Error("no features to measure");var c=s/u,h=a/u;return 1===l||0===i||Math.abs(c-e[0])<o&&Math.abs(h-e[1])<o?Za([c,h],{medianCandidates:r.medianCandidates}):(r.medianCandidates.push([c,h]),Xg([c,h],t,n,r,i-1))}var qg=function(t,e){if(void 0===e&&(e={}),!yu(e=e||{}))throw new Error("options is invalid");var n=e.counter||10;if(!gu(n))throw new Error("counter must be a number");var r=e.weight,i=Ug(t,{weight:e.weight}),o=eu([]);Eu(t,function(t){var e;o.features.push(hh(t,{properties:{weight:null===(e=t.properties)||void 0===e?void 0:e[r]}}))});var s={tolerance:e.tolerance,medianCandidates:[]};return Xg(i.geometry.coordinates,[0,0],o,s,n)};function Wg(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}}var Yg=function(t,e){if(!yu(e=e||{}))throw new Error("options is invalid");var n=e.steps||64,r=e.weight,i=e.properties||{};if(!gu(n))throw new Error("steps must be a number");if(!yu(i))throw new Error("properties must be a number");var o=Cu(t).length,s=Ug(t,{weight:r}),a=0,u=0,l=0;Eu(t,function(t){var e=t.properties[r]||1,n=Wg(Gu(t),Gu(s));a+=Math.pow(n.x,2)*e,u+=Math.pow(n.y,2)*e,l+=n.x*n.y*e});var c=a-u,h=Math.sqrt(Math.pow(c,2)+4*Math.pow(l,2)),f=2*l,p=Math.atan((c+h)/f),d=180*p/Math.PI,g=0,y=0,v=0;Eu(t,function(t){var e=t.properties[r]||1,n=Wg(Gu(t),Gu(s));g+=Math.pow(n.x*Math.cos(p)-n.y*Math.sin(p),2)*e,y+=Math.pow(n.x*Math.sin(p)+n.y*Math.cos(p),2)*e,v+=e});var _=Math.sqrt(2*g/v),m=Math.sqrt(2*y/v),x=Vg(s,_,m,{units:"degrees",angle:d,steps:n,properties:i}),w=Ql(t,eu([x])),b={meanCenterCoordinates:Gu(s),semiMajorAxis:_,semiMinorAxis:m,numberOfFeatures:o,angle:d,percentageWithinEllipse:100*Cu(w).length/o};return x.properties.standardDeviationalEllipse=b,x};var Hg=function(t,e,n,r){if(void 0===r&&(r={}),!yu(r))throw new Error("options is invalid");if(!t)throw new Error("startPoint is required");if(!e)throw new Error("midPoint is required");if(!n)throw new Error("endPoint is required");var i=t,o=e,s=n,a=cu(!0!==r.mercator?uh(i,o):zf(i,o)),u=cu(!0!==r.mercator?uh(s,o):zf(s,o)),l=Math.abs(a-u);return!0===r.explementary?360-l:l};function Zg(t,e){var n=0,r=0;mu(t,function(i,o,s,a,u){u>n&&(n=u,r=o,e.push([]));var l=o-r,c=t.coordinates[u][l+1],h=i[0],f=i[1],p=c[0],d=c[1];e[u].push([.75*h+.25*p,.75*f+.25*d]),e[u].push([.25*h+.75*p,.25*f+.75*d])},!0),e.forEach(function(t){t.push(t[0])})}function Kg(t,e){var n=0,r=0,i=0;mu(t,function(o,s,a,u,l){u>i&&(i=u,r=s,e.push([[]])),l>n&&(n=l,r=s,e[u].push([]));var c=s-r,h=t.coordinates[u][l][c+1],f=o[0],p=o[1],d=h[0],g=h[1];e[u][l].push([.75*f+.25*d,.75*p+.25*g]),e[u][l].push([.25*f+.75*d,.25*p+.75*g])},!0),e.forEach(function(t){t.forEach(function(t){t.push(t[0])})})}var Jg=function(t,e){var n=[],r=e.iterations||1;if(!t)throw new Error("inputPolys is required");return Pu(t,function(t,e,i){var o,s,a;switch(t.type){case"Polygon":o=[[]];for(var u=0;u<r;u++)a=[[]],s=t,u>0&&(s=Ja(o).geometry),Zg(s,a),o=a.slice(0);n.push(Ja(o,i));break;case"MultiPolygon":o=[[[]]];for(var l=0;l<r;l++)a=[[[]]],s=t,l>0&&(s=iu(o).geometry),Kg(s,a),o=a.slice(0);n.push(iu(o,i));break;default:throw new Error("geometry is invalid, must be Polygon or MultiPolygon")}}),eu(n)};function $g(t,e,n){void 0===n&&(n=2);var r=ju(t),i=ju(e),o=r[0]-i[0],s=r[1]-i[1];return 1===n?Math.abs(o)+Math.abs(s):Math.pow(Math.pow(o,n)+Math.pow(s,n),1/n)}function Qg(t,e){var n=(e=e||{}).threshold||1e4,r=e.p||2,i=e.binary||!1,o=e.alpha||-1,s=e.standardization||!1,a=[];Eu(t,function(t){a.push(hh(t))});for(var u=[],l=0;l<a.length;l++)u[l]=[];for(l=0;l<a.length;l++)for(var c=l;c<a.length;c++){l===c&&(u[l][c]=0);var h=$g(a[l],a[c],r);u[l][c]=h,u[c][l]=h}for(l=0;l<a.length;l++)for(c=0;c<a.length;c++){0!==(h=u[l][c])&&(u[l][c]=i?h<=n?1:0:h<=n?Math.pow(h,o):0)}if(s)for(l=0;l<a.length;l++){var f=u[l].reduce(function(t,e){return t+e},0);for(c=0;c<a.length;c++)u[l][c]=u[l][c]/f}return u}function ty(t,e){var n=e.inputField,r=e.threshold||1e5,i=e.p||2,o=e.binary||!1,s=Qg(t,{alpha:e.alpha||-1,binary:o,p:i,standardization:e.standardization||!0,threshold:r}),a=[];Eu(t,function(t){var e=t.properties||{};a.push(e[n])});for(var u=ey(a),l=function(t){for(var e=ey(t),n=0,r=0,i=t;r<i.length;r++){var o=i[r];n+=Math.pow(o-e,2)}return n/t.length}(a),c=0,h=0,f=0,p=0,d=s.length,g=0;g<d;g++){for(var y=0,v=0;v<d;v++)c+=s[g][v]*(a[g]-u)*(a[v]-u),h+=s[g][v],f+=Math.pow(s[g][v]+s[v][g],2),y+=s[g][v]+s[v][g];p+=Math.pow(y,2)}var _=c/h/l,m=-1/(d-1),x=(d*d*(f*=.5)-d*p+h*h*3)/((d-1)*(d+1)*(h*h))-m*m,w=Math.sqrt(x);return{expectedMoranIndex:m,moranIndex:_,stdNorm:w,zNorm:(_-m)/w}}function ey(t){for(var e=0,n=0,r=t;n<r.length;n++){e+=r[n]}return e/t.length}function ny(t,e){return void 0===e&&(e={}),iy(t,"mercator",e)}function ry(t,e){return void 0===e&&(e={}),iy(t,"wgs84",e)}function iy(t,e,n){void 0===n&&(n={});var r=(n=n||{}).mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&gu(t[0])?t="mercator"===e?oy(t):sy(t):(!0!==r&&(t=lc(t)),mu(t,function(t){var n="mercator"===e?oy(t):sy(t);t[0]=n[0],t[1]=n[1]})),t}function oy(t){var e,n=Math.PI/180,r=6378137,i=20037508.342789244,o=[r*(Math.abs(t[0])<=180?t[0]:t[0]-360*((e=t[0])<0?-1:e>0?1:0))*n,r*Math.log(Math.tan(.25*Math.PI+.5*t[1]*n))];return o[0]>i&&(o[0]=i),o[0]<-i&&(o[0]=-i),o[1]>i&&(o[1]=i),o[1]<-i&&(o[1]=-i),o}function sy(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]}var ay=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r};function uy(t){return Array.isArray(t)?py(t):t&&t.bbox?py(t.bbox):[360*fy(),180*fy()]}function ly(t,e){void 0===e&&(e={}),null==t&&(t=1);for(var n=[],r=0;r<t;r++)n.push(Za(uy(e.bbox)));return eu(n)}function cy(t,e){void 0===e&&(e={}),null==t&&(t=1),gu(e.num_vertices)&&void 0!==e.num_vertices||(e.num_vertices=10),gu(e.max_radial_length)&&void 0!==e.max_radial_length||(e.max_radial_length=10);for(var n=[],r=function(t){var r,i=[],o=ay(Array(e.num_vertices+1)).map(Math.random);o.forEach(function(t,e,n){n[e]=e>0?t+n[e-1]:t}),o.forEach(function(t){t=2*t*Math.PI/o[o.length-1];var n=Math.random();i.push([n*(e.max_radial_length||10)*Math.sin(t),n*(e.max_radial_length||10)*Math.cos(t)])}),i[i.length-1]=i[0],i=i.map((r=uy(e.bbox),function(t){return[t[0]+r[0],t[1]+r[1]]})),n.push(Ja([i]))},i=0;i<t;i++)r();return eu(n)}function hy(t,e){if(void 0===e&&(e={}),!yu(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,i=e.max_length,o=e.max_rotation;null==t&&(t=1),(!gu(r)||void 0===r||r<2)&&(r=10),gu(i)&&void 0!==i||(i=1e-4),gu(o)&&void 0!==o||(o=Math.PI/8);for(var s=[],a=0;a<t;a++){for(var u=[uy(n)],l=0;l<r-1;l++){var c=(0===l?2*Math.random()*Math.PI:Math.tan((u[l][1]-u[l-1][1])/(u[l][0]-u[l-1][0])))+(Math.random()-.5)*o*2,h=Math.random()*i;u.push([u[l][0]+h*Math.cos(c),u[l][1]+h*Math.sin(c)])}s.push(Qa(u))}return eu(s)}function fy(){return Math.random()-.5}function py(t){return[Math.random()*(t[2]-t[0])+t[0],Math.random()*(t[3]-t[1])+t[1]]}function dy(t,e){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(null==e)throw new Error("filter is required");var n=[];return Eu(t,function(t){_y(t.properties,e)&&n.push(t)}),eu(n)}function gy(t,e,n){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(null==e)throw new Error("property is required");for(var r=vy(t,e),i=Object.keys(r),o=0;o<i.length;o++){for(var s=i[o],a=r[s],u=[],l=0;l<a.length;l++)u.push(t.features[a[l]]);n(eu(u),s,o)}}function yy(t,e,n,r){var i=r;return gy(t,e,function(t,e,o){i=0===o&&void 0===r?t:n(i,t,e,o)}),i}function vy(t,e){var n={};return Eu(t,function(t,r){var i=t.properties||{};if(Object.prototype.hasOwnProperty.call(i,String(e))){var o=i[e];Object.prototype.hasOwnProperty.call(n,o)?n[o].push(r):n[o]=[r]}}),n}function _y(t,e){if(void 0===t)return!1;var n=typeof e;if("number"===n||"string"===n)return Object.prototype.hasOwnProperty.call(t,e);if(Array.isArray(e)){for(var r=0;r<e.length;r++)if(!_y(t,e[r]))return!1;return!0}return my(t,e)}function my(t,e){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r];if(t[i]!==e[i])return!1}return!0}function xy(t,e){if(!e)return{};if(!e.length)return{};for(var n={},r=0;r<e.length;r++){var i=e[r];Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}var wy=n(8058);var by=function(t,e){var n=Xu(t),r=Xu(e),i=t.properties||{},o=wy.difference(n.coordinates,r.coordinates);return 0===o.length?null:1===o.length?Ja(o[0],i):iu(o,i)},Ey=n(9807);function Sy(){return new Cy}function Cy(){this.reset()}Cy.prototype={constructor:Cy,reset:function(){this.s=this.t=0},add:function(t){Iy(Py,t,this.t),Iy(this,Py.s,this.s),this.s?this.t+=Py.t:this.s=Py.t},valueOf:function(){return this.s}};var Py=new Cy;function Iy(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var My=1e-6,Oy=Math.PI,Ly=Oy/2,ky=Oy/4,Ry=2*Oy,Ty=180/Oy,Ay=Oy/180,Ny=Math.abs,Fy=Math.atan,Dy=Math.atan2,jy=Math.cos,Gy=(Math.ceil,Math.exp),By=(Math.floor,Math.log),zy=(Math.pow,Math.sin),Vy=(Math.sign,Math.sqrt),Uy=Math.tan;function Xy(t){return t>1?0:t<-1?Oy:Math.acos(t)}function qy(t){return t>1?Ly:t<-1?-Ly:Math.asin(t)}Sy(),Sy();function Wy(t){return[Dy(t[1],t[0]),qy(t[2])]}function Yy(t){var e=t[0],n=t[1],r=jy(n);return[r*jy(e),r*zy(e),zy(n)]}function Hy(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Zy(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ky(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Jy(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function $y(t){var e=Vy(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}Sy();function Qy(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function tv(t,e){return[t>Oy?t-Ry:t<-Oy?t+Ry:t,e]}function ev(t,e,n){return(t%=Ry)?e||n?Qy(rv(t),iv(e,n)):rv(t):e||n?iv(e,n):tv}function nv(t){return function(e,n){return[(e+=t)>Oy?e-Ry:e<-Oy?e+Ry:e,n]}}function rv(t){var e=nv(t);return e.invert=nv(-t),e}function iv(t,e){var n=jy(t),r=zy(t),i=jy(e),o=zy(e);function s(t,e){var s=jy(e),a=jy(t)*s,u=zy(t)*s,l=zy(e),c=l*n+a*r;return[Dy(u*i-c*o,a*n-l*r),qy(c*i+u*o)]}return s.invert=function(t,e){var s=jy(e),a=jy(t)*s,u=zy(t)*s,l=zy(e),c=l*i-u*o;return[Dy(u*i+l*o,a*n+c*r),qy(c*n-a*r)]},s}function ov(t,e,n,r,i,o){if(n){var s=jy(e),a=zy(e),u=r*n;null==i?(i=e+r*Ry,o=e-u/2):(i=sv(s,i),o=sv(s,o),(r>0?i<o:i>o)&&(i+=r*Ry));for(var l,c=i;r>0?c>o:c<o;c-=u)l=Wy([s,-a*jy(c),-a*zy(c)]),t.point(l[0],l[1])}}function sv(t,e){(e=Yy(e))[0]-=t,$y(e);var n=Xy(-e[1]);return((-e[2]<0?-n:n)+Ry-My)%Ry}function av(){}function uv(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:av,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function lv(t,e){return Ny(t[0]-e[0])<My&&Ny(t[1]-e[1])<My}function cv(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function hv(t,e,n,r,i){var o,s,a=[],u=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(lv(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else a.push(n=new cv(r,t,null,!0)),u.push(n.o=new cv(r,null,n,!1)),a.push(n=new cv(s,t,null,!1)),u.push(n.o=new cv(s,null,n,!0))}}),a.length){for(u.sort(e),fv(a),fv(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var l,c,h=a[0];;){for(var f=h,p=!0;f.v;)if((f=f.n)===h)return;l=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(o=0,s=l.length;o<s;++o)i.point((c=l[o])[0],c[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(p)for(l=f.p.z,o=l.length-1;o>=0;--o)i.point((c=l[o])[0],c[1]);else r(f.x,f.p.x,-1,i);f=f.p}l=(f=f.o).z,p=!p}while(!f.v);i.lineEnd()}}}function fv(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function pv(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}tv.invert=tv;1===(dv=pv).length&&(gv=dv,dv=function(t,e){return pv(gv(t),e)});var dv,gv,yv=Array.prototype;yv.slice,yv.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);function vv(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}var _v=1e9,mv=-_v;function xv(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,l){var c=0,h=0;if(null==i||(c=s(i,a))!==(h=s(o,a))||u(i,o)<0^a>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+a+4)%4)!==h);else l.point(o[0],o[1])}function s(r,i){return Ny(r[0]-t)<My?i>0?0:3:Ny(r[0]-n)<My?i>0?2:1:Ny(r[1]-e)<My?i>0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var u,l,c,h,f,p,d,g,y,v,_,m=s,x=uv(),w={point:b,lineStart:function(){w.point=E,l&&l.push(c=[]);v=!0,y=!1,d=g=NaN},lineEnd:function(){u&&(E(h,f),p&&y&&x.rejoin(),u.push(x.result()));w.point=b,y&&m.lineEnd()},polygonStart:function(){m=x,u=[],l=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,s,a=l[n],u=1,c=a.length,h=a[0],f=h[0],p=h[1];u<c;++u)o=f,s=p,f=(h=a[u])[0],p=h[1],s<=r?p>r&&(f-o)*(r-s)>(p-s)*(t-o)&&++e:p<=r&&(f-o)*(r-s)<(p-s)*(t-o)&&--e;return e}(),n=_&&e,i=(u=vv(u)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&hv(u,a,e,o,s),s.polygonEnd());m=s,u=l=c=null}};function b(t,e){i(t,e)&&m.point(t,e)}function E(o,s){var a=i(o,s);if(l&&c.push([o,s]),v)h=o,f=s,p=a,v=!1,a&&(m.lineStart(),m.point(o,s));else if(a&&y)m.point(o,s);else{var u=[d=Math.max(mv,Math.min(_v,d)),g=Math.max(mv,Math.min(_v,g))],x=[o=Math.max(mv,Math.min(_v,o)),s=Math.max(mv,Math.min(_v,s))];!function(t,e,n,r,i,o){var s,a=t[0],u=t[1],l=0,c=1,h=e[0]-a,f=e[1]-u;if(s=n-a,h||!(s>0)){if(s/=h,h<0){if(s<l)return;s<c&&(c=s)}else if(h>0){if(s>c)return;s>l&&(l=s)}if(s=i-a,h||!(s<0)){if(s/=h,h<0){if(s>c)return;s>l&&(l=s)}else if(h>0){if(s<l)return;s<c&&(c=s)}if(s=r-u,f||!(s>0)){if(s/=f,f<0){if(s<l)return;s<c&&(c=s)}else if(f>0){if(s>c)return;s>l&&(l=s)}if(s=o-u,f||!(s<0)){if(s/=f,f<0){if(s>c)return;s>l&&(l=s)}else if(f>0){if(s<l)return;s<c&&(c=s)}return l>0&&(t[0]=a+l*h,t[1]=u+l*f),c<1&&(e[0]=a+c*h,e[1]=u+c*f),!0}}}}}(u,x,t,e,n,r)?a&&(m.lineStart(),m.point(o,s),_=!1):(y||(m.lineStart(),m.point(u[0],u[1])),m.point(x[0],x[1]),a||m.lineEnd(),_=!1)}d=o,g=s,y=a}return w}}var wv=Sy();Sy();Sy(),Sy();var bv=1/0,Ev=bv,Sv=-bv,Cv=Sv,Pv={point:function(t,e){t<bv&&(bv=t);t>Sv&&(Sv=t);e<Ev&&(Ev=e);e>Cv&&(Cv=e)},lineStart:av,lineEnd:av,polygonStart:av,polygonEnd:av,result:function(){var t=[[bv,Ev],[Sv,Cv]];return Sv=Cv=-(Ev=bv=1/0),t}};var Iv=Pv;Sy();function Mv(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ov(t,e,n,r){return function(i,o){var s,a,u,l=e(o),c=i.invert(r[0],r[1]),h=uv(),f=e(h),p=!1,d={point:g,lineStart:v,lineEnd:_,polygonStart:function(){d.point=m,d.lineStart=x,d.lineEnd=w,a=[],s=[]},polygonEnd:function(){d.point=g,d.lineStart=v,d.lineEnd=_,a=vv(a);var t=function(t,e){var n=e[0],r=e[1],i=[zy(n),-jy(n),0],o=0,s=0;wv.reset();for(var a=0,u=t.length;a<u;++a)if(c=(l=t[a]).length)for(var l,c,h=l[c-1],f=h[0],p=h[1]/2+ky,d=zy(p),g=jy(p),y=0;y<c;++y,f=_,d=x,g=w,h=v){var v=l[y],_=v[0],m=v[1]/2+ky,x=zy(m),w=jy(m),b=_-f,E=b>=0?1:-1,S=E*b,C=S>Oy,P=d*x;if(wv.add(Dy(P*E*zy(S),g*w+P*jy(S))),o+=C?b+E*Ry:b,C^f>=n^_>=n){var I=Zy(Yy(h),Yy(v));$y(I);var M=Zy(i,I);$y(M);var O=(C^b>=0?-1:1)*qy(M[2]);(r>O||r===O&&(I[0]||I[1]))&&(s+=C^b>=0?1:-1)}}return(o<-1e-6||o<My&&wv<-1e-6)^1&s}(s,c);a.length?(p||(o.polygonStart(),p=!0),hv(a,kv,t,n,o)):t&&(p||(o.polygonStart(),p=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),p&&(o.polygonEnd(),p=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function g(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function y(t,e){var n=i(t,e);l.point(n[0],n[1])}function v(){d.point=y,l.lineStart()}function _(){d.point=g,l.lineEnd()}function m(t,e){u.push([t,e]);var n=i(t,e);f.point(n[0],n[1])}function x(){f.lineStart(),u=[]}function w(){m(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),l=h.result(),c=l.length;if(u.pop(),s.push(u),u=null,c)if(1&i){if((e=(n=l[0]).length-1)>0){for(p||(o.polygonStart(),p=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else c>1&&2&i&&l.push(l.pop().concat(l.shift())),a.push(l.filter(Lv))}return d}}function Lv(t){return t.length>1}function kv(t,e){return((t=t.x)[0]<0?t[1]-Ly-My:Ly-t[1])-((e=e.x)[0]<0?e[1]-Ly-My:Ly-e[1])}Mv(4.5);var Rv=Ov(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Oy:-Oy,u=Ny(o-n);Ny(u-Oy)<My?(t.point(n,r=(r+s)/2>0?Ly:-Ly),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=Oy&&(Ny(n-i)<My&&(n-=i*My),Ny(o-a)<My&&(o-=a*My),r=function(t,e,n,r){var i,o,s=zy(t-n);return Ny(s)>My?Fy((zy(e)*(o=jy(r))*zy(n)-zy(r)*(i=jy(e))*zy(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*Ly,r.point(-Oy,i),r.point(0,i),r.point(Oy,i),r.point(Oy,0),r.point(Oy,-i),r.point(0,-i),r.point(-Oy,-i),r.point(-Oy,0),r.point(-Oy,i);else if(Ny(t[0]-e[0])>My){var o=t[0]<e[0]?Oy:-Oy;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])},[-Oy,-Ly]);function Tv(t){return t}function Av(t){return function(e){var n=new Nv;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Nv(){}function Fv(t,e){t&&jv.hasOwnProperty(t.type)&&jv[t.type](t,e)}Nv.prototype={constructor:Nv,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Dv={Feature:function(t,e){Fv(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Fv(n[r].geometry,e)}},jv={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Gv(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Gv(n[r],e,0)},Polygon:function(t,e){Bv(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Bv(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Fv(n[r],e)}};function Gv(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function Bv(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Gv(t[n],e,1);e.polygonEnd()}function zv(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),function(t,e){t&&Dv.hasOwnProperty(t.type)?Dv[t.type](t,e):Fv(t,e)}(n,t.stream(Iv));var s=Iv.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,l=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,l])}var Vv=jy(30*Ay);function Uv(t,e){return+e?function(t,e){function n(r,i,o,s,a,u,l,c,h,f,p,d,g,y){var v=l-r,_=c-i,m=v*v+_*_;if(m>4*e&&g--){var x=s+f,w=a+p,b=u+d,E=Vy(x*x+w*w+b*b),S=qy(b/=E),C=Ny(Ny(b)-1)<My||Ny(o-h)<My?(o+h)/2:Dy(w,x),P=t(C,S),I=P[0],M=P[1],O=I-r,L=M-i,k=_*O-v*L;(k*k/m>e||Ny((v*O+_*L)/m-.5)>.3||s*f+a*p+u*d<Vv)&&(n(r,i,o,s,a,u,I,M,C,x/=E,w/=E,b,g,y),y.point(I,M),n(I,M,C,x,w,b,l,c,h,f,p,d,g,y))}}return function(e){var r,i,o,s,a,u,l,c,h,f,p,d,g={point:y,lineStart:v,lineEnd:m,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=v}};function y(n,r){n=t(n,r),e.point(n[0],n[1])}function v(){c=NaN,g.point=_,e.lineStart()}function _(r,i){var o=Yy([r,i]),s=t(r,i);n(c,h,l,f,p,d,c=s[0],h=s[1],l=r,f=o[0],p=o[1],d=o[2],16,e),e.point(c,h)}function m(){g.point=y,e.lineEnd()}function x(){v(),g.point=w,g.lineEnd=b}function w(t,e){_(r=t,e),i=c,o=h,s=f,a=p,u=d,g.point=_}function b(){n(c,h,l,f,p,d,i,o,r,s,a,u,16,e),g.lineEnd=m,m()}return g}}(t,e):function(t){return Av({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Xv=Av({point:function(t,e){this.stream.point(t*Ay,e*Ay)}});function qv(t){return function(t){var e,n,r,i,o,s,a,u,l,c,h=150,f=480,p=250,d=0,g=0,y=0,v=0,_=0,m=null,x=Rv,w=null,b=Tv,E=.5,S=Uv(I,E);function C(t){return[(t=o(t[0]*Ay,t[1]*Ay))[0]*h+n,r-t[1]*h]}function P(t){return(t=o.invert((t[0]-n)/h,(r-t[1])/h))&&[t[0]*Ty,t[1]*Ty]}function I(t,i){return[(t=e(t,i))[0]*h+n,r-t[1]*h]}function M(){o=Qy(i=ev(y,v,_),e);var t=e(d,g);return n=f-t[0]*h,r=p+t[1]*h,O()}function O(){return l=c=null,C}return C.stream=function(t){return l&&c===t?l:l=Xv(x(i,S(b(c=t))))},C.clipAngle=function(t){return arguments.length?(x=+t?function(t,e){var n=jy(t),r=n>0,i=Ny(n)>My;function o(t,e){return jy(t)*jy(e)>n}function s(t,e,r){var i=[1,0,0],o=Zy(Yy(t),Yy(e)),s=Hy(o,o),a=o[0],u=s-a*a;if(!u)return!r&&t;var l=n*s/u,c=-n*a/u,h=Zy(i,o),f=Jy(i,l);Ky(f,Jy(o,c));var p=h,d=Hy(f,p),g=Hy(p,p),y=d*d-g*(Hy(f,f)-1);if(!(y<0)){var v=Vy(y),_=Jy(p,(-d-v)/g);if(Ky(_,f),_=Wy(_),!r)return _;var m,x=t[0],w=e[0],b=t[1],E=e[1];w<x&&(m=x,x=w,w=m);var S=w-x,C=Ny(S-Oy)<My;if(!C&&E<b&&(m=b,b=E,E=m),C||S<My?C?b+E>0^_[1]<(Ny(_[0]-x)<My?b:E):b<=_[1]&&_[1]<=E:S>Oy^(x<=_[0]&&_[0]<=w)){var P=Jy(p,(-d+v)/g);return Ky(P,f),[_,Wy(P)]}}}function a(e,n){var i=r?t:Oy-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Ov(o,function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,f){var p,d=[h,f],g=o(h,f),y=r?g?0:a(h,f):g?a(h+(h<0?Oy:-Oy),f):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(p=s(e,d))||lv(e,p)||lv(d,p))&&(d[0]+=My,d[1]+=My,g=o(d[0],d[1])),g!==u)c=0,g?(t.lineStart(),p=s(d,e),t.point(p[0],p[1])):(p=s(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(i&&e&&r^g){var v;y&n||!(v=s(d,e,!0))||(c=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&lv(e,d)||t.point(d[0],d[1]),e=d,u=g,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}},function(n,r,i,o){ov(o,t,e,i,n,r)},r?[0,-t]:[-Oy,t-Oy])}(m=t*Ay,6*Ay):(m=null,Rv),O()):m*Ty},C.clipExtent=function(t){return arguments.length?(b=null==t?(w=s=a=u=null,Tv):xv(w=+t[0][0],s=+t[0][1],a=+t[1][0],u=+t[1][1]),O()):null==w?null:[[w,s],[a,u]]},C.scale=function(t){return arguments.length?(h=+t,M()):h},C.translate=function(t){return arguments.length?(f=+t[0],p=+t[1],M()):[f,p]},C.center=function(t){return arguments.length?(d=t[0]%360*Ay,g=t[1]%360*Ay,M()):[d*Ty,g*Ty]},C.rotate=function(t){return arguments.length?(y=t[0]%360*Ay,v=t[1]%360*Ay,_=t.length>2?t[2]%360*Ay:0,M()):[y*Ty,v*Ty,_*Ty]},C.precision=function(t){return arguments.length?(S=Uv(I,E=t*t),O()):Vy(E)},C.fitExtent=function(t,e){return zv(C,t,e)},C.fitSize=function(t,e){return function(t,e,n){return zv(t,[[0,0],e],n)}(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&P,M()}}(function(){return t})()}function Wv(t){return function(e,n){var r=jy(e),i=jy(n),o=t(r*i);return[o*i*zy(e),o*zy(n)]}}function Yv(t){return function(e,n){var r=Vy(e*e+n*n),i=t(r),o=zy(i),s=jy(i);return[Dy(e*o,r*s),qy(r&&n*o/r)]}}var Hv=Wv(function(t){return Vy(2/(1+t))});Hv.invert=Yv(function(t){return 2*qy(t/2)});var Zv=Wv(function(t){return(t=Xy(t))&&t/zy(t)});function Kv(){return qv(Zv).scale(79.4188).clipAngle(179.999)}function Jv(t,e){return[t,By(Uy((Ly+e)/2))]}function $v(t,e){return[t,e]}function Qv(t,e){var n=jy(e),r=jy(t)*n;return[n*zy(t)/r,zy(e)/r]}function t_(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function e_(t,e){return[jy(e)*zy(t),zy(e)]}function n_(t,e){var n=jy(e),r=1+jy(t)*n;return[n*zy(t)/r,zy(e)/r]}function r_(t,e){return[By(Uy((Ly+e)/2)),-t]}function i_(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return Pu(t,function(t){var i=i_(t,e,n,r);i&&s.push(i)}),eu(s)}var a=function(t){var e=ch(t).geometry.coordinates,n=[-e[0],-e[1]];return Kv().rotate(n).scale(Ua)}(o),u={type:o.type,coordinates:s_(o.coordinates,a)},l=(new Ey.GeoJSONReader).read(u),c=au(uu(e,n),"meters"),h=Ey.BufferOp.bufferOp(l,c,r);if(!o_((h=(new Ey.GeoJSONWriter).write(h)).coordinates))return Ya({type:h.type,coordinates:a_(h.coordinates,a)},i)}function o_(t){return Array.isArray(t[0])?o_(t[0]):isNaN(t[0])}function s_(t,e){return"object"!=typeof t[0]?e(t):t.map(function(t){return s_(t,e)})}function a_(t,e){return"object"!=typeof t[0]?e.invert(t):t.map(function(t){return a_(t,e)})}Zv.invert=Yv(function(t){return t}),Jv.invert=function(t,e){return[t,2*Fy(Gy(e))-Ly]},$v.invert=$v,Qv.invert=Yv(Fy),t_.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,s=o*o;r-=n=(r*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-e)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while(Ny(n)>My&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},e_.invert=Yv(qy),n_.invert=Yv(function(t){return 2*Fy(t)}),r_.invert=function(t,e){return[-e,2*Fy(Gy(t))-Ly]};var u_=function(t,e,n){var r=(n=n||{}).units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return Pu(t,function(t){var n=i_(t,e,r,i);n&&o.push(n)}),eu(o);case"FeatureCollection":return Eu(t,function(t){var n=i_(t,e,r,i);n&&Eu(n,function(t){t&&o.push(t)})}),eu(o)}return i_(t,e,r,i)};var l_=function(t,e,n){void 0===n&&(n={});var r=Xu(t),i=Xu(e),o=wy.union(r.coordinates,i.coordinates);return 0===o.length?null:1===o.length?Ja(o[0],n.properties):iu(o,n.properties)};function c_(t,e,n){void 0===n&&(n={});var r=Xu(t),i=Xu(e),o=wy.intersection(r.coordinates,i.coordinates);return 0===o.length?null:1===o.length?Ja(o[0],n.properties):iu(o,n.properties)}var h_=function(t,e){if(!yu(e=e||{}))throw new Error("options is invalid");var n=e.propertyName;Uu(t,"Polygon","dissolve");var r=[];if(!e.propertyName)return Jh(iu(wy.union.apply(null,t.features.map(function(t){return t.geometry.coordinates}))));var i={};Eu(t,function(t){Object.prototype.hasOwnProperty.call(i,t.properties[n])||(i[t.properties[n]]=[]),i[t.properties[n]].push(t)});for(var o=Object.keys(i),s=0;s<o.length;s++){var a=iu(wy.union.apply(null,i[o[s]].map(function(t){return t.geometry.coordinates})));a.properties[n]=o[s],r.push(a)}return Jh(eu(r))};function f_(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=t[0]+e*i[a],l=t[1]+n*o[a];s.push([u,l])}return s.push(s[0].slice()),Ja([s],r)}function p_(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=[];u.push(t),u.push([t[0]+e*i[a],t[1]+n*o[a]]),u.push([t[0]+e*i[(a+1)%6],t[1]+n*o[(a+1)%6]]),u.push(t),s.push(Ja([u],r))}return s}var d_=function(t,e,n){void 0===n&&(n={});var r=JSON.stringify(n.properties||{}),i=t[0],o=t[1],s=t[2],a=t[3],u=(o+a)/2,l=(i+s)/2,c=2*e/tc([i,u],[s,u],n)*(s-i),h=2*e/tc([l,o],[l,a],n)*(a-o),f=c/2,p=2*f,d=Math.sqrt(3)/2*h,g=s-i,y=a-o,v=3/4*p,_=d,m=(g-p)/(p-f/2),x=Math.floor(m),w=(x*v-f/2-g)/2-f/2+v/2,b=Math.floor((y-d)/d),E=(y-b*d)/2,S=b*d-y>d/2;S&&(E-=d/4);for(var C=[],P=[],I=0;I<6;I++){var M=2*Math.PI/6*I;C.push(Math.cos(M)),P.push(Math.sin(M))}for(var O=[],L=0;L<=x;L++)for(var k=0;k<=b;k++){var R=L%2==1;if((0!==k||!R)&&(0!==k||!S)){var T=L*v+i-w,A=k*_+o+E;if(R&&(A-=d/2),!0===n.triangles)p_([T,A],c/2,h/2,JSON.parse(r),C,P).forEach(function(t){n.mask?c_(n.mask,t)&&O.push(t):O.push(t)});else{var N=f_([T,A],c/2,h/2,JSON.parse(r),C,P);n.mask?c_(n.mask,N)&&O.push(N):O.push(N)}}}return eu(O)};function g_(t){return iu(t)}var y_=function(t,e){var n,r,i=function(t){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],n=t&&t.geometry.coordinates||e;return Ja(n)}(e),o=null;return"FeatureCollection"===t.type?(r=2===(n=t).features.length?wy.union(n.features[0].geometry.coordinates,n.features[1].geometry.coordinates):wy.union.apply(wy,n.features.map(function(t){return t.geometry.coordinates})),o=g_(r)):o=g_(wy.union(t.geometry.coordinates)),o.geometry.coordinates.forEach(function(t){i.geometry.coordinates.push(t[0])}),i};var v_=function(t,e,n,r){void 0===r&&(r={});for(var i=[],o=t[0],s=t[1],a=t[2],u=t[3],l=e/tc([o,s],[a,s],r)*(a-o),c=n/tc([o,s],[o,u],r)*(u-s),h=a-o,f=u-s,p=Math.floor(h/l),d=Math.floor(f/c),g=(f-d*c)/2,y=o+(h-p*l)/2,v=0;v<p;v++){for(var _=s+g,m=0;m<d;m++){var x=Ja([[[y,_],[y,_+c],[y+l,_+c],[y+l,_],[y,_]]],r.properties);r.mask?Gd(r.mask,x)&&i.push(x):i.push(x),_+=c}y+=l}return eu(i)};function __(t,e,n){return void 0===n&&(n={}),v_(t,e,e,n)}var m_=function(t,e,n){void 0===n&&(n={});for(var r=[],i=e/tc([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),o=e/tc([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),s=0,a=t[0];a<=t[2];){for(var u=0,l=t[1];l<=t[3];){var c=null,h=null;s%2==0&&u%2==0?(c=Ja([[[a,l],[a,l+o],[a+i,l],[a,l]]],n.properties),h=Ja([[[a,l+o],[a+i,l+o],[a+i,l],[a,l+o]]],n.properties)):s%2==0&&u%2==1?(c=Ja([[[a,l],[a+i,l+o],[a+i,l],[a,l]]],n.properties),h=Ja([[[a,l],[a,l+o],[a+i,l+o],[a,l]]],n.properties)):u%2==0&&s%2==1?(c=Ja([[[a,l],[a,l+o],[a+i,l+o],[a,l]]],n.properties),h=Ja([[[a,l],[a+i,l+o],[a+i,l],[a,l]]],n.properties)):u%2==1&&s%2==1&&(c=Ja([[[a,l],[a,l+o],[a+i,l],[a,l]]],n.properties),h=Ja([[[a,l+o],[a+i,l+o],[a+i,l],[a,l+o]]],n.properties)),n.mask?(c_(n.mask,c)&&r.push(c),c_(n.mask,h)&&r.push(h)):(r.push(c),r.push(h)),l+=o,u++}s++,a+=i}return eu(r)};var x_=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.gridType,i=n.property,o=n.weight;if(!t)throw new Error("points is required");if(Uu(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==o&&"number"!=typeof o)throw new Error("weight must be a number");i=i||"elevation",r=r||"square",o=o||1;var s,a=Du(t);switch(r){case"point":case"points":s=Zh(a,e,n);break;case"square":case"squares":s=__(a,e,n);break;case"hex":case"hexes":s=d_(a,e,n);break;case"triangle":case"triangles":s=m_(a,e,n);break;default:throw new Error("invalid gridType")}var u=[];return Eu(s,function(e){var s=0,a=0;Eu(t,function(t){var u,l="point"===r?e:hh(e),c=tc(l,t,n);if(void 0!==i&&(u=t.properties[i]),void 0===u&&(u=t.geometry.coordinates[2]),void 0===u)throw new Error("zValue is missing");0===c&&(s=u);var h=1/Math.pow(c,o);a+=h,s+=h*u});var l=lc(e);l.properties[i]=s/a,u.push(l)}),eu(u)},w_=n(7263),b_=function(){function t(t){this.rbush_=new w_(t),this.items_={}}return t.prototype.insert=function(t,e){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[x(e)]=n},t.prototype.load=function(t,e){for(var n=new Array(e.length),r=0,i=e.length;r<i;r++){var o=t[r],s=e[r],a={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};n[r]=a,this.items_[x(s)]=a}this.rbush_.load(n)},t.prototype.remove=function(t){var e=x(t),n=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(n)},t.prototype.update=function(t,e){var n=this.items_[x(e)];ot([n.minX,n.minY,n.maxX,n.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map(function(t){return t.value})},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(t){return t.value})},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var n,r=0,i=t.length;r<i;r++)if(n=e(t[r]))return n;return n},t.prototype.isEmpty=function(){return re(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return et(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),E_=b_,S_="addfeature",C_="changefeature",P_="clear",I_="removefeature",M_="featuresloadstart",O_="featuresloadend",L_="featuresloaderror",k_=0,R_=1,T_=2,A_=3,N_=4,F_=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=as(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return _()},t.prototype.getImage=function(t){return _()},t.prototype.getHitDetectionImage=function(){return _()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return _()},t.prototype.getImageSize=function(){return _()},t.prototype.getOrigin=function(){return _()},t.prototype.getSize=function(){return _()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=as(t)},t.prototype.listenImageChange=function(t){_()},t.prototype.load=function(){_()},t.prototype.unlistenImageChange=function(t){_()},t}(),D_=F_;function j_(t){return Array.isArray(t)?Yt(t):t}var G_=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)}}(),B_=function(t){function e(e){var n=this,r=void 0!==e.rotateWithView&&e.rotateWithView;return(n=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0],declutterMode:e.declutterMode})||this).canvas_=void 0,n.hitDetectionCanvas_=null,n.fill_=void 0!==e.fill?e.fill:null,n.origin_=[0,0],n.points_=e.points,n.radius_=void 0!==e.radius?e.radius:e.radius1,n.radius2_=e.radius2,n.angle_=void 0!==e.angle?e.angle:0,n.stroke_=void 0!==e.stroke?e.stroke:null,n.size_=null,n.renderOptions_=null,n.render(),n}return G_(e,t),e.prototype.clone=function(){var t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.setFill=function(t){this.fill_=t,this.render()},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var n=this.renderOptions_,r=mn(n.size*t,n.size*t);this.draw_(n,r,t),e=r.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return T_},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.setStroke=function(t){this.stroke_=t,this.render()},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,n){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var r=this.radius_,i=void 0===this.radius2_?r:this.radius2_;if(r<i){var o=r;r=i,i=o}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,u=i*Math.sin(a),l=r-Math.sqrt(i*i-u*u),c=Math.sqrt(u*u+l*l),h=c/u;if("miter"===t&&h<=n)return h*e;var f=e/2/h,p=e/2*(l/c),d=Math.sqrt((r+f)*(r+f)+p*p)-r;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=r*Math.sin(a),y=i-Math.sqrt(r*r-g*g),v=Math.sqrt(g*g+y*y)/g;if(v<=n){var _=v*e/2-i-r;return 2*Math.max(d,_)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=Ln,n=0,r=null,i=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=kn),t=j_(t),void 0===(o=this.stroke_.getWidth())&&(o=1),r=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Ln),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var s=this.calculateLineJoinSize_(e,o,n),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*a+s),lineDash:r,lineDashOffset:i,lineJoin:e,miterLimit:n}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var r=this.fill_.getColor();null===r&&(r=In),e.fillStyle=j_(r),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),n=0;if("string"==typeof e&&(e=qt(e)),null===e?n=1:Array.isArray(e)&&(n=4===e.length?e[3]:1),0===n){var r=mn(t.size,t.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(t,r)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,n=this.radius_;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{var r=void 0===this.radius2_?n:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var i=this.angle_-Math.PI/2,o=2*Math.PI/e,s=0;s<e;s++){var a=i+s*o,u=s%2==0?n:r;t.lineTo(u*Math.cos(a),u*Math.sin(a))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=In,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(D_),z_=B_,V_=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)}}(),U_=function(t){function e(e){var n=e||{};return t.call(this,{points:1/0,fill:n.fill,radius:n.radius,stroke:n.stroke,scale:void 0!==n.scale?n.scale:1,rotation:void 0!==n.rotation?n.rotation:0,rotateWithView:void 0!==n.rotateWithView&&n.rotateWithView,displacement:void 0!==n.displacement?n.displacement:[0,0],declutterMode:n.declutterMode})||this}return V_(e,t),e.prototype.clone=function(){var t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(z_),X_=U_,q_=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),W_=q_,Y_=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),H_=Y_,Z_=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Q_,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Q_,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var K_=null;function J_(t,e){if(!K_){var n=new W_({color:"rgba(255,255,255,0.4)"}),r=new H_({color:"#3399CC",width:1.25});K_=[new Z_({image:new X_({fill:n,stroke:r,radius:5}),fill:n,stroke:r})]}return K_}function $_(){var t={},e=[255,255,255,1],n=[0,153,255,1];return t.Polygon=[new Z_({fill:new W_({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new Z_({stroke:new H_({color:e,width:5})}),new Z_({stroke:new H_({color:n,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new Z_({image:new X_({radius:6,fill:new W_({color:n}),stroke:new H_({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function Q_(t){return t.getGeometry()}var tm=Z_,em=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)}}(),nm="renderOrder",rm=function(t){function e(e){var n=this,r=e||{},i=te({},r);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(n=t.call(this,i)||this).declutter_=void 0!==r.declutter&&r.declutter,n.renderBuffer_=void 0!==r.renderBuffer?r.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(r.style),n.updateWhileAnimating_=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,n.updateWhileInteracting_=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,n}return em(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(nm)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new w_(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(nm,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:J_,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var n;Array.isArray(t)?n=t:(T("function"==typeof t.getZIndex,41),n=[t]),e=function(){return n}}return e}(this.style_),this.changed()},e}(Ze),im=rm,om={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},sm=[om.FILL],am=[om.STROKE],um=[om.BEGIN_PATH],lm=[om.CLOSE_PATH],cm=om,hm=function(){function t(){}return t.prototype.drawCustom=function(t,e,n,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),fm=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)}}(),pm=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=n,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return fm(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},e.prototype.appendFlatPointCoordinates=function(t,e){for(var n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,o=i.length,s=0,a=t.length;s<a;s+=e)r[0]=t[s],r[1]=t[s+1],K(n,r)&&(i[o++]=r[0],i[o++]=r[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,n,r,i,o){var s=this.coordinates,a=s.length,u=this.getBufferedMaxExtent();o&&(e+=r);var l,c,h,f=t[e],p=t[e+1],d=this.tmpCoordinate_,g=!0;for(l=e+r;l<n;l+=r)d[0]=t[l],d[1]=t[l+1],(h=Q(u,d))!==c?(g&&(s[a++]=f,s[a++]=p,g=!1),s[a++]=d[0],s[a++]=d[1]):h===z?(s[a++]=d[0],s[a++]=d[1],g=!1):g=!0,f=d[0],p=d[1],c=h;return(i&&g||l===e+r)&&(s[a++]=f,s[a++]=p),a},e.prototype.drawCustomCoordinates_=function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o],u=this.appendFlatLineCoordinates(t,e,a,r,!1,!1);i.push(u),e=a}return e},e.prototype.drawCustom=function(t,e,n,r){this.beginGeometry(t,e);var i,o,s,a,u,l=t.getType(),c=t.getStride(),h=this.coordinates.length;switch(l){case"MultiPolygon":i=t.getOrientedFlatCoordinates(),a=[];var f=t.getEndss();u=0;for(var p=0,d=f.length;p<d;++p){var g=[];u=this.drawCustomCoordinates_(i,u,f[p],c,g),a.push(g)}this.instructions.push([cm.CUSTOM,h,a,t,n,Io]),this.hitDetectionInstructions.push([cm.CUSTOM,h,a,t,r||n,Io]);break;case"Polygon":case"MultiLineString":s=[],i="Polygon"==l?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),u=this.drawCustomCoordinates_(i,0,t.getEnds(),c,s),this.instructions.push([cm.CUSTOM,h,s,t,n,Po]),this.hitDetectionInstructions.push([cm.CUSTOM,h,s,t,r||n,Po]);break;case"LineString":case"Circle":i=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(i,0,i.length,c,!1,!1),this.instructions.push([cm.CUSTOM,h,o,t,n,Co]),this.hitDetectionInstructions.push([cm.CUSTOM,h,o,t,r||n,Co]);break;case"MultiPoint":i=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(i,c))>h&&(this.instructions.push([cm.CUSTOM,h,o,t,n,Co]),this.hitDetectionInstructions.push([cm.CUSTOM,h,o,t,r||n,Co]));break;case"Point":i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([cm.CUSTOM,h,o,t,n]),this.hitDetectionInstructions.push([cm.CUSTOM,h,o,t,r||n])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[cm.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[cm.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var n,r,i=e.length,o=-1;for(t=0;t<i;++t)(r=(n=e[t])[0])==cm.END_GEOMETRY?o=t:r==cm.BEGIN_GEOMETRY&&(n[2]=t,f(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var n=this.state;if(t){var r=t.getColor();n.fillStyle=j_(r||In)}else n.fillStyle=void 0;if(e){var i=e.getColor();n.strokeStyle=j_(i||kn);var o=e.getLineCap();n.lineCap=void 0!==o?o:Mn;var s=e.getLineDash();n.lineDash=s?s.slice():On;var a=e.getLineDashOffset();n.lineDashOffset=a||0;var u=e.getLineJoin();n.lineJoin=void 0!==u?u:Ln;var l=e.getWidth();n.lineWidth=void 0!==l?l:1;var c=e.getMiterLimit();n.miterLimit=void 0!==c?c:10,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,n=[cm.SET_FILL_STYLE,e];return"string"!=typeof e&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[cm.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,r=t.lineCap,i=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=r||i!=t.currentLineDash&&!d(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=u)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=r,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=u)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[cm.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=H(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Y(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(hm),dm=pm,gm=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)}}(),ym=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterMode_=void 0,o.declutterImageWithText_=void 0,o}return gm(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([cm.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([cm.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([cm.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([cm.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),r=t.getSize(),i=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e},e}(dm),vm=ym,_m=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)}}(),mm=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return _m(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,r){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,r,!1,!1),s=[cm.MOVE_TO_LINE_TO,i,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),n},e.prototype.drawLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([cm.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,On,0],um);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(am),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([cm.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],um);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),u=0,l=0,c=o.length;l<c;++l)u=this.drawFlatCoordinates_(s,u,o[l],a);this.hitDetectionInstructions.push(am),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(am),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(am),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(um)},e}(dm),xm=mm,wm=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)}}(),bm=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return wm(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,n,r){var i=this.state,o=void 0!==i.fillStyle,s=void 0!==i.strokeStyle,a=n.length;this.instructions.push(um),this.hitDetectionInstructions.push(um);for(var u=0;u<a;++u){var l=n[u],c=this.coordinates.length,h=this.appendFlatLineCoordinates(t,e,l,r,!0,!s),f=[cm.MOVE_TO_LINE_TO,c,h];this.instructions.push(f),this.hitDetectionInstructions.push(f),s&&(this.instructions.push(lm),this.hitDetectionInstructions.push(lm)),e=l}return o&&(this.instructions.push(sm),this.hitDetectionInstructions.push(sm)),s&&(this.instructions.push(am),this.hitDetectionInstructions.push(am)),e},e.prototype.drawCircle=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([cm.SET_FILL_STYLE,In]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([cm.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);var u=[cm.CIRCLE,a];this.instructions.push(um,u),this.hitDetectionInstructions.push(um,u),void 0!==n.fillStyle&&(this.instructions.push(sm),this.hitDetectionInstructions.push(sm)),void 0!==n.strokeStyle&&(this.instructions.push(am),this.hitDetectionInstructions.push(am)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([cm.SET_FILL_STYLE,In]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([cm.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([cm.SET_FILL_STYLE,In]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([cm.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),u=0,l=0,c=o.length;l<c;++l)u=this.drawFlatCoordinatess_(s,u,o[l],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var n=this.coordinates,r=0,i=n.length;r<i;++r)n[r]=bo(n[r],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(dm),Em=bm,Sm="point",Cm="line";function Pm(t,e,n,r,i){var o,s,a,u,l,c,h,f,p,d=n,g=n,y=0,v=0,_=n;for(o=n;o<r;o+=i){var m=e[o],x=e[o+1];void 0!==u&&(f=m-u,p=x-l,a=Math.sqrt(f*f+p*p),void 0!==c&&(v+=s,Math.acos((c*f+h*p)/(s*a))>t&&(v>y&&(y=v,d=_,g=o),v=0,_=o-i)),s=a,c=f,h=p),u=m,l=x}return(v+=a)>y?[_,o]:[d,g]}var Im=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)}}(),Mm={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Om=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return Im(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var n=this.textFillState_,r=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(n||r)){var o=this.coordinates,s=o.length,a=t.getType(),u=null,l=t.getStride();if(i.placement!==Cm||"LineString"!=a&&"MultiLineString"!=a&&"Polygon"!=a&&"MultiPolygon"!=a){var c=i.overflow?null:[];switch(a){case"Point":case"MultiPoint":u=t.getFlatCoordinates();break;case"LineString":u=t.getFlatMidpoint();break;case"Circle":u=t.getCenter();break;case"MultiLineString":u=t.getFlatMidpoints(),l=2;break;case"Polygon":u=t.getFlatInteriorPoint(),i.overflow||c.push(u[2]/this.resolution),l=3;break;case"MultiPolygon":var h=t.getFlatInteriorPoints();u=[];for(b=0,E=h.length;b<E;b+=3)i.overflow||c.push(h[b+2]/this.resolution),u.push(h[b],h[b+1]);if(0===u.length)return;l=2}if((L=this.appendFlatPointCoordinates(u,l))===s)return;if(c&&(L-s)/2!==u.length/l){var f=s/2;c=c.filter(function(t,e){var n=o[2*(f+e)]===u[e*l]&&o[2*(f+e)+1]===u[e*l+1];return n||--f,n})}this.saveTextStates_(),(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var p=i.padding;if(p!=An&&(i.scale[0]<0||i.scale[1]<0)){var d=i.padding[0],g=i.padding[1],y=i.padding[2],v=i.padding[3];i.scale[0]<0&&(g=-g,v=-v),i.scale[1]<0&&(d=-d,y=-y),p=[d,g,y,v]}var _=this.pixelRatio;this.instructions.push([cm.DRAW_IMAGE,s,L,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,p==An?An:p.map(function(t){return t*_}),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,c]);var m=1/_;this.hitDetectionInstructions.push([cm.DRAW_IMAGE,s,L,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,void 0,this.declutterImageWithText_,p,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,c]),this.endGeometry(e)}else{if(!Et(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(u=t.getFlatCoordinates(),"LineString"==a)x=[u.length];else if("MultiLineString"==a)x=t.getEnds();else if("Polygon"==a)x=t.getEnds().slice(0,1);else if("MultiPolygon"==a){var w=t.getEndss();x=[];for(var b=0,E=w.length;b<E;++b)x.push(w[b][0])}this.beginGeometry(t,e);for(var S=i.textAlign,C=0,P=void 0,I=0,M=x.length;I<M;++I){if(null==S){var O=Pm(i.maxAngle,u,C,x[I],l);C=O[0],P=O[1]}else P=x[I];for(var b=C;b<P;b+=l)o.push(u[b],u[b+1]);var L=o.length;C=x[I],this.drawChars_(s,L),s=L}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||Rn,justify:e.justify,textBaseline:e.textBaseline||Tn,scale:e.scale});var o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))},e.prototype.drawChars_=function(t,e){var n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,o=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,u=Mm[r.textBaseline],l=this.textOffsetY_*a,c=this.text_,h=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([cm.DRAW_CHARS,t,e,u,r.overflow,s,r.maxAngle,a,l,i,h*a,c,o,1]),this.hitDetectionInstructions.push([cm.DRAW_CHARS,t,e,u,r.overflow,s,r.maxAngle,1,l,i,h,c,o,1/a])},e.prototype.setTextStyle=function(t,e){var n,r,i;if(t){var o=t.getFill();o?((r=this.textFillState_)||(r={},this.textFillState_=r),r.fillStyle=j_(o.getColor()||In)):(r=null,this.textFillState_=r);var s=t.getStroke();if(s){(i=this.textStrokeState_)||(i={},this.textStrokeState_=i);var a=s.getLineDash(),u=s.getLineDashOffset(),l=s.getWidth(),c=s.getMiterLimit();i.lineCap=s.getLineCap()||Mn,i.lineDash=a?a.slice():On,i.lineDashOffset=void 0===u?0:u,i.lineJoin=s.getLineJoin()||Ln,i.lineWidth=void 0===l?1:l,i.miterLimit=void 0===c?10:c,i.strokeStyle=j_(s.getColor()||kn)}else i=null,this.textStrokeState_=i;n=this.textState_;var h=t.getFont()||Pn;Bn(h);var f=t.getScaleArray();n.overflow=t.getOverflow(),n.font=h,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||Tn,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||An,n.scale=void 0===f?[1,1]:f;var p=t.getOffsetX(),d=t.getOffsetY(),g=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===p?0:p,this.textOffsetY_=void 0===d?0:d,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===y?0:y,this.strokeKey_=i?("string"==typeof i.strokeStyle?i.strokeStyle:x(i.strokeStyle))+i.lineCap+i.lineDashOffset+"|"+i.lineWidth+i.lineJoin+i.miterLimit+"["+i.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+x(r.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(dm),Lm={Circle:Em,Default:dm,Image:vm,LineString:xm,Polygon:Em,Text:Om},km=function(){function t(t,e,n,r){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var n=this.buildersByZIndex_[e];for(var r in n){var i=n[r].finish();t[e][r]=i}}return t},t.prototype.getBuilder=function(t,e){var n=void 0!==t?t.toString():"0",r=this.buildersByZIndex_[n];void 0===r&&(r={},this.buildersByZIndex_[n]=r);var i=r[e];void 0===i&&(i=new(0,Lm[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[e]=i);return i},t}(),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=function(t){function e(e){var n=t.call(this)||this;return n.ready=!0,n.boundHandleImageChange_=n.handleImageChange_.bind(n),n.layer_=e,n.declutterExecutorGroup=null,n}return Rm(e,t),e.prototype.getFeatures=function(t){return _()},e.prototype.getData=function(t){return null},e.prototype.prepareFrame=function(t){return _()},e.prototype.renderFrame=function(t,e){return _()},e.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},e.prototype.createLoadedTileFinder=function(t,e,n){return function(r,i){var o=this.loadedTileCallback.bind(this,n,r);return t.forEachLoadedTile(e,r,i,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){},e.prototype.getDataAtPixel=function(t,e,n){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===T_&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=T_&&e!=A_&&t.addEventListener(ae,this.boundHandleImageChange_),e==k_&&(t.load(),e=t.getState()),e==T_},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()},e.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},e}(Se),Am=Tm,Nm=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)}}(),Fm=[],Dm=null;var jm=function(t){function e(e){var n=t.call(this,e)||this;return n.container=null,n.renderedResolution,n.tempTransform=[1,0,0,1,0,0],n.pixelTransform=[1,0,0,1,0,0],n.inversePixelTransform=[1,0,0,1,0,0],n.context=null,n.containerReused=!1,n.pixelContext_=null,n.frameState=null,n}return Nm(e,t),e.prototype.getImageData=function(t,e,n){var r,i;Dm||((r=document.createElement("canvas")).width=1,r.height=1,Dm=r.getContext("2d")),Dm.clearRect(0,0,1,1);try{Dm.drawImage(t,e,n,1,1,0,0,1,1),i=Dm.getImageData(0,0,1,1).data}catch(t){return Dm=null,null}return i},e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,n){var r,i,o=this.getLayer().getClassName();t&&t.className===o&&(!n||t&&t.style.backgroundColor&&d(qt(t.style.backgroundColor),qt(n)))&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(i=a.getContext("2d")));if(i&&i.canvas.style.transform===e?(this.container=t,this.context=i,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(r=document.createElement("div")).className=o;var s=r.style;s.position="absolute",s.width="100%",s.height="100%";var a=(i=mn()).canvas;r.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=r,this.context=i}this.containerReused||!n||this.container.style.backgroundColor||(this.container.style.backgroundColor=n)},e.prototype.clipUnrotated=function(t,e,n){var r=xt(n),i=wt(n),o=pt(n),s=ft(n);F(e.coordinateToPixelTransform,r),F(e.coordinateToPixelTransform,i),F(e.coordinateToPixelTransform,o),F(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;F(a,r),F(a,i),F(a,o),F(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,n){var r=this.getLayer();if(r.hasListener(t)){var i=new hn(t,this.inversePixelTransform,n,e);r.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(ze,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ve,t,e)},e.prototype.getRenderTransform=function(t,e,n,r,i,o,s){var a=i/2,u=o/2,l=r/e,c=-l,h=-t[0]+s,f=-t[1];return D(this.tempTransform,a,u,l,c,-n,h,f)},e.prototype.getDataAtPixel=function(t,e,n){var r=F(this.inversePixelTransform,t.slice()),i=this.context,o=this.getLayer().getExtent();if(o&&!K(o,F(e.pixelToCoordinateTransform,t.slice())))return null;var s,a=Math.round(r[0]),u=Math.round(r[1]),l=this.pixelContext_;if(!l){var c=document.createElement("canvas");c.width=1,c.height=1,l=c.getContext("2d"),this.pixelContext_=l}l.clearRect(0,0,1,1);try{l.drawImage(i.canvas,a,u,1,1,0,0,1,1),s=l.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):s}return 0===s[3]?null:s},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(Am),Gm=jm;function Bm(t,e,n,r,i,o,s,a,u,l,c,h){var f=t[e],p=t[e+1],d=0,g=0,y=0,v=0;function _(){d=f,g=p,f=t[e+=r],p=t[e+1],v+=y,y=Math.sqrt((f-d)*(f-d)+(p-g)*(p-g))}do{_()}while(e<n-r&&v+y<o);for(var m=0===y?0:(o-v)/y,x=Nt(d,f,m),w=Nt(g,p,m),b=e-r,E=v,S=o+a*u(l,i,c);e<n-r&&v+y<S;)_();var C,P=Nt(d,f,m=0===y?0:(S-v)/y),I=Nt(g,p,m);if(h){var M=[x,w,P,I];eo(M,0,4,2,h,M,M),C=M[0]>M[2]}else C=x>P;var O,L=Math.PI,k=[],R=b+r===e;if(y=0,v=E,f=t[e=b],p=t[e+1],R){_(),O=Math.atan2(p-g,f-d),C&&(O+=O>0?-L:L);var T=(P+x)/2,A=(I+w)/2;return k[0]=[T,A,(S-o)/2,O,i],k}for(var N=0,F=(i=i.replace(/\n/g," ")).length;N<F;){_();var D=Math.atan2(p-g,f-d);if(C&&(D+=D>0?-L:L),void 0!==O){var j=D-O;if(j+=j>L?-2*L:j<-L?2*L:0,Math.abs(j)>s)return null}O=D;for(var G=N,B=0;N<F;++N){var z=a*u(l,i[C?F-N-1:N],c);if(e+r<n&&v+y<o+B+z/2)break;B+=z}if(N!==G){var V=C?i.substring(F-G,F-N):i.substring(G,N);T=Nt(d,f,m=0===y?0:(o+B/2-v)/y),A=Nt(g,p,m);k.push([T,A,B/2,D,V]),o+=B}}return k}function zm(t,e,n,r){for(var i=t[e],o=t[e+1],s=0,a=e+r;a<n;a+=r){var u=t[a],l=t[a+1];s+=Math.sqrt((u-i)*(u-i)+(l-o)*(l-o)),i=u,o=l}return s}var Vm=[1/0,1/0,-1/0,-1/0],Um=[],Xm=[],qm=[],Wm=[];function Ym(t){return t[3].declutterBox}var Hm=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Zm(t,e){return"start"!==e&&"end"!==e||Hm.test(t)||(e="start"===e?"left":"right"),Mm[e]}function Km(t,e,n){return n>0&&t.push("\n",""),t.push(e,""),t}var Jm=function(){function t(t,e,n,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,n,r){var i=t+e+n+r;if(this.labels_[i])return this.labels_[i];var o=r?this.strokeStates[r]:null,s=n?this.fillStates[n]:null,a=this.textStates[e],u=this.pixelRatio,l=[a.scale[0]*u,a.scale[1]*u],c=Array.isArray(t),h=a.justify?Mm[a.justify]:Zm(Array.isArray(t)?t[0]:t,a.textAlign||Rn),f=r&&o.lineWidth?o.lineWidth:0,p=c?t:t.split("\n").reduce(Km,[]),d=function(t,e){for(var n=[],r=[],i=[],o=0,s=0,a=0,u=0,l=0,c=e.length;l<=c;l+=2){var h=e[l];if("\n"!==h&&l!==c){var f=e[l+1]||t.font,p=Un(f,h);n.push(p),s+=p;var d=zn(f);r.push(d),u=Math.max(u,d)}else o=Math.max(o,s),i.push(s),s=0,a+=u}return{width:o,height:a,widths:n,heights:r,lineWidths:i}}(a,p),g=d.width,y=d.height,v=d.widths,_=d.heights,m=d.lineWidths,x=g+f,w=[],b=(x+2)*l[0],E=(y+f)*l[1],S={width:b<0?Math.floor(b):Math.ceil(b),height:E<0?Math.floor(E):Math.ceil(E),contextInstructions:w};(1==l[0]&&1==l[1]||w.push("scale",l),r)&&(w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",f),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit),(M?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset)));n&&w.push("fillStyle",s.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var C,P=.5-h,I=h*x+P*f,O=[],L=[],k=0,R=0,T=0,A=0,N=0,F=p.length;N<F;N+=2){var D=p[N];if("\n"!==D){var j=p[N+1]||a.font;j!==C&&(r&&O.push("font",j),n&&L.push("font",j),C=j),k=Math.max(k,_[T]);var G=[D,I+P*v[T]+h*(v[T]-m[A]),.5*(f+k)+R];I+=v[T],r&&O.push("strokeText",G),n&&L.push("fillText",G),++T}else R+=k,k=0,I=h*x+P*f,++A}return Array.prototype.push.apply(w,O),Array.prototype.push.apply(w,L),this.labels_[i]=S,S},t.prototype.replayTextBackground_=function(t,e,n,r,i,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,n,r,i,o,s,a,u,l,c,h,f,p,d,g){var y,v=n-(s*=h[0]),_=r-(a*=h[1]),m=i+u>t?t-u:i,x=o+l>e?e-l:o,w=p[3]+m*h[0]+p[1],b=p[0]+x*h[1]+p[2],E=v-p[3],S=_-p[0];return(d||0!==c)&&(Um[0]=E,Wm[0]=E,Um[1]=S,Xm[1]=S,Xm[0]=E+w,qm[0]=Xm[0],qm[1]=S+b,Wm[1]=qm[1]),0!==c?(F(y=D([1,0,0,1,0,0],n,r,1,1,c,-n,-r),Um),F(y,Xm),F(y,qm),F(y,Wm),et(Math.min(Um[0],Xm[0],qm[0],Wm[0]),Math.min(Um[1],Xm[1],qm[1],Wm[1]),Math.max(Um[0],Xm[0],qm[0],Wm[0]),Math.max(Um[1],Xm[1],qm[1],Wm[1]),Vm)):et(Math.min(E,E+w),Math.min(S,S+b),Math.max(E,E+w),Math.max(S,S+b),Vm),f&&(v=Math.round(v),_=Math.round(_)),{drawImageX:v,drawImageY:_,drawImageW:m,drawImageH:x,originX:u,originY:l,declutterBox:{minX:Vm[0],minY:Vm[1],maxX:Vm[2],maxY:Vm[3],value:g},canvasTransform:y,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,n,r,i,o,s){var a=!(!o&&!s),u=r.declutterBox,l=t.canvas,c=s?s[2]*r.scale[0]/2:0;return u.minX-c<=l.width/e&&u.maxX+c>=0&&u.minY-c<=l.height/e&&u.maxY+c>=0&&(a&&this.replayTextBackground_(t,Um,Xm,qm,Wm,o,s),qn(t,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=F(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,n,r){var i=this.textStates[e],o=this.createLabel(t,e,r,n),s=this.strokeStates[n],a=this.pixelRatio,u=Zm(Array.isArray(t)?t[0]:t,i.textAlign||Rn),l=Mm[i.textBaseline||Tn],c=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:u*(o.width/a-2*i.scale[0])+2*(.5-u)*c,anchorY:l*o.height/a+2*(.5-l)*c}},t.prototype.execute_=function(t,e,n,r,i,o,s,a){var u,l,c;this.pixelCoordinates_&&d(n,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=to(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),l=this.renderedTransform_,c=n,l[0]=c[0],l[1]=c[1],l[2]=c[2],l[3]=c[3],l[4]=c[4],l[5]=c[5]);for(var h,f,p,g,y,v,_,m,x,w,b,E,S,C,P,I,M=0,O=r.length,L=0,k=0,R=0,T=null,A=null,N=this.coordinateCache_,F=this.viewRotation_,D=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:F},G=this.instructions!=r||this.overlaps?0:200;M<O;){var B=r[M];switch(B[0]){case cm.BEGIN_GEOMETRY:S=B[1],I=B[3],S.getGeometry()?void 0===s||Et(s,I.getExtent())?++M:M=B[2]+1:M=B[2];break;case cm.BEGIN_PATH:k>G&&(this.fill_(t),k=0),R>G&&(t.stroke(),R=0),k||R||(t.beginPath(),g=NaN,y=NaN),++M;break;case cm.CIRCLE:var z=u[L=B[1]],V=u[L+1],U=u[L+2]-z,X=u[L+3]-V,q=Math.sqrt(U*U+X*X);t.moveTo(z+q,V),t.arc(z,V,q,0,2*Math.PI,!0),++M;break;case cm.CLOSE_PATH:t.closePath(),++M;break;case cm.CUSTOM:L=B[1],h=B[2];var W=B[3],Y=B[4],H=6==B.length?B[5]:void 0;j.geometry=W,j.feature=S,M in N||(N[M]=[]);var Z=N[M];H?H(u,L,h,2,Z):(Z[0]=u[L],Z[1]=u[L+1],Z.length=2),Y(Z,j),++M;break;case cm.DRAW_IMAGE:L=B[1],h=B[2],m=B[3],f=B[4],p=B[5];var K=B[6],J=B[7],$=B[8],Q=B[9],tt=B[10],et=B[11],nt=B[12],rt=B[13],it=B[14],ot=B[15];if(!m&&B.length>=20){x=B[19],w=B[20],b=B[21],E=B[22];var st=this.drawLabelWithPointPlacement_(x,w,b,E);m=st.label,B[3]=m;var at=B[23];f=(st.anchorX-at)*this.pixelRatio,B[4]=f;var ut=B[24];p=(st.anchorY-ut)*this.pixelRatio,B[5]=p,K=m.height,B[6]=K,rt=m.width,B[13]=rt}var lt=void 0;B.length>25&&(lt=B[25]);var ct=void 0,ht=void 0,ft=void 0;B.length>17?(ct=B[16],ht=B[17],ft=B[18]):(ct=An,ht=!1,ft=!1),tt&&D?et+=F:tt||D||(et-=F);for(var pt=0;L<h;L+=2)if(!(lt&<[pt++]<rt/this.pixelRatio)){var dt=[t,e,m,Vt=this.calculateImageOrLabelDimensions_(m.width,m.height,u[L],u[L+1],rt,K,f,p,$,Q,et,nt,i,ct,ht||ft,S),J,ht?T:null,ft?A:null];if(a){if("none"===it)continue;if("obstacle"===it){a.insert(Vt.declutterBox);continue}var gt=void 0,yt=void 0;if(ot){var vt=h-L;if(!ot[vt]){ot[vt]=dt;continue}if(gt=ot[vt],delete ot[vt],yt=Ym(gt),a.collides(yt))continue}if(a.collides(Vt.declutterBox))continue;gt&&(a.insert(yt),this.replayImageOrLabel_.apply(this,gt)),a.insert(Vt.declutterBox)}this.replayImageOrLabel_.apply(this,dt)}++M;break;case cm.DRAW_CHARS:var _t=B[1],mt=B[2],xt=B[3],wt=B[4];E=B[5];var bt=B[6],St=B[7],Ct=B[8];b=B[9];var Pt=B[10];x=B[11],w=B[12];var It=[B[13],B[13]],Mt=this.textStates[w],Ot=Mt.font,Lt=[Mt.scale[0]*St,Mt.scale[1]*St],kt=void 0;Ot in this.widths_?kt=this.widths_[Ot]:(kt={},this.widths_[Ot]=kt);var Rt=zm(u,_t,mt,2),Tt=Math.abs(Lt[0])*Xn(Ot,x,kt);if(wt||Tt<=Rt){var At=this.textStates[w].textAlign,Nt=Bm(u,_t,mt,2,x,(Rt-Tt)*Mm[At],bt,Math.abs(Lt[0]),Xn,Ot,kt,D?0:this.viewRotation_);t:if(Nt){var Ft=[],Dt=void 0,jt=void 0,Gt=void 0,Bt=void 0,zt=void 0;if(b)for(Dt=0,jt=Nt.length;Dt<jt;++Dt){Gt=(zt=Nt[Dt])[4],Bt=this.createLabel(Gt,w,"",b),f=zt[2]+(Lt[0]<0?-Pt:Pt),p=xt*Bt.height+2*(.5-xt)*Pt*Lt[1]/Lt[0]-Ct;var Vt=this.calculateImageOrLabelDimensions_(Bt.width,Bt.height,zt[0],zt[1],Bt.width,Bt.height,f,p,0,0,zt[3],It,!1,An,!1,S);if(a&&a.collides(Vt.declutterBox))break t;Ft.push([t,e,Bt,Vt,1,null,null])}if(E)for(Dt=0,jt=Nt.length;Dt<jt;++Dt){Gt=(zt=Nt[Dt])[4],Bt=this.createLabel(Gt,w,E,""),f=zt[2],p=xt*Bt.height-Ct;Vt=this.calculateImageOrLabelDimensions_(Bt.width,Bt.height,zt[0],zt[1],Bt.width,Bt.height,f,p,0,0,zt[3],It,!1,An,!1,S);if(a&&a.collides(Vt.declutterBox))break t;Ft.push([t,e,Bt,Vt,1,null,null])}a&&a.load(Ft.map(Ym));for(var Ut=0,Xt=Ft.length;Ut<Xt;++Ut)this.replayImageOrLabel_.apply(this,Ft[Ut])}}++M;break;case cm.END_GEOMETRY:if(void 0!==o){var qt=o(S=B[1],I);if(qt)return qt}++M;break;case cm.FILL:G?k++:this.fill_(t),++M;break;case cm.MOVE_TO_LINE_TO:for(L=B[1],h=B[2],C=u[L],_=(P=u[L+1])+.5|0,(v=C+.5|0)===g&&_===y||(t.moveTo(C,P),g=v,y=_),L+=2;L<h;L+=2)v=(C=u[L])+.5|0,_=(P=u[L+1])+.5|0,L!=h-2&&v===g&&_===y||(t.lineTo(C,P),g=v,y=_);++M;break;case cm.SET_FILL_STYLE:T=B,this.alignFill_=B[2],k&&(this.fill_(t),k=0,R&&(t.stroke(),R=0)),t.fillStyle=B[1],++M;break;case cm.SET_STROKE_STYLE:A=B,R&&(t.stroke(),R=0),this.setStrokeStyle_(t,B),++M;break;case cm.STROKE:G?R++:t.stroke(),++M;break;default:++M}}k&&this.fill_(t),R&&t.stroke()},t.prototype.execute=function(t,e,n,r,i,o){this.viewRotation_=r,this.execute_(t,e,n,this.instructions,i,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,n,r,i){return this.viewRotation_=n,this.execute_(t,1,e,this.hitDetectionInstructions,!0,r,i)},t}(),$m=Jm,Qm=["Polygon","Circle","LineString","Image","Text","Default"],tx=function(){function t(t,e,n,r,i,o){this.maxExtent_=t,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(i)}return t.prototype.clip=function(t,e){var n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var n=this.executorsByZIndex_[e];void 0===n&&(n={},this.executorsByZIndex_[e]=n);var r=t[e];for(var i in r){var o=r[i];n[i]=new $m(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var n=this.executorsByZIndex_[e],r=0,i=t.length;r<i;++r)if(t[r]in n)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i,o){var s=2*(r=Math.round(r))+1,a=D(this.hitDetectionTransform_,r+.5,r+.5,1/e,-1/e,-n,-t[0],-t[1]),u=!this.hitDetectionContext_;u&&(this.hitDetectionContext_=mn(s,s));var l,h=this.hitDetectionContext_;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):u||h.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(at(l=[1/0,1/0,-1/0,-1/0],t),Y(l,e*(this.renderBuffer_+r),l));var f,p=function(t){if(void 0!==ex[t])return ex[t];for(var e=2*t+1,n=t*t,r=new Array(n+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var s=i*i+o*o;if(s>n)break;var a=r[s];a||(a=[],r[s]=a),a.push(4*((t+i)*e+(t+o))+3),i>0&&a.push(4*((t-i)*e+(t+o))+3),o>0&&(a.push(4*((t+i)*e+(t-o))+3),i>0&&a.push(4*((t-i)*e+(t-o))+3))}for(var u=[],l=(i=0,r.length);i<l;++i)r[i]&&u.push.apply(u,r[i]);return ex[t]=u,u}(r);function d(t,e){for(var n=h.getImageData(0,0,s,s).data,a=0,u=p.length;a<u;a++)if(n[p[a]]>0){if(!o||"Image"!==f&&"Text"!==f||-1!==o.indexOf(t)){var l=(p[a]-3)/4,c=r-l%s,d=r-(l/s|0),g=i(t,e,c*c+d*d);if(g)return g}h.clearRect(0,0,s,s);break}}var g,y,v,_,m,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(c),g=x.length-1;g>=0;--g){var w=x[g].toString();for(v=this.executorsByZIndex_[w],y=Qm.length-1;y>=0;--y)if(void 0!==(_=v[f=Qm[y]])&&(m=_.executeHitDetection(h,a,n,d,l)))return m}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],r=e[1],i=e[2],o=e[3],s=[n,r,n,o,i,o,i,r];return to(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return re(this.executorsByZIndex_)},t.prototype.execute=function(t,e,n,r,i,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(c),this.maxExtent_&&(t.save(),this.clip(t,n));var u,l,h,f,p,d,g=o||Qm;for(s&&a.reverse(),u=0,l=a.length;u<l;++u){var y=a[u].toString();for(p=this.executorsByZIndex_[y],h=0,f=g.length;h<f;++h){void 0!==(d=p[g[h]])&&d.execute(t,e,n,r,i,s)}}this.maxExtent_&&t.restore()},t}(),ex={};var nx=tx,rx=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)}}(),ix=function(t){function e(e,n,r,i,o,s,a){var u=t.call(this)||this;return u.context_=e,u.pixelRatio_=n,u.extent_=r,u.transform_=i,u.viewRotation_=o,u.squaredTolerance_=s,u.userTransform_=a,u.contextFillState_=null,u.contextStrokeState_=null,u.contextTextState_=null,u.fillState_=null,u.strokeState_=null,u.image_=null,u.imageAnchorX_=0,u.imageAnchorY_=0,u.imageHeight_=0,u.imageOpacity_=0,u.imageOriginX_=0,u.imageOriginY_=0,u.imageRotateWithView_=!1,u.imageRotation_=0,u.imageScale_=[0,0],u.imageWidth_=0,u.text_="",u.textOffsetX_=0,u.textOffsetY_=0,u.textRotateWithView_=!1,u.textRotation_=0,u.textScale_=[0,0],u.textFillState_=null,u.textStrokeState_=null,u.textState_=null,u.pixelCoordinates_=[],u.tmpLocalTransform_=[1,0,0,1,0,0],u}return rx(e,t),e.prototype.drawImages_=function(t,e,n,r){if(this.image_){var i=to(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var u=this.imageRotation_;this.imageRotateWithView_&&(u+=this.viewRotation_);for(var l=0,c=i.length;l<c;l+=2){var h=i[l]-this.imageAnchorX_,f=i[l+1]-this.imageAnchorY_;if(0!==u||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var p=h+this.imageAnchorX_,d=f+this.imageAnchorY_;D(s,p,d,1,1,u,-p,-d),o.setTransform.apply(o,s),o.translate(p,d),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,h,f,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=a)}},e.prototype.drawText_=function(t,e,n,r){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=to(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<n;e+=r){var a=i[e]+this.textOffsetX_,u=i[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var l=D(this.tmpLocalTransform_,a,u,1,1,s,-a,-u);o.setTransform.apply(o,l),o.translate(a,u),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,a,u),this.textFillState_&&o.fillText(this.text_,a,u)}}},e.prototype.moveToLineTo_=function(t,e,n,r,i){var o=this.context_,s=to(t,e,n,r,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;i&&(a-=2);for(var u=2;u<a;u+=2)o.lineTo(s[u],s[u+1]);return i&&o.closePath(),n},e.prototype.drawRings_=function(t,e,n,r){for(var i=0,o=n.length;i<o;++i)e=this.moveToLineTo_(t,e,n[i],r,!0);return e},e.prototype.drawCircle=function(t){if(Et(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,n){var r=t.getFlatCoordinates();if(r){var i=t.getStride();return to(r,0,r.length,i,e,n)}return null}(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],r=e[3]-e[1],i=Math.sqrt(n*n+r*r),o=this.context_;o.beginPath(),o.arc(e[0],e[1],i,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var n=e.getGeometryFunction()(t);n&&Et(this.extent_,n.getExtent())&&(this.setStyle(e),this.drawGeometry(n))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),n=0,r=e.length;n<r;++n)this.drawGeometry(e[n])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Et(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var r=t.getFlatMidpoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Et(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var n=this.context_,r=t.getFlatCoordinates(),i=0,o=t.getEnds(),s=t.getStride();n.beginPath();for(var a=0,u=o.length;a<u;++a)i=this.moveToLineTo_(r,i,o[a],s,!1);n.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Et(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var n=t.getFlatInteriorPoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Et(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getOrientedFlatCoordinates(),r=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=i.length;s<a;++s){var u=i[s];r=this.drawRings_(n,r,u,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(d(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,n=this.contextTextState_,r=t.textAlign?t.textAlign:Rn;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=r&&(n.textAlign=r,e.textAlign=r),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=r,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:r,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var n=this;if(t){var r=t.getColor();this.fillState_={fillStyle:j_(r||In)}}else this.fillState_=null;if(e){var i=e.getColor(),o=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),u=e.getLineJoin(),l=e.getWidth(),c=e.getMiterLimit(),h=s||On;this.strokeState_={lineCap:void 0!==o?o:Mn,lineDash:1===this.pixelRatio_?h:h.map(function(t){return t*n.pixelRatio_}),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==u?u:Ln,lineWidth:(void 0!==l?l:1)*this.pixelRatio_,miterLimit:void 0!==c?c:10,strokeStyle:j_(i||kn)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var n=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*this.pixelRatio_,this.imageAnchorY_=n[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var n=e.getColor();this.textFillState_={fillStyle:j_(n||In)}}else this.textFillState_=null;var r=t.getStroke();if(r){var i=r.getColor(),o=r.getLineCap(),s=r.getLineDash(),a=r.getLineDashOffset(),u=r.getLineJoin(),l=r.getWidth(),c=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:Mn,lineDash:s||On,lineDashOffset:a||0,lineJoin:void 0!==u?u:Ln,lineWidth:void 0!==l?l:1,miterLimit:void 0!==c?c:10,strokeStyle:j_(i||kn)}}else this.textStrokeState_=null;var h=t.getFont(),f=t.getOffsetX(),p=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation(),y=t.getScaleArray(),v=t.getText(),_=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==h?h:Pn,textAlign:void 0!==_?_:Rn,textBaseline:void 0!==m?m:Tn},this.text_=void 0!==v?Array.isArray(v)?v.reduce(function(t,e,n){return t+(n%2?" ":e)},""):v:"",this.textOffsetX_=void 0!==f?this.pixelRatio_*f:0,this.textOffsetY_=void 0!==p?this.pixelRatio_*p:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*y[0],this.pixelRatio_*y[1]]}else this.text_=""},e}(hm),ox=ix,sx="fraction",ax="pixels",ux="bottom-left",lx="bottom-right",cx="top-left",hx="top-right",fx=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)}}(),px=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=r,o.resolution=n,o.state=i,o}return fx(e,t),e.prototype.changed=function(){this.dispatchEvent(ae)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return _()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){_()},e}(se),dx=px,gx=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)}}(),yx=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,r,k_)||this;return a.src_=i,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=k_,a.imageLoadFunction_=s,a}return gx(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=A_,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=_t(this.extent)/this.image_.height),this.state=T_,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=k_&&this.state!=A_||(this.state=R_,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=vx(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=_t(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(dx);function vx(t,e,n){var r=t,i=!0,o=!1,s=!1,a=[me(r,de,function(){s=!0,o||e()})];return r.src&&O?(o=!0,r.decode().then(function(){i&&e()}).catch(function(t){i&&(s?e():n())})):a.push(me(r,ue,n)),function(){i=!1,a.forEach(xe)}}var _x=yx,mx=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)}}(),xx=null,wx=function(t){function e(e,n,r,i,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==i&&(a.image_.crossOrigin=i),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=r,a.src_=n,a.tainted_,a}return mx(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===T_){xx||(xx=mn(1,1)),xx.drawImage(this.image_,0,0);try{xx.getImageData(0,0,1,1),this.tainted_=!1}catch(t){xx=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(ae)},e.prototype.handleImageError_=function(){this.imageState_=A_,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=T_,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],n=mn(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==k_){this.imageState_=R_;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=vx(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===T_){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),n.globalCompositeOperation="multiply","multiply"===n.globalCompositeOperation||this.isTainted_())n.fillStyle=Vt(this.color_),n.fillRect(0,0,e.width/t,e.height/t),n.globalCompositeOperation="destination-in",n.drawImage(this.image_,0,0);else{for(var r=n.getImageData(0,0,e.width,e.height),i=r.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,u=this.color_[3],l=0,c=i.length;l<c;l+=4)i[l]*=o,i[l+1]*=s,i[l+2]*=a,i[l+3]*=u;n.putImageData(r,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(se);var bx=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)}}(),Ex=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.opacity?r.opacity:1,o=void 0!==r.rotation?r.rotation:0,s=void 0!==r.scale?r.scale:1,a=void 0!==r.rotateWithView&&r.rotateWithView;(n=t.call(this,{opacity:i,rotation:o,scale:s,displacement:void 0!==r.displacement?r.displacement:[0,0],rotateWithView:a,declutterMode:r.declutterMode})||this).anchor_=void 0!==r.anchor?r.anchor:[.5,.5],n.normalizedAnchor_=null,n.anchorOrigin_=void 0!==r.anchorOrigin?r.anchorOrigin:cx,n.anchorXUnits_=void 0!==r.anchorXUnits?r.anchorXUnits:sx,n.anchorYUnits_=void 0!==r.anchorYUnits?r.anchorYUnits:sx,n.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null;var u=void 0!==r.img?r.img:null;n.imgSize_=r.imgSize;var l=r.src;T(!(void 0!==l&&u),4),T(!u||u&&n.imgSize_,5),void 0!==l&&0!==l.length||!u||(l=u.src||x(u)),T(void 0!==l&&l.length>0,6);var c=void 0!==r.src?k_:T_;return n.color_=void 0!==r.color?qt(r.color):null,n.iconImage_=function(t,e,n,r,i,o){var s=Kt.get(e,r,o);return s||(s=new wx(t,e,n,r,i,o),Kt.set(e,r,o,s)),s}(u,l,void 0!==n.imgSize_?n.imgSize_:null,n.crossOrigin_,c,n.color_),n.offset_=void 0!==r.offset?r.offset:[0,0],n.offsetOrigin_=void 0!==r.offsetOrigin?r.offsetOrigin:cx,n.origin_=null,n.size_=void 0!==r.size?r.size:null,n}return bx(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==sx||this.anchorYUnits_==sx){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==sx&&(t[0]*=e[0]),this.anchorYUnits_==sx&&(t[1]*=e[1])}if(this.anchorOrigin_!=cx){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=hx&&this.anchorOrigin_!=lx||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=ux&&this.anchorOrigin_!=lx||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var n=this.getDisplacement();return[t[0]-n[0],t[1]+n[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=cx){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),this.offsetOrigin_!=hx&&this.offsetOrigin_!=lx||(t[0]=n[0]-e[0]-t[0]),this.offsetOrigin_!=ux&&this.offsetOrigin_!=lx||(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(ae,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(ae,t)},e}(D_),Sx=Ex,Cx=.5;var Px={Point:function(t,e,n,r,i){var o,s=n.getImage(),a=n.getText();if(s){if(s.getImageState()!=T_)return;var u=t;if(i){var l=s.getDeclutterMode();if("none"!==l)if(u=i,"obstacle"===l){var c=t.getBuilder(n.getZIndex(),"Image");c.setImageStyle(s,o),c.drawPoint(e,r)}else a&&a.getText()&&(o={})}var h=u.getBuilder(n.getZIndex(),"Image");h.setImageStyle(s,o),h.drawPoint(e,r)}if(a&&a.getText()){var f=t;i&&(f=i);var p=f.getBuilder(n.getZIndex(),"Text");p.setTextStyle(a,o),p.drawText(e,r)}},LineString:function(t,e,n,r,i){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawLineString(e,r)}var a=n.getText();if(a&&a.getText()){var u=(i||t).getBuilder(n.getZIndex(),"Text");u.setTextStyle(a),u.drawText(e,r)}},Polygon:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(o,s),a.drawPolygon(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}},MultiPoint:function(t,e,n,r,i){var o,s=n.getImage(),a=n.getText();if(s){if(s.getImageState()!=T_)return;var u=t;if(i){var l=s.getDeclutterMode();if("none"!==l)if(u=i,"obstacle"===l){var c=t.getBuilder(n.getZIndex(),"Image");c.setImageStyle(s,o),c.drawMultiPoint(e,r)}else a&&a.getText()&&(o={})}var h=u.getBuilder(n.getZIndex(),"Image");h.setImageStyle(s,o),h.drawMultiPoint(e,r)}if(a&&a.getText()){var f=t;i&&(f=i);var p=f.getBuilder(n.getZIndex(),"Text");p.setTextStyle(a,o),p.drawText(e,r)}},MultiLineString:function(t,e,n,r,i){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,r)}var a=n.getText();if(a&&a.getText()){var u=(i||t).getBuilder(n.getZIndex(),"Text");u.setTextStyle(a),u.drawText(e,r)}},MultiPolygon:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(s||o){var a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}},GeometryCollection:function(t,e,n,r,i){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o<s;++o){(0,Px[a[o].getType()])(t,a[o],n,r,i)}},Circle:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),"Circle");a.setFillStrokeStyle(o,s),a.drawCircle(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}}};function Ix(t,e){return parseInt(x(t),10)-parseInt(x(e),10)}function Mx(t,e){return.5*t/e}function Ox(t,e,n,r,i,o,s){var a=!1,u=n.getImage();if(u){var l=u.getImageState();l==T_||l==A_?u.unlistenImageChange(i):(l==k_&&u.load(),u.listenImageChange(i),a=!0)}return function(t,e,n,r,i,o){var s=n.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(r,i),u=n.getRenderer();if(u)Lx(t,a,n,e);else{(0,Px[a.getType()])(t,a,n,e,o)}}(t,e,n,r,o,s),a}function Lx(t,e,n,r){if("GeometryCollection"!=e.getType())t.getBuilder(n.getZIndex(),"Default").drawCustom(e,r,n.getRenderer(),n.getHitDetectionRenderer());else for(var i=e.getGeometries(),o=0,s=i.length;o<s;++o)Lx(t,i[o],n,r)}var kx=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)}}(),Rx=function(t){function e(e){var n=t.call(this,e)||this;return n.boundHandleStyleImageChange_=n.handleStyleImageChange_.bind(n),n.animatingOrInteracting_,n.hitDetectionImageData_=null,n.renderedFeatures_=null,n.renderedRevision_=-1,n.renderedResolution_=NaN,n.renderedExtent_=[1/0,1/0,-1/0,-1/0],n.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],n.renderedRotation_,n.renderedCenter_=null,n.renderedProjection_=null,n.renderedRenderOrder_=null,n.replayGroup_=null,n.replayGroupChanged=!0,n.declutterExecutorGroup=null,n.clipping=!0,n.compositionContext_=null,n.opacity_=1,n}return kx(e,t),e.prototype.renderWorlds=function(t,e,n){var r=e.extent,i=e.viewState,o=i.center,s=i.resolution,a=i.projection,u=i.rotation,l=a.getExtent(),c=this.getLayer().getSource(),h=e.pixelRatio,f=e.viewHints,p=!(f[Ur]||f[Xr]),d=this.compositionContext_,g=Math.round(e.size[0]*h),y=Math.round(e.size[1]*h),v=c.getWrapX()&&a.canWrapX(),_=v?bt(l):null,m=v?Math.ceil((r[2]-l[2])/_)+1:1,x=v?Math.floor((r[0]-l[0])/_):0;do{var w=this.getRenderTransform(o,s,u,h,g,y,x*_);t.execute(d,1,w,u,p,void 0,n)}while(++x<m)},e.prototype.setupCompositionContext_=function(){if(1!==this.opacity_){var t=mn(this.context.canvas.width,this.context.canvas.height,Fm);this.compositionContext_=t}else this.compositionContext_=this.context},e.prototype.releaseCompositionContext_=function(){if(1!==this.opacity_){var t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,xn(this.compositionContext_),Fm.push(this.compositionContext_.canvas),this.compositionContext_=null}},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())},e.prototype.renderFrame=function(t,e){var n=t.pixelRatio,r=t.layerStatesArray[t.layerIndex];!function(t,e,n){N(t,e,0,0,n,0,0)}(this.pixelTransform,1/n,1/n),j(this.inversePixelTransform,this.pixelTransform);var i=G(this.pixelTransform);this.useContainer(e,i,this.getBackground(t));var o=this.context,s=o.canvas,a=this.replayGroup_,u=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!u||u.isEmpty()))return null;var l=Math.round(t.size[0]*n),c=Math.round(t.size[1]*n);s.width!=l||s.height!=c?(s.width=l,s.height=c,s.style.transform!==i&&(s.style.transform=i)):this.containerReused||o.clearRect(0,0,l,c),this.preRender(o,t);var h=t.viewState,f=h.projection;this.opacity_=r.opacity,this.setupCompositionContext_();var p=!1,d=!0;if(r.extent&&this.clipping){var g=Di(r.extent,f);(p=(d=Et(g,t.extent))&&!J(g,t.extent))&&this.clipUnrotated(this.compositionContext_,t,g)}return d&&this.renderWorlds(a,t),p&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(o,t),this.renderedRotation_!==h.rotation&&(this.renderedRotation_=h.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var n=[this.context.canvas.width,this.context.canvas.height];F(this.pixelTransform,n);var r=this.renderedCenter_,i=this.renderedResolution_,o=this.renderedRotation_,s=this.renderedProjection_,a=this.wrappedRenderedExtent_,u=this.getLayer(),l=[],h=n[0]*Cx,f=n[1]*Cx;l.push(this.getRenderTransform(r,i,o,Cx,h,f,0).slice());var p=u.getSource(),d=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!J(d,a)){for(var g=a[0],y=bt(d),v=0,_=void 0;g<d[0];)_=y*--v,l.push(this.getRenderTransform(r,i,o,Cx,h,f,_).slice()),g+=y;for(v=0,g=a[2];g>d[2];)_=y*++v,l.push(this.getRenderTransform(r,i,o,Cx,h,f,_).slice()),g-=y}this.hitDetectionImageData_=function(t,e,n,r,i,o,s){var a=mn(t[0]*Cx,t[1]*Cx);a.imageSmoothingEnabled=!1;for(var u=a.canvas,l=new ox(a,Cx,i,null,s),h=n.length,f=Math.floor(16777215/h),p={},d=1;d<=h;++d){var g=n[d-1],y=g.getStyleFunction()||r;if(r){var v=y(g,o);if(v){Array.isArray(v)||(v=[v]);for(var _="#"+("000000"+(d*f).toString(16)).slice(-6),m=0,x=v.length;m<x;++m){var w=v[m],b=w.getGeometryFunction()(g);if(b&&Et(i,b.getExtent())){var E=w.clone(),S=E.getFill();S&&S.setColor(_);var C=E.getStroke();C&&(C.setColor(_),C.setLineDash(null)),E.setText(void 0);var P=w.getImage();if(P&&0!==P.getOpacity()){var I=P.getImageSize();if(!I)continue;var M=mn(I[0],I[1],void 0,{alpha:!1}),O=M.canvas;M.fillStyle=_,M.fillRect(0,0,O.width,O.height),E.setImage(new Sx({img:O,imgSize:I,anchor:P.getAnchor(),anchorXUnits:ax,anchorYUnits:ax,offset:P.getOrigin(),opacity:1,size:P.getSize(),scale:P.getScale(),rotation:P.getRotation(),rotateWithView:P.getRotateWithView()}))}var L=E.getZIndex()||0;(T=p[L])||(T={},p[L]=T,T.Polygon=[],T.Circle=[],T.LineString=[],T.Point=[]),T[b.getType().replace("Multi","")].push(b,E)}}}}}for(var k=Object.keys(p).map(Number).sort(c),R=(d=0,k.length);d<R;++d){var T=p[k[d]];for(var A in T){var N=T[A];for(m=0,x=N.length;m<x;m+=2){l.setStyle(N[m+1]);for(var F=0,D=e.length;F<D;++F)l.setTransform(e[F]),l.drawGeometry(N[m])}}}return a.getImageData(0,0,u.width,u.height)}(n,l,this.renderedFeatures_,u.getStyleFunction(),a,i,o)}e(function(t,e,n){var r=[];if(n){var i=Math.floor(Math.round(t[0])*Cx),o=Math.floor(Math.round(t[1])*Cx),s=4*(Mt(i,0,n.width-1)+Mt(o,0,n.height-1)*n.width),a=n.data[s],u=n.data[s+1],l=n.data[s+2]+256*(u+256*a),c=Math.floor(16777215/e.length);l&&l%c===0&&r.push(e[l/c-1])}return r}(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){var o=this;if(this.replayGroup_){var s,a=e.viewState.resolution,u=e.viewState.rotation,l=this.getLayer(),c={},h=function(t,e,n){var o=x(t),s=c[o];if(s){if(!0!==s&&n<s.distanceSq){if(0===n)return c[o]=!0,i.splice(i.lastIndexOf(s),1),r(t,l,e);s.geometry=e,s.distanceSq=n}}else{if(0===n)return c[o]=!0,r(t,l,e);i.push(c[o]={feature:t,layer:l,geometry:e,distanceSq:n,callback:r})}},f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some(function(r){return s=r.forEachFeatureAtCoordinate(t,a,u,n,h,r===o.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(function(t){return t.value}):null)}),s}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource();if(!n)return!1;var r=t.viewHints[Ur],i=t.viewHints[Xr],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(this.ready&&!o&&r||!s&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=t.extent,u=t.viewState,l=u.projection,c=u.resolution,h=t.pixelRatio,f=e.getRevision(),p=e.getRenderBuffer(),g=e.getRenderOrder();void 0===g&&(g=Ix);var y=u.center.slice(),v=Y(a,p*c),_=v.slice(),m=[v.slice()],x=l.getExtent();if(n.getWrapX()&&l.canWrapX()&&!J(x,t.extent)){var w=bt(x),b=Math.max(bt(v)/2,w);v[0]=x[0]-b,v[2]=x[2]+b,on(y,l);var E=It(m[0],l);E[0]<x[0]&&E[2]<x[2]?m.push([E[0]+w,E[1],E[2]+w,E[3]]):E[0]>x[0]&&E[2]>x[2]&&m.push([E[0]-w,E[1],E[2]-w,E[3]])}if(this.ready&&this.renderedResolution_==c&&this.renderedRevision_==f&&this.renderedRenderOrder_==g&&J(this.wrappedRenderedExtent_,v))return d(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var S,C=new km(Mx(c,h),v,c,h);this.getLayer().getDeclutter()&&(S=new km(Mx(c,h),v,c,h));var P,I=Ti();if(I){for(var M=0,O=m.length;M<O;++M){var L=Fi(m[M],l);n.loadFeatures(L,ji(c,l),I)}P=Ci(I,l)}else for(M=0,O=m.length;M<O;++M)n.loadFeatures(m[M],c,l);var k=function(t,e){var n=Mx(t,e);return n*n}(c,h),R=!0,T=function(t){var n,r=t.getStyleFunction()||e.getStyleFunction();if(r&&(n=r(t,c)),n){var i=this.renderFeature(t,k,n,C,P,S);R=R&&!i}}.bind(this),A=Fi(v,l),N=n.getFeaturesInExtent(A);g&&N.sort(g);for(M=0,O=N.length;M<O;++M)T(N[M]);this.renderedFeatures_=N,this.ready=R;var F=C.finish(),D=new nx(v,c,h,n.getOverlaps(),F,e.getRenderBuffer());return S&&(this.declutterExecutorGroup=new nx(v,c,h,n.getOverlaps(),S.finish(),e.getRenderBuffer())),this.renderedResolution_=c,this.renderedRevision_=f,this.renderedRenderOrder_=g,this.renderedExtent_=_,this.wrappedRenderedExtent_=v,this.renderedCenter_=y,this.renderedProjection_=l,this.replayGroup_=D,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,n,r,i,o){if(!n)return!1;var s=!1;if(Array.isArray(n))for(var a=0,u=n.length;a<u;++a)s=Ox(r,t,n[a],e,this.boundHandleStyleImageChange_,i,o)||s;else s=Ox(r,t,n,e,this.boundHandleStyleImageChange_,i,o);return s},e}(Gm),Tx=Rx,Ax=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)}}(),Nx=function(t){function e(e){return t.call(this,e)||this}return Ax(e,t),e.prototype.createRenderer=function(){return new Tx(this)},e}(im),Fx=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)}}(),Dx=function(t){function e(e){var n=t.call(this)||this;n.projection=xi(e.projection),n.attributions_=jx(e.attributions),n.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,n.loading=!1,n.state_=void 0!==e.state?e.state:"ready",n.wrapX_=void 0!==e.wrapX&&e.wrapX,n.interpolate_=!!e.interpolate,n.viewResolver=null,n.viewRejector=null;var r=n;return n.viewPromise_=new Promise(function(t,e){r.viewResolver=t,r.viewRejector=e}),n}return Fx(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return _()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=jx(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Ie);function jx(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Gx=Dx;function Bx(t,e){return[[-1/0,-1/0,1/0,1/0]]}var zx=!1;function Vx(t,e){return function(n,r,i,o,s){var a=this;!function(t,e,n,r,i,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,r,i):t,!0),"arraybuffer"==e.getType()&&(a.responseType="arraybuffer"),a.withCredentials=zx,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=e.getType(),u=void 0;"json"==r||"text"==r?u=a.responseText:"xml"==r?(u=a.responseXML)||(u=(new DOMParser).parseFromString(a.responseText,"application/xml")):"arraybuffer"==r&&(u=a.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):s()}else s()},a.onerror=s,a.send()}(t,e,n,r,i,function(t,e){a.addFeatures(t),void 0!==o&&o(t)},s||v)}}var Ux=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)}}(),Xx=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.feature=n,i.features=r,i}return Ux(e,t),e}($t),qx=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{attributions:r.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===r.wrapX||r.wrapX})||this).on,n.once,n.un,n.loader_=v,n.format_=r.format,n.overlaps_=void 0===r.overlaps||r.overlaps,n.url_=r.url,void 0!==r.loader?n.loader_=r.loader:void 0!==n.url_&&(T(n.format_,7),n.loader_=Vx(n.url_,n.format_)),n.strategy_=void 0!==r.strategy?r.strategy:Bx;var i,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return n.featuresRtree_=s?new E_:null,n.loadedExtentsRtree_=new E_,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(i=r.features).getArray()),s||void 0!==i||(i=new er(o)),void 0!==o&&n.addFeaturesInternal(o),void 0!==i&&n.bindFeaturesCollection_(i),n}return Ux(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=x(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var r=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Xx(S_,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[_e(e,ae,this.handleFeatureChange_,this),_e(e,Qt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,r=e.getId();return void 0!==r&&(r.toString()in this.idIndex_?n=!1:this.idIndex_[r.toString()]=e),n&&(T(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],r=[],i=0,o=t.length;i<o;i++){var s=x(u=t[i]);this.addToIndex_(s,u)&&n.push(u)}i=0;for(var a=n.length;i<a;i++){var u;s=x(u=n[i]);this.setupChangeEvents_(s,u);var l=u.getGeometry();if(l){var c=l.getExtent();e.push(c),r.push(u)}else this.nullGeometryFeatures_[s]=u}if(this.featuresRtree_&&this.featuresRtree_.load(e,r),this.hasListener(S_)){i=0;for(var h=n.length;i<h;i++)this.dispatchEvent(new Xx(S_,n[i]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(S_,function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener(I_,function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener(Zn,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(Kn,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(xe)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var n=function(t){this.removeFeatureInternal(t)}.bind(this);for(var r in this.featuresRtree_.forEach(n),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new Xx(P_);this.dispatchEvent(i),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(n){return n.getGeometry().intersectsCoordinate(t)?e(n):void 0})},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,function(n){if(n.getGeometry().intersectsExtent(t)){var r=e(n);if(r)return r}})},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),re(this.nullGeometryFeatures_)||p(t,ne(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,function(t){e.push(t)}),e},e.prototype.getFeaturesInExtent=function(t,e){var n=this;if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);var r=function(t,e){if(e.canWrapX()){var n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];It(t,e);var r=bt(n);if(bt(t)>r)return[[n[0],t[1],n[2],t[3]]];if(t[0]<n[0])return[[t[0]+r,t[1],n[2],t[3]],[n[0],t[1],t[2],t[3]]];if(t[2]>n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}(t,e);return[].concat.apply([],r.map(function(t){return n.featuresRtree_.getInExtent(t)}))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var n=t[0],r=t[1],i=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],u=e||g;return this.featuresRtree_.forEachInExtent(a,function(t){if(u(t)){var e=t.getGeometry(),l=s;if((s=e.closestPointXY(n,r,o,s))<l){i=t;var c=Math.sqrt(s);a[0]=n-c,a[1]=r-c,a[2]=n+c,a[3]=r+c}}}),i},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,n=x(e),r=e.getGeometry();if(r){var i=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(i,e)):this.featuresRtree_&&this.featuresRtree_.update(i,e)}else n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);var o=e.getId();if(void 0!==o){var s=o.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new Xx(C_,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:x(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&re(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()},e.prototype.loadFeatures=function(t,e,n){for(var r=this.loadedExtentsRtree_,i=this.strategy_(t,e,n),o=function(t,o){var a=i[t],u=r.forEachInExtent(a,function(t){return J(t.extent,a)});u||(++s.loadingExtentsCount_,s.dispatchEvent(new Xx(M_)),s.loader_.call(s,a,e,n,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Xx(O_,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Xx(L_))}.bind(s)),r.insert(a,{extent:a.slice()}))},s=this,a=0,u=i.length;a<u;++a)o(a);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,n=this.loadedExtentsRtree_;n.forEachInExtent(t,function(n){if(ot(n.extent,t))return e=n,!0}),e&&n.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=x(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}},e.prototype.removeFeatureInternal=function(t){var e=x(t),n=this.featureChangeKeys_[e];if(n){n.forEach(xe),delete this.featureChangeKeys_[e];var r=t.getId();return void 0!==r&&delete this.idIndex_[r.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Xx(I_,t)),t}},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){T(this.format_,7),this.url_=t,this.setLoader(Vx(t,this.format_))},e}(Gx),Wx=qx,Yx=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)}}(),Hx=[0,0,0,0],Zx=[],Kx="modifystart",Jx="modifyend",$x=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.features=n,i.mapBrowserEvent=r,i}return Yx(e,t),e}($t),Qx=function(t){function e(e){var n,r=t.call(this,e)||this;if(r.on,r.once,r.un,r.boundHandleFeatureChange_=r.handleFeatureChange_.bind(r),r.condition_=e.condition?e.condition:Ys,r.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==pr.SINGLECLICK}(t)},r.deleteCondition_=e.deleteCondition?e.deleteCondition:r.defaultDeleteCondition_,r.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:zs,r.vertexFeature_=null,r.vertexSegments_=null,r.lastPixel_=[0,0],r.ignoreNextSingleClick_=!1,r.featuresBeingModified_=null,r.rBush_=new E_,r.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,r.snappedToVertex_=!1,r.changingFeature_=!1,r.dragSegments_=[],r.overlay_=new Nx({source:new Wx({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:rw(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r)},r.source_=null,r.hitDetection_=null,e.features?n=e.features:e.source&&(r.source_=e.source,n=new er(r.source_.getFeatures()),r.source_.addEventListener(S_,r.handleSourceAdd_.bind(r)),r.source_.addEventListener(I_,r.handleSourceRemove_.bind(r))),!n)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(r.hitDetection_=e.hitDetection),r.features_=n,r.features_.forEach(r.addFeature_.bind(r)),r.features_.addEventListener(Zn,r.handleFeatureAdd_.bind(r)),r.features_.addEventListener(Kn,r.handleFeatureRemove_.bind(r)),r.lastPointerEvent_=null,r.delta_=[0,0],r.snapToPointer_=void 0===e.snapToPointer?!r.hitDetection_:e.snapToPointer,r}return Yx(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var n=this.SEGMENT_WRITERS_[e.getType()];n&&n(t,e)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,r),t.addEventListener(ae,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new er;for(var n=this.featuresBeingModified_.getArray(),r=0,i=e.length;r<i;++r)for(var o=e[r],s=0,a=o.length;s<a;++s){var u=o[s].feature;u&&-1===n.indexOf(u)&&this.featuresBeingModified_.push(u)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new $x(Kx,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(ae,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,n=[];e.forEach(function(e){t===e.feature&&n.push(e)});for(var r=n.length-1;r>=0;--r){for(var i=n[r],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var n=e.getCoordinates(),r={feature:t,geometry:e,segment:[n,n]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r){var o=n[r],s={feature:t,geometry:e,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r){var o=n.slice(r,r+2),s={feature:t,geometry:e,index:r,segment:o};this.rBush_.insert(W(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var u=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:u};this.rBush_.insert(W(u),l)}},e.prototype.writePolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var u=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:u};this.rBush_.insert(W(u),l)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length;s<a;++s)for(var u=o[s],l=0,c=u.length-1;l<c;++l){var h=u.slice(l,l+2),f={feature:t,geometry:e,depth:[s,r],index:l,segment:h};this.rBush_.insert(W(h),f)}},e.prototype.writeCircleGeometry_=function(t,e){var n=e.getCenter(),r={feature:t,geometry:e,index:0,segment:[n,n]},i={feature:t,geometry:e,index:1,segment:[n,n]},o=[r,i];r.featureSegments=o,i.featureSegments=o,this.rBush_.insert(rt(n),r);var s=e,a=Ti();if(a&&this.getMap()){var u=this.getMap().getView().getProjection();s=Qo(s=s.clone().transform(a,u)).transform(u,a)}this.rBush_.insert(s.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=n[r];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,n){var r=this.vertexFeature_;r?r.getGeometry().setCoordinates(t):(r=new Va(new No(t)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r));return r.set("features",e),r.set("geometries",n),r},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=pr.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(n=!(e.type!=pr.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==pr.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!n);var n},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],n=[],r=[],i=0,o=this.dragSegments_.length;i<o;++i){var s=this.dragSegments_[i],a=s[0],u=a.feature;-1===n.indexOf(u)&&n.push(u);var l=a.geometry;-1===r.indexOf(l)&&r.push(l);for(var c=a.depth,h=void 0,f=a.segment,p=s[1];e.length<l.getStride();)e.push(f[p][e.length]);switch(l.getType()){case"Point":h=e,f[0]=e,f[1]=e;break;case"MultiPoint":(h=l.getCoordinates())[a.index]=e,f[0]=e,f[1]=e;break;case"LineString":(h=l.getCoordinates())[a.index+p]=e,f[p]=e;break;case"MultiLineString":case"Polygon":(h=l.getCoordinates())[c[0]][a.index+p]=e,f[p]=e;break;case"MultiPolygon":(h=l.getCoordinates())[c[1]][c[0]][a.index+p]=e,f[p]=e;break;case"Circle":if(f[0]=e,f[1]=e,0===a.index)this.changingFeature_=!0,l.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;var d=t.map.getView().getProjection(),g=rn(Ni(l.getCenter(),d),Ni(e,d)),y=Ti();if(y){var v=l.clone().transform(y,d);v.setRadius(g),g=v.transform(d,y).getRadius()}l.setRadius(g),this.changingFeature_=!1}}h&&this.setGeometryCoordinates_(l,h)}this.createOrUpdateVertexFeature_(e,n,r)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var n=this.vertexFeature_;if(n){var r=t.map.getView().getProjection(),i=[],o=n.getGeometry().getCoordinates(),s=W([o]),a=this.rBush_.getInExtent(s),u={};a.sort(tw);for(var l=0,c=a.length;l<c;++l){var h=a[l],f=h.segment,p=x(h.geometry),d=h.depth;if(d&&(p+="-"+d.join("-")),u[p]||(u[p]=new Array(2)),"Circle"!==h.geometry.getType()||1!==h.index)if(!Qe(f[0],o)||u[p][0])if(!Qe(f[1],o)||u[p][1])x(f)in this.vertexSegments_&&!u[p][0]&&!u[p][1]&&this.insertVertexCondition_(t)&&i.push(h);else{if(u[p][0]&&0===u[p][0].index){var g=h.geometry.getCoordinates();switch(h.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":g=g[d[1]];case"Polygon":if(h.index!==g[d[0]].length-2)continue}}this.dragSegments_.push([h,1]),u[p][1]=h}else this.dragSegments_.push([h,0]),u[p][0]=h;else Qe(nw(e,h,r),o)&&!u[p][0]&&(this.dragSegments_.push([h,0]),u[p][0]=h)}i.length&&this.willModifyFeatures_(t,[i]);for(var y=i.length-1;y>=0;--y)this.insertVertex_(i[y],o)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var n=this.dragSegments_[e][0],r=n.geometry;if("Circle"===r.getType()){var i=r.getCenter(),o=n.featureSegments[0],s=n.featureSegments[1];o.segment[0]=i,o.segment[1]=i,s.segment[0]=i,s.segment[1]=i,this.rBush_.update(rt(i),o);var a=r,u=Ti();if(u){var l=t.map.getView().getProjection();a=Qo(a=a.clone().transform(u,l)).transform(l,u)}this.rBush_.update(a.getExtent(),s)}else this.rBush_.update(W(n.segment),n)}return this.featuresBeingModified_&&(this.dispatchEvent(new $x(Jx,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,n){var r,i,o=this,s=n||e.getCoordinateFromPixel(t),a=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===o.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,function(t,e,n){if("Point"===(n=n||t.getGeometry()).getType()&&(a=o.features_.getArray(),u=t,a.indexOf(u)>=0)){i=n;var s=n.getFlatCoordinates().slice(0,2);r=[{feature:t,geometry:n,segment:[s,s]}]}var a,u;return!0},{layerFilter:u})}if(!r){var l=Fi(Y(Di(rt(s,Hx),a),e.getView().getResolution()*this.pixelTolerance_,Hx),a);r=this.rBush_.getInExtent(l)}if(r&&r.length>0){var c=r.sort(function(t,e){return ew(s,t,a)-ew(s,e,a)})[0],h=c.segment,f=nw(s,c,a),p=e.getPixelFromCoordinate(f),d=rn(t,p);if(i||d<=this.pixelTolerance_){var g={};if(g[x(h)]=!0,this.snapToPointer_||(this.delta_[0]=f[0]-s[0],this.delta_[1]=f[1]-s[1]),"Circle"===c.geometry.getType()&&1===c.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);else{var y=e.getPixelFromCoordinate(h[0]),v=e.getPixelFromCoordinate(h[1]),_=nn(p,y),m=nn(p,v);d=Math.sqrt(Math.min(_,m)),this.snappedToVertex_=d<=this.pixelTolerance_,this.snappedToVertex_&&(f=_>m?h[1]:h[0]),this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);var w={};w[x(c.geometry)]=!0;for(var b=1,E=r.length;b<E;++b){var S=r[b].segment;if(!(Qe(h[0],S[0])&&Qe(h[1],S[1])||Qe(h[0],S[1])&&Qe(h[1],S[0])))break;var C=x(r[b].geometry);C in w||(w[C]=!0,g[x(S)]=!0)}}return void(this.vertexSegments_=g)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var n,r=t.segment,i=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case"MultiLineString":case"Polygon":(n=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case"MultiPolygon":(n=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case"LineString":(n=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,n);var u=this.rBush_;u.remove(t),this.updateSegmentIndices_(o,a,s,1);var l={segment:[r[0],e],feature:i,geometry:o,depth:s,index:a};u.insert(W(l.segment),l),this.dragSegments_.push([l,1]);var c={segment:[e,r[1]],feature:i,geometry:o,depth:s,index:a+1};u.insert(W(c.segment),c),this.dragSegments_.push([c,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=pr.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new $x(Jx,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,n,r,i,o,s,a,u,l,c,h=this.dragSegments_,f={},p=!1;for(i=h.length-1;i>=0;--i)c=x((l=(n=h[i])[0]).feature),l.depth&&(c+="-"+l.depth.join("-")),c in f||(f[c]={}),0===n[1]?(f[c].right=l,f[c].index=l.index):1==n[1]&&(f[c].left=l,f[c].index=l.index+1);for(c in f){switch(u=f[c].right,s=f[c].left,(a=(o=f[c].index)-1)<0&&(a=0),t=e=(r=(l=void 0!==s?s:u).geometry).getCoordinates(),p=!1,r.getType()){case"MultiLineString":e[l.depth[0]].length>2&&(e[l.depth[0]].splice(o,1),p=!0);break;case"LineString":e.length>2&&(e.splice(o,1),p=!0);break;case"MultiPolygon":t=t[l.depth[1]];case"Polygon":(t=t[l.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),p=!0,0===o&&(t.pop(),t.push(t[0]),a=t.length-1))}if(p){this.setGeometryCoordinates_(r,e);var d=[];if(void 0!==s&&(this.rBush_.remove(s),d.push(s.segment[0])),void 0!==u&&(this.rBush_.remove(u),d.push(u.segment[1])),void 0!==s&&void 0!==u){var g={depth:l.depth,feature:l.feature,geometry:l.geometry,index:a,segment:d};this.rBush_.insert(W(g.segment),g)}this.updateSegmentIndices_(r,o,l.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),h.length=0}}return p},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,n,r){this.rBush_.forEachInExtent(t.getExtent(),function(i){i.geometry===t&&(void 0===n||void 0===i.depth||d(i.depth,n))&&i.index>e&&(i.index+=r)})},e}(Ds);function tw(t,e){return t.index-e.index}function ew(t,e,n){var r=e.geometry;if("Circle"===r.getType()){var i=r;if(1===e.index){var o=Ti();o&&(i=i.clone().transform(o,n));var s=nn(i.getCenter(),Ni(t,n)),a=Math.sqrt(s)-i.getRadius();return a*a}}var u=Ni(t,n);return Zx[0]=Ni(e.segment[0],n),Zx[1]=Ni(e.segment[1],n),function(t,e){return nn(t,$e(t,e))}(u,Zx)}function nw(t,e,n){var r=e.geometry;if("Circle"===r.getType()&&1===e.index){var i=r,o=Ti();return o&&(i=i.clone().transform(o,n)),Ai(i.getClosestPoint(Ni(t,n)),n)}var s=Ni(t,n);return Zx[0]=Ni(e.segment[0],n),Zx[1]=Ni(e.segment[1],n),Ai($e(s,Zx),n)}function rw(){var t=$_();return function(e,n){return t.Point}}var iw=Qx,ow=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)}}();function sw(t){return t.feature?t.feature:t.element?t.element:void 0}var aw=[],uw=function(t){function e(e){var n=this,r=e||{},i=r;return i.handleDownEvent||(i.handleDownEvent=g),i.stopDown||(i.stopDown=y),(n=t.call(this,i)||this).source_=r.source?r.source:null,n.vertex_=void 0===r.vertex||r.vertex,n.edge_=void 0===r.edge||r.edge,n.features_=r.features?r.features:null,n.featuresListenerKeys_=[],n.featureChangeListenerKeys_={},n.indexedFeaturesExtents_={},n.pendingFeatures_={},n.pixelTolerance_=void 0!==r.pixelTolerance?r.pixelTolerance:10,n.rBush_=new E_,n.GEOMETRY_SEGMENTERS_={Point:n.segmentPointGeometry_.bind(n),LineString:n.segmentLineStringGeometry_.bind(n),LinearRing:n.segmentLineStringGeometry_.bind(n),Polygon:n.segmentPolygonGeometry_.bind(n),MultiPoint:n.segmentMultiPointGeometry_.bind(n),MultiLineString:n.segmentMultiLineStringGeometry_.bind(n),MultiPolygon:n.segmentMultiPolygonGeometry_.bind(n),GeometryCollection:n.segmentGeometryCollectionGeometry_.bind(n),Circle:n.segmentCircleGeometry_.bind(n)},n}return ow(e,t),e.prototype.addFeature=function(t,e){var n=void 0===e||e,r=x(t),i=t.getGeometry();if(i){var o=this.GEOMETRY_SEGMENTERS_[i.getType()];if(o){this.indexedFeaturesExtents_[r]=i.getExtent([1/0,1/0,-1/0,-1/0]);var s=[];if(o(s,i),1===s.length)this.rBush_.insert(W(s[0]),{feature:t,segment:s[0]});else if(s.length>1){var a=s.map(function(t){return W(t)}),u=s.map(function(e){return{feature:t,segment:e}});this.rBush_.load(a,u)}}}n&&(this.featureChangeListenerKeys_[r]=_e(t,ae,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var n=this.snapTo(e.pixel,e.coordinate,e.map);return n&&(e.coordinate=n.vertex.slice(0,2),e.pixel=n.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=sw(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=sw(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var n=x(e);n in this.pendingFeatures_||(this.pendingFeatures_[n]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=ne(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var n=void 0===e||e,r=x(t),i=this.indexedFeaturesExtents_[r];if(i){var o=this.rBush_,s=[];o.forEachInExtent(i,function(e){t===e.feature&&s.push(e)});for(var a=s.length-1;a>=0;--a)o.remove(s[a])}n&&(xe(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])},e.prototype.setMap=function(e){var n=this.getMap(),r=this.featuresListenerKeys_,i=this.getFeatures_();n&&(r.forEach(xe),r.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?r.push(_e(this.features_,Zn,this.handleFeatureAdd_,this),_e(this.features_,Kn,this.handleFeatureRemove_,this)):this.source_&&r.push(_e(this.source_,S_,this.handleFeatureAdd_,this),_e(this.source_,I_,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,n){var r=W([n.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),n.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(r),o=i.length;if(0===o)return null;var s,a=n.getView().getProjection(),u=Ni(e,a),l=1/0,c=this.pixelTolerance_*this.pixelTolerance_,h=function(){if(s){var e=n.getPixelFromCoordinate(s);if(nn(t,e)<=c)return{vertex:s,vertexPixel:[Math.round(e[0]),Math.round(e[1])]}}return null};if(this.vertex_){for(var f=0;f<o;++f){"Circle"!==(p=i[f]).feature.getGeometry().getType()&&p.segment.forEach(function(t){var e=Ni(t,a),n=nn(u,e);n<l&&(s=t,l=n)})}if(w=h())return w}if(this.edge_){for(f=0;f<o;++f){var p,d=null;if("Circle"===(p=i[f]).feature.getGeometry().getType()){var g=p.feature.getGeometry(),y=Ti();y&&(g=g.clone().transform(y,a)),d=Ai(Je(u,g),a)}else{var v=p.segment,_=v[0],m=v[1];m&&(aw[0]=Ni(_,a),aw[1]=Ni(m,a),d=$e(u,aw))}if(d){var x=nn(u,d);x<l&&(s=d,l=x)}}var w;if(w=h())return w}return null},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.segmentCircleGeometry_=function(t,e){var n=this.getMap().getView().getProjection(),r=e,i=Ti();i&&(r=r.clone().transform(i,n));var o=Qo(r);i&&o.transform(n,i);for(var s=o.getCoordinates()[0],a=0,u=s.length-1;a<u;++a)t.push(s.slice(a,a+2))},e.prototype.segmentGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=this.GEOMETRY_SEGMENTERS_[n[r].getType()];i&&i(t,n[r])}},e.prototype.segmentLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r)t.push(n.slice(r,r+2))},e.prototype.segmentMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},e.prototype.segmentMultiPointGeometry_=function(t,e){e.getCoordinates().forEach(function(e){t.push([e])})},e.prototype.segmentMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length;s<a;++s)for(var u=o[s],l=0,c=u.length-1;l<c;++l)t.push(u.slice(l,l+2))},e.prototype.segmentPointGeometry_=function(t,e){t.push([e.getCoordinates()])},e.prototype.segmentPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},e}(Ds),lw=uw,cw=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)}}(),hw=function(t){function e(e,n,r){var i=t.call(this)||this;if(void 0!==r&&void 0===n)i.setFlatCoordinates(r,e);else{var o=n||0;i.setCenterAndRadius(e,o,r)}return i}return cw(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){var i=this.flatCoordinates,o=t-i[0],s=e-i[1],a=o*o+s*s;if(a<r){if(0===a)for(var u=0;u<this.stride;++u)n[u]=i[u];else{var l=this.getRadius()/Math.sqrt(a);n[0]=i[0]+l*o,n[1]=i[1]+l*s;for(u=2;u<this.stride;++u)n[u]=i[u]}return n.length=this.stride,a}return r},e.prototype.containsXY=function(t,e){var n=this.flatCoordinates,r=t-n[0],i=e-n[1];return r*r+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,n=e[this.stride]-e[0];return et(e[0]-n,e[1]-n,e[0]+n,e[1]+n,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return"Circle"},e.prototype.intersectsExtent=function(t){if(Et(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||ct(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,n=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+n;for(var i=1;i<e;++i)r[e+i]=t[i];this.setFlatCoordinates(this.layout,r),this.changed()},e.prototype.setCenterAndRadius=function(t,e,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,i=vo(r,0,t,this.stride);r[i++]=r[0]+e;for(var o=1,s=this.stride;o<s;++o)r[i++]=r[o];r.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var n=this.getCenter(),r=this.getStride();this.setCenter(eo(n,0,n.length,r,t,e,n)),this.changed()},e.prototype.translate=function(t,e){var n=this.getCenter(),r=this.getStride();this.setCenter(no(n,0,n.length,r,t,e,n)),this.changed()},e}(co);hw.prototype.transform;var fw=hw;function pw(t,e,n,r,i,o,s){var a,u,l=(n-e)/r;if(1===l)a=e;else if(2===l)a=e,u=i;else if(0!==l){for(var h=t[e],f=t[e+1],p=0,d=[0],g=e+r;g<n;g+=r){var y=t[g],v=t[g+1];p+=Math.sqrt((y-h)*(y-h)+(v-f)*(v-f)),d.push(p),h=y,f=v}var _=i*p,m=function(t,e,n){for(var r,i,o=n||c,s=0,a=t.length,u=!1;s<a;)(i=+o(t[r=s+(a-s>>1)],e))<0?s=r+1:(a=r,u=!i);return u?s:~s}(d,_);m<0?(u=(_-d[-m-2])/(d[-m-1]-d[-m-2]),a=e+(-m-2)*r):a=e+m*r}var x=s>1?s:2,w=o||new Array(x);for(g=0;g<x;++g)w[g]=void 0===a?NaN:void 0===u?t[a+g]:Nt(t[a+g],t[a+r+g],u);return w}function dw(t,e,n,r,i,o){if(n==e)return null;var s;if(i<t[e+r-1])return o?((s=t.slice(e,e+r))[r-1]=i,s):null;if(t[n-1]<i)return o?((s=t.slice(n-r,n))[r-1]=i,s):null;if(i==t[e+r-1])return t.slice(e,e+r);for(var a=e/r,u=n/r;a<u;){var l=a+u>>1;i<t[(l+1)*r-1]?u=l:a=l+1}var c=t[a*r-1];if(i==c)return t.slice((a-1)*r,(a-1)*r+r);var h=(i-c)/(t[(a+1)*r-1]-c);s=[];for(var f=0;f<r-1;++f)s.push(Nt(t[(a-1)*r+f],t[a*r+f],h));return s.push(i),s}var gw=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)}}(),yw=function(t){function e(e,n){var r=t.call(this)||this;return r.flatMidpoint_=null,r.flatMidpointRevision_=-1,r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return gw(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?p(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<Z(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(fo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),go(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.forEachSegment=function(t){return Bo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=$i&&this.layout!=Qi)return null;var n=void 0!==e&&e;return dw(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n)},e.prototype.getCoordinates=function(){return Co(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return pw(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return zm(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=xo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,Ki)},e.prototype.getType=function(){return"LineString"},e.prototype.intersectsExtent=function(t){return zo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=_o(this.flatCoordinates,0,t,this.stride),this.changed()},e}(co),vw=yw,_w=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)}}(),mw=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,n);else if(void 0!==n&&r)i.setFlatCoordinates(n,e),i.ends_=r;else{for(var o=i.getLayout(),s=e,a=[],u=[],l=0,c=s.length;l<c;++l){var h=s[l];0===l&&(o=h.getLayout()),p(a,h.getFlatCoordinates()),u.push(a.length)}i.setFlatCoordinates(o,a),i.ends_=u}return i}return _w(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?p(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<Z(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(po(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),yo(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.getCoordinateAtM=function(t,e,n){if(this.layout!=$i&&this.layout!=Qi||0===this.flatCoordinates.length)return null;var r=void 0!==e&&e,i=void 0!==n&&n;return function(t,e,n,r,i,o,s){if(s)return dw(t,e,n[n.length-1],r,i,o);var a;if(i<t[r-1])return o?((a=t.slice(0,r))[r-1]=i,a):null;if(t[t.length-1]<i)return o?((a=t.slice(t.length-r))[r-1]=i,a):null;for(var u=0,l=n.length;u<l;++u){var c=n[u];if(e!=c){if(i<t[e+r-1])return null;if(i<=t[c-1])return dw(t,e,c,r,i,!1);e=c}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,r,i)},e.prototype.getCoordinates=function(){return Po(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new vw(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,n=this.layout,r=[],i=0,o=0,s=e.length;o<s;++o){var a=e[o],u=new vw(t.slice(i,a),n);r.push(u),i=a}return r},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,n=0,r=this.ends_,i=this.stride,o=0,s=r.length;o<s;++o){var a=r[o];p(t,pw(e,n,a,i,.5)),n=a}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=wo(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,r),new e(n,Ki,r)},e.prototype.getType=function(){return"MultiLineString"},e.prototype.intersectsExtent=function(t){return function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){if(zo(t,e,n[o],r,i))return!0;e=n[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=mo(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(co),xw=mw,ww=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)}}(),bw=function(t){function e(e,n){var r=t.call(this)||this;return n&&!Array.isArray(e[0])?r.setFlatCoordinates(n,e):r.setCoordinates(e,n),r}return ww(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?p(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){if(r<Z(this.getExtent(),t,e))return r;for(var i=this.flatCoordinates,o=this.stride,s=0,a=i.length;s<a;s+=o){var u=Rt(t,e,i[s],i[s+1]);if(u<r){r=u;for(var l=0;l<o;++l)n[l]=i[s+l];n.length=o}}return r},e.prototype.getCoordinates=function(){return Co(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new No(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,n=this.stride,r=[],i=0,o=t.length;i<o;i+=n){var s=new No(t.slice(i,i+n),e);r.push(s)}return r},e.prototype.getType=function(){return"MultiPoint"},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,n=this.stride,r=0,i=e.length;r<i;r+=n){if($(t,e[r],e[r+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=_o(this.flatCoordinates,0,t,this.stride),this.changed()},e}(co),Ew=bw;var Sw=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)}}(),Cw=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){for(var o=i.getLayout(),s=e,a=[],u=[],l=0,c=s.length;l<c;++l){var h=s[l];0===l&&(o=h.getLayout());for(var f=a.length,d=h.getEnds(),g=0,y=d.length;g<y;++g)d[g]+=f;p(a,h.getFlatCoordinates()),u.push(d)}n=o,e=a,r=u}return void 0!==n&&r?(i.setFlatCoordinates(n,e),i.endss_=r):i.setCoordinates(e,n),i}return Sw(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var n=this.flatCoordinates.length;p(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,i=(e=t.getEnds().slice()).length;r<i;++r)e[r]+=n}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,n=new Array(t),r=0;r<t;++r)n[r]=this.endss_[r].slice();var i=new e(this.flatCoordinates.slice(),this.layout,n);return i.applyProperties(this),i},e.prototype.closestPointXY=function(t,e,n,r){return r<Z(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];i=po(t,e,a,r,i),e=a[a.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,n,r,i,o,s,a,u,l,c){for(var h=c||[NaN,NaN],f=0,p=n.length;f<p;++f){var d=n[f];l=yo(t,e,d,r,i,o,s,a,u,l,h),e=d[d.length-1]}return l}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.containsXY=function(t,e){return function(t,e,n,r,i,o){if(0===n.length)return!1;for(var s=0,a=n.length;s<a;++s){var u=n[s];if(jo(t,e,u,r,i,o))return!0;e=u[u.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,n,r){for(var i=0,o=0,s=n.length;o<s;++o){var a=n[o];i+=Oo(t,e,a,r),e=a[a.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ho(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,Io(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=function(t,e,n,r){for(var i=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=n.length;s<a;++s){var u=n[s];o=it(t,e,u[0],r),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=u[u.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=function(t,e,n,r,i){for(var o=[],s=0,a=n.length;s<a;++s){var u=n[s];o=Go(t,e,u,r,i,2*s,o),e=u[u.length-1]}return o}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new Ew(this.getFlatInteriorPoints().slice(),$i)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(!Wo(t,e,a,r,i))return!1;a.length&&(e=a[a.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ho(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=function(t,e,n,r,i,o,s,a){for(var u=0,l=n.length;u<l;++u){var c=n[u],h=[];s=So(t,e,c,r,i,o,s,h),a.push(h),e=c[c.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,r),new e(n,Ki,r)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var n=this.endss_[t-1];e=n[n.length-1]}var r=this.endss_[t].slice(),i=r[r.length-1];if(0!==e)for(var o=0,s=r.length;o<s;++o)r[o]-=e;return new Jo(this.flatCoordinates.slice(e,i),this.layout,r)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.endss_,r=[],i=0,o=0,s=n.length;o<s;++o){var a=n[o].slice(),u=a[a.length-1];if(0!==i)for(var l=0,c=a.length;l<c;++l)a[l]-=i;var h=new Jo(e.slice(i,u),t,a);r.push(h),i=u}return r},e.prototype.getType=function(){return"MultiPolygon"},e.prototype.intersectsExtent=function(t){return function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(Uo(t,e,a,r,i))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var n=function(t,e,n,r,i){for(var o=i||[],s=0,a=0,u=n.length;a<u;++a){var l=mo(t,e,n[a],r,o[s]);o[s++]=l,e=l[l.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===n.length)this.flatCoordinates.length=0;else{var r=n[n.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},e}(co),Pw=Cw,Iw=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)}}(),Mw="Point",Ow="LineString",Lw="Polygon",kw="Circle",Rw="drawstart",Tw="drawend",Aw="drawabort",Nw=function(t){function e(e,n){var r=t.call(this,e)||this;return r.feature=n,r}return Iw(e,t),e}($t),Fw=function(t){function e(e){var n=this,r=e;r.stopDown||(r.stopDown=y),(n=t.call(this,r)||this).on,n.once,n.un,n.shouldHandle_=!1,n.downPx_=null,n.downTimeout_,n.lastDragTime_,n.pointerType_,n.freehand_=!1,n.source_=e.source?e.source:null,n.features_=e.features?e.features:null,n.snapTolerance_=e.snapTolerance?e.snapTolerance:12,n.type_=e.type,n.mode_=function(t){switch(t){case"Point":case"MultiPoint":return Mw;case"LineString":case"MultiLineString":return Ow;case"Polygon":case"MultiPolygon":return Lw;case"Circle":return kw;default:throw new Error("Invalid type: "+t)}}(n.type_),n.stopClick_=!!e.stopClick,n.minPoints_=e.minPoints?e.minPoints:n.mode_===Lw?3:2,n.maxPoints_=n.mode_===kw?2:e.maxPoints?e.maxPoints:1/0,n.finishCondition_=e.finishCondition?e.finishCondition:g,n.geometryLayout_=e.geometryLayout?e.geometryLayout:Ki;var i,o=e.geometryFunction;if(!o){var s,a=n.mode_;if(a===kw)o=function(t,e,n){var r=e||new fw([NaN,NaN]),i=Ni(t[0],n),o=nn(i,Ni(t[t.length-1],n));r.setCenterAndRadius(i,Math.sqrt(o),this.geometryLayout_);var s=Ti();return s&&r.transform(n,s),r};else a===Mw?s=No:a===Ow?s=vw:a===Lw&&(s=Jo),o=function(t,e,n){return e?a===Lw?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])],this.geometryLayout_):e.setCoordinates([],this.geometryLayout_):e.setCoordinates(t,this.geometryLayout_):e=new s(t,this.geometryLayout_),e}}return n.geometryFunction_=o,n.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,n.finishCoordinate_=null,n.sketchFeature_=null,n.sketchPoint_=null,n.sketchCoords_=null,n.sketchLine_=null,n.sketchLineCoords_=null,n.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,n.overlay_=new Nx({source:new Wx({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=$_(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),n.geometryName_=e.geometryName,n.condition_=e.condition?e.condition:Us,n.freehandCondition_,e.freehand?n.freehandCondition_=zs:n.freehandCondition_=e.freehandCondition?e.freehandCondition:Xs,n.addChangeListener(Ps,n.updateState_),n}return Iw(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===le&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Mw&&this.freehandCondition_(e);var n=e.type===pr.POINTERMOVE,r=!0;!this.freehand_&&this.lastDragTime_&&e.type===pr.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===pr.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===pr.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===pr.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===pr.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===pr.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,e)&&r},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new fr(pr.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var n=!this.finishCoordinate_;n&&this.startDrawing_(t.coordinate),!n&&this.freehand_?this.finishDrawing():this.freehand_||n&&this.mode_!==Mw||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,n=t.pixel,r=e[0]-n[0],i=e[1]-n[1],o=r*r+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var n=!1,r=[this.finishCoordinate_],i=this.mode_;if(i===Mw)e=!0;else if(i===kw)e=2===this.sketchCoords_.length;else if(i===Ow)n=this.sketchCoords_.length>this.minPoints_;else if(i===Lw){var o=this.sketchCoords_;n=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(n)for(var s=this.getMap(),a=0,u=r.length;a<u;a++){var l=r[a],c=s.getPixelFromCoordinate(l),h=t[0]-c[0],f=t[1]-c[1],p=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(h*h+f*f)<=p){this.finishCoordinate_=l;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new Va(new No(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new Va);var e=t.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),n.changed()):(n=new vw(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(n))},e.prototype.startDrawing_=function(t){for(var e=this.getMap().getView().getProjection(),n=lo(this.geometryLayout_);t.length<n;)t.push(0);this.finishCoordinate_=t,this.mode_===Mw?this.sketchCoords_=t.slice():this.mode_===Lw?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Va(new vw(this.sketchLineCoords_)));var r=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new Va,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new Nw(Rw,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){for(var e,n,r=this.getMap(),i=this.sketchFeature_.getGeometry(),o=r.getView().getProjection(),s=lo(this.geometryLayout_);t.length<s;)t.push(0);(this.mode_===Mw?n=this.sketchCoords_:this.mode_===Lw?(n=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(r.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):n=(e=this.sketchCoords_)[e.length-1],n[0]=t[0],n[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if("Polygon"===i.getType()&&this.mode_!==Lw)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,n,r=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;o===Ow||o===kw?(this.finishCoordinate_=t.slice(),(n=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),this.geometryFunction_(n,r,i)):o===Lw&&((n=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),e&&(this.finishCoordinate_=n[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;if(r===Ow||r===kw){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var i=this.finishCoordinate_.slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}this.geometryFunction_(t,e,n),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===Lw){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){i=t[t.length-2].slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,n)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,n=t.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===Ow?(e.pop(),this.geometryFunction_(e,n,r)):this.mode_===Lw&&(e[0].pop(),this.geometryFunction_(e,n,r),e=n.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new Ew([e])):"MultiLineString"===this.type_?t.setGeometry(new xw([e])):"MultiPolygon"===this.type_&&t.setGeometry(new Pw([e])),this.dispatchEvent(new Nw(Tw,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new Nw(Aw,t))},e.prototype.appendCoordinates=function(t){var e,n=this.mode_,r=!this.sketchFeature_;if(r&&this.startDrawing_(t[0]),n===Ow||n===kw)e=this.sketchCoords_;else{if(n!==Lw)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}r&&e.shift(),e.pop();for(var i=0;i<t.length;i++)this.addToDrawing_(t[i]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new Va(new No(n)),this.updateSketchFeatures_(),this.dispatchEvent(new Nw(Rw,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(Ds);var Dw=Fw,jw="preload",Gw="useInterimTilesOnError",Bw=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)}}(),zw=function(t){function e(e){var n=this,r=e||{},i=te({},r);return delete i.preload,delete i.useInterimTilesOnError,(n=t.call(this,i)||this).on,n.once,n.un,n.setPreload(void 0!==r.preload?r.preload:0),n.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),n}return Bw(e,t),e.prototype.getPreload=function(){return this.get(jw)},e.prototype.setPreload=function(t){this.set(jw,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Gw)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Gw,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(Ze),Vw=zw,Uw=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)}}(),Xw=function(t){function e(e,n,r){var i=t.call(this)||this,o=r||{};return i.tileCoord=e,i.state=n,i.interimTile=null,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i.interpolate=!!o.interpolate,i}return Uw(e,t),e.prototype.changed=function(){this.dispatchEvent(ae)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Ar)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Ar){t.interimTile=null;break}t.getState()==Tr?e=t:t.getState()==Rr?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Nr&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){_()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var r=e-n+1e3/60;return r>=this.transition_?1:Wi(r/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(se),qw=Xw,Ww=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)}}(),Yw=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,s)||this;return a.crossOrigin_=i,a.src_=r,a.key=r,a.image_=new Image,null!==i&&(a.image_.crossOrigin=i),a.unlisten_=null,a.tileLoadFunction_=o,a}return Ww(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Ar,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Nr,this.unlistenImage_(),this.image_=((t=mn(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Ar:this.state=Fr,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Nr&&(this.state=Rr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Rr&&(this.state=Tr,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=vx(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(qw);var Hw,Zw=Yw,Kw=function(){function t(t,e,n,r,i,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=Pi(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&bt(r)==bt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?bt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?bt(this.targetProj_.getExtent()):null;var u=xt(n),l=wt(n),c=pt(n),h=ft(n),f=this.transformInv_(u),p=this.transformInv_(l),d=this.transformInv_(c),g=this.transformInv_(h),y=10+(o?Math.max(0,Math.ceil(Lt(ht(n)/(o*o*256*256)))):0);if(this.addQuad_(u,l,c,h,f,p,d,g,y),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach(function(t,e,n){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,n,r,i,o){this.triangles_.push({source:[r,i,o],target:[t,e,n]})},t.prototype.addQuad_=function(t,e,n,r,i,o,s,a,u){var l=W([i,o,s,a]),c=this.sourceWorldWidth_?bt(l)/this.sourceWorldWidth_:null,h=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&c>.5&&c<1,p=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)p=bt(W([t,e,n,r]))/this.targetWorldWidth_>.25||p;!f&&this.sourceProj_.isGlobal()&&c&&(p=c>.25||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3]))||Et(l,this.maxSourceExtent_)){var d=0;if(!(p||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(u>0)p=!0;else if(1!=(d=(isFinite(i[0])&&isFinite(i[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(u>0){if(!p){var g=[(t[0]+n[0])/2,(t[1]+n[1])/2],y=this.transformInv_(g),v=void 0;if(f)v=(At(i[0],h)+At(s[0],h))/2-At(y[0],h);else v=(i[0]+s[0])/2-y[0];var _=(i[1]+s[1])/2-y[1];p=v*v+_*_>this.errorThresholdSquared_}if(p){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var m=[(e[0]+n[0])/2,(e[1]+n[1])/2],x=this.transformInv_(m),w=[(r[0]+t[0])/2,(r[1]+t[1])/2],b=this.transformInv_(w);this.addQuad_(t,e,m,w,i,o,x,b,u-1),this.addQuad_(w,m,n,r,b,x,s,a,u-1)}else{var E=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(E),C=[(n[0]+r[0])/2,(n[1]+r[1])/2],P=this.transformInv_(C);this.addQuad_(t,E,C,r,i,S,P,a,u-1),this.addQuad_(E,e,n,C,S,o,s,P,u-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}11&d||this.addTriangle_(t,n,r,i,s,a),14&d||this.addTriangle_(t,n,e,i,s,o),d&&(13&d||this.addTriangle_(e,r,t,o,a,i),7&d||this.addTriangle_(e,r,n,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(e,n,r){var i=e.source;at(t,i[0]),at(t,i[1]),at(t,i[2])}),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),Jw=Kw,$w={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Qw={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},tb=[];function eb(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function nb(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function rb(t,e,n,r){var i=Ii(n,e,t),o=wi(e,r,n),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var u=t.getExtent();if(!u||K(u,i)){var l=wi(t,o,i)/o;isFinite(l)&&l>0&&(o/=l)}return o}function ib(t,e,n,r,i,o,s,a,u,l,c,h){var f=mn(Math.round(n*t),Math.round(n*e),tb);if(h||te(f,$w),0===u.length)return f.canvas;function p(t){return Math.round(t*n)/n}f.scale(n,n),f.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];u.forEach(function(t,e,n){st(d,t.extent)});var g=bt(d),y=_t(d),v=mn(Math.round(n*g/r),Math.round(n*y/r));h||te(v,$w);var _=n/r;u.forEach(function(t,e,n){var r=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=bt(t.extent),s=_t(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,r*_,i*_,o*_,s*_)});var m=xt(s);return a.getTriangles().forEach(function(t,e,i){var s=t.source,a=t.target,u=s[0][0],l=s[0][1],c=s[1][0],g=s[1][1],y=s[2][0],_=s[2][1],x=p((a[0][0]-m[0])/o),w=p(-(a[0][1]-m[1])/o),b=p((a[1][0]-m[0])/o),E=p(-(a[1][1]-m[1])/o),S=p((a[2][0]-m[0])/o),C=p(-(a[2][1]-m[1])/o),P=u,I=l;u=0,l=0;var M=function(t){for(var e=t.length,n=0;n<e;n++){for(var r=n,i=Math.abs(t[n][n]),o=n+1;o<e;o++){var s=Math.abs(t[o][n]);s>i&&(i=s,r=o)}if(0===i)return null;var a=t[r];t[r]=t[n],t[n]=a;for(var u=n+1;u<e;u++)for(var l=-t[u][n]/t[n][n],c=n;c<e+1;c++)n==c?t[u][c]=0:t[u][c]+=l*t[n][c]}for(var h=new Array(e),f=e-1;f>=0;f--){h[f]=t[f][e]/t[f][f];for(var p=f-1;p>=0;p--)t[p][e]-=t[p][f]*h[f]}return h}([[c-=P,g-=I,0,0,b-x],[y-=P,_-=I,0,0,S-x],[0,0,c,g,E-w],[0,0,y,_,C-w]]);if(M){if(f.save(),f.beginPath(),function(){if(void 0===Hw){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",eb(t,4,5,4,0),eb(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Hw=nb(e,0)||nb(e,4)||nb(e,8)}return Hw}()||!h){f.moveTo(b,E);for(var O=x-b,L=w-E,k=0;k<4;k++)f.lineTo(b+p((k+1)*O/4),E+p(k*L/3)),3!=k&&f.lineTo(b+p((k+1)*O/4),E+p((k+1)*L/3));f.lineTo(S,C)}else f.moveTo(b,E),f.lineTo(x,w),f.lineTo(S,C);f.clip(),f.transform(M[0],M[2],M[1],M[3],x,w),f.translate(d[0]-P,d[3]-I),f.scale(r/n,-r/n),f.drawImage(v.canvas,0,0),f.restore()}}),c&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach(function(t,e,n){var r=t.target,i=(r[0][0]-m[0])/o,s=-(r[0][1]-m[1])/o,a=(r[1][0]-m[0])/o,u=-(r[1][1]-m[1])/o,l=(r[2][0]-m[0])/o,c=-(r[2][1]-m[1])/o;f.beginPath(),f.moveTo(a,u),f.lineTo(i,s),f.lineTo(l,c),f.closePath(),f.stroke()}),f.restore()),f.canvas}var ob=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)}}(),sb=function(t){function e(e,n,r,i,o,s,a,u,l,c,h,f){var p=t.call(this,o,Rr,{interpolate:!!f})||this;p.renderEdges_=void 0!==h&&h,p.pixelRatio_=a,p.gutter_=u,p.canvas_=null,p.sourceTileGrid_=n,p.targetTileGrid_=i,p.wrappedTileCoord_=s||o,p.sourceTiles_=[],p.sourcesListenerKeys_=null,p.sourceZ_=0;var d=i.getTileCoordExtent(p.wrappedTileCoord_),g=p.targetTileGrid_.getExtent(),y=p.sourceTileGrid_.getExtent(),v=g?mt(d,g):d;if(0===ht(v))return p.state=Fr,p;var _=e.getExtent();_&&(y=y?mt(y,_):_);var m=i.getResolution(p.wrappedTileCoord_[0]),x=function(t,e,n,r){var i=dt(n),o=rb(t,e,i,r);return(!isFinite(o)||o<=0)&&ct(n,function(n){return o=rb(t,e,n,r),isFinite(o)&&o>0}),o}(e,r,v,m);if(!isFinite(x)||x<=0)return p.state=Fr,p;var w=void 0!==c?c:.5;if(p.triangulation_=new Jw(e,r,v,y,x*w,m),0===p.triangulation_.getTriangles().length)return p.state=Fr,p;p.sourceZ_=n.getZForResolution(x);var b=p.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(b[1]=Mt(b[1],y[1],y[3]),b[3]=Mt(b[3],y[1],y[3])):b=mt(b,y)),ht(b)){for(var E=n.getTileRangeForExtentAndZ(b,p.sourceZ_),S=E.minX;S<=E.maxX;S++)for(var C=E.minY;C<=E.maxY;C++){var P=l(p.sourceZ_,S,C,a);P&&p.sourceTiles_.push(P)}0===p.sourceTiles_.length&&(p.state=Fr)}else p.state=Fr;return p}return ob(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,r){e&&e.getState()==Ar&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Nr;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),r="number"==typeof n?n:n[0],i="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=ib(r,i,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=Ar}this.changed()},e.prototype.load=function(){if(this.state==Rr){this.state=Tr,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,r){var i=e.getState();if(i==Rr||i==Tr){t++;var o=_e(e,ae,function(n){var r=e.getState();r!=Ar&&r!=Nr&&r!=Fr||(xe(o),0===--t&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(t,e,n){t.getState()==Rr&&t.load()})}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(xe),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(xn(this.canvas_.getContext("2d")),tb.push(this.canvas_),this.canvas_=null),t.prototype.release.call(this)},e}(qw),ab=sb,ub=function(){function t(t,e,n,r){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function lb(t,e,n,r,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new ub(t,e,n,r)}var cb=ub,hb=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)}}(),fb=function(t){function e(e){var n=t.call(this,e)||this;return n.extentChanged=!0,n.renderedExtent_=null,n.renderedPixelRatio,n.renderedProjection=null,n.renderedRevision,n.renderedTiles=[],n.newTiles_=!1,n.tmpExtent=[1/0,1/0,-1/0,-1/0],n.tmpTileRange_=new cb(0,0,0,0),n}return hb(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),r=e.getUseInterimTilesOnError();return n==Ar||n==Fr||n==Nr&&!r},e.prototype.getTile=function(t,e,n,r){var i=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,n,i,o);return a.getState()==Nr&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(Ar)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),r=F(e.pixelToCoordinateTransform,t.slice()),i=n.getExtent();if(i&&!K(i,r))return null;for(var o=e.pixelRatio,s=e.viewState.projection,a=e.viewState,u=n.getRenderSource(),l=u.getTileGridForProjection(a.projection),c=u.getTilePixelRatio(e.pixelRatio),h=l.getZForResolution(a.resolution);h>=l.getMinZoom();--h){var f=l.getTileCoordForCoordAndZ(r,h),p=u.getTile(h,f[1],f[2],o,s);if(!(p instanceof Zw||p instanceof ab))return null;if(p.getState()===Ar){var d=l.getOrigin(h),g=as(l.getTileSize(h)),y=l.getResolution(h),v=Math.floor(c*((r[0]-d[0])/y-f[1]*g[0])),_=Math.floor(c*((d[1]-r[1])/y-f[2]*g[1])),m=Math.round(c*u.getGutterForProjection(a.projection));return this.getImageData(p.getImage(),v+m,_+m)}}return null},e.prototype.loadedTileCallback=function(e,n,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,e,n,r)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var n=t.layerStatesArray[t.layerIndex],r=t.viewState,i=r.projection,o=r.resolution,s=r.center,a=r.rotation,u=t.pixelRatio,l=this.getLayer(),h=l.getSource(),f=h.getRevision(),p=h.getTileGridForProjection(i),d=p.getZForResolution(o,h.zDirection),g=p.getResolution(d),y=t.extent,v=t.viewState.resolution,_=h.getTilePixelRatio(u),m=Math.round(bt(y)/v*u),w=Math.round(_t(y)/v*u),b=n.extent&&Di(n.extent,i);b&&(y=mt(y,Di(n.extent,i)));var E=g*m/2/_,S=g*w/2/_,C=[s[0]-E,s[1]-S,s[0]+E,s[1]+S],P=p.getTileRangeForExtentAndZ(y,d),I={};I[d]={};var M=this.createLoadedTileFinder(h,i,I),O=this.tmpExtent,L=this.tmpTileRange_;this.newTiles_=!1;for(var k=a?vt(r.center,v,a,t.size):void 0,R=P.minX;R<=P.maxX;++R)for(var T=P.minY;T<=P.maxY;++T)if(!a||p.tileCoordIntersectsViewport([d,R,T],k)){var A=this.getTile(d,R,T,t);if(this.isDrawableTile(A)){var N=x(this);if(A.getState()==Ar)I[d][A.tileCoord.toString()]=A,(lt=A.inTransition(N))&&1!==n.opacity&&(A.endTransition(N),lt=!1),this.newTiles_||!lt&&-1!==this.renderedTiles.indexOf(A)||(this.newTiles_=!0);if(1===A.getAlpha(N,t.time))continue}var B=p.getTileCoordChildTileRange(A.tileCoord,L,O),z=!1;B&&(z=M(d+1,B)),z||p.forEachTileCoordParentTileRange(A.tileCoord,M,L,O)}var V=g/o*u/_;D(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/u,1/u,a,-m/2,-w/2);var U=G(this.pixelTransform);this.useContainer(e,U,this.getBackground(t));var X=this.context,q=X.canvas;j(this.inversePixelTransform,this.pixelTransform),D(this.tempTransform,m/2,w/2,V,V,0,-m/2,-w/2),q.width!=m||q.height!=w?(q.width=m,q.height=w):this.containerReused||X.clearRect(0,0,m,w),b&&this.clipUnrotated(X,t,b),h.getInterpolate()||te(X,$w),this.preRender(X,t),this.renderedTiles.length=0;var W,Y,H,Z=Object.keys(I).map(Number);Z.sort(c),1!==n.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(W=[],Y=[]):Z=Z.reverse();for(var K=Z.length-1;K>=0;--K){var J=Z[K],$=h.getTilePixelSize(J,u,i),Q=p.getResolution(J)/g,tt=$[0]*Q*V,et=$[1]*Q*V,nt=p.getTileCoordForCoordAndZ(xt(C),J),rt=p.getTileCoordExtent(nt),it=F(this.tempTransform,[_*(rt[0]-C[0])/g,_*(C[3]-rt[3])/g]),st=_*h.getGutterForProjection(i),at=I[J];for(var ut in at){var lt,ct=(A=at[ut]).tileCoord,ht=nt[1]-ct[1],ft=Math.round(it[0]-(ht-1)*tt),pt=nt[2]-ct[2],dt=Math.round(it[1]-(pt-1)*et),gt=ft-(R=Math.round(it[0]-ht*tt)),yt=dt-(T=Math.round(it[1]-pt*et)),wt=d===J,St=!1;if(!(lt=wt&&1!==A.getAlpha(x(this),t.time)))if(W){H=[R,T,R+gt,T,R+gt,T+yt,R,T+yt];for(var Ct=0,Pt=W.length;Ct<Pt;++Ct)if(d!==J&&J<Y[Ct]){var It=W[Ct];Et([R,T,R+gt,T+yt],[It[0],It[3],It[4],It[7]])&&(St||(X.save(),St=!0),X.beginPath(),X.moveTo(H[0],H[1]),X.lineTo(H[2],H[3]),X.lineTo(H[4],H[5]),X.lineTo(H[6],H[7]),X.moveTo(It[6],It[7]),X.lineTo(It[4],It[5]),X.lineTo(It[2],It[3]),X.lineTo(It[0],It[1]),X.clip())}W.push(H),Y.push(J)}else X.clearRect(R,T,gt,yt);this.drawTileImage(A,t,R,T,gt,yt,st,wt),W&&!lt?(St&&X.restore(),this.renderedTiles.unshift(A)):this.renderedTiles.push(A),this.updateUsedTiles(t.usedTiles,h,A)}}return this.renderedRevision=f,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!ot(this.renderedExtent_,C),this.renderedExtent_=C,this.renderedPixelRatio=u,this.renderedProjection=i,this.manageTilePyramid(t,h,p,u,i,y,d,l.getPreload()),this.scheduleExpireCache(t,h),this.postRender(X,t),n.extent&&X.restore(),te(X,Qw),U!==q.style.transform&&(q.style.transform=U),this.container},e.prototype.drawTileImage=function(t,e,n,r,i,o,s,a){var u=this.getTileImage(t);if(u){var l=x(this),c=e.layerStatesArray[e.layerIndex],h=c.opacity*(a?t.getAlpha(l,e.time):1),f=h!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=h),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,n,r,i,o),f&&this.context.restore(),h!==c.opacity?e.animate=!0:a&&t.endTransition(l)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var n=function(t,e,n){var r=x(t);r in n.usedTiles&&t.expireCache(n.viewState.projection,n.usedTiles[r])}.bind(null,e);t.postRenderFunctions.push(n)}},e.prototype.updateUsedTiles=function(t,e,n){var r=x(e);r in t||(t[r]={}),t[r][n.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,n,r,i,o,s,a,u){var l=x(e);l in t.wantedTiles||(t.wantedTiles[l]={});var c,h,f,p,d,g,y=t.wantedTiles[l],v=t.tileQueue,_=n.getMinZoom(),m=t.viewState.rotation,w=m?vt(t.viewState.center,t.viewState.resolution,m,t.size):void 0,b=0;for(g=_;g<=s;++g)for(h=n.getTileRangeForExtentAndZ(o,g,h),f=n.getResolution(g),p=h.minX;p<=h.maxX;++p)for(d=h.minY;d<=h.maxY;++d)m&&!n.tileCoordIntersectsViewport([g,p,d],w)||(s-g<=a?(++b,(c=e.getTile(g,p,d,r,i)).getState()==Rr&&(y[c.getKey()]=!0,v.isKeyQueued(c.getKey())||v.enqueue([c,l,n.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(g,p,d,i));e.updateCacheSize(b,i)},e}(Gm),pb=fb,db=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)}}(),gb=function(t){function e(e){return t.call(this,e)||this}return db(e,t),e.prototype.createRenderer=function(){return new pb(this)},e}(Vw),yb=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var n=this.entries_[t];return T(void 0!==n,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_},t.prototype.remove=function(t){var e=this.entries_[t];return T(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(t){if(this.containsKey(t))return this.entries_[t].value_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){T(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),vb=yb;function _b(t,e,n,r){return void 0!==r?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function mb(t,e,n){return t+"/"+e+"/"+n}function xb(t){return mb(t[0],t[1],t[2])}var wb=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)}}(),bb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wb(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=function(t){return t.split("/").map(Number)}(this.peekFirstKey()),e=t[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(xb(t.tileCoord)),t.release())}.bind(this))}},e}(vb),Eb=bb,Sb="tileloadstart",Cb="tileloadend",Pb="tileloaderror",Ib=[0,0,0],Mb=function(){function t(t){var e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,T(function(t,e,n){var r=e||c;return t.every(function(e,i){if(0===i)return!0;var o=r(t[i-1],e);return!(o>0||n&&0===o)})}(this.resolutions_,function(t,e){return e-t},!0),17),!t.origins)for(var n=0,r=this.resolutions_.length-1;n<r;++n)if(e){if(this.resolutions_[n]/this.resolutions_[n+1]!==e){e=void 0;break}}else e=this.resolutions_[n]/this.resolutions_[n+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,T(this.origins_.length==this.resolutions_.length,20));var i=t.extent;void 0===i||this.origin_||this.origins_||(this.origin_=xt(i)),T(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,T(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Wr,T(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==i?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map(function(t,e){var n=new cb(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(i){var r=this.getTileRangeForExtentAndZ(i,e);n.minX=Math.max(r.minX,n.minX),n.maxX=Math.min(r.maxX,n.maxX),n.minY=Math.max(r.minY,n.minY),n.maxY=Math.min(r.maxY,n.maxY)}return n},this):i&&this.calculateTileRanges_(i)}return t.prototype.forEachTileCoord=function(t,e,n){for(var r=this.getTileRangeForExtentAndZ(t,e),i=r.minX,o=r.maxX;i<=o;++i)for(var s=r.minY,a=r.maxY;s<=a;++s)n([e,i,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,n,r){var i,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):s=this.getTileCoordExtent(t,r);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?lb(i=Math.floor(i/2),i,o=Math.floor(o/2),o,n):this.getTileRangeForExtentAndZ(s,a,n)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,n){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var r=2*t[1],i=2*t[2];return lb(r,r+1,i,i+1,e)}var o=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;var r=t[0],i=t[1],o=t[2];if(e===r)return lb(i,o,i,o,n);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-r),a=Math.floor(i*s),u=Math.floor(o*s);return e<r?lb(a,a,u,u,n):lb(a,Math.floor(s*(i+1))-1,u,Math.floor(s*(o+1))-1,n)}var l=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(l,e,n)},t.prototype.getTileRangeExtent=function(t,e,n){var r=this.getOrigin(t),i=this.getResolution(t),o=as(this.getTileSize(t),this.tmpSize_),s=r[0]+e.minX*o[0]*i,a=r[0]+(e.maxX+1)*o[0]*i;return et(s,r[1]+e.minY*o[1]*i,a,r[1]+(e.maxY+1)*o[1]*i,n)},t.prototype.getTileRangeForExtentAndZ=function(t,e,n){var r=Ib;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,r);var i=r[1],o=r[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,r),lb(i,r[1],o,r[2],n)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=as(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*r[0]*n,e[1]-(t[2]+.5)*r[1]*n]},t.prototype.getTileCoordExtent=function(t,e){var n=this.getOrigin(t[0]),r=this.getResolution(t[0]),i=as(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*i[0]*r,s=n[1]-(t[2]+1)*i[1]*r;return et(o,s,o+i[0]*r,s+i[1]*r,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,n,r,i){var o=this.getZForResolution(n),s=n/this.getResolution(o),a=this.getOrigin(o),u=as(this.getTileSize(o),this.tmpSize_),l=s*(t-a[0])/n/u[0],c=s*(a[1]-e)/n/u[1];return r?(l=Gt(l,5)-1,c=Gt(c,5)-1):(l=jt(l,5),c=jt(c,5)),_b(o,l,c,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,n,r,i){var o=this.getOrigin(n),s=this.getResolution(n),a=as(this.getTileSize(n),this.tmpSize_),u=(t-o[0])/s/a[0],l=(o[1]-e)/s/a[1];return r?(u=Gt(u,5)-1,l=Gt(l,5)-1):(u=jt(u,5),l=jt(l,5)),_b(n,u,l,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return Mt(h(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.tileCoordIntersectsViewport=function(t,e){return Vo(e,0,e.length,2,this.getTileCoordExtent(t))},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,n=new Array(e),r=this.minZoom;r<e;++r)n[r]=this.getTileRangeForExtentAndZ(t,r);this.fullTileRanges_=n},t}(),Ob=Mb;function Lb(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,n,r){var i=Rb(t);return function(t,e,n,r){var i=void 0!==r?r:"top-left",o=kb(t,e,n);return new Ob({extent:t,origin:gt(t,i),resolutions:o,tileSize:n})}(i,e,n,r)}(t),t.setDefaultTileGrid(e)),e}function kb(t,e,n,r){for(var i=void 0!==e?e:42,o=_t(t),s=bt(t),a=as(void 0!==n?n:Wr),u=r>0?r:Math.max(s/a[0],o/a[1]),l=i+1,c=new Array(l),h=0;h<l;++h)c[h]=u/Math.pow(2,h);return c}function Rb(t){var e=(t=xi(t)).getExtent();if(!e){var n=180*zr[Vr.DEGREES]/t.getMetersPerUnit();e=et(-n,-n,n,n)}return e}var Tb=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)}}(),Ab=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||this;n.on,n.once,n.un,n.opaque_=void 0!==e.opaque&&e.opaque,n.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,n.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;return n.tileGrid&&as(n.tileGrid.getTileSize(n.tileGrid.getMinZoom()),[256,256]),n.tileCache=new Eb(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition,interpolate:e.interpolate},n.zDirection=e.zDirection?e.zDirection:0,n}return Tb(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,n,r){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,s,a,u=!0,l=n.minX;l<=n.maxX;++l)for(var c=n.minY;c<=n.maxY;++c)s=mb(e,l,c),a=!1,i.containsKey(s)&&(a=(o=i.get(s)).getState()===Ar)&&(a=!1!==r(o)),a||(u=!1);return u},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,e,n,r,i){return _()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Lb(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return T(null===e||Si(e,t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,n){var r,i,o,s=this.getTileGridForProjection(n),a=this.getTilePixelRatio(e),u=as(s.getTileSize(t),this.tmpSize);return 1==a?u:(r=u,i=a,void 0===(o=this.tmpSize)&&(o=[0,0]),o[0]=r[0]*i+.5|0,o[1]=r[1]*i+.5|0,o)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=function(t,e,n){var r=e[0],i=t.getTileCoordCenter(e),o=Rb(n);if(K(o,i))return e;var s=bt(o),a=Math.ceil((o[0]-i[0])/s);return i[0]+=s*a,t.getTileCoordForCoordAndZ(i,r)}(r,t,n)),function(t,e){var n=t[0],r=t[1],i=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return!o||o.containsXY(r,i)}(t,r)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},e.prototype.useTile=function(t,e,n,r){},e}(Gx),Nb=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tile=n,r}return Tb(e,t),e}($t),Fb=Ab;function Db(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,u){return s?t.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,function(){var t=s[0],n=e.getFullTileRange(t);return T(n,55),(n.getHeight()-s[2]-1).toString()}):void 0}}function jb(t,e){for(var n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=Db(t[i],e);return function(t){if(1===t.length)return t[0];return function(e,n,r){if(e){var i=function(t){return(t[1]<<t[0])+t[2]}(e),o=At(i,t.length);return t[o](e,n,r)}}}(r)}var Gb=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)}}(),Bb=function(t){function e(n){var r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,interpolate:n.interpolate,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return r.generateTileUrlFunction_=r.tileUrlFunction===e.prototype.tileUrlFunction,r.tileLoadFunction=n.tileLoadFunction,n.tileUrlFunction&&(r.tileUrlFunction=n.tileUrlFunction),r.urls=null,n.urls?r.setUrls(n.urls):n.url&&r.setUrl(n.url),r.tileLoadingKeys_={},r}return Gb(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,n=t.target,r=x(n),i=n.getState();i==Tr?(this.tileLoadingKeys_[r]=!0,e=Sb):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=i==Nr?Pb:i==Ar?Cb:void 0),null!=e&&this.dispatchEvent(new Nb(e,n))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],n=/\{([a-z])-([a-z])\}/.exec(t);if(n){var r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),o=void 0;for(o=r;o<=i;++o)e.push(t.replace(n[0],String.fromCharCode(o)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(n[2],10),a=parseInt(n[1],10);a<=s;a++)e.push(t.replace(n[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(jb(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,n){},e.prototype.useTile=function(t,e,n){var r=mb(t,e,n);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(Fb),zb=Bb,Vb=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)}}(),Ub=function(t){function e(e){var n=this,r=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(r=e.interpolate),(n=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Xb,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:r,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,n.tileClass=void 0!==e.tileClass?e.tileClass:Zw,n.tileCacheForProjection={},n.tileGridForProjection={},n.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,n.renderReprojectionEdges_=!1,n}return Vb(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==n?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[r];i.expireCache(i==n?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Si(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Si(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Si(e,t)){var n=x(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=Lb(t)),this.tileGridForProjection[n]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Si(e,t))return this.tileCache;var n=x(t);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new Eb(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]},e.prototype.createTile_=function(t,e,n,r,i,o){var s=[t,e,n],a=this.getTileCoordForTileUrlFunction(s,i),u=a?this.tileUrlFunction(a,r,i):void 0,l=new this.tileClass(s,void 0!==u?Rr:Fr,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=o,l.addEventListener(ae,this.handleTileChange.bind(this)),l},e.prototype.getTile=function(t,e,n,r,i){var o=this.getProjection();if(o&&i&&!Si(o,i)){var s=this.getTileCacheForProjection(i),a=[t,e,n],u=void 0,l=xb(a);s.containsKey(l)&&(u=s.get(l));var c=this.getKey();if(u&&u.key==c)return u;var h=this.getTileGridForProjection(o),f=this.getTileGridForProjection(i),p=this.getTileCoordForTileUrlFunction(a,i),d=new ab(o,h,i,f,a,p,this.getTilePixelRatio(r),this.getGutter(),function(t,e,n,r){return this.getTileInternal(t,e,n,r,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return d.key=c,u?(d.interimTile=u,d.refreshInterimChain(),s.replace(l,d)):s.set(l,d),d}return this.getTileInternal(t,e,n,r,o||i)},e.prototype.getTileInternal=function(t,e,n,r,i){var o=null,s=mb(t,e,n),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var u=o;o=this.createTile_(t,e,n,r,i,a),u.getState()==Rr?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,n,r,i,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var n=xi(t);if(n){var r=x(n);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}},e}(zb);function Xb(t,e){t.getImage().src=e}var qb=Ub,Wb=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)}}(),Yb=function(t){function e(e){var n=this,r=e||{},i=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(i=r.interpolate);var o=void 0!==r.projection?r.projection:"EPSG:3857",s=void 0!==r.tileGrid?r.tileGrid:function(t){var e=t||{},n=e.extent||xi("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:kb(n,e.maxZoom,e.tileSize,e.maxResolution)};return new Ob(r)}({extent:Rb(o),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return(n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:i,opaque:r.opaque,projection:o,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:s,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this).gutter_=void 0!==r.gutter?r.gutter:0,n}return Wb(e,t),e.prototype.getGutter=function(){return this.gutter_},e}(qb),Hb=Yb,Zb=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)}}(),Kb="element",Jb="map",$b="offset",Qb="position",tE="positioning",eE=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un,n.options=e,n.id=e.id,n.insertFirst=void 0===e.insertFirst||e.insertFirst,n.stopEvent=void 0===e.stopEvent||e.stopEvent,n.element=document.createElement("div"),n.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",n.element.style.position="absolute",n.element.style.pointerEvents="auto";var r=e.autoPan;return r&&"object"!=typeof r&&(r={animation:e.autoPanAnimation,margin:e.autoPanMargin}),n.autoPan=r||!1,n.rendered={transform_:"",visible:!0},n.mapPostrenderListenerKey=null,n.addChangeListener(Kb,n.handleElementChanged),n.addChangeListener(Jb,n.handleMapChanged),n.addChangeListener($b,n.handleOffsetChanged),n.addChangeListener(Qb,n.handlePositionChanged),n.addChangeListener(tE,n.handlePositioningChanged),void 0!==e.element&&n.setElement(e.element),n.setOffset(void 0!==e.offset?e.offset:[0,0]),n.setPositioning(e.positioning||"top-left"),void 0!==e.position&&n.setPosition(e.position),n}return Zb(e,t),e.prototype.getElement=function(){return this.get(Kb)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Jb)||null},e.prototype.getOffset=function(){return this.get($b)},e.prototype.getPosition=function(){return this.get(Qb)},e.prototype.getPositioning=function(){return this.get(tE)},e.prototype.handleElementChanged=function(){Cn(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Sn(this.element),xe(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=_e(t,xr,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(Kb,t)},e.prototype.setMap=function(t){this.set(Jb,t)},e.prototype.setOffset=function(t){this.set($b,t)},e.prototype.setPosition=function(t){this.set(Qb,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(Qb)){var n=this.getRect(e.getTargetElement(),e.getSize()),r=this.getElement(),i=this.getRect(r,[wn(r),bn(r)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!J(n,i)){var a=i[0]-n[0],u=n[2]-i[2],l=i[1]-n[1],c=n[3]-i[3],h=[0,0];if(a<0?h[0]=a-s:u<0&&(h[0]=Math.abs(u)+s),l<0?h[1]=l-s:c<0&&(h[1]=Math.abs(c)+s),0!==h[0]||0!==h[1]){var f=e.getView().getCenterInternal(),p=e.getPixelFromCoordinateInternal(f);if(!p)return;var d=[p[0]+h[0],p[1]+h[1]],g=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(d),duration:g.duration,easing:g.easing})}}}},e.prototype.getRect=function(t,e){var n=t.getBoundingClientRect(),r=n.left+window.pageXOffset,i=n.top+window.pageYOffset;return[r,i,r+e[0],i+e[1]]},e.prototype.setPositioning=function(t){this.set(tE,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var n=t.getPixelFromCoordinate(e),r=t.getSize();this.updateRenderedPosition(n,r)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var n=this.element.style,r=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+r[0])+"px",s=Math.round(t[1]+r[1])+"px",a="0%",u="0%";"bottom-right"==i||"center-right"==i||"top-right"==i?a="-100%":"bottom-center"!=i&&"center-center"!=i&&"top-center"!=i||(a="-50%"),"bottom-left"==i||"bottom-center"==i||"bottom-right"==i?u="-100%":"center-left"!=i&&"center-center"!=i&&"center-right"!=i||(u="-50%");var l="translate(".concat(a,", ").concat(u,") translate(").concat(o,", ").concat(s,")");this.rendered.transform_!=l&&(this.rendered.transform_=l,n.transform=l,n.msTransform=l)},e.prototype.getOptions=function(){return this.options},e}(Ie),nE=eE,rE=n(2857),iE=n.n(rE),oE=n(846),sE=n.n(oE),aE=n(1974),uE=n.n(aE),lE=n(2281),cE=n.n(lE),hE=n(6613),fE=n.n(hE),pE=n(6674),dE=n.n(pE),gE=n(7578),yE={};yE.styleTagTransform=dE(),yE.setAttributes=cE(),yE.insert=uE().bind(null,"head"),yE.domAPI=sE(),yE.insertStyleElement=fE();iE()(gE.A,yE),gE.A&&gE.A.locals&&gE.A.locals;function vE(t){return vE="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},vE(t)}function _E(t){return function(t){if(Array.isArray(t))return mE(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 mE(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)?mE(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 mE(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 xE(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,bE(r.key),r)}}function wE(t,e,n){return(e=bE(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bE(t){var e=function(t,e){if("object"!=vE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=vE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vE(e)?e:e+""}function EE(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 SE(t,e){return t.get(CE(t,e))}function CE(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 PE=new WeakMap,IE=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),EE(this,PE,{}),wE(this,"source",void 0),wE(this,"getSource",function(){return n.source}),wE(this,"setSource",function(t){SE(PE,n).setSource(t),n.source=t}),wE(this,"getStyle",function(){return n.style}),wE(this,"setStyle",function(t){SE(PE,n).setstyle(t),n.style=t}),wE(this,"addFeature",function(t){n.source.addFeature(t)}),wE(this,"removeFeature",function(t){n.source.removeFeature(t)}),this.init(e),SE(PE,this).addFeature=this.addFeature,SE(PE,this).removeFeature=this.removeFeature,SE(PE,this).getSource=this.getSource,SE(PE,this)},(e=[{key:"init",value:function(t){if(!t)return new Nx({source:new Wx});var e={};Array.isArray(t)?(e.features=t,e.zIndex=1e3):(e.features=t.features,e.zIndex=t.zIndex);var n,r,i,o=new Wx({features:_E(e.features)});this.source=o,n=PE,r=this,i=new Nx({source:o,zIndex:e.zIndex}),n.set(CE(n,r),i)}}])&&xE(t.prototype,e),n&&xE(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),ME=xi("EPSG:4326"),OE={projection:ME,center:[120.566032634,33.355905081],zoom:13,maxZoom:18,minZoom:3,extent:[65.32783475401652,.4243521114706,160.16017906160056,73.83501005646247]},LE={CLICK:"click",DBLCLICK:"dbclick"};function kE(t){return kE="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},kE(t)}function RE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function TE(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?RE(Object(n),!0).forEach(function(e){AE(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):RE(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function AE(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=kE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=kE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==kE(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var NE=TE(TE({},LE),{},{POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",CHANGE_RESOLUTION:"change:resolution",LOADEND:"loadend"});function FE(t){return FE="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},FE(t)}function DE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,jE(r.key),r)}}function jE(t){var e=function(t,e){if("object"!=FE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=FE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==FE(e)?e:e+""}function GE(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 BE(t,e){return t.get(function(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")}(t,e))}var zE=new WeakMap,VE=function(){return t=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),GE(this,zE,{}),this.context=e,this.target=n},e=[{key:"eventList",get:function(){return BE(zE,this)}},{key:"eventCallback",value:function(t,e,n){n&&"function"===FE(n).toLocaleLowerCase()&&n({lnglat:t.coordinate,type:e,target:this.context,MAP_EVENT:t})}},{key:"onEvent",value:function(t,e,n,r){var i=t[e.toLocaleUpperCase()];if(BE(zE,this)[i])BE(zE,this)[i].set(n,r);else{var o=new WeakMap;o.set(n,r),BE(zE,this)[i]=o}var s=this.target.on(i,r);return s&&(s.eventType=e),s}},{key:"on",value:function(t,e,n){var r=this;if(t){var i;if(n||(n=LE),Array.isArray(t))return i=t.map(function(t){return r.on(t,e)});var o=n[t.toLocaleUpperCase()];if(o){var s=this;if(BE(zE,this)[o])BE(zE,this)[o].set(e,u);else{var a=new WeakMap;a.set(e,u),BE(zE,this)[o]=a}return(i=this.target.on(o,u))&&(i.eventType=t),i}console.error("Current events are not supported.")}function u(t){return s.eventCallback(t,o,e)}}},{key:"off",value:function(t,e,n){var r,i=this;if(!t)return!1;if(Array.isArray(t))return t.map(function(t){return i.off(t,e)});var o=n[t.toLocaleUpperCase()];return this.target.un(o,e),!(null===(r=BE(zE,this)[o])||void 0===r||!r.get(e)||(this.target.un(o,BE(zE,this)[o].get(e)),BE(zE,this)[o].delete(e),0))}},{key:"featureOn",value:function(t,e,n){var r=this;if(t){var i;if(n||(n=LE),Array.isArray(t))return i=t.map(function(t){return r.featureOn(t,e)});var o=n[t.toLocaleUpperCase()];if(o){var s=this;if(BE(zE,this)[o])BE(zE,this)[o].set(e,u);else{var a=new WeakMap;a.set(e,u),BE(zE,this)[o]=a}return(i=this.target.on(o,u))&&(i.eventType=t),i}console.error("Current events are not supported.")}function u(t){var n=[];s.target.forEachFeatureAtPixel(t.pixel,function(t,e,r){n.push(t)});var r=n.find(function(t){return Array.isArray(s.context.feature)?s.context.feature.some(function(e){return e===t}):t===s.context.feature});if(r)return s.eventCallback(t,o,e)}}}],e&&DE(t.prototype,e),n&&DE(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function UE(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 XE(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)?XE(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 XE(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 qE(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function WE(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=UE(t[i].map(parseFloat),2),s=o[0],a=o[1],u=UE(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=UE(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=UE(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)}function YE(t){return YE="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},YE(t)}function HE(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 ZE(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?HE(Object(n),!0).forEach(function(e){KE(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):HE(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function KE(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=YE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=YE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==YE(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var JE=ZE(ZE({},LE),{},{POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup"});function $E(t){return $E="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},$E(t)}function QE(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 tS(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)?tS(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 tS(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 eS(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 nS(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?eS(Object(n),!0).forEach(function(e){rS(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):eS(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function rS(t,e,n){return(e=oS(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iS(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,oS(r.key),r)}}function oS(t){var e=function(t,e){if("object"!=$E(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=$E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$E(e)?e:e+""}function sS(t,e,n){aS(t,e),e.set(t,n)}function aS(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function uS(t,e){return t.get(cS(t,e))}function lS(t,e,n){return t.set(cS(t,e),n),n}function cS(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 hS=new WeakMap,fS=new WeakMap,pS=new WeakMap,dS=new WeakMap,gS=new WeakMap,yS=new WeakSet,vS=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),aS(n=this,r=yS),r.add(n),sS(this,hS,void 0),sS(this,fS,void 0),sS(this,pS,void 0),sS(this,dS,void 0),sS(this,gS,void 0),this.init(cS(yS,this,_S).call(this,e))},e=[{key:"init",value:function(t){var e=this;if(console.log("options",t),!t)return!1;lS(pS,this,qE()),t.isGeomPolygon?(this.isGeomPolygon=!0,lS(hS,this,new Va({type:"polygon",geometry:new Jo(t.path),name:uS(pS,this)}))):Array.isArray(t.path[0][0])?(lS(hS,this,[]),t.path.forEach(function(t){uS(hS,e).push(new Va({type:"polygon",geometry:new Jo([t]),name:uS(pS,e)}))})):lS(hS,this,new Va({type:"polygon",geometry:new Jo([t.path]),name:uS(pS,this)}));var n=new tm({stroke:new H_({width:t.borderWidth,color:t.strokeColor}),fill:new W_({color:t.fillColor})});this.style=n,Array.isArray(uS(hS,this))?(uS(hS,this).forEach(function(t){t.setStyle(n)}),this.layer=new IE(uS(hS,this))):(uS(hS,this).setStyle(n),this.layer=new IE([uS(hS,this)])),t.map&&this.setMap(t.map),t.extData&&(this.extData=t.extData)}},{key:"setExtData",value:function(t){this.extData=nS(nS({},this.extData),t)}},{key:"feature",get:function(){return uS(hS,this)}},{key:"getPath",value:function(){return this.layer.getSource().getFeatures()[0].getGeometry().getCoordinates()[0]}},{key:"setPath",value:function(t){if(!t)return!1;this.layer.getSource().getFeatures()[0].getGeometry().setCoordinates([t])}},{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){uS(fS,this)&&uS(fS,this).removeFeature(this.layer),t?(t.addFeature(this.layer),lS(fS,this,t),lS(gS,this,new VE(this,uS(fS,this).map))):uS(fS,this)&&uS(fS,this).removeFeature(this.layer)}},{key:"map",get:function(){return uS(fS,this)}},{key:"eventList",get:function(){return uS(gS,this).eventList}},{key:"on",value:function(t,e){return uS(gS,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return uS(gS,this).off(t,e,JE)}},{key:"openEdit",value:function(t,e){uS(fS,this).editGeom(this,t,e)}},{key:"closeEdit",value:function(){return!!uS(fS,this).getEditGeom(this)&&uS(fS,this).closeEditGeom(this)}},{key:"getArea",value:function(){if(this.isGeomPolygon){var t,e=this.layer.getSource().getFeatures()[0].getGeometry().getCoordinates();return WE(e[0])-(null!==(t=e.slice(1))&&void 0!==t?t:[]).reduce(function(t,e){return t+WE(e)},0)}return WE(this.getPath())}},{key:"getLength",value:function(){return 1e3*Bh(Qa(this.getPath()),{units:"kilometers"})}},{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=QE(t[i].map(parseFloat),2),s=o[0],a=o[1],u=QE(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=QE(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=QE(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:"setActive",value:function(t){"boolean"!==$E(t).toLocaleString()&&(t=!!t),this.active=t,t?cS(yS,this,mS).call(this,this.activeStyle):cS(yS,this,mS).call(this,this.style)}},{key:"isActive",value:function(){return!!this.active}},{key:"setActiveStyle",value:function(t){lS(dS,this,t)}},{key:"activeStyle",get:function(){return uS(dS,this)}},{key:"setSourceStyle",value:function(t){this.style=t}},{key:"destroy",value:function(){return!!uS(fS,this)&&(uS(fS,this).removeFeature(this.layer),!0)}}],e&&iS(t.prototype,e),n&&iS(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function _S(t){return t.path?(t.borderWidth||(t.borderWidth=3),t.strokeColor||(t.strokeColor="#3366ff66"),t.fillColor||(t.fillColor="#1199ffaa"),t):(console.error("path is error."),!1)}function mS(t){var e,n,r,i;e instanceof tm?e=t:(null!=t&&t.borderWidth||null!=t&&t.strokeColor||null!=t&&t.fillColor||(e=this.style),e=new tm({stroke:new H_({width:null!==(n=t.borderWidth)&&void 0!==n?n:2,color:null!==(r=t.strokeColor)&&void 0!==r?r:"#3366ff66"}),fill:new W_({color:null!==(i=t.fillColor)&&void 0!==i?i:"#1199ffaa"})}));Array.isArray(uS(hS,this))?uS(hS,this).forEach(function(e){e.setStyle(t)}):uS(hS,this).setStyle(t)}function xS(t){return xS="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},xS(t)}function wS(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,bS(r.key),r)}}function bS(t){var e=function(t,e){if("object"!=xS(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=xS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==xS(e)?e:e+""}function ES(t,e,n){SS(t,e),e.set(t,n)}function SS(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function CS(t,e){return t.get(IS(t,e))}function PS(t,e,n){return t.set(IS(t,e),n),n}function IS(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 MS={},OS=new WeakMap,LS=new WeakMap,kS=new WeakMap,RS=new WeakMap,TS=new WeakSet,AS=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),SS(n=this,r=TS),r.add(n),ES(this,OS,void 0),ES(this,LS,void 0),ES(this,kS,void 0),ES(this,RS,void 0),this.init(IS(TS,this,NS).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;PS(kS,this,qE()),PS(OS,this,new Va({type:"polyline",geometry:new vw(t.path),name:CS(kS,this)}));var e=[];if(t.borderWidth&&e.push(new tm({stroke:new H_({width:2*parseFloat(t.borderWidth)+parseFloat(t.width),color:t.borderColor})})),e.push(new tm({stroke:new H_({width:t.width,color:t.color})})),this.style=e,CS(OS,this).setStyle(e),t.group)if(this.group=t.group,MS[t.group])this.layer=MS[t.group],this.layer.addFeature(CS(OS,this));else{var n=new IE([CS(OS,this)]);MS[t.group]=n,this.layer=n}else this.layer=new IE([CS(OS,this)]);t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return CS(OS,this)}},{key:"getPath",value:function(){return this.layer.getSource().getFeatures()[0].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){CS(LS,this)&&CS(LS,this).removeFeature(this.layer),t?(t.addFeature(this.layer),PS(LS,this,t),PS(RS,this,new VE(this,CS(LS,this).map))):CS(LS,this)&&CS(LS,this).removeFeature(this.layer)}},{key:"map",get:function(){return CS(LS,this)}},{key:"eventList",get:function(){return CS(RS,this).eventList}},{key:"on",value:function(t,e){return CS(RS,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return CS(RS,this).off(t,e,JE)}},{key:"openEdit",value:function(){CS(LS,this).editGeom(this)}},{key:"closeEdit",value:function(){return!!CS(LS,this).getEditGeom(this)&&CS(LS,this).closeEditGeom(this)}},{key:"destroy",value:function(){return!!CS(LS,this)&&(CS(LS,this).removeFeature(this.layer),!0)}}],e&&wS(t.prototype,e),n&&wS(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function NS(t){var e,n,r,i;return t.path?(t.borderWidth=null!==(e=t.borderWidth)&&void 0!==e?e:1,t.borderColor=null!==(n=t.borderColor)&&void 0!==n?n:"#fff",t.width=null!==(r=t.width)&&void 0!==r?r:3,t.color=null!==(i=t.color)&&void 0!==i?i:"#1199ff",t):(console.error("path is error."),!1)}var FS=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=as(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new W_({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:Sm,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getJustify=function(){return this.justify_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=as(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setJustify=function(t){this.justify_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),DS=FS,jS=n(9737),GS=n.n(jS);function BS(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 zS(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?BS(Object(n),!0).forEach(function(e){XS(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):BS(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function VS(t){return VS="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},VS(t)}function US(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,qS(r.key),r)}}function XS(t,e,n){return(e=qS(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qS(t){var e=function(t,e){if("object"!=VS(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=VS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==VS(e)?e:e+""}function WS(t,e,n){YS(t,e),e.set(t,n)}function YS(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function HS(t,e){return t.get(KS(t,e))}function ZS(t,e,n){return t.set(KS(t,e),n),n}function KS(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 JS={font:'14px "Fira Sans", sans-serif',textAlign:"center",justify:void 0,textBaseline:"middle",fill:"#333",stroke:"#0000",borderWidth:0,backgroundFill:void 0,backgroundStroke:void 0,backgroundBorder:void 0,padding:void 0,rotation:void 0,draggable:!1,fitZoom:14,scaleFactor:void 0},$S={},QS=new WeakMap,tC=new WeakMap,eC=new WeakMap,nC=new WeakMap,rC=new WeakMap,iC=new WeakMap,oC=new WeakMap,sC=new WeakMap,aC=new WeakSet,uC=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),YS(n=this,r=aC),r.add(n),WS(this,QS,void 0),WS(this,tC,void 0),WS(this,eC,void 0),WS(this,nC,14),WS(this,rC,""),WS(this,iC,void 0),WS(this,oC,void 0),WS(this,sC,void 0),XS(this,"draggable",!1),XS(this,"modify",void 0),XS(this,"scaleFactorCallback",function(){var t=HS(tC,i).getZoom();if("function"!==VS(HS(iC,i)).toLocaleLowerCase()){var e=t-i.getFitZoom(),n=Math.pow(HS(iC,i),Math.abs(e)),r=document.createElement("div");r.style.font=HS(rC,i),r.style.fontSize=r.style.fontSize.replace(/\d+/,function(t){return e>0?Math.round(parseFloat(t)/n).toString():Math.round(parseFloat(t)*n).toString()});var o="".concat(r.style.fontSize," ").concat(r.style.fontFamily);i.style.getText().setFont(o),HS(QS,i).changed()}else HS(iC,i).call(i,t)}),this.init(KS(aC,this,lC).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;ZS(eC,this,qE()),ZS(QS,this,new Va({geometry:new No(t.position),name:HS(eC,this)})),t.offset||(t.offset=[0,0]);var e={text:t.content,font:"".concat(t.fontSize," ").concat(t.fontFamily||"sans-serif"),offsetX:t.offset[0],offsetY:t.offset[1],textAlign:t.textAlign,justify:t.justify,textBaseline:t.textBaseline,fill:new W_({color:t.fill}),stroke:new H_({color:t.stroke,width:t.borderWidth}),padding:t.padding,placement:"point",rotation:t.rotation},n=new tm({text:new DS(e)});if(this.style=n,HS(QS,this).setStyle(n),t.group)if(this.group=t.group,$S[t.group])this.layer=$S[t.group],this.layer.addFeature(HS(QS,this));else{var r=new IE({features:[HS(QS,this)],zIndex:(t.zIndex||0)+1e4});$S[t.group]=r,this.layer=r}else this.layer=new IE({features:[HS(QS,this)],zIndex:(t.zIndex||0)+1e4});t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable),t.scaleFactor&&(ZS(iC,this,t.scaleFactor),ZS(nC,this,t.fitZoom||14),ZS(rC,this,"".concat(t.fontSize||14," ").concat(t.fontFamily||"sans-serif")),this.setScaleFactor(t.scaleFactor),this.scaleFactorCallback())}},{key:"feature",get:function(){return HS(QS,this)}},{key:"getFitZoom",value:function(){return HS(nC,this)}},{key:"getScaleFactor",value:function(){return HS(iC,this)}},{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){HS(tC,this)&&(HS(tC,this).removeFeature(this.layer),this.getScaleFactor()&&HS(tC,this).map.getView().un("change:resolution",this.scaleFactorCallback)),t?(t.addFeature(this.layer),ZS(tC,this,t),ZS(sC,this,new VE(this,HS(tC,this).map)),this.getScaleFactor()&&HS(tC,this).map.getView().on("change:resolution",this.scaleFactorCallback)):HS(tC,this)&&HS(tC,this).removeFeature(this.layer)}},{key:"map",get:function(){return HS(tC,this)}},{key:"setPosition",value:function(t){HS(QS,this).getGeometry().setCoordinates(t)}},{key:"position",get:function(){return HS(QS,this).getGeometry().getCoordinates()}},{key:"setText",value:function(t){HS(QS,this).getStyle().getText().setText(t),HS(QS,this).changed()}},{key:"setRotation",value:function(t){HS(QS,this).getStyle().getText().setRotation(t),HS(QS,this).changed()}},{key:"eventList",get:function(){return HS(sC,this).eventList}},{key:"on",value:function(t,e){return HS(sC,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return HS(sC,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()})),HS(tC,this).map.addInteraction(this.modify);else{if(!this.modify)return;HS(tC,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"setScaleFactor",value:function(t){console.log("开启跟随缩放"),HS(oC,this)?(HS(tC,this).map.getView().un("change:resolution",HS(oC,this)),ZS(oC,this,void 0)):ZS(oC,this,GS().throttle(this.scaleFactorCallback,600)),t?HS(tC,this)&&HS(tC,this).map.getView().on("change:resolution",HS(oC,this)):HS(oC,this)&&(HS(tC,this).map.getView().un("change:resolution",HS(oC,this)),ZS(oC,this,void 0))}},{key:"destroy",value:function(){return!!HS(tC,this)&&(HS(tC,this).removeFeature(this.layer),!0)}}],e&&US(t.prototype,e),n&&US(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function lC(t){return t.position?t.content?(t.rotation||(t.rotation=0),zS(zS({},JS),t)):(console.error("content is error."),!1):(console.error("position is error."),!1)}function cC(t){return function(t){if(Array.isArray(t))return hC(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 hC(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)?hC(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 hC(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 fC(t){return fC="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},fC(t)}function pC(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 dC(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pC(Object(n),!0).forEach(function(e){yC(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pC(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function gC(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,vC(r.key),r)}}function yC(t,e,n){return(e=vC(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vC(t){var e=function(t,e){if("object"!=fC(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=fC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==fC(e)?e:e+""}function _C(t,e,n){mC(t,e),e.set(t,n)}function mC(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xC(t,e){return t.get(bC(t,e))}function wC(t,e,n){return t.set(bC(t,e),n),n}function bC(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 EC=new WeakMap,SC=[new tm({fill:new W_({color:[255,255,255,.5]})}),new tm({stroke:new H_({color:[255,255,255,1],width:5})}),new tm({stroke:new H_({color:[0,153,255,1],width:3})})],CC=new WeakMap,PC=new WeakMap,IC=new WeakMap,MC=new WeakMap,OC=new WeakMap,LC=new WeakMap,kC=new WeakMap,RC=new WeakMap,TC=new WeakMap,AC=new WeakMap,NC=new WeakSet,FC=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),mC(n=this,r=NC),r.add(n),_C(this,CC,{}),_C(this,PC,void 0),_C(this,IC,void 0),_C(this,MC,void 0),_C(this,OC,void 0),_C(this,LC,new Map),_C(this,kC,void 0),_C(this,RC,void 0),_C(this,TC,new WeakMap),_C(this,AC,0),yC(this,"_instance",void 0),yC(this,"isShowLength",!1),yC(this,"drawStartCB",function(t){t.feature.getGeometry().on("change",function(t){if(!i.isShowLength)return!1;var e=t.target,n=[];e.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,e){var n=xC(kC,i).textList[e];n?(n.setRotation(t.rotation),n.setText(t.content),n.setPosition(t.position)):(n=new uC(dC(dC({},t),{},{textBaseline:"bottom",fill:"#ffffff",stroke:"#2b2b2b",borderWidth:4,padding:[2,2,2,2],fontSize:"16px",map:i})),xC(kC,i).textList[e]=n)})})}),yC(this,"measureTooltipElement",void 0),yC(this,"measureTooltip",void 0),yC(this,"measureTooltipList",[]),yC(this,"count",0),yC(this,"measureSingleclickCB",function(t){i.measureTooltip.setPosition(t.coordinate),0===i.count&&(i.measureTooltipElement.innerHTML="");var e=new No(t.coordinate);return i.gageLengthLayer.getSource().addFeature(new Va(e)),i.measureTooltipElement.className="measure tooltip tooltip-static",bC(NC,i,BC).call(i),i.count++,!0}),yC(this,"gageLengthLayer",void 0),yC(this,"isMeasure",!1);var o=null;if("string"==typeof e.target?o=document.getElementById(e.target):e.target&&(o=e.target),o&&EC.has(o)){var s=EC.get(o);s&&"function"==typeof s.destroy&&s.destroy()}e.undoCB&&(this.undoCB=e.undoCB),e.undoDrawCB&&(this.undoDrawCB=e.undoDrawCB);try{if(e._instance&&e._instance.map)return this._instance=e._instance,wC(PC,this,e._instance.map._instance._map),this}catch(n){console.error("instance error in options")}this.baseOptions=e,wC(CC,this,bC(NC,this,GC).call(this,e)),this.init(xC(CC,this)),wC(MC,this,new VE(this,xC(PC,this))),o&&EC.set(o,this)},e=[{key:"init",value:function(t){return t.zoom=2,console.log("init map",t),wC(PC,this,new Ga(dC({interactions:Fa({shiftDragZoom:!1}).extend([new Qs({condition:Xs})])},t))),this._instance=xC(PC,this),xC(PC,this)}},{key:"getZoom",value:function(){return xC(PC,this).getView().getZoom()}},{key:"getRotation",value:function(){return xC(PC,this).getView().getRotation()}},{key:"map",get:function(){return xC(PC,this)}},{key:"addFeature",value:function(t){if(xC(PC,this).getAllLayers().indexOf(t)>=0)return!1;xC(PC,this).addLayer(t)}},{key:"removeFeature",value:function(t){xC(PC,this).removeLayer(t)}},{key:"addLayer",value:function(t){return this.addFeature(t)}},{key:"removeLayer",value:function(t){return this.removeFeature(t)}},{key:"addMarker",value:function(t){if(!t)return!1;t.setMap(this)}},{key:"addTileLayer",value:function(t){if(!t)return!1;t.setMap(this)}},{key:"addOverlay",value:function(t){if(!t)return!1;xC(PC,this).addOverlay(t)}},{key:"removeOverlay",value:function(t){xC(PC,this).removeOverlay(t)}},{key:"addInfoWindow",value:function(t){if(!t||!t.setMap)return!1;t.setMap(this)}},{key:"addControl",value:function(t){if(!t||!t.setMap)return!1;t.setMap(this)}},{key:"eventList",get:function(){return xC(MC,this).eventList}},{key:"on",value:function(t,e){if("drawend"!==t)return xC(MC,this).on(t,e,NE);wC(RC,this,e)}},{key:"off",value:function(t,e){return xC(MC,this).off(t,e,NE)}},{key:"editGeom",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(xC(LC,this).get(t))return xC(LC,this).get(t);xC(TC,this).set(t,[]),this.undoCB&&this.undoCB(xC(TC,this).get(t).length,t);var o={source:t.layer.getSource(),condition:i};n&&(o.style=n),wC(OC,this,{geom:t,sourceStyle:t.style,modify:new iw(o),snap:new lw({source:t.layer.getSource()})}),xC(LC,this).set(t,xC(OC,this)),this.modify=xC(OC,this).modify,this.modify.on("modifystart",function(e){i(e);var n=e.features.item(0),o=new Va;o.setGeometry(n.getGeometry().clone()),o.setGeometryName(n.getGeometryName()),o.setStyle(n.getStyle()),o.ol_uid=n.ol_uid;var s=xC(TC,r).get(t);s.push(o),xC(TC,r).set(t,s),r.undoCB&&r.undoCB(xC(TC,r).get(t).length,t)}),this.modify.on("modifyend",function(t){i(t)}),this.snap=xC(OC,this).snap,this.snap.on("change:active",function(t){console.log("change:active",t)}),xC(PC,this).addInteraction(xC(OC,this).modify),xC(PC,this).addInteraction(xC(OC,this).snap),Array.isArray(t.feature)?t.feature.forEach(function(t){e?t.setStyle(e):t.setStyle(SC)}):e?t.feature.setStyle(e):t.feature.setStyle(SC)}},{key:"getEditGeom",value:function(t){return xC(LC,this).get(t)}},{key:"getAllEditGeom",value:function(){return xC(LC,this)}},{key:"getUndoStack",value:function(){return xC(TC,this)}},{key:"getUndoCountForGeom",value:function(t){return t?xC(TC,this).get(t).length:0}},{key:"undoEditForGeom",value:function(t){var e=xC(TC,this).get(t).pop();this.undoCB&&this.undoCB(xC(TC,this).get(t).length,t),console.log(e.ol_uid);var n=t.layer.getSource(),r=n.getFeatureByUid(e.ol_uid);n.removeFeature(r),n.addFeature(e)}},{key:"deletePointForGeom",value:function(t){if(!t)return!1;xC(LC,this).get(t).modify.removePoint()}},{key:"closeEditGeom",value:function(t){var e=xC(LC,this).get(t);return e&&(xC(LC,this).delete(t),xC(TC,this).delete(t),this.undoCB&&this.undoCB(0,t),this.closeEdit(e)),null==e?void 0:e.geom}},{key:"closeAllEditGeom",value:function(){var t=this;xC(LC,this).forEach(function(e){t.closeEdit(e)}),xC(LC,this).clear()}},{key:"closeEdit",value:function(t){xC(PC,this).removeInteraction(t.modify),xC(PC,this).removeInteraction(t.snap);var e=t.geom.layer.getSource().getFeatures();Array.isArray(e)?e.forEach(function(e){e.setStyle(t.sourceStyle)}):e.setStyle(t.sourceStyle)}},{key:"startDraw",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},r=arguments.length>3?arguments[3]:void 0;if(xC(kC,this))return!1;var i=this;"function"===fC(e).toLocaleLowerCase()&&wC(RC,this,e);var o={polygon:"Polygon",polyline:"LineString",smartPolygon:"Polygon",riskArea:"Polygon"},s=new IE([]),a=s.getSource(),u={type:o[t],source:a,snapTolerance:1,condition:function(t){var e;return wC(AC,i,(e=xC(AC,i),++e)),i.undoDrawCB&&i.undoDrawCB(xC(AC,i)),n(t)}};r&&(u.style=r);var l=new Dw(u),c=new lw({source:a});return wC(kC,this,{vectorLayer:s,draw:l,snap:c,type:t,textList:[]}),xC(PC,this).addLayer(s),xC(PC,this).addInteraction(l),xC(PC,this).addInteraction(c),xC(PC,this).getTargetElement().style.cursor="crosshair","Polygon"===o[t]&&l.on("drawstart",this.drawStartCB),l.once("drawend",function(e){i.stopDraw(e.feature.getGeometry().getCoordinates()),"Polygon"===o[t]&&l.un("drawstart",i.drawStartCB)}),s}},{key:"hideLength",value:function(){var t;this.isShowLength=!1,(null===(t=xC(kC,this))||void 0===t?void 0:t.textList.length)>0&&xC(kC,this).textList.forEach(function(t){return t.destroy()})}},{key:"showLength",value:function(){this.isShowLength=!0}},{key:"undoDraw",value:function(){var t;xC(kC,this)&&(xC(kC,this).draw.removeLastPoint(),wC(AC,this,(t=xC(AC,this),--t)),this.undoDrawCB&&this.undoDrawCB(xC(AC,this)))}},{key:"drawGeom",get:function(){return xC(kC,this)}},{key:"endDraw",value:function(){xC(kC,this)&&xC(kC,this).draw.finishDrawing()}},{key:"cancelDraw",value:function(){if(xC(kC,this)){xC(kC,this).draw.abortDrawing(),xC(PC,this).getTargetElement().style.cursor="auto";var t=xC(kC,this),e=t.vectorLayer,n=t.draw,r=t.snap;xC(kC,this).textList.length>0&&(xC(kC,this).textList.forEach(function(t){return t.destroy()}),xC(kC,this).textList=[]),wC(kC,this,void 0);var i=this;setTimeout(function(){xC(PC,i).removeLayer(e),xC(PC,i).removeInteraction(n),xC(PC,i).removeInteraction(r)},0)}}},{key:"stopDraw",value:function(t){if(!xC(kC,this))return!1;xC(PC,this).getTargetElement().style.cursor="auto";var e,n,r=xC(kC,this),i=r.vectorLayer,o=r.draw,s=r.snap,a=r.type;if(xC(kC,this).textList.length>0&&xC(kC,this).textList.forEach(function(t){return t.destroy()}),wC(kC,this,void 0),t)switch(a){case"polygon":n=new vS({path:t[0],map:this}),e={path:t[0],geom:n};break;case"polyline":e={path:t,geom:n=new AS({path:t,map:this})};break;case"riskArea":case"smartPolygon":n=new vS({path:t[0],map:this,borderWidth:1,strokeColor:"#ffffff",fillColor:"#ffffff80"}),e={path:t[0],geom:n};break;default:console.error("type is error.")}var u=this;setTimeout(function(){xC(PC,u).removeLayer(i),xC(PC,u).removeInteraction(o),xC(PC,u).removeInteraction(s)},0),"function"===fC(xC(RC,this)).toLocaleLowerCase()&&xC(RC,this).call(this,e)}},{key:"updateSize",value:function(){xC(PC,this).updateSize()}},{key:"setFitView",value:function(t,e){var n,r,i;Array.isArray(t)?t.forEach(function(t){var e;try{e=t.feature.getGeometry().getExtent()}catch(t){return}i||(i=e.map(function(t){return t})),i=st(i,e)}):i=t.feature.getGeometry().getExtent();var o={padding:null!==(n=e.avoid)&&void 0!==n?n:[0,0,0,0],duration:null!==(r=e.duration)&&void 0!==r?r:.3};xC(IC,this).fit(i,o)}},{key:"setFitForGeom",value:function(t,e){var n,r,i={padding:null!==(n=e.avoid)&&void 0!==n?n:[0,0,0,0],duration:null!==(r=e.duration)&&void 0!==r?r:.3};xC(IC,this).fit(t,i)}},{key:"openMeasure",value:function(t){if(this.isMeasure)return console.error("Measurement is currently turned on."),!1;if(this.isMeasure=!0,"length"!==(t=null!=t?t:"length")&&"area"!==t)return!1;this.measureType=t,this.gageLengthLayer=new IE([]),xC(PC,this).addLayer(this.gageLengthLayer);var e=new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#fff",width:2}),image:new X_({fill:new W_({color:"#e59810"}),stroke:new H_({color:"#ffffff",width:1}),radius:5})});this.gageLengthLayer.setStyle(e),this.gageLengthLayer.setZIndex(1e4);var n=this.gageLengthLayer.getSource(),r={type:"length"===t?"LineString":"Polygon",source:n,freehandCondition:function(){return!1},style:new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#fff",width:2}),image:new X_({fill:new W_({color:"#e59810"}),stroke:new H_({color:"#ffffff",width:1}),radius:5})})};r.finishCondition="length"===t?function(){return!1}:function(t){var e,n=t.coordinate,r=null===(e=o.measureDraw)||void 0===e?void 0:e.sketchLineCoords_;if(r){var i=r.at(-3);if(i&&i[0]===n[0]&&i[1]===n[1])return!1}return!0};var i=new Dw(r);this.measureDraw=i,xC(PC,this).addInteraction(i),bC(NC,this,BC).call(this);var o=this;this.count=0,i.on("drawabort",function(t){console.log("drawabort",t)}),i.on("drawstart",function(e){o.sketch=e.feature;var r=e.coordinate;o.listener=o.sketch.getGeometry().on("change",function(e){var n,i=e.target;if("length"===t){var s=Bh(Qa(i.getCoordinates()));n=s<1?Math.round(1e3*s*100)/100+" m":Math.round(100*s)/100+" km",r=i.getLastCoordinate()}else{var a=i.getCoordinates()[0],u=Bh(Qa(a.slice(0,-1)));n=u<1?Math.round(1e3*u*100)/100+" m":Math.round(100*u)/100+" km";var l=WE(i.getCoordinates()[0])/2e3*3;o.measureCentroidText=l>1e4?Math.round(l/1e4*100)/100+" 万亩":Math.round(100*l)/100+" 亩",o.measureCentroid=i.getInteriorPoint().getCoordinates(),r=a.slice(-2)[0]}o.measureTooltipElement.innerHTML=n,o.measureTooltip.setPosition(r)}),"length"!==t?(xC(PC,o).on("click",o.measureSingleclickCB),xC(PC,o).once("dblclick",function(t){new No(t.coordinate),n.addFeature(new No(t.coordinate))})):(xC(PC,o).on("click",o.measureSingleclickCB),xC(PC,o).once("dblclick",function(t){i.finishDrawing()}))},this),i.on("drawend",function(t){if(console.log("drawend"),"length"===o.measureType)return!1;"area"===o.measureType&&(bC(NC,o,BC).call(o),o.measureTooltipElement.innerHTML=o.measureCentroidText,o.measureTooltip.setPosition(o.measureCentroid)),o.measureTooltipElement.className="measure tooltip tooltip-static",o.sketch=null,o.measureTooltipElement=null,o.count=0,Ee(o.listener),xC(PC,o).un("click",o.measureSingleclickCB),bC(NC,o,BC).call(o)},this)}},{key:"closeMeasure",value:function(){var t,e=this;this.isMeasure=!1,null===(t=this.gageLengthLayer)||void 0===t||t.getSource().clear(),xC(PC,this).removeLayer(this.gageLengthLayer),this.measureTooltipList.forEach(function(t){xC(PC,e).removeOverlay(t)}),this.measureTooltipList=[],xC(PC,this).removeInteraction(this.measureDraw),xC(PC,this).un("singleclick",this.measureSingleclickCB),xC(PC,this).un("dbclick",this.measureSingleclickCB),xC(PC,this).un("click",this.measureSingleclickCB)}},{key:"destroy",value:function(){try{var t=document.querySelector("#".concat(xC(CC,this).target)),e=t.cloneNode(),n=t.parentNode,r=document.createElement("div");n.insertBefore(r,t),n.removeChild(t),r.parentNode.insertBefore(e,r),n.removeChild(r),t&&EC.delete(t)}catch(t){console.error("target error in options.")}wC(PC,this,null),this._instance=null}}],e&&gC(t.prototype,e),n&&gC(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function DC(){return{target:"mapbox",zoom:15,zooms:[1,18],center:[116.4,39.9],layers:bC(NC,this,jC).call(this)}}function jC(){var t,e,n,r;this.baseOptions.zooms?n=this.baseOptions.zooms[1]:n=null!==(r=this.baseOptions.maxZoom)&&void 0!==r?r:18;return[new gb({name:"default_DT",zIndex:100,source:new Hb({minZoom:1,maxZoom:null!==(t=this.baseOptions.tileMax)&&void 0!==t?t:n,crossOrigin:"anonymous",url:"https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"})}),new gb({name:"default_BZ",zIndex:100,source:new Hb({minZoom:1,maxZoom:null!==(e=this.baseOptions.tileMax)&&void 0!==e?e:n,crossOrigin:"anonymous",url:"https://webst04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"})})]}function GC(){var t,e,n,r,i,o,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=bC(NC,this,DC).call(this);s.target&&(a.target=s.target),s.layerConfig&&0!==s.layerConfig.layers.length&&(s.layerConfig.default||(a.layers=[]),a.layers=[].concat(cC(a.layers),cC(s.layerConfig.layers))),this.layers=a.layers,a.controls=Cs({attribution:null!==(t=null===(e=s.controls)||void 0===e?void 0:e.attribution)&&void 0!==t&&t,zoom:null!==(n=null===(r=s.controls)||void 0===r?void 0:r.zoom)&&void 0!==n&&n,rotate:null!==(i=null===(o=s.controls)||void 0===o?void 0:o.rotate)&&void 0!==i&&i});var u=dC({},OE);s.initViewConfig&&(u=dC(dC({},OE),s.initViewConfig)),s.zoom&&(u.zoom=s.zoom),Array.isArray(s.zooms)&&2===s.zooms.length&&(u.minZoom=s.zooms[0],u.maxZoom=s.zooms[1]),s.center&&(u.center=s.center);var l=new os(u);return wC(IC,this,l),a.view=l,a}function BC(){this.measureTooltipElement=document.createElement("div"),this.measureTooltipElement.className="measure tooltip tooltip-measure",this.measureTooltip&&this.measureTooltipList.push(this.measureTooltip),this.measureTooltip=new nE({element:this.measureTooltipElement,offset:[0,-15],positioning:"bottom-center"}),xC(PC,this).addOverlay(this.measureTooltip)}function zC(t){return zC="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},zC(t)}function VC(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,XC(r.key),r)}}function UC(t,e,n){return(e=XC(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function XC(t){var e=function(t,e){if("object"!=zC(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=zC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==zC(e)?e:e+""}function qC(t,e,n){WC(t,e),e.set(t,n)}function WC(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function YC(t,e){return t.get(ZC(t,e))}function HC(t,e,n){return t.set(ZC(t,e),n),n}function ZC(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 KC={},JC=new WeakMap,$C=new WeakMap,QC=new WeakMap,tP=new WeakMap,eP=new WeakMap,nP=new WeakSet,rP=new WeakMap,iP=new WeakMap,oP=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),WC(n=this,r=nP),r.add(n),qC(this,JC,void 0),qC(this,$C,void 0),qC(this,QC,void 0),qC(this,tP,void 0),qC(this,eP,0),UC(this,"draggable",!1),UC(this,"modify",void 0),qC(this,rP,!1),qC(this,iP,function(t){YC(rP,i)&&(i.moveBasePosition=i.startPosition,HC(rP,i,!1),HC(eP,i,0));var e=t.frameState.time,n=e-i.moveBaseTime;i.moveBaseTime=e;var r=parseFloat(i.moveMultiply||1);if(HC(eP,i,YC(eP,i)+i.moveSpeed*n/6e4*r),YC(eP,i)>i.moveLength)return i.pauseMove(),HC(rP,i,!0),i.moveFinishCB&&i.moveFinishCB(),!0;var o,s=YC(eP,i)/i.moveLength%2;if(i.ratio=s,i.movePathList){var a,u=null!==(a=i.movePathList.findIndex(function(t){return s>t[0]&&s<=t[1]}))&&void 0!==a?a:i.movePathList.length-1;-1===u&&(u=0);var l=i.movePathList[u],c=(s-l[0])/(l[1]-l[0]);o=i.movePath.getLineString(u).getLineString(u).getCoordinateAt(c>1?2-c:c)}else o=i.movePath.getCoordinateAt(s>1?2-s:s);if(i.setPosition(o),i.options.autoRotation){var h=o[0]-i.moveBasePosition[0],f=o[1]-i.moveBasePosition[1],p=-Math.atan2(f,h);YC(JC,i).getStyle().getImage().setRotation(i.options.rotation+p)}i.moveBasePosition=o,i.movePlayingCB&&i.movePlayingCB(s)}),this.options=e,this.init(ZC(nP,this,sP).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;var e;if(HC(QC,this,qE()),HC(JC,this,new Va({geometry:new No(t.position),name:YC(QC,this)})),t.src)t.activeSrc||(t.activeSrc=t.src),e=new tm({image:new Sx({anchor:t.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:t.src,offset:t.offset,rotation:t.rotation,scale:t.scale})});else{var n,r,i,o=new W_({color:null!==(n=t.color)&&void 0!==n?n:"rgba(37, 165, 247,0.6)"}),s=new H_({color:null!==(r=t.borderColor)&&void 0!==r?r:"#ffeeff",width:null!==(i=t.borderWidth)&&void 0!==i?i:2});e=new tm({image:new X_({fill:o,stroke:s,radius:t.radius})})}if(t.text){var a=t.fontSize,u=void 0===a?14:a,l=t.scale,c=void 0===l?1:l;u*=c;var h={text:t.text,font:"".concat(u,"px ").concat(t.fontFamily||"sans-serif"),textAlign:"center",textBaseline:"top",offsetY:-62*c,fill:new W_({color:"#fff"}),placement:"point"};e.setText(new DS(h))}if(this.style=e,this.options=t,YC(JC,this).setStyle(e),t.text&&t.fontSize&&this.setTextFontSize(t.fontSize),t.group)if(this.group=t.group,KC[t.group])this.layer=KC[t.group],this.layer.addFeature(YC(JC,this));else{var f=new IE({features:[],zIndex:(t.zIndex||0)+1e4,cursor:t.cursor});KC[t.group]=f,this.layer=f,this.layer.addFeature(YC(JC,this))}else this.layer=new IE({features:[YC(JC,this)],zIndex:(t.zIndex||0)+1e4,cursor:t.cursor});t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable)}},{key:"feature",get:function(){return YC(JC,this)}},{key:"setGroup",value:function(t){if(!t)return!1;this.group&&KC[this.group]&&KC[this.group].removeFeature(YC(JC,this)),KC[t]?(this.layer.removeFeature(YC(JC,this)),this.layer=KC[t],KC[t].addFeature(YC(JC,this))):KC[t]=this.layer,this.group=t}},{key:"getGroup",value:function(){return this.group}},{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:"setScale",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(e=parseFloat(e),isNaN(e))return!1;null===(t=this.style.getImage())||void 0===t||t.setScale(e),YC(JC,this).changed()}},{key:"setTextFontSize",value:function(t){var e,n,r,i,o,s,a="".concat(t,"px ").concat(this.options.fontFamily||"sans-serif");switch(null===(e=this.style.getText())||void 0===e||e.setFont(a),t){case 14:null===(n=this.style.getText())||void 0===n||n.setOffsetY(-25);break;case 12:null===(r=this.style.getText())||void 0===r||r.setOffsetY(-22);break;case 9:null===(i=this.style.getText())||void 0===i||i.setOffsetY(-18);break;case 7:null===(o=this.style.getText())||void 0===o||o.setOffsetY(-14);break;default:null===(s=this.style.getText())||void 0===s||s.setOffsetY(-25)}}},{key:"setMap",value:function(t){YC($C,this)&&YC($C,this).removeFeature(this.layer),t?(t.addFeature(this.layer),HC($C,this,t),HC(tP,this,new VE(this,YC($C,this).map))):YC($C,this)&&YC($C,this).removeFeature(this.layer)}},{key:"map",get:function(){return YC($C,this)}},{key:"setPosition",value:function(t){YC(JC,this).getGeometry().setCoordinates(t),YC(JC,this).changed()}},{key:"position",get:function(){return YC(JC,this).getGeometry().getCoordinates()}},{key:"moveAlong",value:function(t){var e,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;if(!this.map)return!1;if(this.startPosition=t[0],this.moveBaseTime=Date.now(),this.moveBasePosition=this.startPosition,Array.isArray(t[0][0])){this.movePath=new xw(t),e=nu(t);var s=0;this.moveLength=Bh(e,{units:"kilometers"}),this.movePathList=t.map(function(t){var e=Bh(Qa(t),{units:"kilometers"}),r=s,i=e/n.moveLength;return[r,s+=i]})}else this.movePath=new vw(t),e=Qa(t),this.moveLength=Bh(e,{units:"kilometers"});this.moveSpeed=r,this.layer.on("postrender",YC(iP,this)),this.map.map.render(),"function"===zC(i).toLocaleLowerCase()&&(this.moveFinishCB=i),"function"===zC(o).toLocaleLowerCase()&&(this.movePlayingCB=o)}},{key:"setMoveRatio",value:function(t){if(this.ratio=t,HC(eP,this,this.moveLength*t),YC(eP,this)>this.moveLength)return this.pauseMove(),HC(rP,this,!0),this.moveFinishCB&&this.moveFinishCB(),!0;var e;if(this.movePathList){var n,r=null!==(n=this.movePathList.findIndex(function(e){return t>e[0]&&t<=e[1]}))&&void 0!==n?n:this.movePathList.length-1;-1===r&&(r=0);var i=this.movePathList[r],o=(t-i[0])/(i[1]-i[0]);e=this.movePath.getLineString(r).getCoordinateAt(o>1?2-o:o)}else e=this.movePath.getCoordinateAt(t>1?2-t:t);this.setPosition(e)}},{key:"setMoveMultiply",value:function(t){isNaN(parseFloat(t))&&(t=1),this.moveMultiply=t}},{key:"getMoveMultiply",value:function(){var t;return null!==(t=this.moveMultiply)&&void 0!==t?t:1}},{key:"pauseMove",value:function(){this.layer.un("postrender",YC(iP,this))}},{key:"resumeMove",value:function(){this.map&&(this.moveBaseTime=Date.now(),this.layer.on("postrender",YC(iP,this)),this.map.map.render())}},{key:"setSrc",value:function(t){var e;if(t)e=new tm({image:new Sx({anchor:this.options.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:t,offset:this.options.offset,rotation:this.options.rotation})});else{var n,r,i,o=new W_({color:null!==(n=this.options.color)&&void 0!==n?n:"rgba(37, 165, 247,0.6)"}),s=new H_({color:null!==(r=this.options.borderColor)&&void 0!==r?r:"#ffeeff",width:null!==(i=this.options.borderWidth)&&void 0!==i?i:2});e=new tm({image:new X_({fill:o,stroke:s,radius:this.options.radius})})}this.style=e,YC(JC,this).setStyle(e)}},{key:"eventList",get:function(){return YC(tP,this).eventList}},{key:"on",value:function(t,e){if("dragstart"!==t){if("dragend"!==t)return YC(tP,this).featureOn(t,e,JE);this.dragEndCallback=e}else this.dragStartCallback=e}},{key:"off",value:function(t,e){if("dragstart"!==t){if("dragend"!==t)return YC(tP,this).off(t,e,JE);this.dragEndCallback=void 0}else this.dragStartCallback=void 0}},{key:"setDraggable",value:function(t){if(this.draggable=t,t){if(!this.modify){this.modify=new iw({hitDetection:this.layer,source:this.layer.getSource()});var e=this;this.modify.on("modifystart",function(t){"function"===zC(e.dragStartCallback).toLocaleLowerCase()&&e.dragStartCallback(t)}),this.modify.on("modifyend",function(t){"function"===zC(e.dragEndCallback).toLocaleLowerCase()&&e.dragEndCallback(t)})}YC($C,this).map.addInteraction(this.modify)}else{if(!this.modify)return;YC($C,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"setActive",value:function(t){if(this.active=t,!this.options.activeSrc)return!1;t?this.setSrc(this.options.activeSrc):this.setSrc(this.options.src)}},{key:"isActive",value:function(){return!!this.active}},{key:"destroy",value:function(){return!!YC($C,this)&&(YC($C,this).removeFeature(this.layer),this.group&&KC[this.group]&&KC[this.group].removeFeature(YC(JC,this)),!0)}}],n=[{key:"clearGroup",value:function(t){t&&KC[t]&&KC[t].getSource().clear()}},{key:"clearAllGroup",value:function(){Object.keys(KC).forEach(function(t){KC[t].getSource().clear()})}}],e&&VC(t.prototype,e),n&&VC(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function sP(t){var e,n,r;return t.position?(t.anchor||(t.anchor=[0,0]),t.offset||(t.offset=[0,0]),t.rotation||(t.rotation=0),t.scale=null!==(e=t.scale)&&void 0!==e?e:1,t.radius=null!==(n=t.radius)&&void 0!==n?n:5,t.cursor=null!==(r=t.cursor)&&void 0!==r?r:"pointer",t):(console.error("position is error."),!1)}function aP(t){return aP="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},aP(t)}function uP(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,lP(r.key),r)}}function lP(t){var e=function(t,e){if("object"!=aP(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=aP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==aP(e)?e:e+""}function cP(t,e,n){hP(t,e),e.set(t,n)}function hP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fP(t,e){return t.get(dP(t,e))}function pP(t,e,n){return t.set(dP(t,e),n),n}function dP(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 gP=new WeakMap,yP=new WeakMap,vP=new WeakMap,_P=new WeakMap,mP=new WeakSet,xP=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),hP(n=this,r=mP),r.add(n),cP(this,gP,void 0),cP(this,yP,void 0),cP(this,vP,void 0),cP(this,_P,void 0),this.init(dP(mP,this,wP).call(this,e))},e=[{key:"init",value:function(t){if(console.log("options",t),!t)return!1;if(!t.dom)throw new Error("dom is error.");pP(vP,this,qE());var e=t.dom;if("string"===aP(e).toLocaleLowerCase()&&(e=document.querySelector("#".concat(t.dom))),!(e instanceof Element))throw new Error("dom is error.");pP(gP,this,new nE({position:t.position,element:e})),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return fP(gP,this)}},{key:"setPosition",value:function(t){fP(gP,this).setPosition(t)}},{key:"getPosition",value:function(){return fP(gP,this).getPosition()}},{key:"isVisible",value:function(){return"none"!==this.feature.getElement().style.display}},{key:"show",value:function(){this.feature.getElement().style.display="block"}},{key:"hide",value:function(){this.feature.getElement().style.display="none"}},{key:"setMap",value:function(t){fP(yP,this)&&fP(yP,this).removeOverlay(fP(gP,this)),t?(t.addOverlay(fP(gP,this)),pP(yP,this,t),pP(_P,this,new VE(this,fP(yP,this).map))):fP(yP,this)&&fP(yP,this).removeOverlay(fP(gP,this))}},{key:"map",get:function(){return fP(yP,this)}},{key:"eventList",get:function(){return fP(_P,this).eventList}},{key:"on",value:function(t,e){return fP(_P,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return fP(_P,this).off(t,e,JE)}},{key:"destroy",value:function(){return!!fP(yP,this)&&(fP(yP,this).removeOverlay(fP(gP,this)),!0)}}],e&&uP(t.prototype,e),n&&uP(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function wP(t){return t.position?(t.anchor||(t.anchor="bottom-center"),t.offset||(t.offset=[0,0]),t.fillColor||(t.fillColor="#1199ffaa"),t):(console.error("position is error."),!1)}function bP(t){return bP="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},bP(t)}function EP(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 SP(t,e,n){return(e=PP(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function CP(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,PP(r.key),r)}}function PP(t){var e=function(t,e){if("object"!=bP(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=bP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==bP(e)?e:e+""}function IP(t,e,n){MP(t,e),e.set(t,n)}function MP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function OP(t,e){return t.get(kP(t,e))}function LP(t,e,n){return t.set(kP(t,e),n),n}function kP(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 RP={name:qE(),minZoom:1,maxZoom:18,zIndex:101},TP=new WeakMap,AP=new WeakMap,NP=new WeakMap,FP=new WeakSet,DP=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),MP(n=this,r=FP),r.add(n),IP(this,TP,void 0),IP(this,AP,void 0),IP(this,NP,void 0),LP(TP,this,kP(FP,this,jP).call(this,e)),LP(AP,this,this.init(OP(TP,this))),OP(TP,this).map&&this.setMap(OP(TP,this).map)},e=[{key:"init",value:function(t){return!!t.tileUrl&&new gb({name:t.name,zIndex:t.zIndex,source:new Hb({minZoom:t.minZoom,maxZoom:t.maxZoom,url:t.tileUrl,crossOrigin:"anonymous"})})}},{key:"layer",get:function(){return OP(AP,this)}},{key:"getTileName",value:function(){return OP(TP,this).name}},{key:"setMap",value:function(t){OP(NP,this)&&OP(NP,this).removeFeature(OP(AP,this)),t?(t.addFeature(OP(AP,this)),LP(NP,this,t)):OP(NP,this)&&OP(NP,this).removeFeature(OP(AP,this))}}],e&&CP(t.prototype,e),n&&CP(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function jP(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?EP(Object(n),!0).forEach(function(e){SP(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):EP(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},RP);return t.zooms&&Array.isArray(t.zooms)&&(e.minZoom=t.zooms[0],e.maxZoom=t.zooms[1]),t.name&&(e.name=t.name),e.tileUrl=t.tileUrl,t.zIndex&&(e.zIndex=t.zIndex),e.map=t.map,e}var GP=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)}}(),BP=function(t){function e(e){var n=e||{};return t.call(this,n)||this}return GP(e,t),e}(Ze),zP=BP,VP=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)}}(),UP=function(t){function e(e){var n=t.call(this,e)||this;return n.image_=null,n}return VP(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,r=t.viewState,i=r.resolution,o=this.getLayer().getSource(),s=t.viewHints,a=t.extent;if(void 0!==e.extent&&(a=mt(a,Di(e.extent,r.projection))),!s[Ur]&&!s[Xr]&&!St(a))if(o){var u=r.projection,l=o.getImage(a,i,n,u);l&&(this.loadImage(l)?this.image_=l:l.getState()===N_&&(this.image_=null))}else this.image_=null;return!!this.image_},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),r=F(e.pixelToCoordinateTransform,t.slice()),i=n.getExtent();if(i&&!K(i,r))return null;var o=this.image_.getExtent(),s=this.image_.getImage(),a=bt(o),u=Math.floor(s.width*((r[0]-o[0])/a));if(u<0||u>=s.width)return null;var l=_t(o),c=Math.floor(s.height*((o[3]-r[1])/l));return c<0||c>=s.height?null:this.getImageData(s,u,c)},e.prototype.renderFrame=function(t,e){var n=this.image_,r=n.getExtent(),i=n.getResolution(),o=n.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,u=t.viewState,l=u.center,c=a*i/(u.resolution*o),h=t.extent,f=u.resolution,p=u.rotation,d=Math.round(bt(h)/f*a),g=Math.round(_t(h)/f*a);D(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,p,-d/2,-g/2),j(this.inversePixelTransform,this.pixelTransform);var y=G(this.pixelTransform);this.useContainer(e,y,this.getBackground(t));var v=this.context,_=v.canvas;_.width!=d||_.height!=g?(_.width=d,_.height=g):this.containerReused||v.clearRect(0,0,d,g);var m=!1,x=!0;if(s.extent){var w=Di(s.extent,u.projection);(m=(x=Et(w,t.extent))&&!J(w,t.extent))&&this.clipUnrotated(v,t,w)}var b=n.getImage(),E=D(this.tempTransform,d/2,g/2,c,c,0,o*(r[0]-l[0])/i,o*(l[1]-r[3])/i);this.renderedResolution=i*a/o;var S=b.width*E[0],C=b.height*E[3];if(this.getLayer().getSource().getInterpolate()||te(v,$w),this.preRender(v,t),x&&S>=.5&&C>=.5){var P=E[4],I=E[5],M=s.opacity,O=void 0;1!==M&&(O=v.globalAlpha,v.globalAlpha=M),v.drawImage(b,0,0,+b.width,+b.height,P,I,S,C),1!==M&&(v.globalAlpha=O)}return this.postRender(v,t),m&&v.restore(),te(v,Qw),y!==_.style.transform&&(_.style.transform=y),this.container},e}(Gm),XP=UP,qP=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)}}(),WP=function(t){function e(e){return t.call(this,e)||this}return qP(e,t),e.prototype.createRenderer=function(){return new XP(this)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(zP),YP=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)}}(),HP=function(t){function e(e,n,r,i,o,s,a){var u=this,l=e.getExtent(),c=n.getExtent(),h=c?mt(r,c):r,f=rb(e,n,dt(h),i),p=new Jw(e,n,h,l,.5*f,i),d=s(p.calculateSourceExtent(),f,o),g=d?k_:N_,y=d?d.getPixelRatio():1;return(u=t.call(this,r,i,y,g)||this).targetProj_=n,u.maxSourceExtent_=l,u.triangulation_=p,u.targetResolution_=i,u.targetExtent_=r,u.sourceImage_=d,u.sourcePixelRatio_=y,u.interpolate_=a,u.canvas_=null,u.sourceListenerKey_=null,u}return YP(e,t),e.prototype.disposeInternal=function(){this.state==R_&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==T_){var e=bt(this.targetExtent_)/this.targetResolution_,n=_t(this.targetExtent_)/this.targetResolution_;this.canvas_=ib(e,n,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==k_){this.state=R_,this.changed();var t=this.sourceImage_.getState();t==T_||t==A_?this.reproject_():(this.sourceListenerKey_=_e(this.sourceImage_,ae,function(t){var e=this.sourceImage_.getState();e!=T_&&e!=A_||(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){xe(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(dx),ZP=HP,KP=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)}}(),JP="imageloadstart",$P="imageloadend",QP="imageloaderror",tI=function(t){function e(e,n){var r=t.call(this,e)||this;return r.image=n,r}return KP(e,t),e}($t),eI=function(t){function e(e){var n=this,r=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(r=e.interpolate),(n=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state,interpolate:r})||this).on,n.once,n.un,n.resolutions_=void 0!==e.resolutions?e.resolutions:null,n.reprojectedImage_=null,n.reprojectedRevision_=0,n}return KP(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=h(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,n,r){var i=this.getProjection();if(i&&r&&!Si(i,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Si(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&ot(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new ZP(i,r,t,e,n,function(t,e,n){return this.getImageInternal(t,e,n,i)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(r=i),this.getImageInternal(t,e,n,r)},e.prototype.getImageInternal=function(t,e,n,r){return _()},e.prototype.handleImageChange=function(t){var e,n=t.target;switch(n.getState()){case R_:this.loading=!0,e=JP;break;case T_:this.loading=!1,e=$P;break;case A_:this.loading=!1,e=QP;break;default:return}this.hasListener(e)&&this.dispatchEvent(new tI(e,n))},e}(Gx);function nI(t,e){t.getImage().src=e}var rI=eI,iI="1.3.0";function oI(t,e){var n=[];Object.keys(e).forEach(function(t){null!==e[t]&&void 0!==e[t]&&n.push(t+"="+encodeURIComponent(e[t]))});var r=n.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}var sI=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)}}(),aI=[101,101],uI=function(t){function e(e){var n=this,r=e||{},i=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(i=r.interpolate),(n=t.call(this,{attributions:r.attributions,interpolate:i,projection:r.projection,resolutions:r.resolutions})||this).crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null,n.url_=r.url,n.imageLoadFunction_=void 0!==r.imageLoadFunction?r.imageLoadFunction:nI,n.params_=r.params||{},n.v13_=!0,n.updateV13_(),n.serverType_=r.serverType,n.hidpi_=void 0===r.hidpi||r.hidpi,n.image_=null,n.imageSize_=[0,0],n.renderedRevision_=0,n.ratio_=void 0!==r.ratio?r.ratio:1.5,n}return sI(e,t),e.prototype.getFeatureInfoUrl=function(t,e,n,r){if(void 0!==this.url_){var i=xi(n),o=this.getProjection();o&&o!==i&&(e=rb(o,i,t,e),t=Ii(t,i,o));var s=yt(t,e,0,aI),a={SERVICE:"WMS",VERSION:iI,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};te(a,this.params_,r);var u=jt((t[0]-s[0])/e,4),l=jt((s[3]-t[1])/e,4);return a[this.v13_?"I":"X"]=u,a[this.v13_?"J":"Y"]=l,this.getRequestUrl_(s,aI,1,o||i,a)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var n={SERVICE:"WMS",VERSION:iI,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var r=this.params_.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;n.LAYER=r}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;n.SCALE=t*i/28e-5}return te(n,e),oI(this.url_,n)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,n,r){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==n||this.hidpi_&&void 0!==this.serverType_||(n=1);var i=e/n,o=dt(t),s=yt(o,i,0,[Gt(bt(t)/i,4),Gt(_t(t)/i,4)]),a=yt(o,i,0,[Gt(this.ratio_*bt(t)/i,4),Gt(this.ratio_*_t(t)/i,4)]),u=this.image_;if(u&&this.renderedRevision_==this.getRevision()&&u.getResolution()==e&&u.getPixelRatio()==n&&J(u.getExtent(),s))return u;var l={SERVICE:"WMS",VERSION:iI,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};te(l,this.params_),this.imageSize_[0]=Dt(bt(a)/i,4),this.imageSize_[1]=Dt(_t(a)/i,4);var c=this.getRequestUrl_(a,this.imageSize_,n,r,l);return this.image_=new _x(a,e,n,c,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(ae,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,n,r,i){if(T(void 0!==this.url_,9),i[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(i.STYLES=""),1!=n)switch(this.serverType_){case"geoserver":var o=90*n+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case"mapserver":i.MAP_RESOLUTION=90*n;break;case"carmentaserver":case"qgis":i.DPI=90*n;break;default:T(!1,8)}i.WIDTH=e[0],i.HEIGHT=e[1];var s,a=r.getAxisOrientation();return s=this.v13_&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,i.BBOX=s.join(","),oI(this.url_,i)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){te(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||iI;this.v13_=function(t,e){for(var n=(""+t).split("."),r=(""+e).split("."),i=0;i<Math.max(n.length,r.length);i++){var o=parseInt(n[i]||"0",10),s=parseInt(r[i]||"0",10);if(o>s)return 1;if(s>o)return-1}return 0}(t,"1.3")>=0},e}(rI),lI=uI,cI=["zIndex","visible","name"];function hI(t){return hI="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},hI(t)}function fI(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,pI(r.key),r)}}function pI(t){var e=function(t,e){if("object"!=hI(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=hI(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==hI(e)?e:e+""}var dI={zIndex:10,visible:!0,ratio:1,serverType:"geoserver",crossOrigin:"anonymous"},gI=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=Object.assign({},dI,e),this.createLayer()},e=[{key:"createLayer",value:function(){var t=this.options,e=t.zIndex,n=t.visible,r=t.name,i=function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(t,cI);this.source=new lI(i),this.layer=new WP({source:this.source,zIndex:e,visible:n}),r&&this.layer.set("name",r)}},{key:"updateSource",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},this.options.params,t.params||{});this.source.updateParams(e),this.source.changed()}},{key:"setVisible",value:function(t){this.layer.setVisible(t)}},{key:"getVisible",value:function(){return this.layer.getVisible()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"getZIndex",value:function(){return this.layer.getZIndex()}},{key:"setOpacity",value:function(t){this.layer.setOpacity(t)}},{key:"getOpacity",value:function(){return this.layer.getOpacity()}},{key:"setMap",value:function(t){this.map&&this.map.removeFeature(this.layer),this.map=t,t&&t.addFeature(this.layer)}},{key:"destroy",value:function(){this.setMap(null),this.layer=null,this.source=null,this.options=null}},{key:"name",get:function(){return this.layer.get("name")},set:function(t){this.layer.set("name",t)}},{key:"setSource",value:function(t){this.layer.setSource(t),this.source=t}},{key:"getSource",value:function(){return this.layer.getSource()}}],e&&fI(t.prototype,e),n&&fI(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),yI=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)}}(),vI=function(t){function e(e,n,r,i,o){var s=this,a=void 0!==o?k_:T_;return(s=t.call(this,e,n,r,a)||this).loader_=void 0!==o?o:null,s.canvas_=i,s.error_=null,s}return yI(e,t),e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=A_):this.state=T_,this.changed()},e.prototype.load=function(){this.state==k_&&(this.state=R_,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(dx),_I=vI,mI=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)}}(),xI=function(t){function e(e){var n=this,r=e||{},i=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(i=r.interpolate),(n=t.call(this,{attributions:r.attributions,interpolate:i,projection:r.projection,resolutions:r.resolutions,state:r.state})||this).canvasFunction_=r.canvasFunction,n.canvas_=null,n.renderedRevision_=0,n.ratio_=void 0!==r.ratio?r.ratio:1.5,n}return mI(e,t),e.prototype.getImageInternal=function(t,e,n,r){e=this.findNearestResolution(e);var i=this.canvas_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==n&&J(i.getExtent(),t))return i;Ct(t=t.slice(),this.ratio_);var o=[bt(t)/e*n,_t(t)/e*n],s=this.canvasFunction_.call(this,t,e,n,o,r);return s&&(i=new _I(t,e,n,s)),this.canvas_=i,this.renderedRevision_=this.getRevision(),i},e}(rI),wI=xI;
|
|
73
|
+
*/(t,r),s=[],a=0;a<o.length;a++){for(var u=o[a],l=[],c=0;c<u.length;c++){var h=u[c];h.properties[n]?l.push(h.properties[n]):l.push(0),!0===i&&(h.properties.matrixPosition=[a,c])}s.push(l)}return s}var tp={successCallback:null,verbose:!1,polygons:!1},ep={};function np(t,e,n,r){r=r||{};for(var i=Object.keys(tp),o=0;o<i.length;o++){var s=i[o],a=r[s];a=null!=a?a:tp[s],ep[s]=a}ep.verbose&&console.log("MarchingSquaresJS-isoBands: computing isobands for ["+e+":"+(e+n)+"]");var u,l=function(t,e,n){for(var r=t.length-1,i=t[0].length-1,o={rows:r,cols:i,cells:[]},s=e+Math.abs(n),a=0;a<r;++a){o.cells[a]=[];for(var u=0;u<i;++u){var l=0,c=t[a+1][u],h=t[a+1][u+1],f=t[a][u+1],p=t[a][u];if(!(isNaN(c)||isNaN(h)||isNaN(f)||isNaN(p))){l|=c<e?0:c>s?128:64,l|=h<e?0:h>s?32:16,l|=f<e?0:f>s?8:4;var d=+(l|=p<e?0:p>s?2:1),g=0;if(17===l||18===l||33===l||34===l||38===l||68===l||72===l||98===l||102===l||132===l||136===l||137===l||152===l||153===l){var y=(c+h+f+p)/4;g=y>s?2:y<e?0:1,34===l?1===g?l=35:0===g&&(l=136):136===l?1===g?(l=35,g=4):0===g&&(l=34):17===l?1===g?(l=155,g=4):0===g&&(l=153):68===l?1===g?(l=103,g=4):0===g&&(l=102):153===l?1===g&&(l=155):102===l?1===g&&(l=103):152===l?g<2&&(l=156,g=1):137===l?g<2&&(l=139,g=1):98===l?g<2&&(l=99,g=1):38===l?g<2&&(l=39,g=1):18===l?g>0?(l=156,g=4):l=152:33===l?g>0?(l=139,g=4):l=137:72===l?g>0?(l=99,g=4):l=98:132===l&&(g>0?(l=39,g=4):l=38)}if(0!=l&&170!=l){var v,_,m,x,w,b,E,S;v=_=m=x=w=b=E=S=.5;var C=[];1===l?(m=1-Hp(e,f,p),S=1-Hp(e,c,p),C.push(Vp[l])):169===l?(m=Hp(s,p,f),S=Hp(s,p,c),C.push(Vp[l])):4===l?(b=1-Hp(e,h,f),x=Hp(e,p,f),C.push(Bp[l])):166===l?(b=Hp(s,f,h),x=1-Hp(s,f,p),C.push(Bp[l])):16===l?(w=Hp(e,f,h),_=Hp(e,c,h),C.push(Gp[l])):154===l?(w=1-Hp(s,h,f),_=1-Hp(s,h,c),C.push(Gp[l])):64===l?(E=Hp(e,p,c),v=1-Hp(e,h,c),C.push(Xp[l])):106===l?(E=1-Hp(s,c,p),v=Hp(s,c,h),C.push(Xp[l])):168===l?(x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),C.push(zp[l]),C.push(Vp[l])):2===l?(x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),C.push(zp[l]),C.push(Vp[l])):162===l?(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),C.push(zp[l]),C.push(Vp[l])):8===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),C.push(Gp[l]),C.push(Bp[l])):138===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(Gp[l]),C.push(Bp[l])):32===l?(w=Hp(s,f,h),b=Hp(e,f,h),v=Hp(e,c,h),_=Hp(s,c,h),C.push(Gp[l]),C.push(Bp[l])):42===l?(S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h),C.push(Up[l]),C.push(Xp[l])):128===l&&(S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(Up[l]),C.push(Xp[l])),5===l?(b=1-Hp(e,h,f),S=1-Hp(e,c,p),C.push(Bp[l])):165===l?(b=Hp(s,f,h),S=Hp(s,p,c),C.push(Bp[l])):20===l?(x=Hp(e,p,f),_=Hp(e,c,h),C.push(zp[l])):150===l?(x=1-Hp(s,f,p),_=1-Hp(s,h,c),C.push(zp[l])):80===l?(w=Hp(e,f,h),E=Hp(e,p,c),C.push(Gp[l])):90===l?(w=1-Hp(s,h,f),E=1-Hp(s,c,p),C.push(Gp[l])):65===l?(m=1-Hp(e,f,p),v=1-Hp(e,h,c),C.push(Vp[l])):105===l?(m=Hp(s,p,f),v=Hp(s,c,h),C.push(Vp[l])):160===l?(w=Hp(s,f,h),b=Hp(e,f,h),S=Hp(e,p,c),E=Hp(s,p,c),C.push(Gp[l]),C.push(Bp[l])):10===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),S=1-Hp(s,c,p),E=1-Hp(e,c,p),C.push(Gp[l]),C.push(Bp[l])):130===l?(x=1-Hp(e,f,p),m=1-Hp(s,f,p),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(zp[l]),C.push(Vp[l])):40===l?(x=Hp(s,p,f),m=Hp(e,p,f),v=Hp(e,c,h),_=Hp(s,c,h),C.push(zp[l]),C.push(Vp[l])):101===l?(b=Hp(s,f,h),v=Hp(s,c,h),C.push(Bp[l])):69===l?(b=1-Hp(e,h,f),v=1-Hp(e,h,c),C.push(Bp[l])):149===l?(S=Hp(s,p,c),_=1-Hp(s,h,c),C.push(Up[l])):21===l?(S=1-Hp(e,c,p),_=Hp(e,c,h),C.push(Up[l])):86===l?(x=1-Hp(s,f,p),E=1-Hp(s,c,p),C.push(zp[l])):84===l?(x=Hp(e,p,f),E=Hp(e,p,c),C.push(zp[l])):89===l?(w=1-Hp(s,h,f),m=Hp(s,p,f),C.push(Vp[l])):81===l?(w=Hp(e,f,h),m=1-Hp(e,f,p),C.push(Vp[l])):96===l?(w=Hp(s,f,h),b=Hp(e,f,h),E=Hp(e,p,c),v=Hp(s,c,h),C.push(Gp[l]),C.push(Bp[l])):74===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),E=1-Hp(s,c,p),v=1-Hp(e,h,c),C.push(Gp[l]),C.push(Bp[l])):24===l?(w=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),_=Hp(e,c,h),C.push(Gp[l]),C.push(Vp[l])):146===l?(w=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),_=1-Hp(s,h,c),C.push(Gp[l]),C.push(Vp[l])):6===l?(b=1-Hp(e,h,f),x=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),C.push(Bp[l]),C.push(zp[l])):164===l?(b=Hp(s,f,h),x=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),C.push(Bp[l]),C.push(zp[l])):129===l?(m=1-Hp(e,f,p),S=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(Vp[l]),C.push(Up[l])):41===l?(m=Hp(s,p,f),S=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h),C.push(Vp[l]),C.push(Up[l])):66===l?(x=1-Hp(e,f,p),m=1-Hp(s,f,p),E=1-Hp(s,c,p),v=1-Hp(e,h,c),C.push(zp[l]),C.push(Vp[l])):104===l?(x=Hp(s,p,f),m=Hp(e,p,f),E=Hp(e,p,c),v=Hp(s,c,h),C.push(Vp[l]),C.push(qp[l])):144===l?(w=Hp(e,f,h),S=Hp(e,p,c),E=Hp(s,p,c),_=1-Hp(s,h,c),C.push(Gp[l]),C.push(Xp[l])):26===l?(w=1-Hp(s,h,f),S=1-Hp(s,c,p),E=1-Hp(e,c,p),_=Hp(e,c,h),C.push(Gp[l]),C.push(Xp[l])):36===l?(b=Hp(s,f,h),x=Hp(e,p,f),v=Hp(e,c,h),_=Hp(s,c,h),C.push(Bp[l]),C.push(zp[l])):134===l?(b=1-Hp(e,h,f),x=1-Hp(s,f,p),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(Bp[l]),C.push(zp[l])):9===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),m=Hp(s,p,f),S=1-Hp(e,c,p),C.push(Gp[l]),C.push(Bp[l])):161===l?(w=Hp(s,f,h),b=Hp(e,f,h),m=1-Hp(e,f,p),S=Hp(s,p,c),C.push(Gp[l]),C.push(Bp[l])):37===l?(b=Hp(s,f,h),S=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h),C.push(Bp[l]),C.push(Up[l])):133===l?(b=1-Hp(e,h,f),S=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c),C.push(Bp[l]),C.push(Up[l])):148===l?(x=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),_=1-Hp(s,h,c),C.push(zp[l]),C.push(Xp[l])):22===l?(x=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),_=Hp(e,c,h),C.push(zp[l]),C.push(Xp[l])):82===l?(w=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),E=1-Hp(s,c,p),C.push(Gp[l]),C.push(Vp[l])):88===l?(w=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),E=Hp(e,p,c),C.push(Gp[l]),C.push(Vp[l])):73===l?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),m=Hp(s,p,f),v=1-Hp(e,h,c),C.push(Gp[l]),C.push(Bp[l])):97===l?(w=Hp(s,f,h),b=Hp(e,f,h),m=1-Hp(e,f,p),v=Hp(s,c,h),C.push(Gp[l]),C.push(Bp[l])):145===l?(w=Hp(e,f,h),m=1-Hp(e,f,p),S=Hp(s,p,c),_=1-Hp(s,h,c),C.push(Gp[l]),C.push(Up[l])):25===l?(w=1-Hp(s,h,f),m=Hp(s,p,f),S=1-Hp(e,c,p),_=Hp(e,c,h),C.push(Gp[l]),C.push(Up[l])):70===l?(b=1-Hp(e,h,f),x=1-Hp(s,f,p),E=1-Hp(s,c,p),v=1-Hp(e,h,c),C.push(Bp[l]),C.push(zp[l])):100===l?(b=Hp(s,f,h),x=Hp(e,p,f),E=Hp(e,p,c),v=Hp(s,c,h),C.push(Bp[l]),C.push(zp[l])):34===l?(0===g?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)):(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)),C.push(Gp[l]),C.push(Bp[l]),C.push(Up[l]),C.push(Xp[l])):35===l?(4===g?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)):(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)),C.push(Gp[l]),C.push(Bp[l]),C.push(Vp[l]),C.push(Xp[l])):136===l?(0===g?(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)):(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)),C.push(Gp[l]),C.push(Bp[l]),C.push(Up[l]),C.push(Xp[l])):153===l?(0===g?(w=Hp(e,f,h),m=1-Hp(e,f,p),S=1-Hp(e,c,p),_=Hp(e,c,h)):(w=1-Hp(s,h,f),m=Hp(s,p,f),S=Hp(s,p,c),_=1-Hp(s,h,c)),C.push(Gp[l]),C.push(Vp[l])):102===l?(0===g?(b=1-Hp(e,h,f),x=Hp(e,p,f),E=Hp(e,p,c),v=1-Hp(e,h,c)):(b=Hp(s,f,h),x=1-Hp(s,f,p),E=1-Hp(s,c,p),v=Hp(s,c,h)),C.push(Bp[l]),C.push(Xp[l])):155===l?(4===g?(w=Hp(e,f,h),m=1-Hp(e,f,p),S=1-Hp(e,c,p),_=Hp(e,c,h)):(w=1-Hp(s,h,f),m=Hp(s,p,f),S=Hp(s,p,c),_=1-Hp(s,h,c)),C.push(Gp[l]),C.push(Up[l])):103===l?(4===g?(b=1-Hp(e,h,f),x=Hp(e,p,f),E=Hp(e,p,c),v=1-Hp(e,h,c)):(b=Hp(s,f,h),x=1-Hp(s,f,p),E=1-Hp(s,c,p),v=Hp(s,c,h)),C.push(Bp[l]),C.push(zp[l])):152===l?(0===g?(w=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),_=Hp(e,c,h)):(w=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),_=1-Hp(s,h,c)),C.push(Gp[l]),C.push(zp[l]),C.push(Vp[l])):156===l?(4===g?(w=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),_=Hp(e,c,h)):(w=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),_=1-Hp(s,h,c)),C.push(Gp[l]),C.push(Vp[l]),C.push(Xp[l])):137===l?(0===g?(w=Hp(s,f,h),b=Hp(e,f,h),m=1-Hp(e,f,p),S=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)):(w=1-Hp(e,h,f),b=1-Hp(s,h,f),m=Hp(s,p,f),S=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)),C.push(Gp[l]),C.push(Bp[l]),C.push(Vp[l])):139===l?(4===g?(w=Hp(s,f,h),b=Hp(e,f,h),m=1-Hp(e,f,p),S=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)):(w=1-Hp(e,h,f),b=1-Hp(s,h,f),m=Hp(s,p,f),S=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)),C.push(Gp[l]),C.push(Bp[l]),C.push(Up[l])):98===l?(0===g?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),E=Hp(e,p,c),v=1-Hp(e,h,c)):(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),E=1-Hp(s,c,p),v=Hp(s,c,h)),C.push(Gp[l]),C.push(Bp[l]),C.push(Xp[l])):99===l?(4===g?(w=1-Hp(e,h,f),b=1-Hp(s,h,f),x=Hp(s,p,f),m=Hp(e,p,f),E=Hp(e,p,c),v=1-Hp(e,h,c)):(w=Hp(s,f,h),b=Hp(e,f,h),x=1-Hp(e,f,p),m=1-Hp(s,f,p),E=1-Hp(s,c,p),v=Hp(s,c,h)),C.push(Gp[l]),C.push(Bp[l]),C.push(Vp[l])):38===l?(0===g?(b=1-Hp(e,h,f),x=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)):(b=Hp(s,f,h),x=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)),C.push(Bp[l]),C.push(Up[l]),C.push(Xp[l])):39===l?(4===g?(b=1-Hp(e,h,f),x=Hp(e,p,f),S=Hp(e,p,c),E=Hp(s,p,c),v=1-Hp(s,h,c),_=1-Hp(e,h,c)):(b=Hp(s,f,h),x=1-Hp(s,f,p),S=1-Hp(s,c,p),E=1-Hp(e,c,p),v=Hp(e,c,h),_=Hp(s,c,h)),C.push(Bp[l]),C.push(zp[l]),C.push(Xp[l])):85===l&&(w=1,b=0,x=1,m=0,S=0,E=1,v=0,_=1),(v<0||v>1||_<0||_>1||w<0||w>1||x<0||x>1||S<0||S>1||E<0||E>1)&&console.log("MarchingSquaresJS-isoBands: "+l+" "+d+" "+c+","+h+","+f+","+p+" "+g+" "+v+" "+_+" "+w+" "+b+" "+x+" "+m+" "+S+" "+E),o.cells[a][u]={cval:l,cval_real:d,flipped:g,topleft:v,topright:_,righttop:w,rightbottom:b,bottomright:x,bottomleft:m,leftbottom:S,lefttop:E,edges:C}}}}}return o}(t,e,n);return ep.polygons?(ep.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],n=0;return t.cells.forEach(function(t,r){t.forEach(function(t,i){if(void 0!==t){var o=Yp[t.cval](t);"object"==typeof o&&Zp(o)?"object"==typeof o[0]&&Zp(o[0])?"object"==typeof o[0][0]&&Zp(o[0][0])?o.forEach(function(t){t.forEach(function(t){t[0]+=i,t[1]+=r}),e[n++]=t}):(o.forEach(function(t){t[0]+=i,t[1]+=r}),e[n++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),e}(l)):(ep.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],n=t.rows,r=t.cols,i=[],o=0;o<n;o++)for(var s=0;s<r;s++)if(void 0!==t.cells[o][s]&&t.cells[o][s].edges.length>0){var a=Jp(t.cells[o][s]),u=null,l=s,c=o;null!==a&&i.push([a.p[0]+l,a.p[1]+c]);do{if(null===(u=$p(t.cells[c][l],a.x,a.y,a.o)))break;if(i.push([u.p[0]+l,u.p[1]+c]),l+=u.x,a=u,(c+=u.y)<0||c>=n||l<0||l>=r||void 0===t.cells[c][l]){var h=Kp(t,l-=u.x,c-=u.y,u.x,u.y,u.o);if(null===h)break;h.path.forEach(function(t){i.push(t)}),l=h.i,c=h.j,a=h}}while(void 0!==t.cells[c][l]&&t.cells[c][l].edges.length>0);e.push(i),i=[],t.cells[o][s].edges.length>0&&s--}return e}(l)),"function"==typeof ep.successCallback&&ep.successCallback(u),u}var rp=64,ip=16,op=4,sp=1,ap=[],up=[],lp=[],cp=[],hp=[],fp=[],pp=[],dp=[],gp=[],yp=[],vp=[],_p=[],mp=[],xp=[],wp=[],bp=[],Ep=[],Sp=[],Cp=[],Pp=[],Ip=[],Mp=[],Op=[],Lp=[];pp[85]=yp[85]=-1,dp[85]=vp[85]=0,gp[85]=_p[85]=1,Cp[85]=Mp[85]=1,Pp[85]=Op[85]=0,Ip[85]=Lp[85]=1,ap[85]=cp[85]=0,up[85]=hp[85]=-1,lp[85]=wp[85]=0,bp[85]=mp[85]=0,Ep[85]=xp[85]=1,fp[85]=Sp[85]=1,Mp[1]=Mp[169]=0,Op[1]=Op[169]=-1,Lp[1]=Lp[169]=0,mp[1]=mp[169]=-1,xp[1]=xp[169]=0,wp[1]=wp[169]=0,yp[4]=yp[166]=0,vp[4]=vp[166]=-1,_p[4]=_p[166]=1,bp[4]=bp[166]=1,Ep[4]=Ep[166]=0,Sp[4]=Sp[166]=0,pp[16]=pp[154]=0,dp[16]=dp[154]=1,gp[16]=gp[154]=1,cp[16]=cp[154]=1,hp[16]=hp[154]=0,fp[16]=fp[154]=1,Cp[64]=Cp[106]=0,Pp[64]=Pp[106]=1,Ip[64]=Ip[106]=0,ap[64]=ap[106]=-1,up[64]=up[106]=0,lp[64]=lp[106]=1,Cp[2]=Cp[168]=0,Pp[2]=Pp[168]=-1,Ip[2]=Ip[168]=1,Mp[2]=Mp[168]=0,Op[2]=Op[168]=-1,Lp[2]=Lp[168]=0,mp[2]=mp[168]=-1,xp[2]=xp[168]=0,wp[2]=wp[168]=0,bp[2]=bp[168]=-1,Ep[2]=Ep[168]=0,Sp[2]=Sp[168]=1,pp[8]=pp[162]=0,dp[8]=dp[162]=-1,gp[8]=gp[162]=0,yp[8]=yp[162]=0,vp[8]=vp[162]=-1,_p[8]=_p[162]=1,mp[8]=mp[162]=1,xp[8]=xp[162]=0,wp[8]=wp[162]=1,bp[8]=bp[162]=1,Ep[8]=Ep[162]=0,Sp[8]=Sp[162]=0,pp[32]=pp[138]=0,dp[32]=dp[138]=1,gp[32]=gp[138]=1,yp[32]=yp[138]=0,vp[32]=vp[138]=1,_p[32]=_p[138]=0,ap[32]=ap[138]=1,up[32]=up[138]=0,lp[32]=lp[138]=0,cp[32]=cp[138]=1,hp[32]=hp[138]=0,fp[32]=fp[138]=1,Mp[128]=Mp[42]=0,Op[128]=Op[42]=1,Lp[128]=Lp[42]=1,Cp[128]=Cp[42]=0,Pp[128]=Pp[42]=1,Ip[128]=Ip[42]=0,ap[128]=ap[42]=-1,up[128]=up[42]=0,lp[128]=lp[42]=1,cp[128]=cp[42]=-1,hp[128]=hp[42]=0,fp[128]=fp[42]=0,yp[5]=yp[165]=-1,vp[5]=vp[165]=0,_p[5]=_p[165]=0,Mp[5]=Mp[165]=1,Op[5]=Op[165]=0,Lp[5]=Lp[165]=0,bp[20]=bp[150]=0,Ep[20]=Ep[150]=1,Sp[20]=Sp[150]=1,cp[20]=cp[150]=0,hp[20]=hp[150]=-1,fp[20]=fp[150]=1,pp[80]=pp[90]=-1,dp[80]=dp[90]=0,gp[80]=gp[90]=1,Cp[80]=Cp[90]=1,Pp[80]=Pp[90]=0,Ip[80]=Ip[90]=1,mp[65]=mp[105]=0,xp[65]=xp[105]=1,wp[65]=wp[105]=0,ap[65]=ap[105]=0,up[65]=up[105]=-1,lp[65]=lp[105]=0,pp[160]=pp[10]=-1,dp[160]=dp[10]=0,gp[160]=gp[10]=1,yp[160]=yp[10]=-1,vp[160]=vp[10]=0,_p[160]=_p[10]=0,Mp[160]=Mp[10]=1,Op[160]=Op[10]=0,Lp[160]=Lp[10]=0,Cp[160]=Cp[10]=1,Pp[160]=Pp[10]=0,Ip[160]=Ip[10]=1,bp[130]=bp[40]=0,Ep[130]=Ep[40]=1,Sp[130]=Sp[40]=1,mp[130]=mp[40]=0,xp[130]=xp[40]=1,wp[130]=wp[40]=0,ap[130]=ap[40]=0,up[130]=up[40]=-1,lp[130]=lp[40]=0,cp[130]=cp[40]=0,hp[130]=hp[40]=-1,fp[130]=fp[40]=1,yp[37]=yp[133]=0,vp[37]=vp[133]=1,_p[37]=_p[133]=1,Mp[37]=Mp[133]=0,Op[37]=Op[133]=1,Lp[37]=Lp[133]=0,ap[37]=ap[133]=-1,up[37]=up[133]=0,lp[37]=lp[133]=0,cp[37]=cp[133]=1,hp[37]=hp[133]=0,fp[37]=fp[133]=0,bp[148]=bp[22]=-1,Ep[148]=Ep[22]=0,Sp[148]=Sp[22]=0,Mp[148]=Mp[22]=0,Op[148]=Op[22]=-1,Lp[148]=Lp[22]=1,Cp[148]=Cp[22]=0,Pp[148]=Pp[22]=1,Ip[148]=Ip[22]=1,cp[148]=cp[22]=-1,hp[148]=hp[22]=0,fp[148]=fp[22]=1,pp[82]=pp[88]=0,dp[82]=dp[88]=-1,gp[82]=gp[88]=1,bp[82]=bp[88]=1,Ep[82]=Ep[88]=0,Sp[82]=Sp[88]=1,mp[82]=mp[88]=-1,xp[82]=xp[88]=0,wp[82]=wp[88]=1,Cp[82]=Cp[88]=0,Pp[82]=Pp[88]=-1,Ip[82]=Ip[88]=0,pp[73]=pp[97]=0,dp[73]=dp[97]=1,gp[73]=gp[97]=0,yp[73]=yp[97]=0,vp[73]=vp[97]=-1,_p[73]=_p[97]=0,mp[73]=mp[97]=1,xp[73]=xp[97]=0,wp[73]=wp[97]=0,ap[73]=ap[97]=1,up[73]=up[97]=0,lp[73]=lp[97]=1,pp[145]=pp[25]=0,dp[145]=dp[25]=-1,gp[145]=gp[25]=0,mp[145]=mp[25]=1,xp[145]=xp[25]=0,wp[145]=wp[25]=1,Mp[145]=Mp[25]=0,Op[145]=Op[25]=1,Lp[145]=Lp[25]=1,cp[145]=cp[25]=-1,hp[145]=hp[25]=0,fp[145]=fp[25]=0,yp[70]=yp[100]=0,vp[70]=vp[100]=1,_p[70]=_p[100]=0,bp[70]=bp[100]=-1,Ep[70]=Ep[100]=0,Sp[70]=Sp[100]=1,Cp[70]=Cp[100]=0,Pp[70]=Pp[100]=-1,Ip[70]=Ip[100]=1,ap[70]=ap[100]=1,up[70]=up[100]=0,lp[70]=lp[100]=0,yp[101]=yp[69]=0,vp[101]=vp[69]=1,_p[101]=_p[69]=0,ap[101]=ap[69]=1,up[101]=up[69]=0,lp[101]=lp[69]=0,Mp[149]=Mp[21]=0,Op[149]=Op[21]=1,Lp[149]=Lp[21]=1,cp[149]=cp[21]=-1,hp[149]=hp[21]=0,fp[149]=fp[21]=0,bp[86]=bp[84]=-1,Ep[86]=Ep[84]=0,Sp[86]=Sp[84]=1,Cp[86]=Cp[84]=0,Pp[86]=Pp[84]=-1,Ip[86]=Ip[84]=1,pp[89]=pp[81]=0,dp[89]=dp[81]=-1,gp[89]=gp[81]=0,mp[89]=mp[81]=1,xp[89]=xp[81]=0,wp[89]=wp[81]=1,pp[96]=pp[74]=0,dp[96]=dp[74]=1,gp[96]=gp[74]=0,yp[96]=yp[74]=-1,vp[96]=vp[74]=0,_p[96]=_p[74]=1,Cp[96]=Cp[74]=1,Pp[96]=Pp[74]=0,Ip[96]=Ip[74]=0,ap[96]=ap[74]=1,up[96]=up[74]=0,lp[96]=lp[74]=1,pp[24]=pp[146]=0,dp[24]=dp[146]=-1,gp[24]=gp[146]=1,bp[24]=bp[146]=1,Ep[24]=Ep[146]=0,Sp[24]=Sp[146]=1,mp[24]=mp[146]=0,xp[24]=xp[146]=1,wp[24]=wp[146]=1,cp[24]=cp[146]=0,hp[24]=hp[146]=-1,fp[24]=fp[146]=0,yp[6]=yp[164]=-1,vp[6]=vp[164]=0,_p[6]=_p[164]=1,bp[6]=bp[164]=-1,Ep[6]=Ep[164]=0,Sp[6]=Sp[164]=0,Mp[6]=Mp[164]=0,Op[6]=Op[164]=-1,Lp[6]=Lp[164]=1,Cp[6]=Cp[164]=1,Pp[6]=Pp[164]=0,Ip[6]=Ip[164]=0,mp[129]=mp[41]=0,xp[129]=xp[41]=1,wp[129]=wp[41]=1,Mp[129]=Mp[41]=0,Op[129]=Op[41]=1,Lp[129]=Lp[41]=0,ap[129]=ap[41]=-1,up[129]=up[41]=0,lp[129]=lp[41]=0,cp[129]=cp[41]=0,hp[129]=hp[41]=-1,fp[129]=fp[41]=0,bp[66]=bp[104]=0,Ep[66]=Ep[104]=1,Sp[66]=Sp[104]=0,mp[66]=mp[104]=-1,xp[66]=xp[104]=0,wp[66]=wp[104]=1,Cp[66]=Cp[104]=0,Pp[66]=Pp[104]=-1,Ip[66]=Ip[104]=0,ap[66]=ap[104]=0,up[66]=up[104]=-1,lp[66]=lp[104]=1,pp[144]=pp[26]=-1,dp[144]=dp[26]=0,gp[144]=gp[26]=0,Mp[144]=Mp[26]=1,Op[144]=Op[26]=0,Lp[144]=Lp[26]=1,Cp[144]=Cp[26]=0,Pp[144]=Pp[26]=1,Ip[144]=Ip[26]=1,cp[144]=cp[26]=-1,hp[144]=hp[26]=0,fp[144]=fp[26]=1,yp[36]=yp[134]=0,vp[36]=vp[134]=1,_p[36]=_p[134]=1,bp[36]=bp[134]=0,Ep[36]=Ep[134]=1,Sp[36]=Sp[134]=0,ap[36]=ap[134]=0,up[36]=up[134]=-1,lp[36]=lp[134]=1,cp[36]=cp[134]=1,hp[36]=hp[134]=0,fp[36]=fp[134]=0,pp[9]=pp[161]=-1,dp[9]=dp[161]=0,gp[9]=gp[161]=0,yp[9]=yp[161]=0,vp[9]=vp[161]=-1,_p[9]=_p[161]=0,mp[9]=mp[161]=1,xp[9]=xp[161]=0,wp[9]=wp[161]=0,Mp[9]=Mp[161]=1,Op[9]=Op[161]=0,Lp[9]=Lp[161]=1,pp[136]=0,dp[136]=1,gp[136]=1,yp[136]=0,vp[136]=1,_p[136]=0,bp[136]=-1,Ep[136]=0,Sp[136]=1,mp[136]=-1,xp[136]=0,wp[136]=0,Mp[136]=0,Op[136]=-1,Lp[136]=0,Cp[136]=0,Pp[136]=-1,Ip[136]=1,ap[136]=1,up[136]=0,lp[136]=0,cp[136]=1,hp[136]=0,fp[136]=1,pp[34]=0,dp[34]=-1,gp[34]=0,yp[34]=0,vp[34]=-1,_p[34]=1,bp[34]=1,Ep[34]=0,Sp[34]=0,mp[34]=1,xp[34]=0,wp[34]=1,Mp[34]=0,Op[34]=1,Lp[34]=1,Cp[34]=0,Pp[34]=1,Ip[34]=0,ap[34]=-1,up[34]=0,lp[34]=1,cp[34]=-1,hp[34]=0,fp[34]=0,pp[35]=0,dp[35]=1,gp[35]=1,yp[35]=0,vp[35]=-1,_p[35]=1,bp[35]=1,Ep[35]=0,Sp[35]=0,mp[35]=-1,xp[35]=0,wp[35]=0,Mp[35]=0,Op[35]=-1,Lp[35]=0,Cp[35]=0,Pp[35]=1,Ip[35]=0,ap[35]=-1,up[35]=0,lp[35]=1,cp[35]=1,hp[35]=0,fp[35]=1,pp[153]=0,dp[153]=1,gp[153]=1,mp[153]=-1,xp[153]=0,wp[153]=0,Mp[153]=0,Op[153]=-1,Lp[153]=0,cp[153]=1,hp[153]=0,fp[153]=1,yp[102]=0,vp[102]=-1,_p[102]=1,bp[102]=1,Ep[102]=0,Sp[102]=0,Cp[102]=0,Pp[102]=1,Ip[102]=0,ap[102]=-1,up[102]=0,lp[102]=1,pp[155]=0,dp[155]=-1,gp[155]=0,mp[155]=1,xp[155]=0,wp[155]=1,Mp[155]=0,Op[155]=1,Lp[155]=1,cp[155]=-1,hp[155]=0,fp[155]=0,yp[103]=0,vp[103]=1,_p[103]=0,bp[103]=-1,Ep[103]=0,Sp[103]=1,Cp[103]=0,Pp[103]=-1,Ip[103]=1,ap[103]=1,up[103]=0,lp[103]=0,pp[152]=0,dp[152]=1,gp[152]=1,bp[152]=-1,Ep[152]=0,Sp[152]=1,mp[152]=-1,xp[152]=0,wp[152]=0,Mp[152]=0,Op[152]=-1,Lp[152]=0,Cp[152]=0,Pp[152]=-1,Ip[152]=1,cp[152]=1,hp[152]=0,fp[152]=1,pp[156]=0,dp[156]=-1,gp[156]=1,bp[156]=1,Ep[156]=0,Sp[156]=1,mp[156]=-1,xp[156]=0,wp[156]=0,Mp[156]=0,Op[156]=-1,Lp[156]=0,Cp[156]=0,Pp[156]=1,Ip[156]=1,cp[156]=-1,hp[156]=0,fp[156]=1,pp[137]=0,dp[137]=1,gp[137]=1,yp[137]=0,vp[137]=1,_p[137]=0,mp[137]=-1,xp[137]=0,wp[137]=0,Mp[137]=0,Op[137]=-1,Lp[137]=0,ap[137]=1,up[137]=0,lp[137]=0,cp[137]=1,hp[137]=0,fp[137]=1,pp[139]=0,dp[139]=1,gp[139]=1,yp[139]=0,vp[139]=-1,_p[139]=0,mp[139]=1,xp[139]=0,wp[139]=0,Mp[139]=0,Op[139]=1,Lp[139]=0,ap[139]=-1,up[139]=0,lp[139]=0,cp[139]=1,hp[139]=0,fp[139]=1,pp[98]=0,dp[98]=-1,gp[98]=0,yp[98]=0,vp[98]=-1,_p[98]=1,bp[98]=1,Ep[98]=0,Sp[98]=0,mp[98]=1,xp[98]=0,wp[98]=1,Cp[98]=0,Pp[98]=1,Ip[98]=0,ap[98]=-1,up[98]=0,lp[98]=1,pp[99]=0,dp[99]=1,gp[99]=0,yp[99]=0,vp[99]=-1,_p[99]=1,bp[99]=1,Ep[99]=0,Sp[99]=0,mp[99]=-1,xp[99]=0,wp[99]=1,Cp[99]=0,Pp[99]=-1,Ip[99]=0,ap[99]=1,up[99]=0,lp[99]=1,yp[38]=0,vp[38]=-1,_p[38]=1,bp[38]=1,Ep[38]=0,Sp[38]=0,Mp[38]=0,Op[38]=1,Lp[38]=1,Cp[38]=0,Pp[38]=1,Ip[38]=0,ap[38]=-1,up[38]=0,lp[38]=1,cp[38]=-1,hp[38]=0,fp[38]=0,yp[39]=0,vp[39]=1,_p[39]=1,bp[39]=-1,Ep[39]=0,Sp[39]=0,Mp[39]=0,Op[39]=-1,Lp[39]=1,Cp[39]=0,Pp[39]=1,Ip[39]=0,ap[39]=-1,up[39]=0,lp[39]=1,cp[39]=1,hp[39]=0,fp[39]=0;var kp=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},Rp=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},Tp=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},Ap=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},Np=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},Fp=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},Dp=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},jp=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Gp=[],Bp=[],zp=[],Vp=[],Up=[],Xp=[],qp=[],Wp=[];Vp[1]=Up[1]=18,Vp[169]=Up[169]=18,zp[4]=Bp[4]=12,zp[166]=Bp[166]=12,Gp[16]=Wp[16]=4,Gp[154]=Wp[154]=4,Xp[64]=qp[64]=22,Xp[106]=qp[106]=22,zp[2]=Xp[2]=17,Vp[2]=Up[2]=18,zp[168]=Xp[168]=17,Vp[168]=Up[168]=18,Gp[8]=Vp[8]=9,Bp[8]=zp[8]=12,Gp[162]=Vp[162]=9,Bp[162]=zp[162]=12,Gp[32]=Wp[32]=4,Bp[32]=qp[32]=1,Gp[138]=Wp[138]=4,Bp[138]=qp[138]=1,Up[128]=Wp[128]=21,Xp[128]=qp[128]=22,Up[42]=Wp[42]=21,Xp[42]=qp[42]=22,Bp[5]=Up[5]=14,Bp[165]=Up[165]=14,zp[20]=Wp[20]=6,zp[150]=Wp[150]=6,Gp[80]=Xp[80]=11,Gp[90]=Xp[90]=11,Vp[65]=qp[65]=3,Vp[105]=qp[105]=3,Gp[160]=Xp[160]=11,Bp[160]=Up[160]=14,Gp[10]=Xp[10]=11,Bp[10]=Up[10]=14,zp[130]=Wp[130]=6,Vp[130]=qp[130]=3,zp[40]=Wp[40]=6,Vp[40]=qp[40]=3,Bp[101]=qp[101]=1,Bp[69]=qp[69]=1,Up[149]=Wp[149]=21,Up[21]=Wp[21]=21,zp[86]=Xp[86]=17,zp[84]=Xp[84]=17,Gp[89]=Vp[89]=9,Gp[81]=Vp[81]=9,Gp[96]=qp[96]=0,Bp[96]=Xp[96]=15,Gp[74]=qp[74]=0,Bp[74]=Xp[74]=15,Gp[24]=zp[24]=8,Vp[24]=Wp[24]=7,Gp[146]=zp[146]=8,Vp[146]=Wp[146]=7,Bp[6]=Xp[6]=15,zp[6]=Up[6]=16,Bp[164]=Xp[164]=15,zp[164]=Up[164]=16,Vp[129]=Wp[129]=7,Up[129]=qp[129]=20,Vp[41]=Wp[41]=7,Up[41]=qp[41]=20,zp[66]=qp[66]=2,Vp[66]=Xp[66]=19,zp[104]=qp[104]=2,Vp[104]=Xp[104]=19,Gp[144]=Up[144]=10,Xp[144]=Wp[144]=23,Gp[26]=Up[26]=10,Xp[26]=Wp[26]=23,Bp[36]=Wp[36]=5,zp[36]=qp[36]=2,Bp[134]=Wp[134]=5,zp[134]=qp[134]=2,Gp[9]=Up[9]=10,Bp[9]=Vp[9]=13,Gp[161]=Up[161]=10,Bp[161]=Vp[161]=13,Bp[37]=Wp[37]=5,Up[37]=qp[37]=20,Bp[133]=Wp[133]=5,Up[133]=qp[133]=20,zp[148]=Up[148]=16,Xp[148]=Wp[148]=23,zp[22]=Up[22]=16,Xp[22]=Wp[22]=23,Gp[82]=zp[82]=8,Vp[82]=Xp[82]=19,Gp[88]=zp[88]=8,Vp[88]=Xp[88]=19,Gp[73]=qp[73]=0,Bp[73]=Vp[73]=13,Gp[97]=qp[97]=0,Bp[97]=Vp[97]=13,Gp[145]=Vp[145]=9,Up[145]=Wp[145]=21,Gp[25]=Vp[25]=9,Up[25]=Wp[25]=21,Bp[70]=qp[70]=1,zp[70]=Xp[70]=17,Bp[100]=qp[100]=1,zp[100]=Xp[100]=17,Gp[34]=Vp[34]=9,Bp[34]=zp[34]=12,Up[34]=Wp[34]=21,Xp[34]=qp[34]=22,Gp[136]=Wp[136]=4,Bp[136]=qp[136]=1,zp[136]=Xp[136]=17,Vp[136]=Up[136]=18,Gp[35]=Wp[35]=4,Bp[35]=zp[35]=12,Vp[35]=Up[35]=18,Xp[35]=qp[35]=22,Gp[153]=Wp[153]=4,Vp[153]=Up[153]=18,Bp[102]=zp[102]=12,Xp[102]=qp[102]=22,Gp[155]=Vp[155]=9,Up[155]=Wp[155]=23,Bp[103]=qp[103]=1,zp[103]=Xp[103]=17,Gp[152]=Wp[152]=4,zp[152]=Xp[152]=17,Vp[152]=Up[152]=18,Gp[156]=zp[156]=8,Vp[156]=Up[156]=18,Xp[156]=Wp[156]=23,Gp[137]=Wp[137]=4,Bp[137]=qp[137]=1,Vp[137]=Up[137]=18,Gp[139]=Wp[139]=4,Bp[139]=Vp[139]=13,Up[139]=qp[139]=20,Gp[98]=Vp[98]=9,Bp[98]=zp[98]=12,Xp[98]=qp[98]=22,Gp[99]=qp[99]=0,Bp[99]=zp[99]=12,Vp[99]=Xp[99]=19,Bp[38]=zp[38]=12,Up[38]=Wp[38]=21,Xp[38]=qp[38]=22,Bp[39]=Wp[39]=5,zp[39]=Up[39]=16,Xp[39]=qp[39]=22;var Yp=[];function Hp(t,e,n){return(t-e)/(n-e)}function Zp(t){return t.constructor.toString().indexOf("Array")>-1}function Kp(t,e,n,r,i,o){for(var s=t.cells[n][e],a=s.cval_real,u=e+r,l=n+i,c=[],h=!1;!h;){if(void 0===t.cells[l]||void 0===t.cells[l][u])if(l-=i,u-=r,a=(s=t.cells[l][u]).cval_real,-1===i)if(0===o)if(a&sp)c.push([u,l]),r=-1,i=0,o=0;else{if(!(a&op)){c.push([u+s.bottomright,l]),r=0,i=1,o=1,h=!0;break}c.push([u+1,l]),r=1,i=0,o=0}else{if(!(a&sp)){if(a&op){c.push([u+s.bottomright,l]),r=0,i=1,o=1,h=!0;break}c.push([u+s.bottomleft,l]),r=0,i=1,o=0,h=!0;break}c.push([u,l]),r=-1,i=0,o=0}else if(1===i)if(0===o){if(!(a&ip)){if(a&rp){c.push([u+s.topleft,l+1]),r=0,i=-1,o=0,h=!0;break}c.push([u+s.topright,l+1]),r=0,i=-1,o=1,h=!0;break}c.push([u+1,l+1]),r=1,i=0,o=1}else c.push([u+1,l+1]),r=1,i=0,o=1;else if(-1===r)if(0===o){if(!(a&rp)){if(a&sp){c.push([u,l+s.leftbottom]),r=1,i=0,o=0,h=!0;break}c.push([u,l+s.lefttop]),r=1,i=0,o=1,h=!0;break}c.push([u,l+1]),r=0,i=1,o=0}else{if(!(a&rp)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([u,l+1]),r=0,i=1,o=0}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&op)){c.push([u+1,l+s.rightbottom]),r=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),r=0,i=-1,o=1}else{if(!(a&op)){if(a&ip){c.push([u+1,l+s.righttop]),r=-1,i=0,o=1;break}c.push([u+1,l+s.rightbottom]),r=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),r=0,i=-1,o=1}}else if(a=(s=t.cells[l][u]).cval_real,-1===r)if(0===o)if(void 0!==t.cells[l-1]&&void 0!==t.cells[l-1][u])r=0,i=-1,o=1;else{if(!(a&sp)){c.push([u+s.bottomright,l]),r=0,i=1,o=1,h=!0;break}c.push([u,l])}else{if(!(a&rp)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+l);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===r){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l+1]&&void 0!==t.cells[l+1][u])r=0,i=1,o=0;else{if(!(a&ip)){c.push([u+s.topleft,l+1]),r=0,i=-1,o=0,h=!0;break}c.push([u+1,l+1]),r=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u+1])r=1,i=0,o=1;else{if(!(a&op)){c.push([u+1,l+s.righttop]),r=-1,i=0,o=1,h=!0;break}c.push([u+1,l]),r=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u-1])r=-1,i=0,o=0;else{if(!(a&rp)){c.push([u,l+s.leftbottom]),r=1,i=0,o=0,h=!0;break}c.push([u,l+1]),r=0,i=1,o=0}}if(l+=i,(u+=r)===e&&l===n)break}return{path:c,i:u,j:l,x:r,y:i,o:o}}function Jp(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&ip?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&op?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&op?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&sp?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&ip?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&op?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&op?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&sp?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&op?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&sp?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&sp?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&rp?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&op?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&sp?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&sp?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&rp?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&op?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&rp?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&sp?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&rp?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&rp?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&ip?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&rp?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&ip?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}function $p(t,e,n,r){var i,o,s,a,u,l=t.cval;switch(e){case-1:if(0===r)i=Bp[l],s=yp[l],a=vp[l],u=_p[l];else i=Gp[l],s=pp[l],a=dp[l],u=gp[l];break;case 1:if(0===r)i=Up[l],s=Mp[l],a=Op[l],u=Lp[l];else i=Xp[l],s=Cp[l],a=Pp[l],u=Ip[l];break;default:switch(n){case-1:if(0===r)i=qp[l],s=ap[l],a=up[l],u=lp[l];else i=Wp[l],s=cp[l],a=hp[l],u=fp[l];break;case 1:if(0===r)i=Vp[l],s=mp[l],a=xp[l],u=wp[l];else i=zp[l],s=bp[l],a=Ep[l],u=Sp[l]}}if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var n=e+1;n<t.edges.length;n++)t.edges[n-1]=t.edges[n];t.edges.pop()}(t,o),l=t.cval_real,i){case 0:l&ip?(e=t.topleft,n=1):(e=1,n=t.righttop);break;case 1:l&op?(e=1,n=t.rightbottom):(e=t.topleft,n=1);break;case 2:l&op?(e=t.topleft,n=1):(e=t.bottomright,n=0);break;case 3:l&sp?(e=t.bottomleft,n=0):(e=t.topleft,n=1);break;case 4:l&ip?(e=t.topright,n=1):(e=1,n=t.righttop);break;case 5:l&op?(e=1,n=t.rightbottom):(e=t.topright,n=1);break;case 6:l&op?(e=t.topright,n=1):(e=t.bottomright,n=0);break;case 7:l&sp?(e=t.bottomleft,n=0):(e=t.topright,n=1);break;case 8:l&op?(e=1,n=t.righttop):(e=t.bottomright,n=0);break;case 9:l&sp?(e=t.bottomleft,n=0):(e=1,n=t.righttop);break;case 10:l&sp?(e=1,n=t.righttop):(e=0,n=t.leftbottom);break;case 11:l&rp?(e=0,n=t.lefttop):(e=1,n=t.righttop);break;case 12:l&op?(e=1,n=t.rightbottom):(e=t.bottomright,n=0);break;case 13:l&sp?(e=t.bottomleft,n=0):(e=1,n=t.rightbottom);break;case 14:l&sp?(e=1,n=t.rightbottom):(e=0,n=t.leftbottom);break;case 15:l&rp?(e=0,n=t.lefttop):(e=1,n=t.rightbottom);break;case 16:l&op?(e=0,n=t.leftbottom):(e=t.bottomright,n=0);break;case 17:l&rp?(e=0,n=t.lefttop):(e=t.bottomright,n=0);break;case 18:l&sp?(e=t.bottomleft,n=0):(e=0,n=t.leftbottom);break;case 19:l&rp?(e=0,n=t.lefttop):(e=t.bottomleft,n=0);break;case 20:l&rp?(e=0,n=t.leftbottom):(e=t.topleft,n=1);break;case 21:l&ip?(e=t.topright,n=1):(e=0,n=t.leftbottom);break;case 22:l&rp?(e=0,n=t.lefttop):(e=t.topleft,n=1);break;case 23:l&ip?(e=t.topright,n=1):(e=0,n=t.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t),null}return void 0!==e&&void 0!==n&&void 0!==s&&void 0!==a&&void 0!==u||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(t),console.log(e+" "+n+" "+s+" "+a+" "+u)),{p:[e,n],x:s,y:a,o:u}}function Qp(t){var e=[],n=[];t.forEach(function(t){var r=Nh(Ja([t]));n.push(r),e.push({ring:t,area:r})}),n.sort(function(t,e){return e-t});var r=[];return n.forEach(function(t){for(var n=0;n<e.length;n++)if(e[n].area===t){r.push(e[n].ring),e.splice(n,1);break}}),r}function td(t){for(var e=t.map(function(t){return{lrCoordinates:t,grouped:!1}}),n=[];!nd(e);)for(var r=0;r<e.length;r++)if(!e[r].grouped){var i=[];i.push(e[r].lrCoordinates),e[r].grouped=!0;for(var o=Ja([e[r].lrCoordinates]),s=r+1;s<e.length;s++){if(!e[s].grouped)ed(Ja([e[s].lrCoordinates]),o)&&(i.push(e[s].lrCoordinates),e[s].grouped=!0)}n.push(i)}return n}function ed(t,e){for(var n=dh(t),r=0;r<n.features.length;r++)if(!Jl(n.features[r],e))return!1;return!0}function nd(t){for(var e=0;e<t.length;e++)if(!1===t[e].grouped)return!1;return!0}Yp[1]=Yp[169]=kp,Yp[4]=Yp[166]=Rp,Yp[16]=Yp[154]=Tp,Yp[64]=Yp[106]=Ap,Yp[168]=Yp[2]=Np,Yp[162]=Yp[8]=Fp,Yp[138]=Yp[32]=Dp,Yp[42]=Yp[128]=jp,Yp[5]=Yp[165]=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},Yp[20]=Yp[150]=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},Yp[80]=Yp[90]=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},Yp[65]=Yp[105]=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Yp[160]=Yp[10]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},Yp[130]=Yp[40]=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},Yp[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},Yp[101]=Yp[69]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},Yp[149]=Yp[21]=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},Yp[86]=Yp[84]=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},Yp[89]=Yp[81]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},Yp[96]=Yp[74]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},Yp[24]=Yp[146]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},Yp[6]=Yp[164]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},Yp[129]=Yp[41]=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},Yp[66]=Yp[104]=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Yp[144]=Yp[26]=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Yp[36]=Yp[134]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},Yp[9]=Yp[161]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},Yp[37]=Yp[133]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},Yp[148]=Yp[22]=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Yp[82]=Yp[88]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},Yp[73]=Yp[97]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Yp[145]=Yp[25]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},Yp[70]=Yp[100]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Yp[34]=function(t){return[jp(t),Fp(t)]},Yp[35]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Yp[136]=function(t){return[Dp(t),Np(t)]},Yp[153]=function(t){return[Tp(t),kp(t)]},Yp[102]=function(t){return[Rp(t),Ap(t)]},Yp[155]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},Yp[103]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Yp[152]=function(t){return[Tp(t),Np(t)]},Yp[156]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Yp[137]=function(t){return[Dp(t),kp(t)]},Yp[139]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},Yp[98]=function(t){return[Fp(t),Ap(t)]},Yp[99]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Yp[38]=function(t){return[Rp(t),jp(t)]},Yp[39]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]};var rd=function(t,e,n){if(!yu(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(Uu(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!yu(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(o))throw new Error("breaksProperties is not an Array");var s=Qf(t,{zProperty:r,flip:!0}),a=function(t,e,n){for(var r=[],i=1;i<e.length;i++){var o=+e[i-1],s=+e[i],a=td(Qp(np(t,o,s-o))),u={};u.groupedRings=a,u[n]=o+"-"+s,r.push(u)}return r}(s,e,r);a=function(t,e,n){var r=Du(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,l=e.length-1,c=i/u,h=o/l,f=function(t){t[0]=t[0]*c+s,t[1]=t[1]*h+a};return t.forEach(function(t){t.groupedRings.forEach(function(t){t.forEach(function(t){t.forEach(f)})})}),t}(a,s,t);var u=a.map(function(t,e){if(o[e]&&!yu(o[e]))throw new Error("Each mappedProperty is required to be an Object");var n=Wu({},i,o[e]);return n[r]=t[r],iu(t.groupedRings,n)});return eu(u)};var id=function(t,e,n){if(!yu(n=n||{}))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("angle is required");return 0===e||(r||(r=hh(t)),!1!==i&&void 0!==i||(t=lc(t)),mu(t,function(t){var n=zf(r,t)+e,i=Sh(r,t),o=Gu(Vf(r,i,n));t[0]=o[0],t[1]=o[1]})),t};function od(t,e,n){var r="Point"===qu(t);return n=function(t,e){null==e&&(e="centroid");if(Array.isArray(e)||"object"==typeof e)return ju(e);var n=t.bbox?t.bbox:Du(t),r=n[0],i=n[1],o=n[2],s=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return Za([r,i]);case"se":case"southeast":case"eastsouth":case"bottomright":return Za([o,i]);case"nw":case"northwest":case"westnorth":case"topleft":return Za([r,s]);case"ne":case"northeast":case"eastnorth":case"topright":return Za([o,s]);case"center":return ch(t);case void 0:case null:case"centroid":return hh(t);default:throw new Error("invalid origin")}}(t,n),1===e||r||mu(t,function(t){var r=Sh(n,t),i=zf(n,t),o=Gu(Vf(n,r*e,i));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)}),t}var sd=function(t,e,n){if(!yu(n=n||{}))throw new Error("options is invalid");var r=n.origin,i=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(r)||"object"==typeof r;return!0!==i&&(t=lc(t)),"FeatureCollection"!==t.type||o?od(t,e,r):(Eu(t,function(n,i){t.features[i]=od(n,e,r)}),t)};var ad=function(t,e,n,r){if(!yu(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation,s=r.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0===e&&0===o)return t;if(null==n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n+=180),!1!==s&&void 0!==s||(t=lc(t)),mu(t,function(t){var r=Gu(Vf(t,e,n,{units:i}));t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)}),t};function ud(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function ld(t,e){return t[0]*e[1]-e[0]*t[1]}function cd(t,e){return!function(t,e){return 0===ld(ud(t),ud(e))}(t,e)&&function(t,e){var n,r,i=t[0],o=ud(t),s=e[0],a=ud(e),u=ld(o,a),l=function(t,e){return[t[0]+e[0],t[1]+e[1]]}(i,function(t,e){return[t*e[0],t*e[1]]}(ld((r=i,[(n=s)[0]-r[0],n[1]-r[1]]),a)/u,o));return l}(t,e)}function hd(t,e,n){var r=[],i=lu(e,n),o=Gu(t),s=[];return o.forEach(function(t,e){if(e!==o.length-1){var n=function(t,e,n){var r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=t[0]+n*(e[1]-t[1])/r,o=e[0]+n*(e[1]-t[1])/r,s=t[1]+n*(t[0]-e[0])/r,a=e[1]+n*(t[0]-e[0])/r;return[[i,s],[o,a]]}(t,o[e+1],i);if(r.push(n),e>0){var a=r[e-1],u=cd(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}}),Qa(s,t.properties)}var fd=function(t,e,n){if(!yu(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");var i=qu(t),o=t.properties;switch(i){case"LineString":return hd(t,e,r);case"MultiLineString":var s=[];return Mu(t,function(t){s.push(hd(t,e,r).geometry.coordinates)}),nu(s,o);default:throw new Error("geometry "+i+" is not supported")}};function pd(t,e,n){var r,i=e[0]-t[0],o=e[1]-t[1],s=n[0]-e[0],a=n[1]-e[1];return((r=i*a-s*o)>0)-(r<0)||+r}function dd(t,e){return e.geometry.coordinates[0].every(function(e){return Jl(Za(e),t)})}var gd=function(){function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return t.buildId=function(t){return t.join(",")},t.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},t.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},t.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},t.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]===0&&i.coordinates[0]-t.coordinates[0]===0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=pd(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)},t.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},t.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},t.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},t}(),yd=gd,vd=function(){function t(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return t.prototype.getSymetric=function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric},t.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},t.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},t.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},t.prototype.toLineString=function(){return Qa([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return pd(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}(),_d=function(){function t(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return t.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},t.prototype.get=function(t){return this.edges[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.edges.forEach(t)},t.prototype.map=function(t){return this.edges.map(t)},t.prototype.some=function(t){return this.edges.some(t)},t.prototype.isValid=function(){return!0},t.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e},0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=pd(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},t.prototype.toMultiPoint=function(){return ru(this.edges.map(function(t){return t.from.coordinates}))},t.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Ja([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=ih(this.toPolygon())},t.findEdgeRingContaining=function(t,e){var n,r,i=t.getEnvelope();return e.forEach(function(e){var o,s,a,u,l,c,h=e.getEnvelope();if((r&&(n=r.getEnvelope()),s=i,a=(o=h).geometry.coordinates[0].map(function(t){return t[0]}),u=o.geometry.coordinates[0].map(function(t){return t[1]}),l=s.geometry.coordinates[0].map(function(t){return t[0]}),c=s.geometry.coordinates[0].map(function(t){return t[1]}),Math.max.apply(null,a)!==Math.max.apply(null,l)||Math.max.apply(null,u)!==Math.max.apply(null,c)||Math.min.apply(null,a)!==Math.min.apply(null,l)||Math.min.apply(null,u)!==Math.min.apply(null,c))&&dd(h,i)){for(var f=t.map(function(t){return t.from.coordinates}),p=void 0,d=function(t){e.some(function(e){return n=t,r=e.from.coordinates,n[0]===r[0]&&n[1]===r[1];var n,r})||(p=t)},g=0,y=f;g<y.length;g++){d(y[g])}p&&e.inside(Za(p))&&(r&&!dd(n,h)||(r=e))}}),r},t.prototype.inside=function(t){return Jl(t,this.toPolygon())},t}(),md=_d;var xd=function(){function t(){this.edges=[],this.nodes={}}return t.fromGeoJson=function(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(e);var n=new t;return Mu(e,function(t){Vu(t,"LineString","Graph::fromGeoJson"),xu(t,function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e})}),n},t.prototype.getNode=function(t){var e=yd.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new yd(t)),n},t.prototype.addEdge=function(t,e){var n=new vd(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},t.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},t.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(t){return t.to});this.removeNode(t),n.forEach(function(t){return e._removeIfDangle(t)})}},t.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},t.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach(function(t){return e._computeNextCWEdges(e.nodes[t])}):t.getOuterEdges().forEach(function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e})},t.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,l=void 0;s.label===e&&(u=s),a.label===e&&(l=a),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},t.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}}),t},t.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n,e.label)})});var e=[];return this.edges.forEach(function(n){n.ring||e.push(t._findEdgeRing(n))}),e},t.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++r}),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e},t.prototype._findEdgeRing=function(t){var e=t,n=new md;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},t.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(t){return e.removeEdge(t)}),t.innerEdges.forEach(function(t){return e.removeEdge(t)}),delete this.nodes[t.id]},t.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},t}(),wd=xd;function bd(t){var e=wd.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var n=[],r=[];return e.getEdgeRings().filter(function(t){return t.isValid()}).forEach(function(t){t.isHole()?n.push(t):r.push(t)}),n.forEach(function(t){md.findEdgeRingContaining(t,r)&&r.push(t)}),eu(r.map(function(t){return t.toPolygon()}))}function Ed(t,e){for(var n=0;n<t.coordinates.length-1;n++)if(Cd(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function Sd(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){if(Jl(r[n],t))return!0}return bh(e,Sf(t)).features.length>0}function Cd(t,e,n){var r=n[0]-t[0],i=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return 0===r*s-i*o&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}var Pd=function(t,e){var n=!0;return Mu(t,function(t){Mu(e,function(e){if(!1===n)return!1;n=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return n=t.coordinates,r=e.coordinates,!(n[0]===r[0]&&n[1]===r[1]);case"LineString":return!Ed(e,t);case"Polygon":return!Jl(t,e)}break;case"LineString":switch(e.type){case"Point":return!Ed(t,e);case"LineString":return!function(t,e){if(bh(t,e).features.length>0)return!0;return!1}(t,e);case"Polygon":return!Sd(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Jl(e,t);case"LineString":return!Sd(t,e);case"Polygon":return!function(t,e){for(var n=0,r=t.coordinates[0];n<r.length;n++){if(Jl(r[n],e))return!0}for(var i=0,o=e.coordinates[0];i<o.length;i++){if(Jl(o[i],t))return!0}var s=bh(Sf(t),Sf(e));if(s.features.length>0)return!0;return!1}(e,t)}}var n,r;return!1}(t.geometry,e.geometry)})}),n};function Id(t,e){var n=Xu(t),r=Xu(e),i=n.type,o=r.type,s=n.coordinates,a=r.coordinates;switch(i){case"Point":if("Point"===o)return Od(s,a);throw new Error("feature2 "+o+" geometry not supported");case"MultiPoint":switch(o){case"Point":return function(t,e){var n,r=!1;for(n=0;n<t.coordinates.length;n++)if(Od(t.coordinates[n],e.coordinates)){r=!0;break}return r}(n,r);case"MultiPoint":return function(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){for(var i=r[n],o=!1,s=0,a=t.coordinates;s<a.length;s++){if(Od(i,a[s])){o=!0;break}}if(!o)return!1}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"Point":return Xh(r,n,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var n=!1,r=0,i=e.coordinates;r<i.length;r++){var o=i[r];if(Xh({type:"Point",coordinates:o},t,{ignoreEndVertices:!0})&&(n=!0),!Xh({type:"Point",coordinates:o},t,{ignoreEndVertices:!1}))return!1}return n}(n,r);case"MultiPoint":return function(t,e){for(var n=!1,r=0,i=e.coordinates;r<i.length;r++){var o=i[r];if(Xh(o,t,{ignoreEndVertices:!0})&&(n=!0),!Xh(o,t))return!1}if(n)return!0;return!1}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Point":return Jl(r,n,{ignoreBoundary:!0});case"LineString":return function(t,e){var n=!1,r=0,i=Du(t),o=Du(e);if(!Md(i,o))return!1;for(;r<e.coordinates.length-1;r++){if(Jl({type:"Point",coordinates:Ld(e.coordinates[r],e.coordinates[r+1])},t,{ignoreBoundary:!0})){n=!0;break}}return n}(n,r);case"Polygon":return function(t,e){if("Feature"===t.type&&null===t.geometry)return!1;if("Feature"===e.type&&null===e.geometry)return!1;var n=Du(t),r=Du(e);if(!Md(n,r))return!1;for(var i=Xu(e).coordinates,o=0,s=i;o<s.length;o++)for(var a=0,u=s[o];a<u.length;a++){if(!Jl(u[a],t))return!1}return!0}(n,r);case"MultiPoint":return function(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){if(!Jl(r[n],t,{ignoreBoundary:!0}))return!1}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Md(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function Od(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ld(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}function kd(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o<i&&!n&&!r;){for(var s=0;s<e.coordinates.length-1;s++){var a=!0;0!==s&&s!==e.coordinates.length-2||(a=!1),Ad(e.coordinates[s],e.coordinates[s+1],t.coordinates[o],a)?n=!0:r=!0}o++}return n&&r}function Rd(t,e){var n=Cf(e);return bh(t,n).features.length>0}function Td(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o<i&&(!n||!r);o++)Jl(Za(t.coordinates[o]),e)?n=!0:r=!0;return r&&n}function Ad(t,e,n,r){var i=n[0]-t[0],o=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0===i*a-o*s&&(r?Math.abs(s)>=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]<n[0]&&n[0]<e[0]:e[0]<n[0]&&n[0]<t[0]:a>0?t[1]<n[1]&&n[1]<e[1]:e[1]<n[1]&&n[1]<t[1])}var Nd=function(t,e){var n=Xu(t),r=Xu(e),i=n.type,o=r.type;switch(i){case"MultiPoint":switch(o){case"LineString":return kd(n,r);case"Polygon":return Td(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"MultiPoint":return kd(r,n);case"LineString":return function(t,e){if(bh(t,e).features.length>0)for(var n=0;n<t.coordinates.length-1;n++)for(var r=0;r<e.coordinates.length-1;r++){var i=!0;if(0!==r&&r!==e.coordinates.length-2||(i=!1),Ad(t.coordinates[n],t.coordinates[n+1],e.coordinates[r],i))return!0}return!1}(n,r);case"Polygon":return Rd(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"MultiPoint":return Td(r,n);case"LineString":return Rd(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}},Fd=n(7910);function Dd(t,e){var n=Xu(t),r=Xu(e),i=n.type,o=r.type;if("MultiPoint"===i&&"MultiPoint"!==o||("LineString"===i||"MultiLineString"===i)&&"LineString"!==o&&"MultiLineString"!==o||("Polygon"===i||"MultiPolygon"===i)&&"Polygon"!==o&&"MultiPolygon"!==o)throw new Error("features must be of the same type");if("Point"===i)throw new Error("Point geometry not supported");if(new Fd({precision:6}).compare(t,e))return!1;var s=0;switch(i){case"MultiPoint":for(var a=0;a<n.coordinates.length;a++)for(var u=0;u<r.coordinates.length;u++){var l=n.coordinates[a],c=r.coordinates[u];if(l[0]===c[0]&&l[1]===c[1])return!0}return!1;case"LineString":case"MultiLineString":Lu(t,function(t){Lu(e,function(e){Df(t,e).features.length&&s++})});break;case"Polygon":case"MultiPolygon":Lu(t,function(t){Lu(e,function(e){bh(t,e).features.length&&s++})})}return s>0}var jd=function(t,e){return Xu(t).type===Xu(e).type&&new Fd({precision:6}).compare(Vc(t),Vc(e))};function Gd(t,e){var n=!1;return Mu(t,function(t){Mu(e,function(e){if(!0===n)return!0;n=!Pd(t.geometry,e.geometry)})}),n}var Bd=n(5221);var zd=function(t,e,n){void 0===n&&(n={}),!0!==n.mutate&&(t=lc(t)),n.minPoints=n.minPoints||3;var r=new Bd.DBSCAN,i=r.run(Cu(t),pu(e,n.units),n.minPoints,tc),o=-1;return i.forEach(function(e){o++,e.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster=o,n.properties.dbscan="core"})}),r.noise.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster?n.properties.dbscan="edge":n.properties.dbscan="noise"}),t},Vd=n(8682);var Ud=function(t,e){void 0===e&&(e={});var n=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(n/2)),e.numberOfClusters>n&&(e.numberOfClusters=n),!0!==e.mutate&&(t=lc(t));var r=Cu(t),i=r.slice(0,e.numberOfClusters),o=Vd(r,e.numberOfClusters,i),s={};return o.centroids.forEach(function(t,e){s[e]=t}),Eu(t,function(t,e){var n=o.idxs[e];t.properties.cluster=n,t.properties.centroid=s[n]}),t};function Xd(t,e){return cu(zf(t[0],t[1]))===cu(zf(e[0],e[1]))}function qd(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e)}var Wd=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==qd(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==qd(e,"line2"))throw new Error("line2 must be a LineString");for(var n=mh(Vc(t)).features,r=mh(Vc(e)).features,i=0;i<n.length;i++){var o=n[i].geometry.coordinates;if(!r[i])break;if(!Xd(o,r[i].geometry.coordinates))return!1}return!0};function Yd(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}var Hd={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||Hd.heuristics.manhattan,o=r.closest||!1,s=new Jd(function(t){return t.f}),a=e;for(e.h=i(e,n),s.push(e);s.size()>0;){var u=s.pop();if(u===n)return Yd(u);u.closed=!0;for(var l=t.neighbors(u),c=0,h=l.length;c<h;++c){var f=l[c];if(!f.closed&&!f.isWall()){var p=u.g+f.getCost(u),d=f.visited;(!d||p<f.g)&&(f.visited=!0,f.parent=u,f.h=f.h||i(f,n),f.g=p,f.f=f.g+f.h,t.markDirty(f),o&&(f.h<a.h||f.h===a.h&&f.g<a.g)&&(a=f),d?s.rescoreElement(f):s.push(f))}}}return o?Yd(a):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=null}};function Zd(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n<t.length;n++){this.grid[n]=[];for(var r=0,i=t[n];r<i.length;r++){var o=new Kd(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function Kd(t,e,n){this.x=t,this.y=e,this.weight=n}function Jd(t){this.content=[],this.scoreFunction=t}function $d(t,e){for(var n=0;n<e.features.length;n++)if(Jl(t,e.features[n]))return!0;return!1}Zd.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)Hd.cleanNode(this.nodes[t])},Zd.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)Hd.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},Zd.prototype.markDirty=function(t){this.dirtyNodes.push(t)},Zd.prototype.neighbors=function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e},Zd.prototype.toString=function(){for(var t,e,n,r,i=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,r=(e=o[s]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\n")},Kd.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},Kd.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},Kd.prototype.isWall=function(){return 0===this.weight},Jd.prototype={push:function(t){this.content.push(t),this.sinkDown(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(t){this.sinkDown(this.content.indexOf(t))},sinkDown:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},bubbleUp:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,s=o-1,a=null;if(s<e){var u=this.content[s];(i=this.scoreFunction(u))<r&&(a=s)}if(o<e){var l=this.content[o];this.scoreFunction(l)<(null===a?r:i)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}};var Qd=function(t,e,n){if(!yu(n=n||{}))throw new Error("options is invalid");var r=n.resolution,i=n.minDistance,o=n.obstacles||eu([]);if(!t)throw new Error("start is required");if(!e)throw new Error("end is required");if(r&&!gu(r)||r<=0)throw new Error("options.resolution must be a number, greater than 0");if(i)throw new Error("options.minDistance is not yet implemented");var s=ju(t),a=ju(e);switch(t=Za(s),e=Za(a),qu(o)){case"FeatureCollection":if(0===o.features.length)return Qa([s,a]);break;case"Polygon":o=eu([Ya(Xu(o))]);break;default:throw new Error("invalid obstacles")}var u=o;u.features.push(t),u.features.push(e);var l=Du(sd(rh(Du(u)),1.15));r||(r=tc([l[0],l[1]],[l[2],l[1]],n)/100),u.features.pop(),u.features.pop();for(var c=l[0],h=l[1],f=l[2],p=l[3],d=r/tc([c,h],[f,h],n)*(f-c),g=r/tc([c,h],[c,p],n)*(p-h),y=f-c,v=p-h,_=Math.floor(y/d),m=Math.floor(v/g),x=(y-_*d)/2,w=[],b=[],E=[],S=[],C=1/0,P=1/0,I=p-(v-m*g)/2,M=0;I>=h;){for(var O=[],L=[],k=c+x,R=0;k<=f;){var T=Za([k,I]),A=$d(T,o);O.push(A?0:1),L.push(k+"|"+I);var N=tc(T,t);!A&&N<C&&(C=N,E={x:R,y:M});var F=tc(T,e);!A&&F<P&&(P=F,S={x:R,y:M}),k+=d,R++}b.push(O),w.push(L),I-=g,M++}var D=new Zd(b,{diagonal:!0}),j=D.grid[E.y][E.x],G=D.grid[S.y][S.x],B=Hd.search(D,j,G),z=[s];return B.forEach(function(t){var e=w[t.x][t.y].split("|");z.push([+e[0],+e[1]])}),z.push(a),Vc(Qa(z))};function tg(t){return function(){return t}}function eg(t){return t[0]}function ng(t){return t[1]}function rg(){this._=null}function ig(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function og(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function sg(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function ag(t){for(;t.L;)t=t.L;return t}rg.prototype={constructor:rg,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=ag(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(og(this,n),n=(t=n).U),n.C=!1,r.C=!0,sg(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(sg(this,n),n=(t=n).U),n.C=!1,r.C=!0,og(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,s=t.R;if(n=o?s?ag(s):o:s,i?i.L===t?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=s,s.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,og(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,sg(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,og(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,sg(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,og(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,sg(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var ug=rg;function lg(t,e,n,r){var i=[null,null],o=Tg.push(i)-1;return i.left=t,i.right=e,n&&hg(i,t,e,n),r&&hg(i,e,t,r),kg[t.index].halfedges.push(o),kg[e.index].halfedges.push(o),i}function cg(t,e,n){var r=[e,n];return r.left=t,r}function hg(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function fg(t,e,n,r,i){var o,s=t[0],a=t[1],u=s[0],l=s[1],c=0,h=1,f=a[0]-u,p=a[1]-l;if(o=e-u,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<h&&(h=o)}else if(f>0){if(o>h)return;o>c&&(c=o)}if(o=r-u,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<h&&(h=o)}if(o=n-l,p||!(o>0)){if(o/=p,p<0){if(o<c)return;o<h&&(h=o)}else if(p>0){if(o>h)return;o>c&&(c=o)}if(o=i-l,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o<c)return;o<h&&(h=o)}return!(c>0||h<1)||(c>0&&(t[0]=[u+c*f,l+c*p]),h<1&&(t[1]=[u+h*f,l+h*p]),!0)}}}}}function pg(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],l=t.left,c=t.right,h=l[0],f=l[1],p=c[0],d=c[1],g=(h+p)/2,y=(f+d)/2;if(d===f){if(g<e||g>=r)return;if(h>p){if(u){if(u[1]>=i)return}else u=[g,n];o=[g,i]}else{if(u){if(u[1]<n)return}else u=[g,i];o=[g,n]}}else if(a=y-(s=(h-p)/(d-f))*g,s<-1||s>1)if(h>p){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]<n)return}else u=[(i-a)/s,i];o=[(n-a)/s,n]}else if(f<d){if(u){if(u[0]>=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]<e)return}else u=[r,s*r+a];o=[e,s*e+a]}return t[0]=u,t[1]=o,!0}function dg(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function gg(t,e){return e[+(e.left!==t.site)]}function yg(t,e){return e[+(e.left===t.site)]}var vg,_g=[];function mg(){ig(this),this.x=this.y=this.arc=this.site=this.cy=null}function xg(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var s=i[0],a=i[1],u=r[0]-s,l=r[1]-a,c=o[0]-s,h=o[1]-a,f=2*(u*h-l*c);if(!(f>=-Ng)){var p=u*u+l*l,d=c*c+h*h,g=(h*p-l*d)/f,y=(u*d-c*p)/f,v=_g.pop()||new mg;v.arc=t,v.site=i,v.x=g+s,v.y=(v.cy=y+a)+Math.sqrt(g*g+y*y),t.circle=v;for(var _=null,m=Rg._;m;)if(v.y<m.y||v.y===m.y&&v.x<=m.x){if(!m.L){_=m.P;break}m=m.L}else{if(!m.R){_=m;break}m=m.R}Rg.insert(_,v),_||(vg=v)}}}}function wg(t){var e=t.circle;e&&(e.P||(vg=e.N),Rg.remove(e),_g.push(e),ig(e),t.circle=null)}var bg=[];function Eg(){ig(this),this.edge=this.site=this.circle=null}function Sg(t){var e=bg.pop()||new Eg;return e.site=t,e}function Cg(t){wg(t),Lg.remove(t),bg.push(t),ig(t)}function Pg(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];Cg(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)<Ag&&Math.abs(r-u.circle.cy)<Ag;)o=u.P,a.unshift(u),Cg(u),u=o;a.unshift(u),wg(u);for(var l=s;l.circle&&Math.abs(n-l.circle.x)<Ag&&Math.abs(r-l.circle.cy)<Ag;)s=l.N,a.push(l),Cg(l),l=s;a.push(l),wg(l);var c,h=a.length;for(c=1;c<h;++c)l=a[c],u=a[c-1],hg(l.edge,u.site,l.site,i);u=a[0],(l=a[h-1]).edge=lg(u.site,l.site,null,i),xg(u),xg(l)}function Ig(t){for(var e,n,r,i,o=t[0],s=t[1],a=Lg._;a;)if((r=Mg(a,s)-o)>Ag)a=a.L;else{if(!((i=o-Og(a,s))>Ag)){r>-Ag?(e=a.P,n=a):i>-Ag?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){kg[t.index]={site:t,halfedges:[]}}(t);var u=Sg(t);if(Lg.insert(e,u),e||n){if(e===n)return wg(e),n=Sg(e.site),Lg.insert(u,n),u.edge=n.edge=lg(e.site,u.site),xg(e),void xg(n);if(n){wg(e),wg(n);var l=e.site,c=l[0],h=l[1],f=t[0]-c,p=t[1]-h,d=n.site,g=d[0]-c,y=d[1]-h,v=2*(f*y-p*g),_=f*f+p*p,m=g*g+y*y,x=[(y*_-p*m)/v+c,(f*m-g*_)/v+h];hg(n.edge,l,d,x),u.edge=lg(l,t,null,x),n.edge=lg(t,d,null,x),xg(e),xg(n)}else u.edge=lg(e.site,u.site)}}function Mg(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],l=u-e;if(!l)return a;var c=a-r,h=1/o-1/l,f=c/l;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*l)-u+l/2+i-o/2)))/h+r:(r+a)/2}function Og(t,e){var n=t.N;if(n)return Mg(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var Lg,kg,Rg,Tg,Ag=1e-6,Ng=1e-12;function Fg(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function Dg(t,e){return e[1]-t[1]||e[0]-t[0]}function jg(t,e){var n,r,i,o=t.sort(Dg).pop();for(Tg=[],kg=new Array(t.length),Lg=new ug,Rg=new ug;;)if(i=vg,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===n&&o[1]===r||(Ig(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;Pg(i.arc)}if(function(){for(var t,e,n,r,i=0,o=kg.length;i<o;++i)if((t=kg[i])&&(r=(e=t.halfedges).length)){var s=new Array(r),a=new Array(r);for(n=0;n<r;++n)s[n]=n,a[n]=dg(t,Tg[e[n]]);for(s.sort(function(t,e){return a[e]-a[t]}),n=0;n<r;++n)a[n]=e[s[n]];for(n=0;n<r;++n)e[n]=a[n]}}(),e){var s=+e[0][0],a=+e[0][1],u=+e[1][0],l=+e[1][1];!function(t,e,n,r){for(var i,o=Tg.length;o--;)pg(i=Tg[o],t,e,n,r)&&fg(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>Ag||Math.abs(i[0][1]-i[1][1])>Ag)||delete Tg[o]}(s,a,u,l),function(t,e,n,r){var i,o,s,a,u,l,c,h,f,p,d,g,y=kg.length,v=!0;for(i=0;i<y;++i)if(o=kg[i]){for(s=o.site,a=(u=o.halfedges).length;a--;)Tg[u[a]]||u.splice(a,1);for(a=0,l=u.length;a<l;)d=(p=yg(o,Tg[u[a]]))[0],g=p[1],h=(c=gg(o,Tg[u[++a%l]]))[0],f=c[1],(Math.abs(d-h)>Ag||Math.abs(g-f)>Ag)&&(u.splice(a,0,Tg.push(cg(s,p,Math.abs(d-t)<Ag&&r-g>Ag?[t,Math.abs(h-t)<Ag?f:r]:Math.abs(g-r)<Ag&&n-d>Ag?[Math.abs(f-r)<Ag?h:n,r]:Math.abs(d-n)<Ag&&g-e>Ag?[n,Math.abs(h-n)<Ag?f:e]:Math.abs(g-e)<Ag&&d-t>Ag?[Math.abs(f-e)<Ag?h:t,e]:null))-1),++l);l&&(v=!1)}if(v){var _,m,x,w=1/0;for(i=0,v=null;i<y;++i)(o=kg[i])&&(x=(_=(s=o.site)[0]-t)*_+(m=s[1]-e)*m)<w&&(w=x,v=o);if(v){var b=[t,e],E=[t,r],S=[n,r],C=[n,e];v.halfedges.push(Tg.push(cg(s=v.site,b,E))-1,Tg.push(cg(s,E,S))-1,Tg.push(cg(s,S,C))-1,Tg.push(cg(s,C,b))-1)}}for(i=0;i<y;++i)(o=kg[i])&&(o.halfedges.length||delete kg[i])}(s,a,u,l)}this.edges=Tg,this.cells=kg,Lg=Rg=Tg=kg=null}function Gg(t){return(t=t.slice()).push(t[0]),Ja([t])}jg.prototype={constructor:jg,polygons:function(){var t=this.edges;return this.cells.map(function(e){var n=e.halfedges.map(function(n){return gg(e,t[n])});return n.data=e.site.data,n})},triangles:function(){var t=[],e=this.edges;return this.cells.forEach(function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a=n.site,u=-1,l=e[i[o-1]],c=l.left===a?l.right:l.left;++u<o;)s=c,c=(l=e[i[u]]).left===a?l.right:l.left,s&&c&&r<s.index&&r<c.index&&Fg(a,s,c)<0&&t.push([a.data,s.data,c.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})},find:function(t,e,n){for(var r,i,o=this,s=o._found||0,a=o.cells.length;!(i=o.cells[s]);)if(++s>=a)return null;var u=t-i.site[0],l=e-i.site[1],c=u*u+l*l;do{i=o.cells[r=s],s=null,i.halfedges.forEach(function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],l=e-a[1],h=u*u+l*l;h<c&&(c=h,s=a.index)}})}while(null!==s);return o._found=r,null==n||c<=n*n?i.site:null}};var Bg=function(t,e){if(!yu(e=e||{}))throw new Error("options is invalid");var n=e.bbox||[-180,-85,180,85];if(!t)throw new Error("points is required");if(!Array.isArray(n))throw new Error("bbox is invalid");return Uu(t,"Point","points"),eu(function(){var t=eg,e=ng,n=null;function r(r){return new jg(r.map(function(n,i){var o=[Math.round(t(n,i,r)/Ag)*Ag,Math.round(e(n,i,r)/Ag)*Ag];return o.index=i,o.data=n,o}),n)}return r.polygons=function(t){return r(t).polygons()},r.links=function(t){return r(t).links()},r.triangles=function(t){return r(t).triangles()},r.x=function(e){return arguments.length?(t="function"==typeof e?e:tg(+e),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:tg(+t),r):e},r.extent=function(t){return arguments.length?(n=null==t?null:[[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]],r):n&&[[n[0][0],n[0][1]],[n[1][0],n[1][1]]]},r.size=function(t){return arguments.length?(n=null==t?null:[[0,0],[+t[0],+t[1]]],r):n&&[n[1][0]-n[0][0],n[1][1]-n[0][1]]},r}().x(function(t){return t.geometry.coordinates[0]}).y(function(t){return t.geometry.coordinates[1]}).extent([[n[0],n[1]],[n[2],n[3]]]).polygons(t.features).map(Gg))};function zg(t){var e=t*Math.PI/180;return Math.tan(e)}var Vg=function(t,e,n,r){var i=(r=r||{}).steps||64,o=r.units||"kilometers",s=r.angle||0,a=r.pivot||t,u=r.properties||t.properties||{};if(!t)throw new Error("center is required");if(!e)throw new Error("xSemiAxis is required");if(!n)throw new Error("ySemiAxis is required");if(!yu(r))throw new Error("options must be an object");if(!gu(i))throw new Error("steps must be a number");if(!gu(s))throw new Error("angle must be a number");var l=ju(t);if("degrees"===o)var c=fu(s);else e=Vf(t,e,90,{units:o}),n=Vf(t,n,0,{units:o}),e=ju(e)[0]-l[0],n=ju(n)[1]-l[1];for(var h=[],f=0;f<i;f+=1){var p=-360*f/i,d=e*n/Math.sqrt(Math.pow(n,2)+Math.pow(e,2)*Math.pow(zg(p),2)),g=e*n/Math.sqrt(Math.pow(e,2)+Math.pow(n,2)/Math.pow(zg(p),2));if(p<-90&&p>=-270&&(d=-d),p<-180&&p>=-360&&(g=-g),"degrees"===o){var y=d*Math.cos(c)+g*Math.sin(c),v=g*Math.cos(c)-d*Math.sin(c);d=y,g=v}h.push([d+l[0],g+l[1]])}return h.push(h[0]),"degrees"===o?Ja([h],u):id(Ja([h],u),s,{pivot:a})};var Ug=function(t,e){void 0===e&&(e={});var n=0,r=0,i=0;return Pu(t,function(t,o,s){var a=e.weight?null==s?void 0:s[e.weight]:void 0;if(!gu(a=null==a?1:a))throw new Error("weight value must be a number for feature index "+o);(a=Number(a))>0&&mu(t,function(t){n+=t[0]*a,r+=t[1]*a,i+=a})}),Za([n/i,r/i],e.properties,e)};function Xg(t,e,n,r,i){var o=r.tolerance||.001,s=0,a=0,u=0,l=0;if(Eu(n,function(e){var n,r=null===(n=e.properties)||void 0===n?void 0:n.weight,i=null==r?1:r;if(!gu(i=Number(i)))throw new Error("weight value must be a number");if(i>0){l+=1;var o=i*tc(e,t);0===o&&(o=1);var c=i/o;s+=e.geometry.coordinates[0]*c,a+=e.geometry.coordinates[1]*c,u+=c}}),l<1)throw new Error("no features to measure");var c=s/u,h=a/u;return 1===l||0===i||Math.abs(c-e[0])<o&&Math.abs(h-e[1])<o?Za([c,h],{medianCandidates:r.medianCandidates}):(r.medianCandidates.push([c,h]),Xg([c,h],t,n,r,i-1))}var qg=function(t,e){if(void 0===e&&(e={}),!yu(e=e||{}))throw new Error("options is invalid");var n=e.counter||10;if(!gu(n))throw new Error("counter must be a number");var r=e.weight,i=Ug(t,{weight:e.weight}),o=eu([]);Eu(t,function(t){var e;o.features.push(hh(t,{properties:{weight:null===(e=t.properties)||void 0===e?void 0:e[r]}}))});var s={tolerance:e.tolerance,medianCandidates:[]};return Xg(i.geometry.coordinates,[0,0],o,s,n)};function Wg(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}}var Yg=function(t,e){if(!yu(e=e||{}))throw new Error("options is invalid");var n=e.steps||64,r=e.weight,i=e.properties||{};if(!gu(n))throw new Error("steps must be a number");if(!yu(i))throw new Error("properties must be a number");var o=Cu(t).length,s=Ug(t,{weight:r}),a=0,u=0,l=0;Eu(t,function(t){var e=t.properties[r]||1,n=Wg(Gu(t),Gu(s));a+=Math.pow(n.x,2)*e,u+=Math.pow(n.y,2)*e,l+=n.x*n.y*e});var c=a-u,h=Math.sqrt(Math.pow(c,2)+4*Math.pow(l,2)),f=2*l,p=Math.atan((c+h)/f),d=180*p/Math.PI,g=0,y=0,v=0;Eu(t,function(t){var e=t.properties[r]||1,n=Wg(Gu(t),Gu(s));g+=Math.pow(n.x*Math.cos(p)-n.y*Math.sin(p),2)*e,y+=Math.pow(n.x*Math.sin(p)+n.y*Math.cos(p),2)*e,v+=e});var _=Math.sqrt(2*g/v),m=Math.sqrt(2*y/v),x=Vg(s,_,m,{units:"degrees",angle:d,steps:n,properties:i}),w=Ql(t,eu([x])),b={meanCenterCoordinates:Gu(s),semiMajorAxis:_,semiMinorAxis:m,numberOfFeatures:o,angle:d,percentageWithinEllipse:100*Cu(w).length/o};return x.properties.standardDeviationalEllipse=b,x};var Hg=function(t,e,n,r){if(void 0===r&&(r={}),!yu(r))throw new Error("options is invalid");if(!t)throw new Error("startPoint is required");if(!e)throw new Error("midPoint is required");if(!n)throw new Error("endPoint is required");var i=t,o=e,s=n,a=cu(!0!==r.mercator?uh(i,o):zf(i,o)),u=cu(!0!==r.mercator?uh(s,o):zf(s,o)),l=Math.abs(a-u);return!0===r.explementary?360-l:l};function Zg(t,e){var n=0,r=0;mu(t,function(i,o,s,a,u){u>n&&(n=u,r=o,e.push([]));var l=o-r,c=t.coordinates[u][l+1],h=i[0],f=i[1],p=c[0],d=c[1];e[u].push([.75*h+.25*p,.75*f+.25*d]),e[u].push([.25*h+.75*p,.25*f+.75*d])},!0),e.forEach(function(t){t.push(t[0])})}function Kg(t,e){var n=0,r=0,i=0;mu(t,function(o,s,a,u,l){u>i&&(i=u,r=s,e.push([[]])),l>n&&(n=l,r=s,e[u].push([]));var c=s-r,h=t.coordinates[u][l][c+1],f=o[0],p=o[1],d=h[0],g=h[1];e[u][l].push([.75*f+.25*d,.75*p+.25*g]),e[u][l].push([.25*f+.75*d,.25*p+.75*g])},!0),e.forEach(function(t){t.forEach(function(t){t.push(t[0])})})}var Jg=function(t,e){var n=[],r=e.iterations||1;if(!t)throw new Error("inputPolys is required");return Pu(t,function(t,e,i){var o,s,a;switch(t.type){case"Polygon":o=[[]];for(var u=0;u<r;u++)a=[[]],s=t,u>0&&(s=Ja(o).geometry),Zg(s,a),o=a.slice(0);n.push(Ja(o,i));break;case"MultiPolygon":o=[[[]]];for(var l=0;l<r;l++)a=[[[]]],s=t,l>0&&(s=iu(o).geometry),Kg(s,a),o=a.slice(0);n.push(iu(o,i));break;default:throw new Error("geometry is invalid, must be Polygon or MultiPolygon")}}),eu(n)};function $g(t,e,n){void 0===n&&(n=2);var r=ju(t),i=ju(e),o=r[0]-i[0],s=r[1]-i[1];return 1===n?Math.abs(o)+Math.abs(s):Math.pow(Math.pow(o,n)+Math.pow(s,n),1/n)}function Qg(t,e){var n=(e=e||{}).threshold||1e4,r=e.p||2,i=e.binary||!1,o=e.alpha||-1,s=e.standardization||!1,a=[];Eu(t,function(t){a.push(hh(t))});for(var u=[],l=0;l<a.length;l++)u[l]=[];for(l=0;l<a.length;l++)for(var c=l;c<a.length;c++){l===c&&(u[l][c]=0);var h=$g(a[l],a[c],r);u[l][c]=h,u[c][l]=h}for(l=0;l<a.length;l++)for(c=0;c<a.length;c++){0!==(h=u[l][c])&&(u[l][c]=i?h<=n?1:0:h<=n?Math.pow(h,o):0)}if(s)for(l=0;l<a.length;l++){var f=u[l].reduce(function(t,e){return t+e},0);for(c=0;c<a.length;c++)u[l][c]=u[l][c]/f}return u}function ty(t,e){var n=e.inputField,r=e.threshold||1e5,i=e.p||2,o=e.binary||!1,s=Qg(t,{alpha:e.alpha||-1,binary:o,p:i,standardization:e.standardization||!0,threshold:r}),a=[];Eu(t,function(t){var e=t.properties||{};a.push(e[n])});for(var u=ey(a),l=function(t){for(var e=ey(t),n=0,r=0,i=t;r<i.length;r++){var o=i[r];n+=Math.pow(o-e,2)}return n/t.length}(a),c=0,h=0,f=0,p=0,d=s.length,g=0;g<d;g++){for(var y=0,v=0;v<d;v++)c+=s[g][v]*(a[g]-u)*(a[v]-u),h+=s[g][v],f+=Math.pow(s[g][v]+s[v][g],2),y+=s[g][v]+s[v][g];p+=Math.pow(y,2)}var _=c/h/l,m=-1/(d-1),x=(d*d*(f*=.5)-d*p+h*h*3)/((d-1)*(d+1)*(h*h))-m*m,w=Math.sqrt(x);return{expectedMoranIndex:m,moranIndex:_,stdNorm:w,zNorm:(_-m)/w}}function ey(t){for(var e=0,n=0,r=t;n<r.length;n++){e+=r[n]}return e/t.length}function ny(t,e){return void 0===e&&(e={}),iy(t,"mercator",e)}function ry(t,e){return void 0===e&&(e={}),iy(t,"wgs84",e)}function iy(t,e,n){void 0===n&&(n={});var r=(n=n||{}).mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&gu(t[0])?t="mercator"===e?oy(t):sy(t):(!0!==r&&(t=lc(t)),mu(t,function(t){var n="mercator"===e?oy(t):sy(t);t[0]=n[0],t[1]=n[1]})),t}function oy(t){var e,n=Math.PI/180,r=6378137,i=20037508.342789244,o=[r*(Math.abs(t[0])<=180?t[0]:t[0]-360*((e=t[0])<0?-1:e>0?1:0))*n,r*Math.log(Math.tan(.25*Math.PI+.5*t[1]*n))];return o[0]>i&&(o[0]=i),o[0]<-i&&(o[0]=-i),o[1]>i&&(o[1]=i),o[1]<-i&&(o[1]=-i),o}function sy(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]}var ay=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r};function uy(t){return Array.isArray(t)?py(t):t&&t.bbox?py(t.bbox):[360*fy(),180*fy()]}function ly(t,e){void 0===e&&(e={}),null==t&&(t=1);for(var n=[],r=0;r<t;r++)n.push(Za(uy(e.bbox)));return eu(n)}function cy(t,e){void 0===e&&(e={}),null==t&&(t=1),gu(e.num_vertices)&&void 0!==e.num_vertices||(e.num_vertices=10),gu(e.max_radial_length)&&void 0!==e.max_radial_length||(e.max_radial_length=10);for(var n=[],r=function(t){var r,i=[],o=ay(Array(e.num_vertices+1)).map(Math.random);o.forEach(function(t,e,n){n[e]=e>0?t+n[e-1]:t}),o.forEach(function(t){t=2*t*Math.PI/o[o.length-1];var n=Math.random();i.push([n*(e.max_radial_length||10)*Math.sin(t),n*(e.max_radial_length||10)*Math.cos(t)])}),i[i.length-1]=i[0],i=i.map((r=uy(e.bbox),function(t){return[t[0]+r[0],t[1]+r[1]]})),n.push(Ja([i]))},i=0;i<t;i++)r();return eu(n)}function hy(t,e){if(void 0===e&&(e={}),!yu(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,i=e.max_length,o=e.max_rotation;null==t&&(t=1),(!gu(r)||void 0===r||r<2)&&(r=10),gu(i)&&void 0!==i||(i=1e-4),gu(o)&&void 0!==o||(o=Math.PI/8);for(var s=[],a=0;a<t;a++){for(var u=[uy(n)],l=0;l<r-1;l++){var c=(0===l?2*Math.random()*Math.PI:Math.tan((u[l][1]-u[l-1][1])/(u[l][0]-u[l-1][0])))+(Math.random()-.5)*o*2,h=Math.random()*i;u.push([u[l][0]+h*Math.cos(c),u[l][1]+h*Math.sin(c)])}s.push(Qa(u))}return eu(s)}function fy(){return Math.random()-.5}function py(t){return[Math.random()*(t[2]-t[0])+t[0],Math.random()*(t[3]-t[1])+t[1]]}function dy(t,e){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(null==e)throw new Error("filter is required");var n=[];return Eu(t,function(t){_y(t.properties,e)&&n.push(t)}),eu(n)}function gy(t,e,n){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(null==e)throw new Error("property is required");for(var r=vy(t,e),i=Object.keys(r),o=0;o<i.length;o++){for(var s=i[o],a=r[s],u=[],l=0;l<a.length;l++)u.push(t.features[a[l]]);n(eu(u),s,o)}}function yy(t,e,n,r){var i=r;return gy(t,e,function(t,e,o){i=0===o&&void 0===r?t:n(i,t,e,o)}),i}function vy(t,e){var n={};return Eu(t,function(t,r){var i=t.properties||{};if(Object.prototype.hasOwnProperty.call(i,String(e))){var o=i[e];Object.prototype.hasOwnProperty.call(n,o)?n[o].push(r):n[o]=[r]}}),n}function _y(t,e){if(void 0===t)return!1;var n=typeof e;if("number"===n||"string"===n)return Object.prototype.hasOwnProperty.call(t,e);if(Array.isArray(e)){for(var r=0;r<e.length;r++)if(!_y(t,e[r]))return!1;return!0}return my(t,e)}function my(t,e){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r];if(t[i]!==e[i])return!1}return!0}function xy(t,e){if(!e)return{};if(!e.length)return{};for(var n={},r=0;r<e.length;r++){var i=e[r];Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}var wy=n(8058);var by=function(t,e){var n=Xu(t),r=Xu(e),i=t.properties||{},o=wy.difference(n.coordinates,r.coordinates);return 0===o.length?null:1===o.length?Ja(o[0],i):iu(o,i)},Ey=n(9807);function Sy(){return new Cy}function Cy(){this.reset()}Cy.prototype={constructor:Cy,reset:function(){this.s=this.t=0},add:function(t){Iy(Py,t,this.t),Iy(this,Py.s,this.s),this.s?this.t+=Py.t:this.s=Py.t},valueOf:function(){return this.s}};var Py=new Cy;function Iy(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var My=1e-6,Oy=Math.PI,Ly=Oy/2,ky=Oy/4,Ry=2*Oy,Ty=180/Oy,Ay=Oy/180,Ny=Math.abs,Fy=Math.atan,Dy=Math.atan2,jy=Math.cos,Gy=(Math.ceil,Math.exp),By=(Math.floor,Math.log),zy=(Math.pow,Math.sin),Vy=(Math.sign,Math.sqrt),Uy=Math.tan;function Xy(t){return t>1?0:t<-1?Oy:Math.acos(t)}function qy(t){return t>1?Ly:t<-1?-Ly:Math.asin(t)}Sy(),Sy();function Wy(t){return[Dy(t[1],t[0]),qy(t[2])]}function Yy(t){var e=t[0],n=t[1],r=jy(n);return[r*jy(e),r*zy(e),zy(n)]}function Hy(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Zy(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ky(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Jy(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function $y(t){var e=Vy(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}Sy();function Qy(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function tv(t,e){return[t>Oy?t-Ry:t<-Oy?t+Ry:t,e]}function ev(t,e,n){return(t%=Ry)?e||n?Qy(rv(t),iv(e,n)):rv(t):e||n?iv(e,n):tv}function nv(t){return function(e,n){return[(e+=t)>Oy?e-Ry:e<-Oy?e+Ry:e,n]}}function rv(t){var e=nv(t);return e.invert=nv(-t),e}function iv(t,e){var n=jy(t),r=zy(t),i=jy(e),o=zy(e);function s(t,e){var s=jy(e),a=jy(t)*s,u=zy(t)*s,l=zy(e),c=l*n+a*r;return[Dy(u*i-c*o,a*n-l*r),qy(c*i+u*o)]}return s.invert=function(t,e){var s=jy(e),a=jy(t)*s,u=zy(t)*s,l=zy(e),c=l*i-u*o;return[Dy(u*i+l*o,a*n+c*r),qy(c*n-a*r)]},s}function ov(t,e,n,r,i,o){if(n){var s=jy(e),a=zy(e),u=r*n;null==i?(i=e+r*Ry,o=e-u/2):(i=sv(s,i),o=sv(s,o),(r>0?i<o:i>o)&&(i+=r*Ry));for(var l,c=i;r>0?c>o:c<o;c-=u)l=Wy([s,-a*jy(c),-a*zy(c)]),t.point(l[0],l[1])}}function sv(t,e){(e=Yy(e))[0]-=t,$y(e);var n=Xy(-e[1]);return((-e[2]<0?-n:n)+Ry-My)%Ry}function av(){}function uv(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:av,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function lv(t,e){return Ny(t[0]-e[0])<My&&Ny(t[1]-e[1])<My}function cv(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function hv(t,e,n,r,i){var o,s,a=[],u=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(lv(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else a.push(n=new cv(r,t,null,!0)),u.push(n.o=new cv(r,null,n,!1)),a.push(n=new cv(s,t,null,!1)),u.push(n.o=new cv(s,null,n,!0))}}),a.length){for(u.sort(e),fv(a),fv(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var l,c,h=a[0];;){for(var f=h,p=!0;f.v;)if((f=f.n)===h)return;l=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(o=0,s=l.length;o<s;++o)i.point((c=l[o])[0],c[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(p)for(l=f.p.z,o=l.length-1;o>=0;--o)i.point((c=l[o])[0],c[1]);else r(f.x,f.p.x,-1,i);f=f.p}l=(f=f.o).z,p=!p}while(!f.v);i.lineEnd()}}}function fv(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function pv(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}tv.invert=tv;1===(dv=pv).length&&(gv=dv,dv=function(t,e){return pv(gv(t),e)});var dv,gv,yv=Array.prototype;yv.slice,yv.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);function vv(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}var _v=1e9,mv=-_v;function xv(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,l){var c=0,h=0;if(null==i||(c=s(i,a))!==(h=s(o,a))||u(i,o)<0^a>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+a+4)%4)!==h);else l.point(o[0],o[1])}function s(r,i){return Ny(r[0]-t)<My?i>0?0:3:Ny(r[0]-n)<My?i>0?2:1:Ny(r[1]-e)<My?i>0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var u,l,c,h,f,p,d,g,y,v,_,m=s,x=uv(),w={point:b,lineStart:function(){w.point=E,l&&l.push(c=[]);v=!0,y=!1,d=g=NaN},lineEnd:function(){u&&(E(h,f),p&&y&&x.rejoin(),u.push(x.result()));w.point=b,y&&m.lineEnd()},polygonStart:function(){m=x,u=[],l=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,s,a=l[n],u=1,c=a.length,h=a[0],f=h[0],p=h[1];u<c;++u)o=f,s=p,f=(h=a[u])[0],p=h[1],s<=r?p>r&&(f-o)*(r-s)>(p-s)*(t-o)&&++e:p<=r&&(f-o)*(r-s)<(p-s)*(t-o)&&--e;return e}(),n=_&&e,i=(u=vv(u)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&hv(u,a,e,o,s),s.polygonEnd());m=s,u=l=c=null}};function b(t,e){i(t,e)&&m.point(t,e)}function E(o,s){var a=i(o,s);if(l&&c.push([o,s]),v)h=o,f=s,p=a,v=!1,a&&(m.lineStart(),m.point(o,s));else if(a&&y)m.point(o,s);else{var u=[d=Math.max(mv,Math.min(_v,d)),g=Math.max(mv,Math.min(_v,g))],x=[o=Math.max(mv,Math.min(_v,o)),s=Math.max(mv,Math.min(_v,s))];!function(t,e,n,r,i,o){var s,a=t[0],u=t[1],l=0,c=1,h=e[0]-a,f=e[1]-u;if(s=n-a,h||!(s>0)){if(s/=h,h<0){if(s<l)return;s<c&&(c=s)}else if(h>0){if(s>c)return;s>l&&(l=s)}if(s=i-a,h||!(s<0)){if(s/=h,h<0){if(s>c)return;s>l&&(l=s)}else if(h>0){if(s<l)return;s<c&&(c=s)}if(s=r-u,f||!(s>0)){if(s/=f,f<0){if(s<l)return;s<c&&(c=s)}else if(f>0){if(s>c)return;s>l&&(l=s)}if(s=o-u,f||!(s<0)){if(s/=f,f<0){if(s>c)return;s>l&&(l=s)}else if(f>0){if(s<l)return;s<c&&(c=s)}return l>0&&(t[0]=a+l*h,t[1]=u+l*f),c<1&&(e[0]=a+c*h,e[1]=u+c*f),!0}}}}}(u,x,t,e,n,r)?a&&(m.lineStart(),m.point(o,s),_=!1):(y||(m.lineStart(),m.point(u[0],u[1])),m.point(x[0],x[1]),a||m.lineEnd(),_=!1)}d=o,g=s,y=a}return w}}var wv=Sy();Sy();Sy(),Sy();var bv=1/0,Ev=bv,Sv=-bv,Cv=Sv,Pv={point:function(t,e){t<bv&&(bv=t);t>Sv&&(Sv=t);e<Ev&&(Ev=e);e>Cv&&(Cv=e)},lineStart:av,lineEnd:av,polygonStart:av,polygonEnd:av,result:function(){var t=[[bv,Ev],[Sv,Cv]];return Sv=Cv=-(Ev=bv=1/0),t}};var Iv=Pv;Sy();function Mv(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ov(t,e,n,r){return function(i,o){var s,a,u,l=e(o),c=i.invert(r[0],r[1]),h=uv(),f=e(h),p=!1,d={point:g,lineStart:v,lineEnd:_,polygonStart:function(){d.point=m,d.lineStart=x,d.lineEnd=w,a=[],s=[]},polygonEnd:function(){d.point=g,d.lineStart=v,d.lineEnd=_,a=vv(a);var t=function(t,e){var n=e[0],r=e[1],i=[zy(n),-jy(n),0],o=0,s=0;wv.reset();for(var a=0,u=t.length;a<u;++a)if(c=(l=t[a]).length)for(var l,c,h=l[c-1],f=h[0],p=h[1]/2+ky,d=zy(p),g=jy(p),y=0;y<c;++y,f=_,d=x,g=w,h=v){var v=l[y],_=v[0],m=v[1]/2+ky,x=zy(m),w=jy(m),b=_-f,E=b>=0?1:-1,S=E*b,C=S>Oy,P=d*x;if(wv.add(Dy(P*E*zy(S),g*w+P*jy(S))),o+=C?b+E*Ry:b,C^f>=n^_>=n){var I=Zy(Yy(h),Yy(v));$y(I);var M=Zy(i,I);$y(M);var O=(C^b>=0?-1:1)*qy(M[2]);(r>O||r===O&&(I[0]||I[1]))&&(s+=C^b>=0?1:-1)}}return(o<-1e-6||o<My&&wv<-1e-6)^1&s}(s,c);a.length?(p||(o.polygonStart(),p=!0),hv(a,kv,t,n,o)):t&&(p||(o.polygonStart(),p=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),p&&(o.polygonEnd(),p=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function g(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function y(t,e){var n=i(t,e);l.point(n[0],n[1])}function v(){d.point=y,l.lineStart()}function _(){d.point=g,l.lineEnd()}function m(t,e){u.push([t,e]);var n=i(t,e);f.point(n[0],n[1])}function x(){f.lineStart(),u=[]}function w(){m(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),l=h.result(),c=l.length;if(u.pop(),s.push(u),u=null,c)if(1&i){if((e=(n=l[0]).length-1)>0){for(p||(o.polygonStart(),p=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else c>1&&2&i&&l.push(l.pop().concat(l.shift())),a.push(l.filter(Lv))}return d}}function Lv(t){return t.length>1}function kv(t,e){return((t=t.x)[0]<0?t[1]-Ly-My:Ly-t[1])-((e=e.x)[0]<0?e[1]-Ly-My:Ly-e[1])}Mv(4.5);var Rv=Ov(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Oy:-Oy,u=Ny(o-n);Ny(u-Oy)<My?(t.point(n,r=(r+s)/2>0?Ly:-Ly),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=Oy&&(Ny(n-i)<My&&(n-=i*My),Ny(o-a)<My&&(o-=a*My),r=function(t,e,n,r){var i,o,s=zy(t-n);return Ny(s)>My?Fy((zy(e)*(o=jy(r))*zy(n)-zy(r)*(i=jy(e))*zy(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*Ly,r.point(-Oy,i),r.point(0,i),r.point(Oy,i),r.point(Oy,0),r.point(Oy,-i),r.point(0,-i),r.point(-Oy,-i),r.point(-Oy,0),r.point(-Oy,i);else if(Ny(t[0]-e[0])>My){var o=t[0]<e[0]?Oy:-Oy;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])},[-Oy,-Ly]);function Tv(t){return t}function Av(t){return function(e){var n=new Nv;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Nv(){}function Fv(t,e){t&&jv.hasOwnProperty(t.type)&&jv[t.type](t,e)}Nv.prototype={constructor:Nv,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Dv={Feature:function(t,e){Fv(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Fv(n[r].geometry,e)}},jv={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Gv(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Gv(n[r],e,0)},Polygon:function(t,e){Bv(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Bv(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Fv(n[r],e)}};function Gv(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function Bv(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Gv(t[n],e,1);e.polygonEnd()}function zv(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),function(t,e){t&&Dv.hasOwnProperty(t.type)?Dv[t.type](t,e):Fv(t,e)}(n,t.stream(Iv));var s=Iv.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,l=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,l])}var Vv=jy(30*Ay);function Uv(t,e){return+e?function(t,e){function n(r,i,o,s,a,u,l,c,h,f,p,d,g,y){var v=l-r,_=c-i,m=v*v+_*_;if(m>4*e&&g--){var x=s+f,w=a+p,b=u+d,E=Vy(x*x+w*w+b*b),S=qy(b/=E),C=Ny(Ny(b)-1)<My||Ny(o-h)<My?(o+h)/2:Dy(w,x),P=t(C,S),I=P[0],M=P[1],O=I-r,L=M-i,k=_*O-v*L;(k*k/m>e||Ny((v*O+_*L)/m-.5)>.3||s*f+a*p+u*d<Vv)&&(n(r,i,o,s,a,u,I,M,C,x/=E,w/=E,b,g,y),y.point(I,M),n(I,M,C,x,w,b,l,c,h,f,p,d,g,y))}}return function(e){var r,i,o,s,a,u,l,c,h,f,p,d,g={point:y,lineStart:v,lineEnd:m,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=v}};function y(n,r){n=t(n,r),e.point(n[0],n[1])}function v(){c=NaN,g.point=_,e.lineStart()}function _(r,i){var o=Yy([r,i]),s=t(r,i);n(c,h,l,f,p,d,c=s[0],h=s[1],l=r,f=o[0],p=o[1],d=o[2],16,e),e.point(c,h)}function m(){g.point=y,e.lineEnd()}function x(){v(),g.point=w,g.lineEnd=b}function w(t,e){_(r=t,e),i=c,o=h,s=f,a=p,u=d,g.point=_}function b(){n(c,h,l,f,p,d,i,o,r,s,a,u,16,e),g.lineEnd=m,m()}return g}}(t,e):function(t){return Av({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Xv=Av({point:function(t,e){this.stream.point(t*Ay,e*Ay)}});function qv(t){return function(t){var e,n,r,i,o,s,a,u,l,c,h=150,f=480,p=250,d=0,g=0,y=0,v=0,_=0,m=null,x=Rv,w=null,b=Tv,E=.5,S=Uv(I,E);function C(t){return[(t=o(t[0]*Ay,t[1]*Ay))[0]*h+n,r-t[1]*h]}function P(t){return(t=o.invert((t[0]-n)/h,(r-t[1])/h))&&[t[0]*Ty,t[1]*Ty]}function I(t,i){return[(t=e(t,i))[0]*h+n,r-t[1]*h]}function M(){o=Qy(i=ev(y,v,_),e);var t=e(d,g);return n=f-t[0]*h,r=p+t[1]*h,O()}function O(){return l=c=null,C}return C.stream=function(t){return l&&c===t?l:l=Xv(x(i,S(b(c=t))))},C.clipAngle=function(t){return arguments.length?(x=+t?function(t,e){var n=jy(t),r=n>0,i=Ny(n)>My;function o(t,e){return jy(t)*jy(e)>n}function s(t,e,r){var i=[1,0,0],o=Zy(Yy(t),Yy(e)),s=Hy(o,o),a=o[0],u=s-a*a;if(!u)return!r&&t;var l=n*s/u,c=-n*a/u,h=Zy(i,o),f=Jy(i,l);Ky(f,Jy(o,c));var p=h,d=Hy(f,p),g=Hy(p,p),y=d*d-g*(Hy(f,f)-1);if(!(y<0)){var v=Vy(y),_=Jy(p,(-d-v)/g);if(Ky(_,f),_=Wy(_),!r)return _;var m,x=t[0],w=e[0],b=t[1],E=e[1];w<x&&(m=x,x=w,w=m);var S=w-x,C=Ny(S-Oy)<My;if(!C&&E<b&&(m=b,b=E,E=m),C||S<My?C?b+E>0^_[1]<(Ny(_[0]-x)<My?b:E):b<=_[1]&&_[1]<=E:S>Oy^(x<=_[0]&&_[0]<=w)){var P=Jy(p,(-d+v)/g);return Ky(P,f),[_,Wy(P)]}}}function a(e,n){var i=r?t:Oy-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Ov(o,function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,f){var p,d=[h,f],g=o(h,f),y=r?g?0:a(h,f):g?a(h+(h<0?Oy:-Oy),f):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(p=s(e,d))||lv(e,p)||lv(d,p))&&(d[0]+=My,d[1]+=My,g=o(d[0],d[1])),g!==u)c=0,g?(t.lineStart(),p=s(d,e),t.point(p[0],p[1])):(p=s(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(i&&e&&r^g){var v;y&n||!(v=s(d,e,!0))||(c=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&lv(e,d)||t.point(d[0],d[1]),e=d,u=g,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}},function(n,r,i,o){ov(o,t,e,i,n,r)},r?[0,-t]:[-Oy,t-Oy])}(m=t*Ay,6*Ay):(m=null,Rv),O()):m*Ty},C.clipExtent=function(t){return arguments.length?(b=null==t?(w=s=a=u=null,Tv):xv(w=+t[0][0],s=+t[0][1],a=+t[1][0],u=+t[1][1]),O()):null==w?null:[[w,s],[a,u]]},C.scale=function(t){return arguments.length?(h=+t,M()):h},C.translate=function(t){return arguments.length?(f=+t[0],p=+t[1],M()):[f,p]},C.center=function(t){return arguments.length?(d=t[0]%360*Ay,g=t[1]%360*Ay,M()):[d*Ty,g*Ty]},C.rotate=function(t){return arguments.length?(y=t[0]%360*Ay,v=t[1]%360*Ay,_=t.length>2?t[2]%360*Ay:0,M()):[y*Ty,v*Ty,_*Ty]},C.precision=function(t){return arguments.length?(S=Uv(I,E=t*t),O()):Vy(E)},C.fitExtent=function(t,e){return zv(C,t,e)},C.fitSize=function(t,e){return function(t,e,n){return zv(t,[[0,0],e],n)}(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&P,M()}}(function(){return t})()}function Wv(t){return function(e,n){var r=jy(e),i=jy(n),o=t(r*i);return[o*i*zy(e),o*zy(n)]}}function Yv(t){return function(e,n){var r=Vy(e*e+n*n),i=t(r),o=zy(i),s=jy(i);return[Dy(e*o,r*s),qy(r&&n*o/r)]}}var Hv=Wv(function(t){return Vy(2/(1+t))});Hv.invert=Yv(function(t){return 2*qy(t/2)});var Zv=Wv(function(t){return(t=Xy(t))&&t/zy(t)});function Kv(){return qv(Zv).scale(79.4188).clipAngle(179.999)}function Jv(t,e){return[t,By(Uy((Ly+e)/2))]}function $v(t,e){return[t,e]}function Qv(t,e){var n=jy(e),r=jy(t)*n;return[n*zy(t)/r,zy(e)/r]}function t_(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function e_(t,e){return[jy(e)*zy(t),zy(e)]}function n_(t,e){var n=jy(e),r=1+jy(t)*n;return[n*zy(t)/r,zy(e)/r]}function r_(t,e){return[By(Uy((Ly+e)/2)),-t]}function i_(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return Pu(t,function(t){var i=i_(t,e,n,r);i&&s.push(i)}),eu(s)}var a=function(t){var e=ch(t).geometry.coordinates,n=[-e[0],-e[1]];return Kv().rotate(n).scale(Ua)}(o),u={type:o.type,coordinates:s_(o.coordinates,a)},l=(new Ey.GeoJSONReader).read(u),c=au(uu(e,n),"meters"),h=Ey.BufferOp.bufferOp(l,c,r);if(!o_((h=(new Ey.GeoJSONWriter).write(h)).coordinates))return Ya({type:h.type,coordinates:a_(h.coordinates,a)},i)}function o_(t){return Array.isArray(t[0])?o_(t[0]):isNaN(t[0])}function s_(t,e){return"object"!=typeof t[0]?e(t):t.map(function(t){return s_(t,e)})}function a_(t,e){return"object"!=typeof t[0]?e.invert(t):t.map(function(t){return a_(t,e)})}Zv.invert=Yv(function(t){return t}),Jv.invert=function(t,e){return[t,2*Fy(Gy(e))-Ly]},$v.invert=$v,Qv.invert=Yv(Fy),t_.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,s=o*o;r-=n=(r*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-e)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while(Ny(n)>My&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},e_.invert=Yv(qy),n_.invert=Yv(function(t){return 2*Fy(t)}),r_.invert=function(t,e){return[-e,2*Fy(Gy(t))-Ly]};var u_=function(t,e,n){var r=(n=n||{}).units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return Pu(t,function(t){var n=i_(t,e,r,i);n&&o.push(n)}),eu(o);case"FeatureCollection":return Eu(t,function(t){var n=i_(t,e,r,i);n&&Eu(n,function(t){t&&o.push(t)})}),eu(o)}return i_(t,e,r,i)};var l_=function(t,e,n){void 0===n&&(n={});var r=Xu(t),i=Xu(e),o=wy.union(r.coordinates,i.coordinates);return 0===o.length?null:1===o.length?Ja(o[0],n.properties):iu(o,n.properties)};function c_(t,e,n){void 0===n&&(n={});var r=Xu(t),i=Xu(e),o=wy.intersection(r.coordinates,i.coordinates);return 0===o.length?null:1===o.length?Ja(o[0],n.properties):iu(o,n.properties)}var h_=function(t,e){if(!yu(e=e||{}))throw new Error("options is invalid");var n=e.propertyName;Uu(t,"Polygon","dissolve");var r=[];if(!e.propertyName)return Jh(iu(wy.union.apply(null,t.features.map(function(t){return t.geometry.coordinates}))));var i={};Eu(t,function(t){Object.prototype.hasOwnProperty.call(i,t.properties[n])||(i[t.properties[n]]=[]),i[t.properties[n]].push(t)});for(var o=Object.keys(i),s=0;s<o.length;s++){var a=iu(wy.union.apply(null,i[o[s]].map(function(t){return t.geometry.coordinates})));a.properties[n]=o[s],r.push(a)}return Jh(eu(r))};function f_(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=t[0]+e*i[a],l=t[1]+n*o[a];s.push([u,l])}return s.push(s[0].slice()),Ja([s],r)}function p_(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=[];u.push(t),u.push([t[0]+e*i[a],t[1]+n*o[a]]),u.push([t[0]+e*i[(a+1)%6],t[1]+n*o[(a+1)%6]]),u.push(t),s.push(Ja([u],r))}return s}var d_=function(t,e,n){void 0===n&&(n={});var r=JSON.stringify(n.properties||{}),i=t[0],o=t[1],s=t[2],a=t[3],u=(o+a)/2,l=(i+s)/2,c=2*e/tc([i,u],[s,u],n)*(s-i),h=2*e/tc([l,o],[l,a],n)*(a-o),f=c/2,p=2*f,d=Math.sqrt(3)/2*h,g=s-i,y=a-o,v=3/4*p,_=d,m=(g-p)/(p-f/2),x=Math.floor(m),w=(x*v-f/2-g)/2-f/2+v/2,b=Math.floor((y-d)/d),E=(y-b*d)/2,S=b*d-y>d/2;S&&(E-=d/4);for(var C=[],P=[],I=0;I<6;I++){var M=2*Math.PI/6*I;C.push(Math.cos(M)),P.push(Math.sin(M))}for(var O=[],L=0;L<=x;L++)for(var k=0;k<=b;k++){var R=L%2==1;if((0!==k||!R)&&(0!==k||!S)){var T=L*v+i-w,A=k*_+o+E;if(R&&(A-=d/2),!0===n.triangles)p_([T,A],c/2,h/2,JSON.parse(r),C,P).forEach(function(t){n.mask?c_(n.mask,t)&&O.push(t):O.push(t)});else{var N=f_([T,A],c/2,h/2,JSON.parse(r),C,P);n.mask?c_(n.mask,N)&&O.push(N):O.push(N)}}}return eu(O)};function g_(t){return iu(t)}var y_=function(t,e){var n,r,i=function(t){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],n=t&&t.geometry.coordinates||e;return Ja(n)}(e),o=null;return"FeatureCollection"===t.type?(r=2===(n=t).features.length?wy.union(n.features[0].geometry.coordinates,n.features[1].geometry.coordinates):wy.union.apply(wy,n.features.map(function(t){return t.geometry.coordinates})),o=g_(r)):o=g_(wy.union(t.geometry.coordinates)),o.geometry.coordinates.forEach(function(t){i.geometry.coordinates.push(t[0])}),i};var v_=function(t,e,n,r){void 0===r&&(r={});for(var i=[],o=t[0],s=t[1],a=t[2],u=t[3],l=e/tc([o,s],[a,s],r)*(a-o),c=n/tc([o,s],[o,u],r)*(u-s),h=a-o,f=u-s,p=Math.floor(h/l),d=Math.floor(f/c),g=(f-d*c)/2,y=o+(h-p*l)/2,v=0;v<p;v++){for(var _=s+g,m=0;m<d;m++){var x=Ja([[[y,_],[y,_+c],[y+l,_+c],[y+l,_],[y,_]]],r.properties);r.mask?Gd(r.mask,x)&&i.push(x):i.push(x),_+=c}y+=l}return eu(i)};function __(t,e,n){return void 0===n&&(n={}),v_(t,e,e,n)}var m_=function(t,e,n){void 0===n&&(n={});for(var r=[],i=e/tc([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),o=e/tc([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),s=0,a=t[0];a<=t[2];){for(var u=0,l=t[1];l<=t[3];){var c=null,h=null;s%2==0&&u%2==0?(c=Ja([[[a,l],[a,l+o],[a+i,l],[a,l]]],n.properties),h=Ja([[[a,l+o],[a+i,l+o],[a+i,l],[a,l+o]]],n.properties)):s%2==0&&u%2==1?(c=Ja([[[a,l],[a+i,l+o],[a+i,l],[a,l]]],n.properties),h=Ja([[[a,l],[a,l+o],[a+i,l+o],[a,l]]],n.properties)):u%2==0&&s%2==1?(c=Ja([[[a,l],[a,l+o],[a+i,l+o],[a,l]]],n.properties),h=Ja([[[a,l],[a+i,l+o],[a+i,l],[a,l]]],n.properties)):u%2==1&&s%2==1&&(c=Ja([[[a,l],[a,l+o],[a+i,l],[a,l]]],n.properties),h=Ja([[[a,l+o],[a+i,l+o],[a+i,l],[a,l+o]]],n.properties)),n.mask?(c_(n.mask,c)&&r.push(c),c_(n.mask,h)&&r.push(h)):(r.push(c),r.push(h)),l+=o,u++}s++,a+=i}return eu(r)};var x_=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.gridType,i=n.property,o=n.weight;if(!t)throw new Error("points is required");if(Uu(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==o&&"number"!=typeof o)throw new Error("weight must be a number");i=i||"elevation",r=r||"square",o=o||1;var s,a=Du(t);switch(r){case"point":case"points":s=Zh(a,e,n);break;case"square":case"squares":s=__(a,e,n);break;case"hex":case"hexes":s=d_(a,e,n);break;case"triangle":case"triangles":s=m_(a,e,n);break;default:throw new Error("invalid gridType")}var u=[];return Eu(s,function(e){var s=0,a=0;Eu(t,function(t){var u,l="point"===r?e:hh(e),c=tc(l,t,n);if(void 0!==i&&(u=t.properties[i]),void 0===u&&(u=t.geometry.coordinates[2]),void 0===u)throw new Error("zValue is missing");0===c&&(s=u);var h=1/Math.pow(c,o);a+=h,s+=h*u});var l=lc(e);l.properties[i]=s/a,u.push(l)}),eu(u)},w_=n(7263),b_=function(){function t(t){this.rbush_=new w_(t),this.items_={}}return t.prototype.insert=function(t,e){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[x(e)]=n},t.prototype.load=function(t,e){for(var n=new Array(e.length),r=0,i=e.length;r<i;r++){var o=t[r],s=e[r],a={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};n[r]=a,this.items_[x(s)]=a}this.rbush_.load(n)},t.prototype.remove=function(t){var e=x(t),n=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(n)},t.prototype.update=function(t,e){var n=this.items_[x(e)];ot([n.minX,n.minY,n.maxX,n.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map(function(t){return t.value})},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(t){return t.value})},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var n,r=0,i=t.length;r<i;r++)if(n=e(t[r]))return n;return n},t.prototype.isEmpty=function(){return re(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return et(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),E_=b_,S_="addfeature",C_="changefeature",P_="clear",I_="removefeature",M_="featuresloadstart",O_="featuresloadend",L_="featuresloaderror",k_=0,R_=1,T_=2,A_=3,N_=4,F_=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=as(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return _()},t.prototype.getImage=function(t){return _()},t.prototype.getHitDetectionImage=function(){return _()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return _()},t.prototype.getImageSize=function(){return _()},t.prototype.getOrigin=function(){return _()},t.prototype.getSize=function(){return _()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=as(t)},t.prototype.listenImageChange=function(t){_()},t.prototype.load=function(){_()},t.prototype.unlistenImageChange=function(t){_()},t}(),D_=F_;function j_(t){return Array.isArray(t)?Yt(t):t}var G_=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)}}(),B_=function(t){function e(e){var n=this,r=void 0!==e.rotateWithView&&e.rotateWithView;return(n=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0],declutterMode:e.declutterMode})||this).canvas_=void 0,n.hitDetectionCanvas_=null,n.fill_=void 0!==e.fill?e.fill:null,n.origin_=[0,0],n.points_=e.points,n.radius_=void 0!==e.radius?e.radius:e.radius1,n.radius2_=e.radius2,n.angle_=void 0!==e.angle?e.angle:0,n.stroke_=void 0!==e.stroke?e.stroke:null,n.size_=null,n.renderOptions_=null,n.render(),n}return G_(e,t),e.prototype.clone=function(){var t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.setFill=function(t){this.fill_=t,this.render()},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var n=this.renderOptions_,r=mn(n.size*t,n.size*t);this.draw_(n,r,t),e=r.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return T_},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.setStroke=function(t){this.stroke_=t,this.render()},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,n){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var r=this.radius_,i=void 0===this.radius2_?r:this.radius2_;if(r<i){var o=r;r=i,i=o}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,u=i*Math.sin(a),l=r-Math.sqrt(i*i-u*u),c=Math.sqrt(u*u+l*l),h=c/u;if("miter"===t&&h<=n)return h*e;var f=e/2/h,p=e/2*(l/c),d=Math.sqrt((r+f)*(r+f)+p*p)-r;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=r*Math.sin(a),y=i-Math.sqrt(r*r-g*g),v=Math.sqrt(g*g+y*y)/g;if(v<=n){var _=v*e/2-i-r;return 2*Math.max(d,_)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=Ln,n=0,r=null,i=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=kn),t=j_(t),void 0===(o=this.stroke_.getWidth())&&(o=1),r=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Ln),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var s=this.calculateLineJoinSize_(e,o,n),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*a+s),lineDash:r,lineDashOffset:i,lineJoin:e,miterLimit:n}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var r=this.fill_.getColor();null===r&&(r=In),e.fillStyle=j_(r),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),n=0;if("string"==typeof e&&(e=qt(e)),null===e?n=1:Array.isArray(e)&&(n=4===e.length?e[3]:1),0===n){var r=mn(t.size,t.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(t,r)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,n=this.radius_;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{var r=void 0===this.radius2_?n:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var i=this.angle_-Math.PI/2,o=2*Math.PI/e,s=0;s<e;s++){var a=i+s*o,u=s%2==0?n:r;t.lineTo(u*Math.cos(a),u*Math.sin(a))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=In,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(D_),z_=B_,V_=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)}}(),U_=function(t){function e(e){var n=e||{};return t.call(this,{points:1/0,fill:n.fill,radius:n.radius,stroke:n.stroke,scale:void 0!==n.scale?n.scale:1,rotation:void 0!==n.rotation?n.rotation:0,rotateWithView:void 0!==n.rotateWithView&&n.rotateWithView,displacement:void 0!==n.displacement?n.displacement:[0,0],declutterMode:n.declutterMode})||this}return V_(e,t),e.prototype.clone=function(){var t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(z_),X_=U_,q_=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),W_=q_,Y_=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),H_=Y_,Z_=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Q_,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Q_,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var K_=null;function J_(t,e){if(!K_){var n=new W_({color:"rgba(255,255,255,0.4)"}),r=new H_({color:"#3399CC",width:1.25});K_=[new Z_({image:new X_({fill:n,stroke:r,radius:5}),fill:n,stroke:r})]}return K_}function $_(){var t={},e=[255,255,255,1],n=[0,153,255,1];return t.Polygon=[new Z_({fill:new W_({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new Z_({stroke:new H_({color:e,width:5})}),new Z_({stroke:new H_({color:n,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new Z_({image:new X_({radius:6,fill:new W_({color:n}),stroke:new H_({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function Q_(t){return t.getGeometry()}var tm=Z_,em=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)}}(),nm="renderOrder",rm=function(t){function e(e){var n=this,r=e||{},i=te({},r);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(n=t.call(this,i)||this).declutter_=void 0!==r.declutter&&r.declutter,n.renderBuffer_=void 0!==r.renderBuffer?r.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(r.style),n.updateWhileAnimating_=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,n.updateWhileInteracting_=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,n}return em(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(nm)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new w_(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(nm,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:J_,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var n;Array.isArray(t)?n=t:(T("function"==typeof t.getZIndex,41),n=[t]),e=function(){return n}}return e}(this.style_),this.changed()},e}(Ze),im=rm,om={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},sm=[om.FILL],am=[om.STROKE],um=[om.BEGIN_PATH],lm=[om.CLOSE_PATH],cm=om,hm=function(){function t(){}return t.prototype.drawCustom=function(t,e,n,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),fm=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)}}(),pm=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=n,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return fm(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},e.prototype.appendFlatPointCoordinates=function(t,e){for(var n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,o=i.length,s=0,a=t.length;s<a;s+=e)r[0]=t[s],r[1]=t[s+1],K(n,r)&&(i[o++]=r[0],i[o++]=r[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,n,r,i,o){var s=this.coordinates,a=s.length,u=this.getBufferedMaxExtent();o&&(e+=r);var l,c,h,f=t[e],p=t[e+1],d=this.tmpCoordinate_,g=!0;for(l=e+r;l<n;l+=r)d[0]=t[l],d[1]=t[l+1],(h=Q(u,d))!==c?(g&&(s[a++]=f,s[a++]=p,g=!1),s[a++]=d[0],s[a++]=d[1]):h===z?(s[a++]=d[0],s[a++]=d[1],g=!1):g=!0,f=d[0],p=d[1],c=h;return(i&&g||l===e+r)&&(s[a++]=f,s[a++]=p),a},e.prototype.drawCustomCoordinates_=function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o],u=this.appendFlatLineCoordinates(t,e,a,r,!1,!1);i.push(u),e=a}return e},e.prototype.drawCustom=function(t,e,n,r){this.beginGeometry(t,e);var i,o,s,a,u,l=t.getType(),c=t.getStride(),h=this.coordinates.length;switch(l){case"MultiPolygon":i=t.getOrientedFlatCoordinates(),a=[];var f=t.getEndss();u=0;for(var p=0,d=f.length;p<d;++p){var g=[];u=this.drawCustomCoordinates_(i,u,f[p],c,g),a.push(g)}this.instructions.push([cm.CUSTOM,h,a,t,n,Io]),this.hitDetectionInstructions.push([cm.CUSTOM,h,a,t,r||n,Io]);break;case"Polygon":case"MultiLineString":s=[],i="Polygon"==l?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),u=this.drawCustomCoordinates_(i,0,t.getEnds(),c,s),this.instructions.push([cm.CUSTOM,h,s,t,n,Po]),this.hitDetectionInstructions.push([cm.CUSTOM,h,s,t,r||n,Po]);break;case"LineString":case"Circle":i=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(i,0,i.length,c,!1,!1),this.instructions.push([cm.CUSTOM,h,o,t,n,Co]),this.hitDetectionInstructions.push([cm.CUSTOM,h,o,t,r||n,Co]);break;case"MultiPoint":i=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(i,c))>h&&(this.instructions.push([cm.CUSTOM,h,o,t,n,Co]),this.hitDetectionInstructions.push([cm.CUSTOM,h,o,t,r||n,Co]));break;case"Point":i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([cm.CUSTOM,h,o,t,n]),this.hitDetectionInstructions.push([cm.CUSTOM,h,o,t,r||n])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[cm.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[cm.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var n,r,i=e.length,o=-1;for(t=0;t<i;++t)(r=(n=e[t])[0])==cm.END_GEOMETRY?o=t:r==cm.BEGIN_GEOMETRY&&(n[2]=t,f(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var n=this.state;if(t){var r=t.getColor();n.fillStyle=j_(r||In)}else n.fillStyle=void 0;if(e){var i=e.getColor();n.strokeStyle=j_(i||kn);var o=e.getLineCap();n.lineCap=void 0!==o?o:Mn;var s=e.getLineDash();n.lineDash=s?s.slice():On;var a=e.getLineDashOffset();n.lineDashOffset=a||0;var u=e.getLineJoin();n.lineJoin=void 0!==u?u:Ln;var l=e.getWidth();n.lineWidth=void 0!==l?l:1;var c=e.getMiterLimit();n.miterLimit=void 0!==c?c:10,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,n=[cm.SET_FILL_STYLE,e];return"string"!=typeof e&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[cm.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,r=t.lineCap,i=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=r||i!=t.currentLineDash&&!d(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=u)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=r,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=u)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[cm.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=H(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Y(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(hm),dm=pm,gm=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)}}(),ym=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterMode_=void 0,o.declutterImageWithText_=void 0,o}return gm(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([cm.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([cm.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([cm.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([cm.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),r=t.getSize(),i=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e},e}(dm),vm=ym,_m=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)}}(),mm=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return _m(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,r){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,r,!1,!1),s=[cm.MOVE_TO_LINE_TO,i,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),n},e.prototype.drawLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([cm.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,On,0],um);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(am),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([cm.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],um);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),u=0,l=0,c=o.length;l<c;++l)u=this.drawFlatCoordinates_(s,u,o[l],a);this.hitDetectionInstructions.push(am),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(am),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(am),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(um)},e}(dm),xm=mm,wm=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)}}(),bm=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return wm(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,n,r){var i=this.state,o=void 0!==i.fillStyle,s=void 0!==i.strokeStyle,a=n.length;this.instructions.push(um),this.hitDetectionInstructions.push(um);for(var u=0;u<a;++u){var l=n[u],c=this.coordinates.length,h=this.appendFlatLineCoordinates(t,e,l,r,!0,!s),f=[cm.MOVE_TO_LINE_TO,c,h];this.instructions.push(f),this.hitDetectionInstructions.push(f),s&&(this.instructions.push(lm),this.hitDetectionInstructions.push(lm)),e=l}return o&&(this.instructions.push(sm),this.hitDetectionInstructions.push(sm)),s&&(this.instructions.push(am),this.hitDetectionInstructions.push(am)),e},e.prototype.drawCircle=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([cm.SET_FILL_STYLE,In]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([cm.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);var u=[cm.CIRCLE,a];this.instructions.push(um,u),this.hitDetectionInstructions.push(um,u),void 0!==n.fillStyle&&(this.instructions.push(sm),this.hitDetectionInstructions.push(sm)),void 0!==n.strokeStyle&&(this.instructions.push(am),this.hitDetectionInstructions.push(am)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([cm.SET_FILL_STYLE,In]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([cm.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([cm.SET_FILL_STYLE,In]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([cm.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),u=0,l=0,c=o.length;l<c;++l)u=this.drawFlatCoordinatess_(s,u,o[l],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var n=this.coordinates,r=0,i=n.length;r<i;++r)n[r]=bo(n[r],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(dm),Em=bm,Sm="point",Cm="line";function Pm(t,e,n,r,i){var o,s,a,u,l,c,h,f,p,d=n,g=n,y=0,v=0,_=n;for(o=n;o<r;o+=i){var m=e[o],x=e[o+1];void 0!==u&&(f=m-u,p=x-l,a=Math.sqrt(f*f+p*p),void 0!==c&&(v+=s,Math.acos((c*f+h*p)/(s*a))>t&&(v>y&&(y=v,d=_,g=o),v=0,_=o-i)),s=a,c=f,h=p),u=m,l=x}return(v+=a)>y?[_,o]:[d,g]}var Im=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)}}(),Mm={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Om=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return Im(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var n=this.textFillState_,r=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(n||r)){var o=this.coordinates,s=o.length,a=t.getType(),u=null,l=t.getStride();if(i.placement!==Cm||"LineString"!=a&&"MultiLineString"!=a&&"Polygon"!=a&&"MultiPolygon"!=a){var c=i.overflow?null:[];switch(a){case"Point":case"MultiPoint":u=t.getFlatCoordinates();break;case"LineString":u=t.getFlatMidpoint();break;case"Circle":u=t.getCenter();break;case"MultiLineString":u=t.getFlatMidpoints(),l=2;break;case"Polygon":u=t.getFlatInteriorPoint(),i.overflow||c.push(u[2]/this.resolution),l=3;break;case"MultiPolygon":var h=t.getFlatInteriorPoints();u=[];for(b=0,E=h.length;b<E;b+=3)i.overflow||c.push(h[b+2]/this.resolution),u.push(h[b],h[b+1]);if(0===u.length)return;l=2}if((L=this.appendFlatPointCoordinates(u,l))===s)return;if(c&&(L-s)/2!==u.length/l){var f=s/2;c=c.filter(function(t,e){var n=o[2*(f+e)]===u[e*l]&&o[2*(f+e)+1]===u[e*l+1];return n||--f,n})}this.saveTextStates_(),(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var p=i.padding;if(p!=An&&(i.scale[0]<0||i.scale[1]<0)){var d=i.padding[0],g=i.padding[1],y=i.padding[2],v=i.padding[3];i.scale[0]<0&&(g=-g,v=-v),i.scale[1]<0&&(d=-d,y=-y),p=[d,g,y,v]}var _=this.pixelRatio;this.instructions.push([cm.DRAW_IMAGE,s,L,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,p==An?An:p.map(function(t){return t*_}),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,c]);var m=1/_;this.hitDetectionInstructions.push([cm.DRAW_IMAGE,s,L,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,void 0,this.declutterImageWithText_,p,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,c]),this.endGeometry(e)}else{if(!Et(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(u=t.getFlatCoordinates(),"LineString"==a)x=[u.length];else if("MultiLineString"==a)x=t.getEnds();else if("Polygon"==a)x=t.getEnds().slice(0,1);else if("MultiPolygon"==a){var w=t.getEndss();x=[];for(var b=0,E=w.length;b<E;++b)x.push(w[b][0])}this.beginGeometry(t,e);for(var S=i.textAlign,C=0,P=void 0,I=0,M=x.length;I<M;++I){if(null==S){var O=Pm(i.maxAngle,u,C,x[I],l);C=O[0],P=O[1]}else P=x[I];for(var b=C;b<P;b+=l)o.push(u[b],u[b+1]);var L=o.length;C=x[I],this.drawChars_(s,L),s=L}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||Rn,justify:e.justify,textBaseline:e.textBaseline||Tn,scale:e.scale});var o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))},e.prototype.drawChars_=function(t,e){var n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,o=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,u=Mm[r.textBaseline],l=this.textOffsetY_*a,c=this.text_,h=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([cm.DRAW_CHARS,t,e,u,r.overflow,s,r.maxAngle,a,l,i,h*a,c,o,1]),this.hitDetectionInstructions.push([cm.DRAW_CHARS,t,e,u,r.overflow,s,r.maxAngle,1,l,i,h,c,o,1/a])},e.prototype.setTextStyle=function(t,e){var n,r,i;if(t){var o=t.getFill();o?((r=this.textFillState_)||(r={},this.textFillState_=r),r.fillStyle=j_(o.getColor()||In)):(r=null,this.textFillState_=r);var s=t.getStroke();if(s){(i=this.textStrokeState_)||(i={},this.textStrokeState_=i);var a=s.getLineDash(),u=s.getLineDashOffset(),l=s.getWidth(),c=s.getMiterLimit();i.lineCap=s.getLineCap()||Mn,i.lineDash=a?a.slice():On,i.lineDashOffset=void 0===u?0:u,i.lineJoin=s.getLineJoin()||Ln,i.lineWidth=void 0===l?1:l,i.miterLimit=void 0===c?10:c,i.strokeStyle=j_(s.getColor()||kn)}else i=null,this.textStrokeState_=i;n=this.textState_;var h=t.getFont()||Pn;Bn(h);var f=t.getScaleArray();n.overflow=t.getOverflow(),n.font=h,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||Tn,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||An,n.scale=void 0===f?[1,1]:f;var p=t.getOffsetX(),d=t.getOffsetY(),g=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===p?0:p,this.textOffsetY_=void 0===d?0:d,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===y?0:y,this.strokeKey_=i?("string"==typeof i.strokeStyle?i.strokeStyle:x(i.strokeStyle))+i.lineCap+i.lineDashOffset+"|"+i.lineWidth+i.lineJoin+i.miterLimit+"["+i.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+x(r.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(dm),Lm={Circle:Em,Default:dm,Image:vm,LineString:xm,Polygon:Em,Text:Om},km=function(){function t(t,e,n,r){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var n=this.buildersByZIndex_[e];for(var r in n){var i=n[r].finish();t[e][r]=i}}return t},t.prototype.getBuilder=function(t,e){var n=void 0!==t?t.toString():"0",r=this.buildersByZIndex_[n];void 0===r&&(r={},this.buildersByZIndex_[n]=r);var i=r[e];void 0===i&&(i=new(0,Lm[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[e]=i);return i},t}(),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=function(t){function e(e){var n=t.call(this)||this;return n.ready=!0,n.boundHandleImageChange_=n.handleImageChange_.bind(n),n.layer_=e,n.declutterExecutorGroup=null,n}return Rm(e,t),e.prototype.getFeatures=function(t){return _()},e.prototype.getData=function(t){return null},e.prototype.prepareFrame=function(t){return _()},e.prototype.renderFrame=function(t,e){return _()},e.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},e.prototype.createLoadedTileFinder=function(t,e,n){return function(r,i){var o=this.loadedTileCallback.bind(this,n,r);return t.forEachLoadedTile(e,r,i,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){},e.prototype.getDataAtPixel=function(t,e,n){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===T_&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=T_&&e!=A_&&t.addEventListener(ae,this.boundHandleImageChange_),e==k_&&(t.load(),e=t.getState()),e==T_},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()},e.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},e}(Se),Am=Tm,Nm=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)}}(),Fm=[],Dm=null;var jm=function(t){function e(e){var n=t.call(this,e)||this;return n.container=null,n.renderedResolution,n.tempTransform=[1,0,0,1,0,0],n.pixelTransform=[1,0,0,1,0,0],n.inversePixelTransform=[1,0,0,1,0,0],n.context=null,n.containerReused=!1,n.pixelContext_=null,n.frameState=null,n}return Nm(e,t),e.prototype.getImageData=function(t,e,n){var r,i;Dm||((r=document.createElement("canvas")).width=1,r.height=1,Dm=r.getContext("2d")),Dm.clearRect(0,0,1,1);try{Dm.drawImage(t,e,n,1,1,0,0,1,1),i=Dm.getImageData(0,0,1,1).data}catch(t){return Dm=null,null}return i},e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,n){var r,i,o=this.getLayer().getClassName();t&&t.className===o&&(!n||t&&t.style.backgroundColor&&d(qt(t.style.backgroundColor),qt(n)))&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(i=a.getContext("2d")));if(i&&i.canvas.style.transform===e?(this.container=t,this.context=i,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(r=document.createElement("div")).className=o;var s=r.style;s.position="absolute",s.width="100%",s.height="100%";var a=(i=mn()).canvas;r.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=r,this.context=i}this.containerReused||!n||this.container.style.backgroundColor||(this.container.style.backgroundColor=n)},e.prototype.clipUnrotated=function(t,e,n){var r=xt(n),i=wt(n),o=pt(n),s=ft(n);F(e.coordinateToPixelTransform,r),F(e.coordinateToPixelTransform,i),F(e.coordinateToPixelTransform,o),F(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;F(a,r),F(a,i),F(a,o),F(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,n){var r=this.getLayer();if(r.hasListener(t)){var i=new hn(t,this.inversePixelTransform,n,e);r.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(ze,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ve,t,e)},e.prototype.getRenderTransform=function(t,e,n,r,i,o,s){var a=i/2,u=o/2,l=r/e,c=-l,h=-t[0]+s,f=-t[1];return D(this.tempTransform,a,u,l,c,-n,h,f)},e.prototype.getDataAtPixel=function(t,e,n){var r=F(this.inversePixelTransform,t.slice()),i=this.context,o=this.getLayer().getExtent();if(o&&!K(o,F(e.pixelToCoordinateTransform,t.slice())))return null;var s,a=Math.round(r[0]),u=Math.round(r[1]),l=this.pixelContext_;if(!l){var c=document.createElement("canvas");c.width=1,c.height=1,l=c.getContext("2d"),this.pixelContext_=l}l.clearRect(0,0,1,1);try{l.drawImage(i.canvas,a,u,1,1,0,0,1,1),s=l.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):s}return 0===s[3]?null:s},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(Am),Gm=jm;function Bm(t,e,n,r,i,o,s,a,u,l,c,h){var f=t[e],p=t[e+1],d=0,g=0,y=0,v=0;function _(){d=f,g=p,f=t[e+=r],p=t[e+1],v+=y,y=Math.sqrt((f-d)*(f-d)+(p-g)*(p-g))}do{_()}while(e<n-r&&v+y<o);for(var m=0===y?0:(o-v)/y,x=Nt(d,f,m),w=Nt(g,p,m),b=e-r,E=v,S=o+a*u(l,i,c);e<n-r&&v+y<S;)_();var C,P=Nt(d,f,m=0===y?0:(S-v)/y),I=Nt(g,p,m);if(h){var M=[x,w,P,I];eo(M,0,4,2,h,M,M),C=M[0]>M[2]}else C=x>P;var O,L=Math.PI,k=[],R=b+r===e;if(y=0,v=E,f=t[e=b],p=t[e+1],R){_(),O=Math.atan2(p-g,f-d),C&&(O+=O>0?-L:L);var T=(P+x)/2,A=(I+w)/2;return k[0]=[T,A,(S-o)/2,O,i],k}for(var N=0,F=(i=i.replace(/\n/g," ")).length;N<F;){_();var D=Math.atan2(p-g,f-d);if(C&&(D+=D>0?-L:L),void 0!==O){var j=D-O;if(j+=j>L?-2*L:j<-L?2*L:0,Math.abs(j)>s)return null}O=D;for(var G=N,B=0;N<F;++N){var z=a*u(l,i[C?F-N-1:N],c);if(e+r<n&&v+y<o+B+z/2)break;B+=z}if(N!==G){var V=C?i.substring(F-G,F-N):i.substring(G,N);T=Nt(d,f,m=0===y?0:(o+B/2-v)/y),A=Nt(g,p,m);k.push([T,A,B/2,D,V]),o+=B}}return k}function zm(t,e,n,r){for(var i=t[e],o=t[e+1],s=0,a=e+r;a<n;a+=r){var u=t[a],l=t[a+1];s+=Math.sqrt((u-i)*(u-i)+(l-o)*(l-o)),i=u,o=l}return s}var Vm=[1/0,1/0,-1/0,-1/0],Um=[],Xm=[],qm=[],Wm=[];function Ym(t){return t[3].declutterBox}var Hm=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Zm(t,e){return"start"!==e&&"end"!==e||Hm.test(t)||(e="start"===e?"left":"right"),Mm[e]}function Km(t,e,n){return n>0&&t.push("\n",""),t.push(e,""),t}var Jm=function(){function t(t,e,n,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,n,r){var i=t+e+n+r;if(this.labels_[i])return this.labels_[i];var o=r?this.strokeStates[r]:null,s=n?this.fillStates[n]:null,a=this.textStates[e],u=this.pixelRatio,l=[a.scale[0]*u,a.scale[1]*u],c=Array.isArray(t),h=a.justify?Mm[a.justify]:Zm(Array.isArray(t)?t[0]:t,a.textAlign||Rn),f=r&&o.lineWidth?o.lineWidth:0,p=c?t:t.split("\n").reduce(Km,[]),d=function(t,e){for(var n=[],r=[],i=[],o=0,s=0,a=0,u=0,l=0,c=e.length;l<=c;l+=2){var h=e[l];if("\n"!==h&&l!==c){var f=e[l+1]||t.font,p=Un(f,h);n.push(p),s+=p;var d=zn(f);r.push(d),u=Math.max(u,d)}else o=Math.max(o,s),i.push(s),s=0,a+=u}return{width:o,height:a,widths:n,heights:r,lineWidths:i}}(a,p),g=d.width,y=d.height,v=d.widths,_=d.heights,m=d.lineWidths,x=g+f,w=[],b=(x+2)*l[0],E=(y+f)*l[1],S={width:b<0?Math.floor(b):Math.ceil(b),height:E<0?Math.floor(E):Math.ceil(E),contextInstructions:w};(1==l[0]&&1==l[1]||w.push("scale",l),r)&&(w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",f),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit),(M?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset)));n&&w.push("fillStyle",s.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var C,P=.5-h,I=h*x+P*f,O=[],L=[],k=0,R=0,T=0,A=0,N=0,F=p.length;N<F;N+=2){var D=p[N];if("\n"!==D){var j=p[N+1]||a.font;j!==C&&(r&&O.push("font",j),n&&L.push("font",j),C=j),k=Math.max(k,_[T]);var G=[D,I+P*v[T]+h*(v[T]-m[A]),.5*(f+k)+R];I+=v[T],r&&O.push("strokeText",G),n&&L.push("fillText",G),++T}else R+=k,k=0,I=h*x+P*f,++A}return Array.prototype.push.apply(w,O),Array.prototype.push.apply(w,L),this.labels_[i]=S,S},t.prototype.replayTextBackground_=function(t,e,n,r,i,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,n,r,i,o,s,a,u,l,c,h,f,p,d,g){var y,v=n-(s*=h[0]),_=r-(a*=h[1]),m=i+u>t?t-u:i,x=o+l>e?e-l:o,w=p[3]+m*h[0]+p[1],b=p[0]+x*h[1]+p[2],E=v-p[3],S=_-p[0];return(d||0!==c)&&(Um[0]=E,Wm[0]=E,Um[1]=S,Xm[1]=S,Xm[0]=E+w,qm[0]=Xm[0],qm[1]=S+b,Wm[1]=qm[1]),0!==c?(F(y=D([1,0,0,1,0,0],n,r,1,1,c,-n,-r),Um),F(y,Xm),F(y,qm),F(y,Wm),et(Math.min(Um[0],Xm[0],qm[0],Wm[0]),Math.min(Um[1],Xm[1],qm[1],Wm[1]),Math.max(Um[0],Xm[0],qm[0],Wm[0]),Math.max(Um[1],Xm[1],qm[1],Wm[1]),Vm)):et(Math.min(E,E+w),Math.min(S,S+b),Math.max(E,E+w),Math.max(S,S+b),Vm),f&&(v=Math.round(v),_=Math.round(_)),{drawImageX:v,drawImageY:_,drawImageW:m,drawImageH:x,originX:u,originY:l,declutterBox:{minX:Vm[0],minY:Vm[1],maxX:Vm[2],maxY:Vm[3],value:g},canvasTransform:y,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,n,r,i,o,s){var a=!(!o&&!s),u=r.declutterBox,l=t.canvas,c=s?s[2]*r.scale[0]/2:0;return u.minX-c<=l.width/e&&u.maxX+c>=0&&u.minY-c<=l.height/e&&u.maxY+c>=0&&(a&&this.replayTextBackground_(t,Um,Xm,qm,Wm,o,s),qn(t,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=F(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,n,r){var i=this.textStates[e],o=this.createLabel(t,e,r,n),s=this.strokeStates[n],a=this.pixelRatio,u=Zm(Array.isArray(t)?t[0]:t,i.textAlign||Rn),l=Mm[i.textBaseline||Tn],c=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:u*(o.width/a-2*i.scale[0])+2*(.5-u)*c,anchorY:l*o.height/a+2*(.5-l)*c}},t.prototype.execute_=function(t,e,n,r,i,o,s,a){var u,l,c;this.pixelCoordinates_&&d(n,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=to(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),l=this.renderedTransform_,c=n,l[0]=c[0],l[1]=c[1],l[2]=c[2],l[3]=c[3],l[4]=c[4],l[5]=c[5]);for(var h,f,p,g,y,v,_,m,x,w,b,E,S,C,P,I,M=0,O=r.length,L=0,k=0,R=0,T=null,A=null,N=this.coordinateCache_,F=this.viewRotation_,D=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:F},G=this.instructions!=r||this.overlaps?0:200;M<O;){var B=r[M];switch(B[0]){case cm.BEGIN_GEOMETRY:S=B[1],I=B[3],S.getGeometry()?void 0===s||Et(s,I.getExtent())?++M:M=B[2]+1:M=B[2];break;case cm.BEGIN_PATH:k>G&&(this.fill_(t),k=0),R>G&&(t.stroke(),R=0),k||R||(t.beginPath(),g=NaN,y=NaN),++M;break;case cm.CIRCLE:var z=u[L=B[1]],V=u[L+1],U=u[L+2]-z,X=u[L+3]-V,q=Math.sqrt(U*U+X*X);t.moveTo(z+q,V),t.arc(z,V,q,0,2*Math.PI,!0),++M;break;case cm.CLOSE_PATH:t.closePath(),++M;break;case cm.CUSTOM:L=B[1],h=B[2];var W=B[3],Y=B[4],H=6==B.length?B[5]:void 0;j.geometry=W,j.feature=S,M in N||(N[M]=[]);var Z=N[M];H?H(u,L,h,2,Z):(Z[0]=u[L],Z[1]=u[L+1],Z.length=2),Y(Z,j),++M;break;case cm.DRAW_IMAGE:L=B[1],h=B[2],m=B[3],f=B[4],p=B[5];var K=B[6],J=B[7],$=B[8],Q=B[9],tt=B[10],et=B[11],nt=B[12],rt=B[13],it=B[14],ot=B[15];if(!m&&B.length>=20){x=B[19],w=B[20],b=B[21],E=B[22];var st=this.drawLabelWithPointPlacement_(x,w,b,E);m=st.label,B[3]=m;var at=B[23];f=(st.anchorX-at)*this.pixelRatio,B[4]=f;var ut=B[24];p=(st.anchorY-ut)*this.pixelRatio,B[5]=p,K=m.height,B[6]=K,rt=m.width,B[13]=rt}var lt=void 0;B.length>25&&(lt=B[25]);var ct=void 0,ht=void 0,ft=void 0;B.length>17?(ct=B[16],ht=B[17],ft=B[18]):(ct=An,ht=!1,ft=!1),tt&&D?et+=F:tt||D||(et-=F);for(var pt=0;L<h;L+=2)if(!(lt&<[pt++]<rt/this.pixelRatio)){var dt=[t,e,m,Vt=this.calculateImageOrLabelDimensions_(m.width,m.height,u[L],u[L+1],rt,K,f,p,$,Q,et,nt,i,ct,ht||ft,S),J,ht?T:null,ft?A:null];if(a){if("none"===it)continue;if("obstacle"===it){a.insert(Vt.declutterBox);continue}var gt=void 0,yt=void 0;if(ot){var vt=h-L;if(!ot[vt]){ot[vt]=dt;continue}if(gt=ot[vt],delete ot[vt],yt=Ym(gt),a.collides(yt))continue}if(a.collides(Vt.declutterBox))continue;gt&&(a.insert(yt),this.replayImageOrLabel_.apply(this,gt)),a.insert(Vt.declutterBox)}this.replayImageOrLabel_.apply(this,dt)}++M;break;case cm.DRAW_CHARS:var _t=B[1],mt=B[2],xt=B[3],wt=B[4];E=B[5];var bt=B[6],St=B[7],Ct=B[8];b=B[9];var Pt=B[10];x=B[11],w=B[12];var It=[B[13],B[13]],Mt=this.textStates[w],Ot=Mt.font,Lt=[Mt.scale[0]*St,Mt.scale[1]*St],kt=void 0;Ot in this.widths_?kt=this.widths_[Ot]:(kt={},this.widths_[Ot]=kt);var Rt=zm(u,_t,mt,2),Tt=Math.abs(Lt[0])*Xn(Ot,x,kt);if(wt||Tt<=Rt){var At=this.textStates[w].textAlign,Nt=Bm(u,_t,mt,2,x,(Rt-Tt)*Mm[At],bt,Math.abs(Lt[0]),Xn,Ot,kt,D?0:this.viewRotation_);t:if(Nt){var Ft=[],Dt=void 0,jt=void 0,Gt=void 0,Bt=void 0,zt=void 0;if(b)for(Dt=0,jt=Nt.length;Dt<jt;++Dt){Gt=(zt=Nt[Dt])[4],Bt=this.createLabel(Gt,w,"",b),f=zt[2]+(Lt[0]<0?-Pt:Pt),p=xt*Bt.height+2*(.5-xt)*Pt*Lt[1]/Lt[0]-Ct;var Vt=this.calculateImageOrLabelDimensions_(Bt.width,Bt.height,zt[0],zt[1],Bt.width,Bt.height,f,p,0,0,zt[3],It,!1,An,!1,S);if(a&&a.collides(Vt.declutterBox))break t;Ft.push([t,e,Bt,Vt,1,null,null])}if(E)for(Dt=0,jt=Nt.length;Dt<jt;++Dt){Gt=(zt=Nt[Dt])[4],Bt=this.createLabel(Gt,w,E,""),f=zt[2],p=xt*Bt.height-Ct;Vt=this.calculateImageOrLabelDimensions_(Bt.width,Bt.height,zt[0],zt[1],Bt.width,Bt.height,f,p,0,0,zt[3],It,!1,An,!1,S);if(a&&a.collides(Vt.declutterBox))break t;Ft.push([t,e,Bt,Vt,1,null,null])}a&&a.load(Ft.map(Ym));for(var Ut=0,Xt=Ft.length;Ut<Xt;++Ut)this.replayImageOrLabel_.apply(this,Ft[Ut])}}++M;break;case cm.END_GEOMETRY:if(void 0!==o){var qt=o(S=B[1],I);if(qt)return qt}++M;break;case cm.FILL:G?k++:this.fill_(t),++M;break;case cm.MOVE_TO_LINE_TO:for(L=B[1],h=B[2],C=u[L],_=(P=u[L+1])+.5|0,(v=C+.5|0)===g&&_===y||(t.moveTo(C,P),g=v,y=_),L+=2;L<h;L+=2)v=(C=u[L])+.5|0,_=(P=u[L+1])+.5|0,L!=h-2&&v===g&&_===y||(t.lineTo(C,P),g=v,y=_);++M;break;case cm.SET_FILL_STYLE:T=B,this.alignFill_=B[2],k&&(this.fill_(t),k=0,R&&(t.stroke(),R=0)),t.fillStyle=B[1],++M;break;case cm.SET_STROKE_STYLE:A=B,R&&(t.stroke(),R=0),this.setStrokeStyle_(t,B),++M;break;case cm.STROKE:G?R++:t.stroke(),++M;break;default:++M}}k&&this.fill_(t),R&&t.stroke()},t.prototype.execute=function(t,e,n,r,i,o){this.viewRotation_=r,this.execute_(t,e,n,this.instructions,i,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,n,r,i){return this.viewRotation_=n,this.execute_(t,1,e,this.hitDetectionInstructions,!0,r,i)},t}(),$m=Jm,Qm=["Polygon","Circle","LineString","Image","Text","Default"],tx=function(){function t(t,e,n,r,i,o){this.maxExtent_=t,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(i)}return t.prototype.clip=function(t,e){var n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var n=this.executorsByZIndex_[e];void 0===n&&(n={},this.executorsByZIndex_[e]=n);var r=t[e];for(var i in r){var o=r[i];n[i]=new $m(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var n=this.executorsByZIndex_[e],r=0,i=t.length;r<i;++r)if(t[r]in n)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i,o){var s=2*(r=Math.round(r))+1,a=D(this.hitDetectionTransform_,r+.5,r+.5,1/e,-1/e,-n,-t[0],-t[1]),u=!this.hitDetectionContext_;u&&(this.hitDetectionContext_=mn(s,s));var l,h=this.hitDetectionContext_;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):u||h.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(at(l=[1/0,1/0,-1/0,-1/0],t),Y(l,e*(this.renderBuffer_+r),l));var f,p=function(t){if(void 0!==ex[t])return ex[t];for(var e=2*t+1,n=t*t,r=new Array(n+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var s=i*i+o*o;if(s>n)break;var a=r[s];a||(a=[],r[s]=a),a.push(4*((t+i)*e+(t+o))+3),i>0&&a.push(4*((t-i)*e+(t+o))+3),o>0&&(a.push(4*((t+i)*e+(t-o))+3),i>0&&a.push(4*((t-i)*e+(t-o))+3))}for(var u=[],l=(i=0,r.length);i<l;++i)r[i]&&u.push.apply(u,r[i]);return ex[t]=u,u}(r);function d(t,e){for(var n=h.getImageData(0,0,s,s).data,a=0,u=p.length;a<u;a++)if(n[p[a]]>0){if(!o||"Image"!==f&&"Text"!==f||-1!==o.indexOf(t)){var l=(p[a]-3)/4,c=r-l%s,d=r-(l/s|0),g=i(t,e,c*c+d*d);if(g)return g}h.clearRect(0,0,s,s);break}}var g,y,v,_,m,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(c),g=x.length-1;g>=0;--g){var w=x[g].toString();for(v=this.executorsByZIndex_[w],y=Qm.length-1;y>=0;--y)if(void 0!==(_=v[f=Qm[y]])&&(m=_.executeHitDetection(h,a,n,d,l)))return m}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],r=e[1],i=e[2],o=e[3],s=[n,r,n,o,i,o,i,r];return to(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return re(this.executorsByZIndex_)},t.prototype.execute=function(t,e,n,r,i,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(c),this.maxExtent_&&(t.save(),this.clip(t,n));var u,l,h,f,p,d,g=o||Qm;for(s&&a.reverse(),u=0,l=a.length;u<l;++u){var y=a[u].toString();for(p=this.executorsByZIndex_[y],h=0,f=g.length;h<f;++h){void 0!==(d=p[g[h]])&&d.execute(t,e,n,r,i,s)}}this.maxExtent_&&t.restore()},t}(),ex={};var nx=tx,rx=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)}}(),ix=function(t){function e(e,n,r,i,o,s,a){var u=t.call(this)||this;return u.context_=e,u.pixelRatio_=n,u.extent_=r,u.transform_=i,u.viewRotation_=o,u.squaredTolerance_=s,u.userTransform_=a,u.contextFillState_=null,u.contextStrokeState_=null,u.contextTextState_=null,u.fillState_=null,u.strokeState_=null,u.image_=null,u.imageAnchorX_=0,u.imageAnchorY_=0,u.imageHeight_=0,u.imageOpacity_=0,u.imageOriginX_=0,u.imageOriginY_=0,u.imageRotateWithView_=!1,u.imageRotation_=0,u.imageScale_=[0,0],u.imageWidth_=0,u.text_="",u.textOffsetX_=0,u.textOffsetY_=0,u.textRotateWithView_=!1,u.textRotation_=0,u.textScale_=[0,0],u.textFillState_=null,u.textStrokeState_=null,u.textState_=null,u.pixelCoordinates_=[],u.tmpLocalTransform_=[1,0,0,1,0,0],u}return rx(e,t),e.prototype.drawImages_=function(t,e,n,r){if(this.image_){var i=to(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var u=this.imageRotation_;this.imageRotateWithView_&&(u+=this.viewRotation_);for(var l=0,c=i.length;l<c;l+=2){var h=i[l]-this.imageAnchorX_,f=i[l+1]-this.imageAnchorY_;if(0!==u||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var p=h+this.imageAnchorX_,d=f+this.imageAnchorY_;D(s,p,d,1,1,u,-p,-d),o.setTransform.apply(o,s),o.translate(p,d),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,h,f,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=a)}},e.prototype.drawText_=function(t,e,n,r){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=to(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<n;e+=r){var a=i[e]+this.textOffsetX_,u=i[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var l=D(this.tmpLocalTransform_,a,u,1,1,s,-a,-u);o.setTransform.apply(o,l),o.translate(a,u),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,a,u),this.textFillState_&&o.fillText(this.text_,a,u)}}},e.prototype.moveToLineTo_=function(t,e,n,r,i){var o=this.context_,s=to(t,e,n,r,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;i&&(a-=2);for(var u=2;u<a;u+=2)o.lineTo(s[u],s[u+1]);return i&&o.closePath(),n},e.prototype.drawRings_=function(t,e,n,r){for(var i=0,o=n.length;i<o;++i)e=this.moveToLineTo_(t,e,n[i],r,!0);return e},e.prototype.drawCircle=function(t){if(Et(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,n){var r=t.getFlatCoordinates();if(r){var i=t.getStride();return to(r,0,r.length,i,e,n)}return null}(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],r=e[3]-e[1],i=Math.sqrt(n*n+r*r),o=this.context_;o.beginPath(),o.arc(e[0],e[1],i,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var n=e.getGeometryFunction()(t);n&&Et(this.extent_,n.getExtent())&&(this.setStyle(e),this.drawGeometry(n))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),n=0,r=e.length;n<r;++n)this.drawGeometry(e[n])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Et(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var r=t.getFlatMidpoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Et(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var n=this.context_,r=t.getFlatCoordinates(),i=0,o=t.getEnds(),s=t.getStride();n.beginPath();for(var a=0,u=o.length;a<u;++a)i=this.moveToLineTo_(r,i,o[a],s,!1);n.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Et(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var n=t.getFlatInteriorPoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Et(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getOrientedFlatCoordinates(),r=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=i.length;s<a;++s){var u=i[s];r=this.drawRings_(n,r,u,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(d(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,n=this.contextTextState_,r=t.textAlign?t.textAlign:Rn;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=r&&(n.textAlign=r,e.textAlign=r),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=r,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:r,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var n=this;if(t){var r=t.getColor();this.fillState_={fillStyle:j_(r||In)}}else this.fillState_=null;if(e){var i=e.getColor(),o=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),u=e.getLineJoin(),l=e.getWidth(),c=e.getMiterLimit(),h=s||On;this.strokeState_={lineCap:void 0!==o?o:Mn,lineDash:1===this.pixelRatio_?h:h.map(function(t){return t*n.pixelRatio_}),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==u?u:Ln,lineWidth:(void 0!==l?l:1)*this.pixelRatio_,miterLimit:void 0!==c?c:10,strokeStyle:j_(i||kn)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var n=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*this.pixelRatio_,this.imageAnchorY_=n[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var n=e.getColor();this.textFillState_={fillStyle:j_(n||In)}}else this.textFillState_=null;var r=t.getStroke();if(r){var i=r.getColor(),o=r.getLineCap(),s=r.getLineDash(),a=r.getLineDashOffset(),u=r.getLineJoin(),l=r.getWidth(),c=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:Mn,lineDash:s||On,lineDashOffset:a||0,lineJoin:void 0!==u?u:Ln,lineWidth:void 0!==l?l:1,miterLimit:void 0!==c?c:10,strokeStyle:j_(i||kn)}}else this.textStrokeState_=null;var h=t.getFont(),f=t.getOffsetX(),p=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation(),y=t.getScaleArray(),v=t.getText(),_=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==h?h:Pn,textAlign:void 0!==_?_:Rn,textBaseline:void 0!==m?m:Tn},this.text_=void 0!==v?Array.isArray(v)?v.reduce(function(t,e,n){return t+(n%2?" ":e)},""):v:"",this.textOffsetX_=void 0!==f?this.pixelRatio_*f:0,this.textOffsetY_=void 0!==p?this.pixelRatio_*p:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*y[0],this.pixelRatio_*y[1]]}else this.text_=""},e}(hm),ox=ix,sx="fraction",ax="pixels",ux="bottom-left",lx="bottom-right",cx="top-left",hx="top-right",fx=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)}}(),px=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=r,o.resolution=n,o.state=i,o}return fx(e,t),e.prototype.changed=function(){this.dispatchEvent(ae)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return _()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){_()},e}(se),dx=px,gx=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)}}(),yx=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,r,k_)||this;return a.src_=i,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=k_,a.imageLoadFunction_=s,a}return gx(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=A_,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=_t(this.extent)/this.image_.height),this.state=T_,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=k_&&this.state!=A_||(this.state=R_,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=vx(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=_t(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(dx);function vx(t,e,n){var r=t,i=!0,o=!1,s=!1,a=[me(r,de,function(){s=!0,o||e()})];return r.src&&O?(o=!0,r.decode().then(function(){i&&e()}).catch(function(t){i&&(s?e():n())})):a.push(me(r,ue,n)),function(){i=!1,a.forEach(xe)}}var _x=yx,mx=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)}}(),xx=null,wx=function(t){function e(e,n,r,i,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==i&&(a.image_.crossOrigin=i),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=r,a.src_=n,a.tainted_,a}return mx(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===T_){xx||(xx=mn(1,1)),xx.drawImage(this.image_,0,0);try{xx.getImageData(0,0,1,1),this.tainted_=!1}catch(t){xx=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(ae)},e.prototype.handleImageError_=function(){this.imageState_=A_,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=T_,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],n=mn(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==k_){this.imageState_=R_;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=vx(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===T_){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),n.globalCompositeOperation="multiply","multiply"===n.globalCompositeOperation||this.isTainted_())n.fillStyle=Vt(this.color_),n.fillRect(0,0,e.width/t,e.height/t),n.globalCompositeOperation="destination-in",n.drawImage(this.image_,0,0);else{for(var r=n.getImageData(0,0,e.width,e.height),i=r.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,u=this.color_[3],l=0,c=i.length;l<c;l+=4)i[l]*=o,i[l+1]*=s,i[l+2]*=a,i[l+3]*=u;n.putImageData(r,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(se);var bx=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)}}(),Ex=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.opacity?r.opacity:1,o=void 0!==r.rotation?r.rotation:0,s=void 0!==r.scale?r.scale:1,a=void 0!==r.rotateWithView&&r.rotateWithView;(n=t.call(this,{opacity:i,rotation:o,scale:s,displacement:void 0!==r.displacement?r.displacement:[0,0],rotateWithView:a,declutterMode:r.declutterMode})||this).anchor_=void 0!==r.anchor?r.anchor:[.5,.5],n.normalizedAnchor_=null,n.anchorOrigin_=void 0!==r.anchorOrigin?r.anchorOrigin:cx,n.anchorXUnits_=void 0!==r.anchorXUnits?r.anchorXUnits:sx,n.anchorYUnits_=void 0!==r.anchorYUnits?r.anchorYUnits:sx,n.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null;var u=void 0!==r.img?r.img:null;n.imgSize_=r.imgSize;var l=r.src;T(!(void 0!==l&&u),4),T(!u||u&&n.imgSize_,5),void 0!==l&&0!==l.length||!u||(l=u.src||x(u)),T(void 0!==l&&l.length>0,6);var c=void 0!==r.src?k_:T_;return n.color_=void 0!==r.color?qt(r.color):null,n.iconImage_=function(t,e,n,r,i,o){var s=Kt.get(e,r,o);return s||(s=new wx(t,e,n,r,i,o),Kt.set(e,r,o,s)),s}(u,l,void 0!==n.imgSize_?n.imgSize_:null,n.crossOrigin_,c,n.color_),n.offset_=void 0!==r.offset?r.offset:[0,0],n.offsetOrigin_=void 0!==r.offsetOrigin?r.offsetOrigin:cx,n.origin_=null,n.size_=void 0!==r.size?r.size:null,n}return bx(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==sx||this.anchorYUnits_==sx){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==sx&&(t[0]*=e[0]),this.anchorYUnits_==sx&&(t[1]*=e[1])}if(this.anchorOrigin_!=cx){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=hx&&this.anchorOrigin_!=lx||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=ux&&this.anchorOrigin_!=lx||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var n=this.getDisplacement();return[t[0]-n[0],t[1]+n[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=cx){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),this.offsetOrigin_!=hx&&this.offsetOrigin_!=lx||(t[0]=n[0]-e[0]-t[0]),this.offsetOrigin_!=ux&&this.offsetOrigin_!=lx||(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(ae,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(ae,t)},e}(D_),Sx=Ex,Cx=.5;var Px={Point:function(t,e,n,r,i){var o,s=n.getImage(),a=n.getText();if(s){if(s.getImageState()!=T_)return;var u=t;if(i){var l=s.getDeclutterMode();if("none"!==l)if(u=i,"obstacle"===l){var c=t.getBuilder(n.getZIndex(),"Image");c.setImageStyle(s,o),c.drawPoint(e,r)}else a&&a.getText()&&(o={})}var h=u.getBuilder(n.getZIndex(),"Image");h.setImageStyle(s,o),h.drawPoint(e,r)}if(a&&a.getText()){var f=t;i&&(f=i);var p=f.getBuilder(n.getZIndex(),"Text");p.setTextStyle(a,o),p.drawText(e,r)}},LineString:function(t,e,n,r,i){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawLineString(e,r)}var a=n.getText();if(a&&a.getText()){var u=(i||t).getBuilder(n.getZIndex(),"Text");u.setTextStyle(a),u.drawText(e,r)}},Polygon:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(o,s),a.drawPolygon(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}},MultiPoint:function(t,e,n,r,i){var o,s=n.getImage(),a=n.getText();if(s){if(s.getImageState()!=T_)return;var u=t;if(i){var l=s.getDeclutterMode();if("none"!==l)if(u=i,"obstacle"===l){var c=t.getBuilder(n.getZIndex(),"Image");c.setImageStyle(s,o),c.drawMultiPoint(e,r)}else a&&a.getText()&&(o={})}var h=u.getBuilder(n.getZIndex(),"Image");h.setImageStyle(s,o),h.drawMultiPoint(e,r)}if(a&&a.getText()){var f=t;i&&(f=i);var p=f.getBuilder(n.getZIndex(),"Text");p.setTextStyle(a,o),p.drawText(e,r)}},MultiLineString:function(t,e,n,r,i){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,r)}var a=n.getText();if(a&&a.getText()){var u=(i||t).getBuilder(n.getZIndex(),"Text");u.setTextStyle(a),u.drawText(e,r)}},MultiPolygon:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(s||o){var a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}},GeometryCollection:function(t,e,n,r,i){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o<s;++o){(0,Px[a[o].getType()])(t,a[o],n,r,i)}},Circle:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),"Circle");a.setFillStrokeStyle(o,s),a.drawCircle(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}}};function Ix(t,e){return parseInt(x(t),10)-parseInt(x(e),10)}function Mx(t,e){return.5*t/e}function Ox(t,e,n,r,i,o,s){var a=!1,u=n.getImage();if(u){var l=u.getImageState();l==T_||l==A_?u.unlistenImageChange(i):(l==k_&&u.load(),u.listenImageChange(i),a=!0)}return function(t,e,n,r,i,o){var s=n.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(r,i),u=n.getRenderer();if(u)Lx(t,a,n,e);else{(0,Px[a.getType()])(t,a,n,e,o)}}(t,e,n,r,o,s),a}function Lx(t,e,n,r){if("GeometryCollection"!=e.getType())t.getBuilder(n.getZIndex(),"Default").drawCustom(e,r,n.getRenderer(),n.getHitDetectionRenderer());else for(var i=e.getGeometries(),o=0,s=i.length;o<s;++o)Lx(t,i[o],n,r)}var kx=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)}}(),Rx=function(t){function e(e){var n=t.call(this,e)||this;return n.boundHandleStyleImageChange_=n.handleStyleImageChange_.bind(n),n.animatingOrInteracting_,n.hitDetectionImageData_=null,n.renderedFeatures_=null,n.renderedRevision_=-1,n.renderedResolution_=NaN,n.renderedExtent_=[1/0,1/0,-1/0,-1/0],n.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],n.renderedRotation_,n.renderedCenter_=null,n.renderedProjection_=null,n.renderedRenderOrder_=null,n.replayGroup_=null,n.replayGroupChanged=!0,n.declutterExecutorGroup=null,n.clipping=!0,n.compositionContext_=null,n.opacity_=1,n}return kx(e,t),e.prototype.renderWorlds=function(t,e,n){var r=e.extent,i=e.viewState,o=i.center,s=i.resolution,a=i.projection,u=i.rotation,l=a.getExtent(),c=this.getLayer().getSource(),h=e.pixelRatio,f=e.viewHints,p=!(f[Ur]||f[Xr]),d=this.compositionContext_,g=Math.round(e.size[0]*h),y=Math.round(e.size[1]*h),v=c.getWrapX()&&a.canWrapX(),_=v?bt(l):null,m=v?Math.ceil((r[2]-l[2])/_)+1:1,x=v?Math.floor((r[0]-l[0])/_):0;do{var w=this.getRenderTransform(o,s,u,h,g,y,x*_);t.execute(d,1,w,u,p,void 0,n)}while(++x<m)},e.prototype.setupCompositionContext_=function(){if(1!==this.opacity_){var t=mn(this.context.canvas.width,this.context.canvas.height,Fm);this.compositionContext_=t}else this.compositionContext_=this.context},e.prototype.releaseCompositionContext_=function(){if(1!==this.opacity_){var t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,xn(this.compositionContext_),Fm.push(this.compositionContext_.canvas),this.compositionContext_=null}},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())},e.prototype.renderFrame=function(t,e){var n=t.pixelRatio,r=t.layerStatesArray[t.layerIndex];!function(t,e,n){N(t,e,0,0,n,0,0)}(this.pixelTransform,1/n,1/n),j(this.inversePixelTransform,this.pixelTransform);var i=G(this.pixelTransform);this.useContainer(e,i,this.getBackground(t));var o=this.context,s=o.canvas,a=this.replayGroup_,u=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!u||u.isEmpty()))return null;var l=Math.round(t.size[0]*n),c=Math.round(t.size[1]*n);s.width!=l||s.height!=c?(s.width=l,s.height=c,s.style.transform!==i&&(s.style.transform=i)):this.containerReused||o.clearRect(0,0,l,c),this.preRender(o,t);var h=t.viewState,f=h.projection;this.opacity_=r.opacity,this.setupCompositionContext_();var p=!1,d=!0;if(r.extent&&this.clipping){var g=Di(r.extent,f);(p=(d=Et(g,t.extent))&&!J(g,t.extent))&&this.clipUnrotated(this.compositionContext_,t,g)}return d&&this.renderWorlds(a,t),p&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(o,t),this.renderedRotation_!==h.rotation&&(this.renderedRotation_=h.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var n=[this.context.canvas.width,this.context.canvas.height];F(this.pixelTransform,n);var r=this.renderedCenter_,i=this.renderedResolution_,o=this.renderedRotation_,s=this.renderedProjection_,a=this.wrappedRenderedExtent_,u=this.getLayer(),l=[],h=n[0]*Cx,f=n[1]*Cx;l.push(this.getRenderTransform(r,i,o,Cx,h,f,0).slice());var p=u.getSource(),d=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!J(d,a)){for(var g=a[0],y=bt(d),v=0,_=void 0;g<d[0];)_=y*--v,l.push(this.getRenderTransform(r,i,o,Cx,h,f,_).slice()),g+=y;for(v=0,g=a[2];g>d[2];)_=y*++v,l.push(this.getRenderTransform(r,i,o,Cx,h,f,_).slice()),g-=y}this.hitDetectionImageData_=function(t,e,n,r,i,o,s){var a=mn(t[0]*Cx,t[1]*Cx);a.imageSmoothingEnabled=!1;for(var u=a.canvas,l=new ox(a,Cx,i,null,s),h=n.length,f=Math.floor(16777215/h),p={},d=1;d<=h;++d){var g=n[d-1],y=g.getStyleFunction()||r;if(r){var v=y(g,o);if(v){Array.isArray(v)||(v=[v]);for(var _="#"+("000000"+(d*f).toString(16)).slice(-6),m=0,x=v.length;m<x;++m){var w=v[m],b=w.getGeometryFunction()(g);if(b&&Et(i,b.getExtent())){var E=w.clone(),S=E.getFill();S&&S.setColor(_);var C=E.getStroke();C&&(C.setColor(_),C.setLineDash(null)),E.setText(void 0);var P=w.getImage();if(P&&0!==P.getOpacity()){var I=P.getImageSize();if(!I)continue;var M=mn(I[0],I[1],void 0,{alpha:!1}),O=M.canvas;M.fillStyle=_,M.fillRect(0,0,O.width,O.height),E.setImage(new Sx({img:O,imgSize:I,anchor:P.getAnchor(),anchorXUnits:ax,anchorYUnits:ax,offset:P.getOrigin(),opacity:1,size:P.getSize(),scale:P.getScale(),rotation:P.getRotation(),rotateWithView:P.getRotateWithView()}))}var L=E.getZIndex()||0;(T=p[L])||(T={},p[L]=T,T.Polygon=[],T.Circle=[],T.LineString=[],T.Point=[]),T[b.getType().replace("Multi","")].push(b,E)}}}}}for(var k=Object.keys(p).map(Number).sort(c),R=(d=0,k.length);d<R;++d){var T=p[k[d]];for(var A in T){var N=T[A];for(m=0,x=N.length;m<x;m+=2){l.setStyle(N[m+1]);for(var F=0,D=e.length;F<D;++F)l.setTransform(e[F]),l.drawGeometry(N[m])}}}return a.getImageData(0,0,u.width,u.height)}(n,l,this.renderedFeatures_,u.getStyleFunction(),a,i,o)}e(function(t,e,n){var r=[];if(n){var i=Math.floor(Math.round(t[0])*Cx),o=Math.floor(Math.round(t[1])*Cx),s=4*(Mt(i,0,n.width-1)+Mt(o,0,n.height-1)*n.width),a=n.data[s],u=n.data[s+1],l=n.data[s+2]+256*(u+256*a),c=Math.floor(16777215/e.length);l&&l%c===0&&r.push(e[l/c-1])}return r}(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){var o=this;if(this.replayGroup_){var s,a=e.viewState.resolution,u=e.viewState.rotation,l=this.getLayer(),c={},h=function(t,e,n){var o=x(t),s=c[o];if(s){if(!0!==s&&n<s.distanceSq){if(0===n)return c[o]=!0,i.splice(i.lastIndexOf(s),1),r(t,l,e);s.geometry=e,s.distanceSq=n}}else{if(0===n)return c[o]=!0,r(t,l,e);i.push(c[o]={feature:t,layer:l,geometry:e,distanceSq:n,callback:r})}},f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some(function(r){return s=r.forEachFeatureAtCoordinate(t,a,u,n,h,r===o.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(function(t){return t.value}):null)}),s}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource();if(!n)return!1;var r=t.viewHints[Ur],i=t.viewHints[Xr],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(this.ready&&!o&&r||!s&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=t.extent,u=t.viewState,l=u.projection,c=u.resolution,h=t.pixelRatio,f=e.getRevision(),p=e.getRenderBuffer(),g=e.getRenderOrder();void 0===g&&(g=Ix);var y=u.center.slice(),v=Y(a,p*c),_=v.slice(),m=[v.slice()],x=l.getExtent();if(n.getWrapX()&&l.canWrapX()&&!J(x,t.extent)){var w=bt(x),b=Math.max(bt(v)/2,w);v[0]=x[0]-b,v[2]=x[2]+b,on(y,l);var E=It(m[0],l);E[0]<x[0]&&E[2]<x[2]?m.push([E[0]+w,E[1],E[2]+w,E[3]]):E[0]>x[0]&&E[2]>x[2]&&m.push([E[0]-w,E[1],E[2]-w,E[3]])}if(this.ready&&this.renderedResolution_==c&&this.renderedRevision_==f&&this.renderedRenderOrder_==g&&J(this.wrappedRenderedExtent_,v))return d(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var S,C=new km(Mx(c,h),v,c,h);this.getLayer().getDeclutter()&&(S=new km(Mx(c,h),v,c,h));var P,I=Ti();if(I){for(var M=0,O=m.length;M<O;++M){var L=Fi(m[M],l);n.loadFeatures(L,ji(c,l),I)}P=Ci(I,l)}else for(M=0,O=m.length;M<O;++M)n.loadFeatures(m[M],c,l);var k=function(t,e){var n=Mx(t,e);return n*n}(c,h),R=!0,T=function(t){var n,r=t.getStyleFunction()||e.getStyleFunction();if(r&&(n=r(t,c)),n){var i=this.renderFeature(t,k,n,C,P,S);R=R&&!i}}.bind(this),A=Fi(v,l),N=n.getFeaturesInExtent(A);g&&N.sort(g);for(M=0,O=N.length;M<O;++M)T(N[M]);this.renderedFeatures_=N,this.ready=R;var F=C.finish(),D=new nx(v,c,h,n.getOverlaps(),F,e.getRenderBuffer());return S&&(this.declutterExecutorGroup=new nx(v,c,h,n.getOverlaps(),S.finish(),e.getRenderBuffer())),this.renderedResolution_=c,this.renderedRevision_=f,this.renderedRenderOrder_=g,this.renderedExtent_=_,this.wrappedRenderedExtent_=v,this.renderedCenter_=y,this.renderedProjection_=l,this.replayGroup_=D,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,n,r,i,o){if(!n)return!1;var s=!1;if(Array.isArray(n))for(var a=0,u=n.length;a<u;++a)s=Ox(r,t,n[a],e,this.boundHandleStyleImageChange_,i,o)||s;else s=Ox(r,t,n,e,this.boundHandleStyleImageChange_,i,o);return s},e}(Gm),Tx=Rx,Ax=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)}}(),Nx=function(t){function e(e){return t.call(this,e)||this}return Ax(e,t),e.prototype.createRenderer=function(){return new Tx(this)},e}(im),Fx=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)}}(),Dx=function(t){function e(e){var n=t.call(this)||this;n.projection=xi(e.projection),n.attributions_=jx(e.attributions),n.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,n.loading=!1,n.state_=void 0!==e.state?e.state:"ready",n.wrapX_=void 0!==e.wrapX&&e.wrapX,n.interpolate_=!!e.interpolate,n.viewResolver=null,n.viewRejector=null;var r=n;return n.viewPromise_=new Promise(function(t,e){r.viewResolver=t,r.viewRejector=e}),n}return Fx(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return _()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=jx(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Ie);function jx(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Gx=Dx;function Bx(t,e){return[[-1/0,-1/0,1/0,1/0]]}var zx=!1;function Vx(t,e){return function(n,r,i,o,s){var a=this;!function(t,e,n,r,i,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,r,i):t,!0),"arraybuffer"==e.getType()&&(a.responseType="arraybuffer"),a.withCredentials=zx,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=e.getType(),u=void 0;"json"==r||"text"==r?u=a.responseText:"xml"==r?(u=a.responseXML)||(u=(new DOMParser).parseFromString(a.responseText,"application/xml")):"arraybuffer"==r&&(u=a.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):s()}else s()},a.onerror=s,a.send()}(t,e,n,r,i,function(t,e){a.addFeatures(t),void 0!==o&&o(t)},s||v)}}var Ux=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)}}(),Xx=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.feature=n,i.features=r,i}return Ux(e,t),e}($t),qx=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{attributions:r.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===r.wrapX||r.wrapX})||this).on,n.once,n.un,n.loader_=v,n.format_=r.format,n.overlaps_=void 0===r.overlaps||r.overlaps,n.url_=r.url,void 0!==r.loader?n.loader_=r.loader:void 0!==n.url_&&(T(n.format_,7),n.loader_=Vx(n.url_,n.format_)),n.strategy_=void 0!==r.strategy?r.strategy:Bx;var i,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return n.featuresRtree_=s?new E_:null,n.loadedExtentsRtree_=new E_,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(i=r.features).getArray()),s||void 0!==i||(i=new er(o)),void 0!==o&&n.addFeaturesInternal(o),void 0!==i&&n.bindFeaturesCollection_(i),n}return Ux(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=x(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var r=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Xx(S_,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[_e(e,ae,this.handleFeatureChange_,this),_e(e,Qt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,r=e.getId();return void 0!==r&&(r.toString()in this.idIndex_?n=!1:this.idIndex_[r.toString()]=e),n&&(T(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],r=[],i=0,o=t.length;i<o;i++){var s=x(u=t[i]);this.addToIndex_(s,u)&&n.push(u)}i=0;for(var a=n.length;i<a;i++){var u;s=x(u=n[i]);this.setupChangeEvents_(s,u);var l=u.getGeometry();if(l){var c=l.getExtent();e.push(c),r.push(u)}else this.nullGeometryFeatures_[s]=u}if(this.featuresRtree_&&this.featuresRtree_.load(e,r),this.hasListener(S_)){i=0;for(var h=n.length;i<h;i++)this.dispatchEvent(new Xx(S_,n[i]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(S_,function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener(I_,function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener(Zn,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(Kn,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(xe)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var n=function(t){this.removeFeatureInternal(t)}.bind(this);for(var r in this.featuresRtree_.forEach(n),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new Xx(P_);this.dispatchEvent(i),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(n){return n.getGeometry().intersectsCoordinate(t)?e(n):void 0})},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,function(n){if(n.getGeometry().intersectsExtent(t)){var r=e(n);if(r)return r}})},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),re(this.nullGeometryFeatures_)||p(t,ne(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,function(t){e.push(t)}),e},e.prototype.getFeaturesInExtent=function(t,e){var n=this;if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);var r=function(t,e){if(e.canWrapX()){var n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];It(t,e);var r=bt(n);if(bt(t)>r)return[[n[0],t[1],n[2],t[3]]];if(t[0]<n[0])return[[t[0]+r,t[1],n[2],t[3]],[n[0],t[1],t[2],t[3]]];if(t[2]>n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}(t,e);return[].concat.apply([],r.map(function(t){return n.featuresRtree_.getInExtent(t)}))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var n=t[0],r=t[1],i=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],u=e||g;return this.featuresRtree_.forEachInExtent(a,function(t){if(u(t)){var e=t.getGeometry(),l=s;if((s=e.closestPointXY(n,r,o,s))<l){i=t;var c=Math.sqrt(s);a[0]=n-c,a[1]=r-c,a[2]=n+c,a[3]=r+c}}}),i},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,n=x(e),r=e.getGeometry();if(r){var i=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(i,e)):this.featuresRtree_&&this.featuresRtree_.update(i,e)}else n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);var o=e.getId();if(void 0!==o){var s=o.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new Xx(C_,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:x(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&re(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()},e.prototype.loadFeatures=function(t,e,n){for(var r=this.loadedExtentsRtree_,i=this.strategy_(t,e,n),o=function(t,o){var a=i[t],u=r.forEachInExtent(a,function(t){return J(t.extent,a)});u||(++s.loadingExtentsCount_,s.dispatchEvent(new Xx(M_)),s.loader_.call(s,a,e,n,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Xx(O_,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Xx(L_))}.bind(s)),r.insert(a,{extent:a.slice()}))},s=this,a=0,u=i.length;a<u;++a)o(a);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,n=this.loadedExtentsRtree_;n.forEachInExtent(t,function(n){if(ot(n.extent,t))return e=n,!0}),e&&n.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=x(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}},e.prototype.removeFeatureInternal=function(t){var e=x(t),n=this.featureChangeKeys_[e];if(n){n.forEach(xe),delete this.featureChangeKeys_[e];var r=t.getId();return void 0!==r&&delete this.idIndex_[r.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Xx(I_,t)),t}},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){T(this.format_,7),this.url_=t,this.setLoader(Vx(t,this.format_))},e}(Gx),Wx=qx,Yx=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)}}(),Hx=[0,0,0,0],Zx=[],Kx="modifystart",Jx="modifyend",$x=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.features=n,i.mapBrowserEvent=r,i}return Yx(e,t),e}($t),Qx=function(t){function e(e){var n,r=t.call(this,e)||this;if(r.on,r.once,r.un,r.boundHandleFeatureChange_=r.handleFeatureChange_.bind(r),r.condition_=e.condition?e.condition:Ys,r.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==pr.SINGLECLICK}(t)},r.deleteCondition_=e.deleteCondition?e.deleteCondition:r.defaultDeleteCondition_,r.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:zs,r.vertexFeature_=null,r.vertexSegments_=null,r.lastPixel_=[0,0],r.ignoreNextSingleClick_=!1,r.featuresBeingModified_=null,r.rBush_=new E_,r.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,r.snappedToVertex_=!1,r.changingFeature_=!1,r.dragSegments_=[],r.overlay_=new Nx({source:new Wx({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:rw(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r)},r.source_=null,r.hitDetection_=null,e.features?n=e.features:e.source&&(r.source_=e.source,n=new er(r.source_.getFeatures()),r.source_.addEventListener(S_,r.handleSourceAdd_.bind(r)),r.source_.addEventListener(I_,r.handleSourceRemove_.bind(r))),!n)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(r.hitDetection_=e.hitDetection),r.features_=n,r.features_.forEach(r.addFeature_.bind(r)),r.features_.addEventListener(Zn,r.handleFeatureAdd_.bind(r)),r.features_.addEventListener(Kn,r.handleFeatureRemove_.bind(r)),r.lastPointerEvent_=null,r.delta_=[0,0],r.snapToPointer_=void 0===e.snapToPointer?!r.hitDetection_:e.snapToPointer,r}return Yx(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var n=this.SEGMENT_WRITERS_[e.getType()];n&&n(t,e)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,r),t.addEventListener(ae,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new er;for(var n=this.featuresBeingModified_.getArray(),r=0,i=e.length;r<i;++r)for(var o=e[r],s=0,a=o.length;s<a;++s){var u=o[s].feature;u&&-1===n.indexOf(u)&&this.featuresBeingModified_.push(u)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new $x(Kx,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(ae,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,n=[];e.forEach(function(e){t===e.feature&&n.push(e)});for(var r=n.length-1;r>=0;--r){for(var i=n[r],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var n=e.getCoordinates(),r={feature:t,geometry:e,segment:[n,n]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r){var o=n[r],s={feature:t,geometry:e,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r){var o=n.slice(r,r+2),s={feature:t,geometry:e,index:r,segment:o};this.rBush_.insert(W(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var u=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:u};this.rBush_.insert(W(u),l)}},e.prototype.writePolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var u=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:u};this.rBush_.insert(W(u),l)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length;s<a;++s)for(var u=o[s],l=0,c=u.length-1;l<c;++l){var h=u.slice(l,l+2),f={feature:t,geometry:e,depth:[s,r],index:l,segment:h};this.rBush_.insert(W(h),f)}},e.prototype.writeCircleGeometry_=function(t,e){var n=e.getCenter(),r={feature:t,geometry:e,index:0,segment:[n,n]},i={feature:t,geometry:e,index:1,segment:[n,n]},o=[r,i];r.featureSegments=o,i.featureSegments=o,this.rBush_.insert(rt(n),r);var s=e,a=Ti();if(a&&this.getMap()){var u=this.getMap().getView().getProjection();s=Qo(s=s.clone().transform(a,u)).transform(u,a)}this.rBush_.insert(s.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=n[r];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,n){var r=this.vertexFeature_;r?r.getGeometry().setCoordinates(t):(r=new Va(new No(t)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r));return r.set("features",e),r.set("geometries",n),r},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=pr.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(n=!(e.type!=pr.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==pr.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!n);var n},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],n=[],r=[],i=0,o=this.dragSegments_.length;i<o;++i){var s=this.dragSegments_[i],a=s[0],u=a.feature;-1===n.indexOf(u)&&n.push(u);var l=a.geometry;-1===r.indexOf(l)&&r.push(l);for(var c=a.depth,h=void 0,f=a.segment,p=s[1];e.length<l.getStride();)e.push(f[p][e.length]);switch(l.getType()){case"Point":h=e,f[0]=e,f[1]=e;break;case"MultiPoint":(h=l.getCoordinates())[a.index]=e,f[0]=e,f[1]=e;break;case"LineString":(h=l.getCoordinates())[a.index+p]=e,f[p]=e;break;case"MultiLineString":case"Polygon":(h=l.getCoordinates())[c[0]][a.index+p]=e,f[p]=e;break;case"MultiPolygon":(h=l.getCoordinates())[c[1]][c[0]][a.index+p]=e,f[p]=e;break;case"Circle":if(f[0]=e,f[1]=e,0===a.index)this.changingFeature_=!0,l.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;var d=t.map.getView().getProjection(),g=rn(Ni(l.getCenter(),d),Ni(e,d)),y=Ti();if(y){var v=l.clone().transform(y,d);v.setRadius(g),g=v.transform(d,y).getRadius()}l.setRadius(g),this.changingFeature_=!1}}h&&this.setGeometryCoordinates_(l,h)}this.createOrUpdateVertexFeature_(e,n,r)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var n=this.vertexFeature_;if(n){var r=t.map.getView().getProjection(),i=[],o=n.getGeometry().getCoordinates(),s=W([o]),a=this.rBush_.getInExtent(s),u={};a.sort(tw);for(var l=0,c=a.length;l<c;++l){var h=a[l],f=h.segment,p=x(h.geometry),d=h.depth;if(d&&(p+="-"+d.join("-")),u[p]||(u[p]=new Array(2)),"Circle"!==h.geometry.getType()||1!==h.index)if(!Qe(f[0],o)||u[p][0])if(!Qe(f[1],o)||u[p][1])x(f)in this.vertexSegments_&&!u[p][0]&&!u[p][1]&&this.insertVertexCondition_(t)&&i.push(h);else{if(u[p][0]&&0===u[p][0].index){var g=h.geometry.getCoordinates();switch(h.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":g=g[d[1]];case"Polygon":if(h.index!==g[d[0]].length-2)continue}}this.dragSegments_.push([h,1]),u[p][1]=h}else this.dragSegments_.push([h,0]),u[p][0]=h;else Qe(nw(e,h,r),o)&&!u[p][0]&&(this.dragSegments_.push([h,0]),u[p][0]=h)}i.length&&this.willModifyFeatures_(t,[i]);for(var y=i.length-1;y>=0;--y)this.insertVertex_(i[y],o)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var n=this.dragSegments_[e][0],r=n.geometry;if("Circle"===r.getType()){var i=r.getCenter(),o=n.featureSegments[0],s=n.featureSegments[1];o.segment[0]=i,o.segment[1]=i,s.segment[0]=i,s.segment[1]=i,this.rBush_.update(rt(i),o);var a=r,u=Ti();if(u){var l=t.map.getView().getProjection();a=Qo(a=a.clone().transform(u,l)).transform(l,u)}this.rBush_.update(a.getExtent(),s)}else this.rBush_.update(W(n.segment),n)}return this.featuresBeingModified_&&(this.dispatchEvent(new $x(Jx,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,n){var r,i,o=this,s=n||e.getCoordinateFromPixel(t),a=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===o.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,function(t,e,n){if("Point"===(n=n||t.getGeometry()).getType()&&(a=o.features_.getArray(),u=t,a.indexOf(u)>=0)){i=n;var s=n.getFlatCoordinates().slice(0,2);r=[{feature:t,geometry:n,segment:[s,s]}]}var a,u;return!0},{layerFilter:u})}if(!r){var l=Fi(Y(Di(rt(s,Hx),a),e.getView().getResolution()*this.pixelTolerance_,Hx),a);r=this.rBush_.getInExtent(l)}if(r&&r.length>0){var c=r.sort(function(t,e){return ew(s,t,a)-ew(s,e,a)})[0],h=c.segment,f=nw(s,c,a),p=e.getPixelFromCoordinate(f),d=rn(t,p);if(i||d<=this.pixelTolerance_){var g={};if(g[x(h)]=!0,this.snapToPointer_||(this.delta_[0]=f[0]-s[0],this.delta_[1]=f[1]-s[1]),"Circle"===c.geometry.getType()&&1===c.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);else{var y=e.getPixelFromCoordinate(h[0]),v=e.getPixelFromCoordinate(h[1]),_=nn(p,y),m=nn(p,v);d=Math.sqrt(Math.min(_,m)),this.snappedToVertex_=d<=this.pixelTolerance_,this.snappedToVertex_&&(f=_>m?h[1]:h[0]),this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);var w={};w[x(c.geometry)]=!0;for(var b=1,E=r.length;b<E;++b){var S=r[b].segment;if(!(Qe(h[0],S[0])&&Qe(h[1],S[1])||Qe(h[0],S[1])&&Qe(h[1],S[0])))break;var C=x(r[b].geometry);C in w||(w[C]=!0,g[x(S)]=!0)}}return void(this.vertexSegments_=g)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var n,r=t.segment,i=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case"MultiLineString":case"Polygon":(n=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case"MultiPolygon":(n=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case"LineString":(n=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,n);var u=this.rBush_;u.remove(t),this.updateSegmentIndices_(o,a,s,1);var l={segment:[r[0],e],feature:i,geometry:o,depth:s,index:a};u.insert(W(l.segment),l),this.dragSegments_.push([l,1]);var c={segment:[e,r[1]],feature:i,geometry:o,depth:s,index:a+1};u.insert(W(c.segment),c),this.dragSegments_.push([c,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=pr.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new $x(Jx,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,n,r,i,o,s,a,u,l,c,h=this.dragSegments_,f={},p=!1;for(i=h.length-1;i>=0;--i)c=x((l=(n=h[i])[0]).feature),l.depth&&(c+="-"+l.depth.join("-")),c in f||(f[c]={}),0===n[1]?(f[c].right=l,f[c].index=l.index):1==n[1]&&(f[c].left=l,f[c].index=l.index+1);for(c in f){switch(u=f[c].right,s=f[c].left,(a=(o=f[c].index)-1)<0&&(a=0),t=e=(r=(l=void 0!==s?s:u).geometry).getCoordinates(),p=!1,r.getType()){case"MultiLineString":e[l.depth[0]].length>2&&(e[l.depth[0]].splice(o,1),p=!0);break;case"LineString":e.length>2&&(e.splice(o,1),p=!0);break;case"MultiPolygon":t=t[l.depth[1]];case"Polygon":(t=t[l.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),p=!0,0===o&&(t.pop(),t.push(t[0]),a=t.length-1))}if(p){this.setGeometryCoordinates_(r,e);var d=[];if(void 0!==s&&(this.rBush_.remove(s),d.push(s.segment[0])),void 0!==u&&(this.rBush_.remove(u),d.push(u.segment[1])),void 0!==s&&void 0!==u){var g={depth:l.depth,feature:l.feature,geometry:l.geometry,index:a,segment:d};this.rBush_.insert(W(g.segment),g)}this.updateSegmentIndices_(r,o,l.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),h.length=0}}return p},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,n,r){this.rBush_.forEachInExtent(t.getExtent(),function(i){i.geometry===t&&(void 0===n||void 0===i.depth||d(i.depth,n))&&i.index>e&&(i.index+=r)})},e}(Ds);function tw(t,e){return t.index-e.index}function ew(t,e,n){var r=e.geometry;if("Circle"===r.getType()){var i=r;if(1===e.index){var o=Ti();o&&(i=i.clone().transform(o,n));var s=nn(i.getCenter(),Ni(t,n)),a=Math.sqrt(s)-i.getRadius();return a*a}}var u=Ni(t,n);return Zx[0]=Ni(e.segment[0],n),Zx[1]=Ni(e.segment[1],n),function(t,e){return nn(t,$e(t,e))}(u,Zx)}function nw(t,e,n){var r=e.geometry;if("Circle"===r.getType()&&1===e.index){var i=r,o=Ti();return o&&(i=i.clone().transform(o,n)),Ai(i.getClosestPoint(Ni(t,n)),n)}var s=Ni(t,n);return Zx[0]=Ni(e.segment[0],n),Zx[1]=Ni(e.segment[1],n),Ai($e(s,Zx),n)}function rw(){var t=$_();return function(e,n){return t.Point}}var iw=Qx,ow=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)}}();function sw(t){return t.feature?t.feature:t.element?t.element:void 0}var aw=[],uw=function(t){function e(e){var n=this,r=e||{},i=r;return i.handleDownEvent||(i.handleDownEvent=g),i.stopDown||(i.stopDown=y),(n=t.call(this,i)||this).source_=r.source?r.source:null,n.vertex_=void 0===r.vertex||r.vertex,n.edge_=void 0===r.edge||r.edge,n.features_=r.features?r.features:null,n.featuresListenerKeys_=[],n.featureChangeListenerKeys_={},n.indexedFeaturesExtents_={},n.pendingFeatures_={},n.pixelTolerance_=void 0!==r.pixelTolerance?r.pixelTolerance:10,n.rBush_=new E_,n.GEOMETRY_SEGMENTERS_={Point:n.segmentPointGeometry_.bind(n),LineString:n.segmentLineStringGeometry_.bind(n),LinearRing:n.segmentLineStringGeometry_.bind(n),Polygon:n.segmentPolygonGeometry_.bind(n),MultiPoint:n.segmentMultiPointGeometry_.bind(n),MultiLineString:n.segmentMultiLineStringGeometry_.bind(n),MultiPolygon:n.segmentMultiPolygonGeometry_.bind(n),GeometryCollection:n.segmentGeometryCollectionGeometry_.bind(n),Circle:n.segmentCircleGeometry_.bind(n)},n}return ow(e,t),e.prototype.addFeature=function(t,e){var n=void 0===e||e,r=x(t),i=t.getGeometry();if(i){var o=this.GEOMETRY_SEGMENTERS_[i.getType()];if(o){this.indexedFeaturesExtents_[r]=i.getExtent([1/0,1/0,-1/0,-1/0]);var s=[];if(o(s,i),1===s.length)this.rBush_.insert(W(s[0]),{feature:t,segment:s[0]});else if(s.length>1){var a=s.map(function(t){return W(t)}),u=s.map(function(e){return{feature:t,segment:e}});this.rBush_.load(a,u)}}}n&&(this.featureChangeListenerKeys_[r]=_e(t,ae,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var n=this.snapTo(e.pixel,e.coordinate,e.map);return n&&(e.coordinate=n.vertex.slice(0,2),e.pixel=n.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=sw(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=sw(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var n=x(e);n in this.pendingFeatures_||(this.pendingFeatures_[n]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=ne(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var n=void 0===e||e,r=x(t),i=this.indexedFeaturesExtents_[r];if(i){var o=this.rBush_,s=[];o.forEachInExtent(i,function(e){t===e.feature&&s.push(e)});for(var a=s.length-1;a>=0;--a)o.remove(s[a])}n&&(xe(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])},e.prototype.setMap=function(e){var n=this.getMap(),r=this.featuresListenerKeys_,i=this.getFeatures_();n&&(r.forEach(xe),r.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?r.push(_e(this.features_,Zn,this.handleFeatureAdd_,this),_e(this.features_,Kn,this.handleFeatureRemove_,this)):this.source_&&r.push(_e(this.source_,S_,this.handleFeatureAdd_,this),_e(this.source_,I_,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,n){var r=W([n.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),n.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(r),o=i.length;if(0===o)return null;var s,a=n.getView().getProjection(),u=Ni(e,a),l=1/0,c=this.pixelTolerance_*this.pixelTolerance_,h=function(){if(s){var e=n.getPixelFromCoordinate(s);if(nn(t,e)<=c)return{vertex:s,vertexPixel:[Math.round(e[0]),Math.round(e[1])]}}return null};if(this.vertex_){for(var f=0;f<o;++f){"Circle"!==(p=i[f]).feature.getGeometry().getType()&&p.segment.forEach(function(t){var e=Ni(t,a),n=nn(u,e);n<l&&(s=t,l=n)})}if(w=h())return w}if(this.edge_){for(f=0;f<o;++f){var p,d=null;if("Circle"===(p=i[f]).feature.getGeometry().getType()){var g=p.feature.getGeometry(),y=Ti();y&&(g=g.clone().transform(y,a)),d=Ai(Je(u,g),a)}else{var v=p.segment,_=v[0],m=v[1];m&&(aw[0]=Ni(_,a),aw[1]=Ni(m,a),d=$e(u,aw))}if(d){var x=nn(u,d);x<l&&(s=d,l=x)}}var w;if(w=h())return w}return null},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.segmentCircleGeometry_=function(t,e){var n=this.getMap().getView().getProjection(),r=e,i=Ti();i&&(r=r.clone().transform(i,n));var o=Qo(r);i&&o.transform(n,i);for(var s=o.getCoordinates()[0],a=0,u=s.length-1;a<u;++a)t.push(s.slice(a,a+2))},e.prototype.segmentGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=this.GEOMETRY_SEGMENTERS_[n[r].getType()];i&&i(t,n[r])}},e.prototype.segmentLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r)t.push(n.slice(r,r+2))},e.prototype.segmentMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},e.prototype.segmentMultiPointGeometry_=function(t,e){e.getCoordinates().forEach(function(e){t.push([e])})},e.prototype.segmentMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length;s<a;++s)for(var u=o[s],l=0,c=u.length-1;l<c;++l)t.push(u.slice(l,l+2))},e.prototype.segmentPointGeometry_=function(t,e){t.push([e.getCoordinates()])},e.prototype.segmentPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},e}(Ds),lw=uw,cw=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)}}(),hw=function(t){function e(e,n,r){var i=t.call(this)||this;if(void 0!==r&&void 0===n)i.setFlatCoordinates(r,e);else{var o=n||0;i.setCenterAndRadius(e,o,r)}return i}return cw(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){var i=this.flatCoordinates,o=t-i[0],s=e-i[1],a=o*o+s*s;if(a<r){if(0===a)for(var u=0;u<this.stride;++u)n[u]=i[u];else{var l=this.getRadius()/Math.sqrt(a);n[0]=i[0]+l*o,n[1]=i[1]+l*s;for(u=2;u<this.stride;++u)n[u]=i[u]}return n.length=this.stride,a}return r},e.prototype.containsXY=function(t,e){var n=this.flatCoordinates,r=t-n[0],i=e-n[1];return r*r+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,n=e[this.stride]-e[0];return et(e[0]-n,e[1]-n,e[0]+n,e[1]+n,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return"Circle"},e.prototype.intersectsExtent=function(t){if(Et(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||ct(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,n=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+n;for(var i=1;i<e;++i)r[e+i]=t[i];this.setFlatCoordinates(this.layout,r),this.changed()},e.prototype.setCenterAndRadius=function(t,e,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,i=vo(r,0,t,this.stride);r[i++]=r[0]+e;for(var o=1,s=this.stride;o<s;++o)r[i++]=r[o];r.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var n=this.getCenter(),r=this.getStride();this.setCenter(eo(n,0,n.length,r,t,e,n)),this.changed()},e.prototype.translate=function(t,e){var n=this.getCenter(),r=this.getStride();this.setCenter(no(n,0,n.length,r,t,e,n)),this.changed()},e}(co);hw.prototype.transform;var fw=hw;function pw(t,e,n,r,i,o,s){var a,u,l=(n-e)/r;if(1===l)a=e;else if(2===l)a=e,u=i;else if(0!==l){for(var h=t[e],f=t[e+1],p=0,d=[0],g=e+r;g<n;g+=r){var y=t[g],v=t[g+1];p+=Math.sqrt((y-h)*(y-h)+(v-f)*(v-f)),d.push(p),h=y,f=v}var _=i*p,m=function(t,e,n){for(var r,i,o=n||c,s=0,a=t.length,u=!1;s<a;)(i=+o(t[r=s+(a-s>>1)],e))<0?s=r+1:(a=r,u=!i);return u?s:~s}(d,_);m<0?(u=(_-d[-m-2])/(d[-m-1]-d[-m-2]),a=e+(-m-2)*r):a=e+m*r}var x=s>1?s:2,w=o||new Array(x);for(g=0;g<x;++g)w[g]=void 0===a?NaN:void 0===u?t[a+g]:Nt(t[a+g],t[a+r+g],u);return w}function dw(t,e,n,r,i,o){if(n==e)return null;var s;if(i<t[e+r-1])return o?((s=t.slice(e,e+r))[r-1]=i,s):null;if(t[n-1]<i)return o?((s=t.slice(n-r,n))[r-1]=i,s):null;if(i==t[e+r-1])return t.slice(e,e+r);for(var a=e/r,u=n/r;a<u;){var l=a+u>>1;i<t[(l+1)*r-1]?u=l:a=l+1}var c=t[a*r-1];if(i==c)return t.slice((a-1)*r,(a-1)*r+r);var h=(i-c)/(t[(a+1)*r-1]-c);s=[];for(var f=0;f<r-1;++f)s.push(Nt(t[(a-1)*r+f],t[a*r+f],h));return s.push(i),s}var gw=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)}}(),yw=function(t){function e(e,n){var r=t.call(this)||this;return r.flatMidpoint_=null,r.flatMidpointRevision_=-1,r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return gw(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?p(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<Z(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(fo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),go(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.forEachSegment=function(t){return Bo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=$i&&this.layout!=Qi)return null;var n=void 0!==e&&e;return dw(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n)},e.prototype.getCoordinates=function(){return Co(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return pw(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return zm(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=xo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,Ki)},e.prototype.getType=function(){return"LineString"},e.prototype.intersectsExtent=function(t){return zo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=_o(this.flatCoordinates,0,t,this.stride),this.changed()},e}(co),vw=yw,_w=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)}}(),mw=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,n);else if(void 0!==n&&r)i.setFlatCoordinates(n,e),i.ends_=r;else{for(var o=i.getLayout(),s=e,a=[],u=[],l=0,c=s.length;l<c;++l){var h=s[l];0===l&&(o=h.getLayout()),p(a,h.getFlatCoordinates()),u.push(a.length)}i.setFlatCoordinates(o,a),i.ends_=u}return i}return _w(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?p(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<Z(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(po(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),yo(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.getCoordinateAtM=function(t,e,n){if(this.layout!=$i&&this.layout!=Qi||0===this.flatCoordinates.length)return null;var r=void 0!==e&&e,i=void 0!==n&&n;return function(t,e,n,r,i,o,s){if(s)return dw(t,e,n[n.length-1],r,i,o);var a;if(i<t[r-1])return o?((a=t.slice(0,r))[r-1]=i,a):null;if(t[t.length-1]<i)return o?((a=t.slice(t.length-r))[r-1]=i,a):null;for(var u=0,l=n.length;u<l;++u){var c=n[u];if(e!=c){if(i<t[e+r-1])return null;if(i<=t[c-1])return dw(t,e,c,r,i,!1);e=c}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,r,i)},e.prototype.getCoordinates=function(){return Po(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new vw(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,n=this.layout,r=[],i=0,o=0,s=e.length;o<s;++o){var a=e[o],u=new vw(t.slice(i,a),n);r.push(u),i=a}return r},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,n=0,r=this.ends_,i=this.stride,o=0,s=r.length;o<s;++o){var a=r[o];p(t,pw(e,n,a,i,.5)),n=a}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=wo(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,r),new e(n,Ki,r)},e.prototype.getType=function(){return"MultiLineString"},e.prototype.intersectsExtent=function(t){return function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){if(zo(t,e,n[o],r,i))return!0;e=n[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=mo(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(co),xw=mw,ww=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)}}(),bw=function(t){function e(e,n){var r=t.call(this)||this;return n&&!Array.isArray(e[0])?r.setFlatCoordinates(n,e):r.setCoordinates(e,n),r}return ww(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?p(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){if(r<Z(this.getExtent(),t,e))return r;for(var i=this.flatCoordinates,o=this.stride,s=0,a=i.length;s<a;s+=o){var u=Rt(t,e,i[s],i[s+1]);if(u<r){r=u;for(var l=0;l<o;++l)n[l]=i[s+l];n.length=o}}return r},e.prototype.getCoordinates=function(){return Co(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new No(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,n=this.stride,r=[],i=0,o=t.length;i<o;i+=n){var s=new No(t.slice(i,i+n),e);r.push(s)}return r},e.prototype.getType=function(){return"MultiPoint"},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,n=this.stride,r=0,i=e.length;r<i;r+=n){if($(t,e[r],e[r+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=_o(this.flatCoordinates,0,t,this.stride),this.changed()},e}(co),Ew=bw;var Sw=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)}}(),Cw=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){for(var o=i.getLayout(),s=e,a=[],u=[],l=0,c=s.length;l<c;++l){var h=s[l];0===l&&(o=h.getLayout());for(var f=a.length,d=h.getEnds(),g=0,y=d.length;g<y;++g)d[g]+=f;p(a,h.getFlatCoordinates()),u.push(d)}n=o,e=a,r=u}return void 0!==n&&r?(i.setFlatCoordinates(n,e),i.endss_=r):i.setCoordinates(e,n),i}return Sw(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var n=this.flatCoordinates.length;p(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,i=(e=t.getEnds().slice()).length;r<i;++r)e[r]+=n}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,n=new Array(t),r=0;r<t;++r)n[r]=this.endss_[r].slice();var i=new e(this.flatCoordinates.slice(),this.layout,n);return i.applyProperties(this),i},e.prototype.closestPointXY=function(t,e,n,r){return r<Z(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];i=po(t,e,a,r,i),e=a[a.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,n,r,i,o,s,a,u,l,c){for(var h=c||[NaN,NaN],f=0,p=n.length;f<p;++f){var d=n[f];l=yo(t,e,d,r,i,o,s,a,u,l,h),e=d[d.length-1]}return l}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.containsXY=function(t,e){return function(t,e,n,r,i,o){if(0===n.length)return!1;for(var s=0,a=n.length;s<a;++s){var u=n[s];if(jo(t,e,u,r,i,o))return!0;e=u[u.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,n,r){for(var i=0,o=0,s=n.length;o<s;++o){var a=n[o];i+=Oo(t,e,a,r),e=a[a.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ho(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,Io(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=function(t,e,n,r){for(var i=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=n.length;s<a;++s){var u=n[s];o=it(t,e,u[0],r),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=u[u.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=function(t,e,n,r,i){for(var o=[],s=0,a=n.length;s<a;++s){var u=n[s];o=Go(t,e,u,r,i,2*s,o),e=u[u.length-1]}return o}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new Ew(this.getFlatInteriorPoints().slice(),$i)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(!Wo(t,e,a,r,i))return!1;a.length&&(e=a[a.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ho(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=function(t,e,n,r,i,o,s,a){for(var u=0,l=n.length;u<l;++u){var c=n[u],h=[];s=So(t,e,c,r,i,o,s,h),a.push(h),e=c[c.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,r),new e(n,Ki,r)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var n=this.endss_[t-1];e=n[n.length-1]}var r=this.endss_[t].slice(),i=r[r.length-1];if(0!==e)for(var o=0,s=r.length;o<s;++o)r[o]-=e;return new Jo(this.flatCoordinates.slice(e,i),this.layout,r)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.endss_,r=[],i=0,o=0,s=n.length;o<s;++o){var a=n[o].slice(),u=a[a.length-1];if(0!==i)for(var l=0,c=a.length;l<c;++l)a[l]-=i;var h=new Jo(e.slice(i,u),t,a);r.push(h),i=u}return r},e.prototype.getType=function(){return"MultiPolygon"},e.prototype.intersectsExtent=function(t){return function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(Uo(t,e,a,r,i))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var n=function(t,e,n,r,i){for(var o=i||[],s=0,a=0,u=n.length;a<u;++a){var l=mo(t,e,n[a],r,o[s]);o[s++]=l,e=l[l.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===n.length)this.flatCoordinates.length=0;else{var r=n[n.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},e}(co),Pw=Cw,Iw=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)}}(),Mw="Point",Ow="LineString",Lw="Polygon",kw="Circle",Rw="drawstart",Tw="drawend",Aw="drawabort",Nw=function(t){function e(e,n){var r=t.call(this,e)||this;return r.feature=n,r}return Iw(e,t),e}($t),Fw=function(t){function e(e){var n=this,r=e;r.stopDown||(r.stopDown=y),(n=t.call(this,r)||this).on,n.once,n.un,n.shouldHandle_=!1,n.downPx_=null,n.downTimeout_,n.lastDragTime_,n.pointerType_,n.freehand_=!1,n.source_=e.source?e.source:null,n.features_=e.features?e.features:null,n.snapTolerance_=e.snapTolerance?e.snapTolerance:12,n.type_=e.type,n.mode_=function(t){switch(t){case"Point":case"MultiPoint":return Mw;case"LineString":case"MultiLineString":return Ow;case"Polygon":case"MultiPolygon":return Lw;case"Circle":return kw;default:throw new Error("Invalid type: "+t)}}(n.type_),n.stopClick_=!!e.stopClick,n.minPoints_=e.minPoints?e.minPoints:n.mode_===Lw?3:2,n.maxPoints_=n.mode_===kw?2:e.maxPoints?e.maxPoints:1/0,n.finishCondition_=e.finishCondition?e.finishCondition:g,n.geometryLayout_=e.geometryLayout?e.geometryLayout:Ki;var i,o=e.geometryFunction;if(!o){var s,a=n.mode_;if(a===kw)o=function(t,e,n){var r=e||new fw([NaN,NaN]),i=Ni(t[0],n),o=nn(i,Ni(t[t.length-1],n));r.setCenterAndRadius(i,Math.sqrt(o),this.geometryLayout_);var s=Ti();return s&&r.transform(n,s),r};else a===Mw?s=No:a===Ow?s=vw:a===Lw&&(s=Jo),o=function(t,e,n){return e?a===Lw?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])],this.geometryLayout_):e.setCoordinates([],this.geometryLayout_):e.setCoordinates(t,this.geometryLayout_):e=new s(t,this.geometryLayout_),e}}return n.geometryFunction_=o,n.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,n.finishCoordinate_=null,n.sketchFeature_=null,n.sketchPoint_=null,n.sketchCoords_=null,n.sketchLine_=null,n.sketchLineCoords_=null,n.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,n.overlay_=new Nx({source:new Wx({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=$_(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),n.geometryName_=e.geometryName,n.condition_=e.condition?e.condition:Us,n.freehandCondition_,e.freehand?n.freehandCondition_=zs:n.freehandCondition_=e.freehandCondition?e.freehandCondition:Xs,n.addChangeListener(Ps,n.updateState_),n}return Iw(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===le&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Mw&&this.freehandCondition_(e);var n=e.type===pr.POINTERMOVE,r=!0;!this.freehand_&&this.lastDragTime_&&e.type===pr.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===pr.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===pr.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===pr.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===pr.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===pr.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,e)&&r},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new fr(pr.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var n=!this.finishCoordinate_;n&&this.startDrawing_(t.coordinate),!n&&this.freehand_?this.finishDrawing():this.freehand_||n&&this.mode_!==Mw||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,n=t.pixel,r=e[0]-n[0],i=e[1]-n[1],o=r*r+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var n=!1,r=[this.finishCoordinate_],i=this.mode_;if(i===Mw)e=!0;else if(i===kw)e=2===this.sketchCoords_.length;else if(i===Ow)n=this.sketchCoords_.length>this.minPoints_;else if(i===Lw){var o=this.sketchCoords_;n=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(n)for(var s=this.getMap(),a=0,u=r.length;a<u;a++){var l=r[a],c=s.getPixelFromCoordinate(l),h=t[0]-c[0],f=t[1]-c[1],p=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(h*h+f*f)<=p){this.finishCoordinate_=l;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new Va(new No(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new Va);var e=t.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),n.changed()):(n=new vw(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(n))},e.prototype.startDrawing_=function(t){for(var e=this.getMap().getView().getProjection(),n=lo(this.geometryLayout_);t.length<n;)t.push(0);this.finishCoordinate_=t,this.mode_===Mw?this.sketchCoords_=t.slice():this.mode_===Lw?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Va(new vw(this.sketchLineCoords_)));var r=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new Va,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new Nw(Rw,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){for(var e,n,r=this.getMap(),i=this.sketchFeature_.getGeometry(),o=r.getView().getProjection(),s=lo(this.geometryLayout_);t.length<s;)t.push(0);(this.mode_===Mw?n=this.sketchCoords_:this.mode_===Lw?(n=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(r.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):n=(e=this.sketchCoords_)[e.length-1],n[0]=t[0],n[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if("Polygon"===i.getType()&&this.mode_!==Lw)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,n,r=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;o===Ow||o===kw?(this.finishCoordinate_=t.slice(),(n=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),this.geometryFunction_(n,r,i)):o===Lw&&((n=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),e&&(this.finishCoordinate_=n[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;if(r===Ow||r===kw){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var i=this.finishCoordinate_.slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}this.geometryFunction_(t,e,n),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===Lw){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){i=t[t.length-2].slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,n)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,n=t.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===Ow?(e.pop(),this.geometryFunction_(e,n,r)):this.mode_===Lw&&(e[0].pop(),this.geometryFunction_(e,n,r),e=n.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new Ew([e])):"MultiLineString"===this.type_?t.setGeometry(new xw([e])):"MultiPolygon"===this.type_&&t.setGeometry(new Pw([e])),this.dispatchEvent(new Nw(Tw,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new Nw(Aw,t))},e.prototype.appendCoordinates=function(t){var e,n=this.mode_,r=!this.sketchFeature_;if(r&&this.startDrawing_(t[0]),n===Ow||n===kw)e=this.sketchCoords_;else{if(n!==Lw)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}r&&e.shift(),e.pop();for(var i=0;i<t.length;i++)this.addToDrawing_(t[i]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new Va(new No(n)),this.updateSketchFeatures_(),this.dispatchEvent(new Nw(Rw,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(Ds);var Dw=Fw,jw="preload",Gw="useInterimTilesOnError",Bw=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)}}(),zw=function(t){function e(e){var n=this,r=e||{},i=te({},r);return delete i.preload,delete i.useInterimTilesOnError,(n=t.call(this,i)||this).on,n.once,n.un,n.setPreload(void 0!==r.preload?r.preload:0),n.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),n}return Bw(e,t),e.prototype.getPreload=function(){return this.get(jw)},e.prototype.setPreload=function(t){this.set(jw,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Gw)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Gw,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(Ze),Vw=zw,Uw=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)}}(),Xw=function(t){function e(e,n,r){var i=t.call(this)||this,o=r||{};return i.tileCoord=e,i.state=n,i.interimTile=null,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i.interpolate=!!o.interpolate,i}return Uw(e,t),e.prototype.changed=function(){this.dispatchEvent(ae)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Ar)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Ar){t.interimTile=null;break}t.getState()==Tr?e=t:t.getState()==Rr?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Nr&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){_()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var r=e-n+1e3/60;return r>=this.transition_?1:Wi(r/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(se),qw=Xw,Ww=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)}}(),Yw=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,s)||this;return a.crossOrigin_=i,a.src_=r,a.key=r,a.image_=new Image,null!==i&&(a.image_.crossOrigin=i),a.unlisten_=null,a.tileLoadFunction_=o,a}return Ww(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Ar,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Nr,this.unlistenImage_(),this.image_=((t=mn(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Ar:this.state=Fr,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Nr&&(this.state=Rr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Rr&&(this.state=Tr,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=vx(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(qw);var Hw,Zw=Yw,Kw=function(){function t(t,e,n,r,i,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=Pi(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&bt(r)==bt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?bt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?bt(this.targetProj_.getExtent()):null;var u=xt(n),l=wt(n),c=pt(n),h=ft(n),f=this.transformInv_(u),p=this.transformInv_(l),d=this.transformInv_(c),g=this.transformInv_(h),y=10+(o?Math.max(0,Math.ceil(Lt(ht(n)/(o*o*256*256)))):0);if(this.addQuad_(u,l,c,h,f,p,d,g,y),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach(function(t,e,n){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,n,r,i,o){this.triangles_.push({source:[r,i,o],target:[t,e,n]})},t.prototype.addQuad_=function(t,e,n,r,i,o,s,a,u){var l=W([i,o,s,a]),c=this.sourceWorldWidth_?bt(l)/this.sourceWorldWidth_:null,h=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&c>.5&&c<1,p=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)p=bt(W([t,e,n,r]))/this.targetWorldWidth_>.25||p;!f&&this.sourceProj_.isGlobal()&&c&&(p=c>.25||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3]))||Et(l,this.maxSourceExtent_)){var d=0;if(!(p||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(u>0)p=!0;else if(1!=(d=(isFinite(i[0])&&isFinite(i[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(u>0){if(!p){var g=[(t[0]+n[0])/2,(t[1]+n[1])/2],y=this.transformInv_(g),v=void 0;if(f)v=(At(i[0],h)+At(s[0],h))/2-At(y[0],h);else v=(i[0]+s[0])/2-y[0];var _=(i[1]+s[1])/2-y[1];p=v*v+_*_>this.errorThresholdSquared_}if(p){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var m=[(e[0]+n[0])/2,(e[1]+n[1])/2],x=this.transformInv_(m),w=[(r[0]+t[0])/2,(r[1]+t[1])/2],b=this.transformInv_(w);this.addQuad_(t,e,m,w,i,o,x,b,u-1),this.addQuad_(w,m,n,r,b,x,s,a,u-1)}else{var E=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(E),C=[(n[0]+r[0])/2,(n[1]+r[1])/2],P=this.transformInv_(C);this.addQuad_(t,E,C,r,i,S,P,a,u-1),this.addQuad_(E,e,n,C,S,o,s,P,u-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}11&d||this.addTriangle_(t,n,r,i,s,a),14&d||this.addTriangle_(t,n,e,i,s,o),d&&(13&d||this.addTriangle_(e,r,t,o,a,i),7&d||this.addTriangle_(e,r,n,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(e,n,r){var i=e.source;at(t,i[0]),at(t,i[1]),at(t,i[2])}),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),Jw=Kw,$w={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Qw={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},tb=[];function eb(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function nb(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function rb(t,e,n,r){var i=Ii(n,e,t),o=wi(e,r,n),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var u=t.getExtent();if(!u||K(u,i)){var l=wi(t,o,i)/o;isFinite(l)&&l>0&&(o/=l)}return o}function ib(t,e,n,r,i,o,s,a,u,l,c,h){var f=mn(Math.round(n*t),Math.round(n*e),tb);if(h||te(f,$w),0===u.length)return f.canvas;function p(t){return Math.round(t*n)/n}f.scale(n,n),f.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];u.forEach(function(t,e,n){st(d,t.extent)});var g=bt(d),y=_t(d),v=mn(Math.round(n*g/r),Math.round(n*y/r));h||te(v,$w);var _=n/r;u.forEach(function(t,e,n){var r=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=bt(t.extent),s=_t(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,r*_,i*_,o*_,s*_)});var m=xt(s);return a.getTriangles().forEach(function(t,e,i){var s=t.source,a=t.target,u=s[0][0],l=s[0][1],c=s[1][0],g=s[1][1],y=s[2][0],_=s[2][1],x=p((a[0][0]-m[0])/o),w=p(-(a[0][1]-m[1])/o),b=p((a[1][0]-m[0])/o),E=p(-(a[1][1]-m[1])/o),S=p((a[2][0]-m[0])/o),C=p(-(a[2][1]-m[1])/o),P=u,I=l;u=0,l=0;var M=function(t){for(var e=t.length,n=0;n<e;n++){for(var r=n,i=Math.abs(t[n][n]),o=n+1;o<e;o++){var s=Math.abs(t[o][n]);s>i&&(i=s,r=o)}if(0===i)return null;var a=t[r];t[r]=t[n],t[n]=a;for(var u=n+1;u<e;u++)for(var l=-t[u][n]/t[n][n],c=n;c<e+1;c++)n==c?t[u][c]=0:t[u][c]+=l*t[n][c]}for(var h=new Array(e),f=e-1;f>=0;f--){h[f]=t[f][e]/t[f][f];for(var p=f-1;p>=0;p--)t[p][e]-=t[p][f]*h[f]}return h}([[c-=P,g-=I,0,0,b-x],[y-=P,_-=I,0,0,S-x],[0,0,c,g,E-w],[0,0,y,_,C-w]]);if(M){if(f.save(),f.beginPath(),function(){if(void 0===Hw){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",eb(t,4,5,4,0),eb(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Hw=nb(e,0)||nb(e,4)||nb(e,8)}return Hw}()||!h){f.moveTo(b,E);for(var O=x-b,L=w-E,k=0;k<4;k++)f.lineTo(b+p((k+1)*O/4),E+p(k*L/3)),3!=k&&f.lineTo(b+p((k+1)*O/4),E+p((k+1)*L/3));f.lineTo(S,C)}else f.moveTo(b,E),f.lineTo(x,w),f.lineTo(S,C);f.clip(),f.transform(M[0],M[2],M[1],M[3],x,w),f.translate(d[0]-P,d[3]-I),f.scale(r/n,-r/n),f.drawImage(v.canvas,0,0),f.restore()}}),c&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach(function(t,e,n){var r=t.target,i=(r[0][0]-m[0])/o,s=-(r[0][1]-m[1])/o,a=(r[1][0]-m[0])/o,u=-(r[1][1]-m[1])/o,l=(r[2][0]-m[0])/o,c=-(r[2][1]-m[1])/o;f.beginPath(),f.moveTo(a,u),f.lineTo(i,s),f.lineTo(l,c),f.closePath(),f.stroke()}),f.restore()),f.canvas}var ob=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)}}(),sb=function(t){function e(e,n,r,i,o,s,a,u,l,c,h,f){var p=t.call(this,o,Rr,{interpolate:!!f})||this;p.renderEdges_=void 0!==h&&h,p.pixelRatio_=a,p.gutter_=u,p.canvas_=null,p.sourceTileGrid_=n,p.targetTileGrid_=i,p.wrappedTileCoord_=s||o,p.sourceTiles_=[],p.sourcesListenerKeys_=null,p.sourceZ_=0;var d=i.getTileCoordExtent(p.wrappedTileCoord_),g=p.targetTileGrid_.getExtent(),y=p.sourceTileGrid_.getExtent(),v=g?mt(d,g):d;if(0===ht(v))return p.state=Fr,p;var _=e.getExtent();_&&(y=y?mt(y,_):_);var m=i.getResolution(p.wrappedTileCoord_[0]),x=function(t,e,n,r){var i=dt(n),o=rb(t,e,i,r);return(!isFinite(o)||o<=0)&&ct(n,function(n){return o=rb(t,e,n,r),isFinite(o)&&o>0}),o}(e,r,v,m);if(!isFinite(x)||x<=0)return p.state=Fr,p;var w=void 0!==c?c:.5;if(p.triangulation_=new Jw(e,r,v,y,x*w,m),0===p.triangulation_.getTriangles().length)return p.state=Fr,p;p.sourceZ_=n.getZForResolution(x);var b=p.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(b[1]=Mt(b[1],y[1],y[3]),b[3]=Mt(b[3],y[1],y[3])):b=mt(b,y)),ht(b)){for(var E=n.getTileRangeForExtentAndZ(b,p.sourceZ_),S=E.minX;S<=E.maxX;S++)for(var C=E.minY;C<=E.maxY;C++){var P=l(p.sourceZ_,S,C,a);P&&p.sourceTiles_.push(P)}0===p.sourceTiles_.length&&(p.state=Fr)}else p.state=Fr;return p}return ob(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,r){e&&e.getState()==Ar&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Nr;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),r="number"==typeof n?n:n[0],i="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=ib(r,i,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=Ar}this.changed()},e.prototype.load=function(){if(this.state==Rr){this.state=Tr,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,r){var i=e.getState();if(i==Rr||i==Tr){t++;var o=_e(e,ae,function(n){var r=e.getState();r!=Ar&&r!=Nr&&r!=Fr||(xe(o),0===--t&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(t,e,n){t.getState()==Rr&&t.load()})}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(xe),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(xn(this.canvas_.getContext("2d")),tb.push(this.canvas_),this.canvas_=null),t.prototype.release.call(this)},e}(qw),ab=sb,ub=function(){function t(t,e,n,r){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function lb(t,e,n,r,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new ub(t,e,n,r)}var cb=ub,hb=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)}}(),fb=function(t){function e(e){var n=t.call(this,e)||this;return n.extentChanged=!0,n.renderedExtent_=null,n.renderedPixelRatio,n.renderedProjection=null,n.renderedRevision,n.renderedTiles=[],n.newTiles_=!1,n.tmpExtent=[1/0,1/0,-1/0,-1/0],n.tmpTileRange_=new cb(0,0,0,0),n}return hb(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),r=e.getUseInterimTilesOnError();return n==Ar||n==Fr||n==Nr&&!r},e.prototype.getTile=function(t,e,n,r){var i=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,n,i,o);return a.getState()==Nr&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(Ar)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),r=F(e.pixelToCoordinateTransform,t.slice()),i=n.getExtent();if(i&&!K(i,r))return null;for(var o=e.pixelRatio,s=e.viewState.projection,a=e.viewState,u=n.getRenderSource(),l=u.getTileGridForProjection(a.projection),c=u.getTilePixelRatio(e.pixelRatio),h=l.getZForResolution(a.resolution);h>=l.getMinZoom();--h){var f=l.getTileCoordForCoordAndZ(r,h),p=u.getTile(h,f[1],f[2],o,s);if(!(p instanceof Zw||p instanceof ab))return null;if(p.getState()===Ar){var d=l.getOrigin(h),g=as(l.getTileSize(h)),y=l.getResolution(h),v=Math.floor(c*((r[0]-d[0])/y-f[1]*g[0])),_=Math.floor(c*((d[1]-r[1])/y-f[2]*g[1])),m=Math.round(c*u.getGutterForProjection(a.projection));return this.getImageData(p.getImage(),v+m,_+m)}}return null},e.prototype.loadedTileCallback=function(e,n,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,e,n,r)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var n=t.layerStatesArray[t.layerIndex],r=t.viewState,i=r.projection,o=r.resolution,s=r.center,a=r.rotation,u=t.pixelRatio,l=this.getLayer(),h=l.getSource(),f=h.getRevision(),p=h.getTileGridForProjection(i),d=p.getZForResolution(o,h.zDirection),g=p.getResolution(d),y=t.extent,v=t.viewState.resolution,_=h.getTilePixelRatio(u),m=Math.round(bt(y)/v*u),w=Math.round(_t(y)/v*u),b=n.extent&&Di(n.extent,i);b&&(y=mt(y,Di(n.extent,i)));var E=g*m/2/_,S=g*w/2/_,C=[s[0]-E,s[1]-S,s[0]+E,s[1]+S],P=p.getTileRangeForExtentAndZ(y,d),I={};I[d]={};var M=this.createLoadedTileFinder(h,i,I),O=this.tmpExtent,L=this.tmpTileRange_;this.newTiles_=!1;for(var k=a?vt(r.center,v,a,t.size):void 0,R=P.minX;R<=P.maxX;++R)for(var T=P.minY;T<=P.maxY;++T)if(!a||p.tileCoordIntersectsViewport([d,R,T],k)){var A=this.getTile(d,R,T,t);if(this.isDrawableTile(A)){var N=x(this);if(A.getState()==Ar)I[d][A.tileCoord.toString()]=A,(lt=A.inTransition(N))&&1!==n.opacity&&(A.endTransition(N),lt=!1),this.newTiles_||!lt&&-1!==this.renderedTiles.indexOf(A)||(this.newTiles_=!0);if(1===A.getAlpha(N,t.time))continue}var B=p.getTileCoordChildTileRange(A.tileCoord,L,O),z=!1;B&&(z=M(d+1,B)),z||p.forEachTileCoordParentTileRange(A.tileCoord,M,L,O)}var V=g/o*u/_;D(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/u,1/u,a,-m/2,-w/2);var U=G(this.pixelTransform);this.useContainer(e,U,this.getBackground(t));var X=this.context,q=X.canvas;j(this.inversePixelTransform,this.pixelTransform),D(this.tempTransform,m/2,w/2,V,V,0,-m/2,-w/2),q.width!=m||q.height!=w?(q.width=m,q.height=w):this.containerReused||X.clearRect(0,0,m,w),b&&this.clipUnrotated(X,t,b),h.getInterpolate()||te(X,$w),this.preRender(X,t),this.renderedTiles.length=0;var W,Y,H,Z=Object.keys(I).map(Number);Z.sort(c),1!==n.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(W=[],Y=[]):Z=Z.reverse();for(var K=Z.length-1;K>=0;--K){var J=Z[K],$=h.getTilePixelSize(J,u,i),Q=p.getResolution(J)/g,tt=$[0]*Q*V,et=$[1]*Q*V,nt=p.getTileCoordForCoordAndZ(xt(C),J),rt=p.getTileCoordExtent(nt),it=F(this.tempTransform,[_*(rt[0]-C[0])/g,_*(C[3]-rt[3])/g]),st=_*h.getGutterForProjection(i),at=I[J];for(var ut in at){var lt,ct=(A=at[ut]).tileCoord,ht=nt[1]-ct[1],ft=Math.round(it[0]-(ht-1)*tt),pt=nt[2]-ct[2],dt=Math.round(it[1]-(pt-1)*et),gt=ft-(R=Math.round(it[0]-ht*tt)),yt=dt-(T=Math.round(it[1]-pt*et)),wt=d===J,St=!1;if(!(lt=wt&&1!==A.getAlpha(x(this),t.time)))if(W){H=[R,T,R+gt,T,R+gt,T+yt,R,T+yt];for(var Ct=0,Pt=W.length;Ct<Pt;++Ct)if(d!==J&&J<Y[Ct]){var It=W[Ct];Et([R,T,R+gt,T+yt],[It[0],It[3],It[4],It[7]])&&(St||(X.save(),St=!0),X.beginPath(),X.moveTo(H[0],H[1]),X.lineTo(H[2],H[3]),X.lineTo(H[4],H[5]),X.lineTo(H[6],H[7]),X.moveTo(It[6],It[7]),X.lineTo(It[4],It[5]),X.lineTo(It[2],It[3]),X.lineTo(It[0],It[1]),X.clip())}W.push(H),Y.push(J)}else X.clearRect(R,T,gt,yt);this.drawTileImage(A,t,R,T,gt,yt,st,wt),W&&!lt?(St&&X.restore(),this.renderedTiles.unshift(A)):this.renderedTiles.push(A),this.updateUsedTiles(t.usedTiles,h,A)}}return this.renderedRevision=f,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!ot(this.renderedExtent_,C),this.renderedExtent_=C,this.renderedPixelRatio=u,this.renderedProjection=i,this.manageTilePyramid(t,h,p,u,i,y,d,l.getPreload()),this.scheduleExpireCache(t,h),this.postRender(X,t),n.extent&&X.restore(),te(X,Qw),U!==q.style.transform&&(q.style.transform=U),this.container},e.prototype.drawTileImage=function(t,e,n,r,i,o,s,a){var u=this.getTileImage(t);if(u){var l=x(this),c=e.layerStatesArray[e.layerIndex],h=c.opacity*(a?t.getAlpha(l,e.time):1),f=h!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=h),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,n,r,i,o),f&&this.context.restore(),h!==c.opacity?e.animate=!0:a&&t.endTransition(l)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var n=function(t,e,n){var r=x(t);r in n.usedTiles&&t.expireCache(n.viewState.projection,n.usedTiles[r])}.bind(null,e);t.postRenderFunctions.push(n)}},e.prototype.updateUsedTiles=function(t,e,n){var r=x(e);r in t||(t[r]={}),t[r][n.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,n,r,i,o,s,a,u){var l=x(e);l in t.wantedTiles||(t.wantedTiles[l]={});var c,h,f,p,d,g,y=t.wantedTiles[l],v=t.tileQueue,_=n.getMinZoom(),m=t.viewState.rotation,w=m?vt(t.viewState.center,t.viewState.resolution,m,t.size):void 0,b=0;for(g=_;g<=s;++g)for(h=n.getTileRangeForExtentAndZ(o,g,h),f=n.getResolution(g),p=h.minX;p<=h.maxX;++p)for(d=h.minY;d<=h.maxY;++d)m&&!n.tileCoordIntersectsViewport([g,p,d],w)||(s-g<=a?(++b,(c=e.getTile(g,p,d,r,i)).getState()==Rr&&(y[c.getKey()]=!0,v.isKeyQueued(c.getKey())||v.enqueue([c,l,n.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(g,p,d,i));e.updateCacheSize(b,i)},e}(Gm),pb=fb,db=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)}}(),gb=function(t){function e(e){return t.call(this,e)||this}return db(e,t),e.prototype.createRenderer=function(){return new pb(this)},e}(Vw),yb=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var n=this.entries_[t];return T(void 0!==n,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_},t.prototype.remove=function(t){var e=this.entries_[t];return T(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(t){if(this.containsKey(t))return this.entries_[t].value_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){T(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),vb=yb;function _b(t,e,n,r){return void 0!==r?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function mb(t,e,n){return t+"/"+e+"/"+n}function xb(t){return mb(t[0],t[1],t[2])}var wb=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)}}(),bb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wb(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=function(t){return t.split("/").map(Number)}(this.peekFirstKey()),e=t[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(xb(t.tileCoord)),t.release())}.bind(this))}},e}(vb),Eb=bb,Sb="tileloadstart",Cb="tileloadend",Pb="tileloaderror",Ib=[0,0,0],Mb=function(){function t(t){var e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,T(function(t,e,n){var r=e||c;return t.every(function(e,i){if(0===i)return!0;var o=r(t[i-1],e);return!(o>0||n&&0===o)})}(this.resolutions_,function(t,e){return e-t},!0),17),!t.origins)for(var n=0,r=this.resolutions_.length-1;n<r;++n)if(e){if(this.resolutions_[n]/this.resolutions_[n+1]!==e){e=void 0;break}}else e=this.resolutions_[n]/this.resolutions_[n+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,T(this.origins_.length==this.resolutions_.length,20));var i=t.extent;void 0===i||this.origin_||this.origins_||(this.origin_=xt(i)),T(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,T(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Wr,T(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==i?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map(function(t,e){var n=new cb(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(i){var r=this.getTileRangeForExtentAndZ(i,e);n.minX=Math.max(r.minX,n.minX),n.maxX=Math.min(r.maxX,n.maxX),n.minY=Math.max(r.minY,n.minY),n.maxY=Math.min(r.maxY,n.maxY)}return n},this):i&&this.calculateTileRanges_(i)}return t.prototype.forEachTileCoord=function(t,e,n){for(var r=this.getTileRangeForExtentAndZ(t,e),i=r.minX,o=r.maxX;i<=o;++i)for(var s=r.minY,a=r.maxY;s<=a;++s)n([e,i,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,n,r){var i,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):s=this.getTileCoordExtent(t,r);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?lb(i=Math.floor(i/2),i,o=Math.floor(o/2),o,n):this.getTileRangeForExtentAndZ(s,a,n)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,n){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var r=2*t[1],i=2*t[2];return lb(r,r+1,i,i+1,e)}var o=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;var r=t[0],i=t[1],o=t[2];if(e===r)return lb(i,o,i,o,n);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-r),a=Math.floor(i*s),u=Math.floor(o*s);return e<r?lb(a,a,u,u,n):lb(a,Math.floor(s*(i+1))-1,u,Math.floor(s*(o+1))-1,n)}var l=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(l,e,n)},t.prototype.getTileRangeExtent=function(t,e,n){var r=this.getOrigin(t),i=this.getResolution(t),o=as(this.getTileSize(t),this.tmpSize_),s=r[0]+e.minX*o[0]*i,a=r[0]+(e.maxX+1)*o[0]*i;return et(s,r[1]+e.minY*o[1]*i,a,r[1]+(e.maxY+1)*o[1]*i,n)},t.prototype.getTileRangeForExtentAndZ=function(t,e,n){var r=Ib;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,r);var i=r[1],o=r[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,r),lb(i,r[1],o,r[2],n)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=as(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*r[0]*n,e[1]-(t[2]+.5)*r[1]*n]},t.prototype.getTileCoordExtent=function(t,e){var n=this.getOrigin(t[0]),r=this.getResolution(t[0]),i=as(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*i[0]*r,s=n[1]-(t[2]+1)*i[1]*r;return et(o,s,o+i[0]*r,s+i[1]*r,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,n,r,i){var o=this.getZForResolution(n),s=n/this.getResolution(o),a=this.getOrigin(o),u=as(this.getTileSize(o),this.tmpSize_),l=s*(t-a[0])/n/u[0],c=s*(a[1]-e)/n/u[1];return r?(l=Gt(l,5)-1,c=Gt(c,5)-1):(l=jt(l,5),c=jt(c,5)),_b(o,l,c,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,n,r,i){var o=this.getOrigin(n),s=this.getResolution(n),a=as(this.getTileSize(n),this.tmpSize_),u=(t-o[0])/s/a[0],l=(o[1]-e)/s/a[1];return r?(u=Gt(u,5)-1,l=Gt(l,5)-1):(u=jt(u,5),l=jt(l,5)),_b(n,u,l,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return Mt(h(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.tileCoordIntersectsViewport=function(t,e){return Vo(e,0,e.length,2,this.getTileCoordExtent(t))},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,n=new Array(e),r=this.minZoom;r<e;++r)n[r]=this.getTileRangeForExtentAndZ(t,r);this.fullTileRanges_=n},t}(),Ob=Mb;function Lb(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,n,r){var i=Rb(t);return function(t,e,n,r){var i=void 0!==r?r:"top-left",o=kb(t,e,n);return new Ob({extent:t,origin:gt(t,i),resolutions:o,tileSize:n})}(i,e,n,r)}(t),t.setDefaultTileGrid(e)),e}function kb(t,e,n,r){for(var i=void 0!==e?e:42,o=_t(t),s=bt(t),a=as(void 0!==n?n:Wr),u=r>0?r:Math.max(s/a[0],o/a[1]),l=i+1,c=new Array(l),h=0;h<l;++h)c[h]=u/Math.pow(2,h);return c}function Rb(t){var e=(t=xi(t)).getExtent();if(!e){var n=180*zr[Vr.DEGREES]/t.getMetersPerUnit();e=et(-n,-n,n,n)}return e}var Tb=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)}}(),Ab=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||this;n.on,n.once,n.un,n.opaque_=void 0!==e.opaque&&e.opaque,n.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,n.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;return n.tileGrid&&as(n.tileGrid.getTileSize(n.tileGrid.getMinZoom()),[256,256]),n.tileCache=new Eb(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition,interpolate:e.interpolate},n.zDirection=e.zDirection?e.zDirection:0,n}return Tb(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,n,r){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,s,a,u=!0,l=n.minX;l<=n.maxX;++l)for(var c=n.minY;c<=n.maxY;++c)s=mb(e,l,c),a=!1,i.containsKey(s)&&(a=(o=i.get(s)).getState()===Ar)&&(a=!1!==r(o)),a||(u=!1);return u},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,e,n,r,i){return _()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Lb(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return T(null===e||Si(e,t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,n){var r,i,o,s=this.getTileGridForProjection(n),a=this.getTilePixelRatio(e),u=as(s.getTileSize(t),this.tmpSize);return 1==a?u:(r=u,i=a,void 0===(o=this.tmpSize)&&(o=[0,0]),o[0]=r[0]*i+.5|0,o[1]=r[1]*i+.5|0,o)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=function(t,e,n){var r=e[0],i=t.getTileCoordCenter(e),o=Rb(n);if(K(o,i))return e;var s=bt(o),a=Math.ceil((o[0]-i[0])/s);return i[0]+=s*a,t.getTileCoordForCoordAndZ(i,r)}(r,t,n)),function(t,e){var n=t[0],r=t[1],i=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return!o||o.containsXY(r,i)}(t,r)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},e.prototype.useTile=function(t,e,n,r){},e}(Gx),Nb=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tile=n,r}return Tb(e,t),e}($t),Fb=Ab;function Db(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,u){return s?t.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,function(){var t=s[0],n=e.getFullTileRange(t);return T(n,55),(n.getHeight()-s[2]-1).toString()}):void 0}}function jb(t,e){for(var n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=Db(t[i],e);return function(t){if(1===t.length)return t[0];return function(e,n,r){if(e){var i=function(t){return(t[1]<<t[0])+t[2]}(e),o=At(i,t.length);return t[o](e,n,r)}}}(r)}var Gb=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)}}(),Bb=function(t){function e(n){var r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,interpolate:n.interpolate,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return r.generateTileUrlFunction_=r.tileUrlFunction===e.prototype.tileUrlFunction,r.tileLoadFunction=n.tileLoadFunction,n.tileUrlFunction&&(r.tileUrlFunction=n.tileUrlFunction),r.urls=null,n.urls?r.setUrls(n.urls):n.url&&r.setUrl(n.url),r.tileLoadingKeys_={},r}return Gb(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,n=t.target,r=x(n),i=n.getState();i==Tr?(this.tileLoadingKeys_[r]=!0,e=Sb):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=i==Nr?Pb:i==Ar?Cb:void 0),null!=e&&this.dispatchEvent(new Nb(e,n))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],n=/\{([a-z])-([a-z])\}/.exec(t);if(n){var r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),o=void 0;for(o=r;o<=i;++o)e.push(t.replace(n[0],String.fromCharCode(o)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(n[2],10),a=parseInt(n[1],10);a<=s;a++)e.push(t.replace(n[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(jb(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,n){},e.prototype.useTile=function(t,e,n){var r=mb(t,e,n);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(Fb),zb=Bb,Vb=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)}}(),Ub=function(t){function e(e){var n=this,r=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(r=e.interpolate),(n=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Xb,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:r,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,n.tileClass=void 0!==e.tileClass?e.tileClass:Zw,n.tileCacheForProjection={},n.tileGridForProjection={},n.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,n.renderReprojectionEdges_=!1,n}return Vb(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==n?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[r];i.expireCache(i==n?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Si(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Si(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Si(e,t)){var n=x(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=Lb(t)),this.tileGridForProjection[n]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Si(e,t))return this.tileCache;var n=x(t);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new Eb(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]},e.prototype.createTile_=function(t,e,n,r,i,o){var s=[t,e,n],a=this.getTileCoordForTileUrlFunction(s,i),u=a?this.tileUrlFunction(a,r,i):void 0,l=new this.tileClass(s,void 0!==u?Rr:Fr,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=o,l.addEventListener(ae,this.handleTileChange.bind(this)),l},e.prototype.getTile=function(t,e,n,r,i){var o=this.getProjection();if(o&&i&&!Si(o,i)){var s=this.getTileCacheForProjection(i),a=[t,e,n],u=void 0,l=xb(a);s.containsKey(l)&&(u=s.get(l));var c=this.getKey();if(u&&u.key==c)return u;var h=this.getTileGridForProjection(o),f=this.getTileGridForProjection(i),p=this.getTileCoordForTileUrlFunction(a,i),d=new ab(o,h,i,f,a,p,this.getTilePixelRatio(r),this.getGutter(),function(t,e,n,r){return this.getTileInternal(t,e,n,r,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return d.key=c,u?(d.interimTile=u,d.refreshInterimChain(),s.replace(l,d)):s.set(l,d),d}return this.getTileInternal(t,e,n,r,o||i)},e.prototype.getTileInternal=function(t,e,n,r,i){var o=null,s=mb(t,e,n),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var u=o;o=this.createTile_(t,e,n,r,i,a),u.getState()==Rr?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,n,r,i,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var n=xi(t);if(n){var r=x(n);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}},e}(zb);function Xb(t,e){t.getImage().src=e}var qb=Ub,Wb=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)}}(),Yb=function(t){function e(e){var n=this,r=e||{},i=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(i=r.interpolate);var o=void 0!==r.projection?r.projection:"EPSG:3857",s=void 0!==r.tileGrid?r.tileGrid:function(t){var e=t||{},n=e.extent||xi("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:kb(n,e.maxZoom,e.tileSize,e.maxResolution)};return new Ob(r)}({extent:Rb(o),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return(n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:i,opaque:r.opaque,projection:o,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:s,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this).gutter_=void 0!==r.gutter?r.gutter:0,n}return Wb(e,t),e.prototype.getGutter=function(){return this.gutter_},e}(qb),Hb=Yb,Zb=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)}}(),Kb="element",Jb="map",$b="offset",Qb="position",tE="positioning",eE=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un,n.options=e,n.id=e.id,n.insertFirst=void 0===e.insertFirst||e.insertFirst,n.stopEvent=void 0===e.stopEvent||e.stopEvent,n.element=document.createElement("div"),n.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",n.element.style.position="absolute",n.element.style.pointerEvents="auto";var r=e.autoPan;return r&&"object"!=typeof r&&(r={animation:e.autoPanAnimation,margin:e.autoPanMargin}),n.autoPan=r||!1,n.rendered={transform_:"",visible:!0},n.mapPostrenderListenerKey=null,n.addChangeListener(Kb,n.handleElementChanged),n.addChangeListener(Jb,n.handleMapChanged),n.addChangeListener($b,n.handleOffsetChanged),n.addChangeListener(Qb,n.handlePositionChanged),n.addChangeListener(tE,n.handlePositioningChanged),void 0!==e.element&&n.setElement(e.element),n.setOffset(void 0!==e.offset?e.offset:[0,0]),n.setPositioning(e.positioning||"top-left"),void 0!==e.position&&n.setPosition(e.position),n}return Zb(e,t),e.prototype.getElement=function(){return this.get(Kb)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Jb)||null},e.prototype.getOffset=function(){return this.get($b)},e.prototype.getPosition=function(){return this.get(Qb)},e.prototype.getPositioning=function(){return this.get(tE)},e.prototype.handleElementChanged=function(){Cn(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Sn(this.element),xe(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=_e(t,xr,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(Kb,t)},e.prototype.setMap=function(t){this.set(Jb,t)},e.prototype.setOffset=function(t){this.set($b,t)},e.prototype.setPosition=function(t){this.set(Qb,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(Qb)){var n=this.getRect(e.getTargetElement(),e.getSize()),r=this.getElement(),i=this.getRect(r,[wn(r),bn(r)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!J(n,i)){var a=i[0]-n[0],u=n[2]-i[2],l=i[1]-n[1],c=n[3]-i[3],h=[0,0];if(a<0?h[0]=a-s:u<0&&(h[0]=Math.abs(u)+s),l<0?h[1]=l-s:c<0&&(h[1]=Math.abs(c)+s),0!==h[0]||0!==h[1]){var f=e.getView().getCenterInternal(),p=e.getPixelFromCoordinateInternal(f);if(!p)return;var d=[p[0]+h[0],p[1]+h[1]],g=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(d),duration:g.duration,easing:g.easing})}}}},e.prototype.getRect=function(t,e){var n=t.getBoundingClientRect(),r=n.left+window.pageXOffset,i=n.top+window.pageYOffset;return[r,i,r+e[0],i+e[1]]},e.prototype.setPositioning=function(t){this.set(tE,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var n=t.getPixelFromCoordinate(e),r=t.getSize();this.updateRenderedPosition(n,r)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var n=this.element.style,r=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+r[0])+"px",s=Math.round(t[1]+r[1])+"px",a="0%",u="0%";"bottom-right"==i||"center-right"==i||"top-right"==i?a="-100%":"bottom-center"!=i&&"center-center"!=i&&"top-center"!=i||(a="-50%"),"bottom-left"==i||"bottom-center"==i||"bottom-right"==i?u="-100%":"center-left"!=i&&"center-center"!=i&&"center-right"!=i||(u="-50%");var l="translate(".concat(a,", ").concat(u,") translate(").concat(o,", ").concat(s,")");this.rendered.transform_!=l&&(this.rendered.transform_=l,n.transform=l,n.msTransform=l)},e.prototype.getOptions=function(){return this.options},e}(Ie),nE=eE,rE=n(2857),iE=n.n(rE),oE=n(846),sE=n.n(oE),aE=n(1974),uE=n.n(aE),lE=n(2281),cE=n.n(lE),hE=n(6613),fE=n.n(hE),pE=n(6674),dE=n.n(pE),gE=n(7578),yE={};yE.styleTagTransform=dE(),yE.setAttributes=cE(),yE.insert=uE().bind(null,"head"),yE.domAPI=sE(),yE.insertStyleElement=fE();iE()(gE.A,yE),gE.A&&gE.A.locals&&gE.A.locals;function vE(t){return vE="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},vE(t)}function _E(t){return function(t){if(Array.isArray(t))return mE(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 mE(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)?mE(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 mE(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 xE(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,bE(r.key),r)}}function wE(t,e,n){return(e=bE(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bE(t){var e=function(t,e){if("object"!=vE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=vE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vE(e)?e:e+""}function EE(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 SE(t,e){return t.get(CE(t,e))}function CE(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 PE=new WeakMap,IE=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),EE(this,PE,{}),wE(this,"source",void 0),wE(this,"getSource",function(){return n.source}),wE(this,"setSource",function(t){SE(PE,n).setSource(t),n.source=t}),wE(this,"getStyle",function(){return n.style}),wE(this,"setStyle",function(t){SE(PE,n).setstyle(t),n.style=t}),wE(this,"addFeature",function(t){n.source.addFeature(t)}),wE(this,"removeFeature",function(t){n.source.removeFeature(t)}),this.init(e),SE(PE,this).addFeature=this.addFeature,SE(PE,this).removeFeature=this.removeFeature,SE(PE,this).getSource=this.getSource,SE(PE,this)},(e=[{key:"init",value:function(t){if(!t)return new Nx({source:new Wx});var e={};Array.isArray(t)?(e.features=t,e.zIndex=1e3):(e.features=t.features,e.zIndex=t.zIndex);var n,r,i,o=new Wx({features:_E(e.features)});this.source=o,n=PE,r=this,i=new Nx({source:o,zIndex:e.zIndex}),n.set(CE(n,r),i)}}])&&xE(t.prototype,e),n&&xE(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),ME=xi("EPSG:4326"),OE={projection:ME,center:[120.566032634,33.355905081],zoom:13,maxZoom:18,minZoom:3,extent:[65.32783475401652,.4243521114706,160.16017906160056,73.83501005646247]},LE={CLICK:"click",DBLCLICK:"dbclick"};function kE(t){return kE="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},kE(t)}function RE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function TE(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?RE(Object(n),!0).forEach(function(e){AE(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):RE(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function AE(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=kE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=kE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==kE(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var NE=TE(TE({},LE),{},{POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",CHANGE_RESOLUTION:"change:resolution",LOADEND:"loadend"});function FE(t){return FE="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},FE(t)}function DE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,jE(r.key),r)}}function jE(t){var e=function(t,e){if("object"!=FE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=FE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==FE(e)?e:e+""}function GE(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 BE(t,e){return t.get(function(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")}(t,e))}var zE=new WeakMap,VE=function(){return t=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),GE(this,zE,{}),this.context=e,this.target=n},e=[{key:"eventList",get:function(){return BE(zE,this)}},{key:"eventCallback",value:function(t,e,n){n&&"function"===FE(n).toLocaleLowerCase()&&n({lnglat:t.coordinate,type:e,target:this.context,MAP_EVENT:t})}},{key:"onEvent",value:function(t,e,n,r){var i=t[e.toLocaleUpperCase()];if(BE(zE,this)[i])BE(zE,this)[i].set(n,r);else{var o=new WeakMap;o.set(n,r),BE(zE,this)[i]=o}var s=this.target.on(i,r);return s&&(s.eventType=e),s}},{key:"on",value:function(t,e,n){var r=this;if(t){var i;if(n||(n=LE),Array.isArray(t))return i=t.map(function(t){return r.on(t,e)});var o=n[t.toLocaleUpperCase()];if(o){var s=this;if(BE(zE,this)[o])BE(zE,this)[o].set(e,u);else{var a=new WeakMap;a.set(e,u),BE(zE,this)[o]=a}return(i=this.target.on(o,u))&&(i.eventType=t),i}console.error("Current events are not supported.")}function u(t){return s.eventCallback(t,o,e)}}},{key:"off",value:function(t,e,n){var r,i=this;if(!t)return!1;if(Array.isArray(t))return t.map(function(t){return i.off(t,e)});var o=n[t.toLocaleUpperCase()];return this.target.un(o,e),!(null===(r=BE(zE,this)[o])||void 0===r||!r.get(e)||(this.target.un(o,BE(zE,this)[o].get(e)),BE(zE,this)[o].delete(e),0))}},{key:"featureOn",value:function(t,e,n){var r=this;if(t){var i;if(n||(n=LE),Array.isArray(t))return i=t.map(function(t){return r.featureOn(t,e)});var o=n[t.toLocaleUpperCase()];if(o){var s=this;if(BE(zE,this)[o])BE(zE,this)[o].set(e,u);else{var a=new WeakMap;a.set(e,u),BE(zE,this)[o]=a}return(i=this.target.on(o,u))&&(i.eventType=t),i}console.error("Current events are not supported.")}function u(t){var n=[];s.target.forEachFeatureAtPixel(t.pixel,function(t,e,r){n.push(t)});var r=n.find(function(t){return Array.isArray(s.context.feature)?s.context.feature.some(function(e){return e===t}):t===s.context.feature});if(r)return s.eventCallback(t,o,e)}}}],e&&DE(t.prototype,e),n&&DE(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function UE(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 XE(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)?XE(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 XE(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 qE(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function WE(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=UE(t[i].map(parseFloat),2),s=o[0],a=o[1],u=UE(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=UE(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=UE(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)}function YE(t){return YE="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},YE(t)}function HE(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 ZE(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?HE(Object(n),!0).forEach(function(e){KE(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):HE(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function KE(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=YE(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=YE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==YE(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var JE=ZE(ZE({},LE),{},{POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup"});function $E(t){return $E="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},$E(t)}function QE(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 tS(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)?tS(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 tS(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 eS(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 nS(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?eS(Object(n),!0).forEach(function(e){rS(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):eS(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function rS(t,e,n){return(e=oS(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iS(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,oS(r.key),r)}}function oS(t){var e=function(t,e){if("object"!=$E(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=$E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$E(e)?e:e+""}function sS(t,e,n){aS(t,e),e.set(t,n)}function aS(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function uS(t,e){return t.get(cS(t,e))}function lS(t,e,n){return t.set(cS(t,e),n),n}function cS(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 hS=new WeakMap,fS=new WeakMap,pS=new WeakMap,dS=new WeakMap,gS=new WeakMap,yS=new WeakSet,vS=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),aS(n=this,r=yS),r.add(n),sS(this,hS,void 0),sS(this,fS,void 0),sS(this,pS,void 0),sS(this,dS,void 0),sS(this,gS,void 0),this.init(cS(yS,this,_S).call(this,e))},e=[{key:"init",value:function(t){var e=this;if(console.log("options",t),!t)return!1;lS(pS,this,qE()),t.isGeomPolygon?(this.isGeomPolygon=!0,lS(hS,this,new Va({type:"polygon",geometry:new Jo(t.path),name:uS(pS,this)}))):Array.isArray(t.path[0][0])?(lS(hS,this,[]),t.path.forEach(function(t){uS(hS,e).push(new Va({type:"polygon",geometry:new Jo([t]),name:uS(pS,e)}))})):lS(hS,this,new Va({type:"polygon",geometry:new Jo([t.path]),name:uS(pS,this)}));var n=new tm({stroke:new H_({width:t.borderWidth,color:t.strokeColor}),fill:new W_({color:t.fillColor})});this.style=n,Array.isArray(uS(hS,this))?(uS(hS,this).forEach(function(t){t.setStyle(n)}),this.layer=new IE(uS(hS,this))):(uS(hS,this).setStyle(n),this.layer=new IE([uS(hS,this)])),t.map&&this.setMap(t.map),t.extData&&(this.extData=t.extData)}},{key:"setExtData",value:function(t){this.extData=nS(nS({},this.extData),t)}},{key:"feature",get:function(){return uS(hS,this)}},{key:"getPath",value:function(){return this.layer.getSource().getFeatures()[0].getGeometry().getCoordinates()[0]}},{key:"setPath",value:function(t){if(!t)return!1;this.layer.getSource().getFeatures()[0].getGeometry().setCoordinates([t])}},{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){uS(fS,this)&&uS(fS,this).removeFeature(this.layer),t?(t.addFeature(this.layer),lS(fS,this,t),lS(gS,this,new VE(this,uS(fS,this).map))):uS(fS,this)&&uS(fS,this).removeFeature(this.layer)}},{key:"map",get:function(){return uS(fS,this)}},{key:"eventList",get:function(){return uS(gS,this).eventList}},{key:"on",value:function(t,e){return uS(gS,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return uS(gS,this).off(t,e,JE)}},{key:"openEdit",value:function(t,e){uS(fS,this).editGeom(this,t,e)}},{key:"closeEdit",value:function(){return!!uS(fS,this).getEditGeom(this)&&uS(fS,this).closeEditGeom(this)}},{key:"getArea",value:function(){if(this.isGeomPolygon){var t,e=this.layer.getSource().getFeatures()[0].getGeometry().getCoordinates();return WE(e[0])-(null!==(t=e.slice(1))&&void 0!==t?t:[]).reduce(function(t,e){return t+WE(e)},0)}return WE(this.getPath())}},{key:"getLength",value:function(){return 1e3*Bh(Qa(this.getPath()),{units:"kilometers"})}},{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=QE(t[i].map(parseFloat),2),s=o[0],a=o[1],u=QE(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=QE(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=QE(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:"setActive",value:function(t){"boolean"!==$E(t).toLocaleString()&&(t=!!t),this.active=t,t?cS(yS,this,mS).call(this,this.activeStyle):cS(yS,this,mS).call(this,this.style)}},{key:"isActive",value:function(){return!!this.active}},{key:"setActiveStyle",value:function(t){lS(dS,this,t)}},{key:"activeStyle",get:function(){return uS(dS,this)}},{key:"setSourceStyle",value:function(t){this.style=t}},{key:"destroy",value:function(){return!!uS(fS,this)&&(uS(fS,this).removeFeature(this.layer),!0)}}],e&&iS(t.prototype,e),n&&iS(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function _S(t){return t.path?(t.borderWidth||(t.borderWidth=3),t.strokeColor||(t.strokeColor="#3366ff66"),t.fillColor||(t.fillColor="#1199ffaa"),t):(console.error("path is error."),!1)}function mS(t){var e,n,r,i;e instanceof tm?e=t:(null!=t&&t.borderWidth||null!=t&&t.strokeColor||null!=t&&t.fillColor||(e=this.style),e=new tm({stroke:new H_({width:null!==(n=t.borderWidth)&&void 0!==n?n:2,color:null!==(r=t.strokeColor)&&void 0!==r?r:"#3366ff66"}),fill:new W_({color:null!==(i=t.fillColor)&&void 0!==i?i:"#1199ffaa"})}));Array.isArray(uS(hS,this))?uS(hS,this).forEach(function(e){e.setStyle(t)}):uS(hS,this).setStyle(t)}function xS(t){return xS="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},xS(t)}function wS(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,bS(r.key),r)}}function bS(t){var e=function(t,e){if("object"!=xS(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=xS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==xS(e)?e:e+""}function ES(t,e,n){SS(t,e),e.set(t,n)}function SS(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function CS(t,e){return t.get(IS(t,e))}function PS(t,e,n){return t.set(IS(t,e),n),n}function IS(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 MS={},OS=new WeakMap,LS=new WeakMap,kS=new WeakMap,RS=new WeakMap,TS=new WeakSet,AS=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),SS(n=this,r=TS),r.add(n),ES(this,OS,void 0),ES(this,LS,void 0),ES(this,kS,void 0),ES(this,RS,void 0),this.init(IS(TS,this,NS).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;PS(kS,this,qE()),PS(OS,this,new Va({type:"polyline",geometry:new vw(t.path),name:CS(kS,this)}));var e=[];if(t.borderWidth&&e.push(new tm({stroke:new H_({width:2*parseFloat(t.borderWidth)+parseFloat(t.width),color:t.borderColor})})),e.push(new tm({stroke:new H_({width:t.width,color:t.color})})),this.style=e,CS(OS,this).setStyle(e),t.group)if(this.group=t.group,MS[t.group])this.layer=MS[t.group],this.layer.addFeature(CS(OS,this));else{var n=new IE([CS(OS,this)]);MS[t.group]=n,this.layer=n}else this.layer=new IE([CS(OS,this)]);t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return CS(OS,this)}},{key:"getPath",value:function(){return this.layer.getSource().getFeatures()[0].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){CS(LS,this)&&CS(LS,this).removeFeature(this.layer),t?(t.addFeature(this.layer),PS(LS,this,t),PS(RS,this,new VE(this,CS(LS,this).map))):CS(LS,this)&&CS(LS,this).removeFeature(this.layer)}},{key:"map",get:function(){return CS(LS,this)}},{key:"eventList",get:function(){return CS(RS,this).eventList}},{key:"on",value:function(t,e){return CS(RS,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return CS(RS,this).off(t,e,JE)}},{key:"openEdit",value:function(){CS(LS,this).editGeom(this)}},{key:"closeEdit",value:function(){return!!CS(LS,this).getEditGeom(this)&&CS(LS,this).closeEditGeom(this)}},{key:"destroy",value:function(){return!!CS(LS,this)&&(CS(LS,this).removeFeature(this.layer),!0)}}],e&&wS(t.prototype,e),n&&wS(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function NS(t){var e,n,r,i;return t.path?(t.borderWidth=null!==(e=t.borderWidth)&&void 0!==e?e:1,t.borderColor=null!==(n=t.borderColor)&&void 0!==n?n:"#fff",t.width=null!==(r=t.width)&&void 0!==r?r:3,t.color=null!==(i=t.color)&&void 0!==i?i:"#1199ff",t):(console.error("path is error."),!1)}var FS=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=as(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new W_({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:Sm,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getJustify=function(){return this.justify_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=as(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setJustify=function(t){this.justify_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),DS=FS,jS=n(9737),GS=n.n(jS);function BS(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 zS(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?BS(Object(n),!0).forEach(function(e){XS(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):BS(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function VS(t){return VS="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},VS(t)}function US(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,qS(r.key),r)}}function XS(t,e,n){return(e=qS(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qS(t){var e=function(t,e){if("object"!=VS(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=VS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==VS(e)?e:e+""}function WS(t,e,n){YS(t,e),e.set(t,n)}function YS(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function HS(t,e){return t.get(KS(t,e))}function ZS(t,e,n){return t.set(KS(t,e),n),n}function KS(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 JS={font:'14px "Fira Sans", sans-serif',textAlign:"center",justify:void 0,textBaseline:"middle",fill:"#333",stroke:"#0000",borderWidth:0,backgroundFill:void 0,backgroundStroke:void 0,backgroundBorder:void 0,padding:void 0,rotation:void 0,draggable:!1,fitZoom:14,scaleFactor:void 0},$S={},QS=new WeakMap,tC=new WeakMap,eC=new WeakMap,nC=new WeakMap,rC=new WeakMap,iC=new WeakMap,oC=new WeakMap,sC=new WeakMap,aC=new WeakSet,uC=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),YS(n=this,r=aC),r.add(n),WS(this,QS,void 0),WS(this,tC,void 0),WS(this,eC,void 0),WS(this,nC,14),WS(this,rC,""),WS(this,iC,void 0),WS(this,oC,void 0),WS(this,sC,void 0),XS(this,"draggable",!1),XS(this,"modify",void 0),XS(this,"scaleFactorCallback",function(){var t=HS(tC,i).getZoom();if("function"!==VS(HS(iC,i)).toLocaleLowerCase()){var e=t-i.getFitZoom(),n=Math.pow(HS(iC,i),Math.abs(e)),r=document.createElement("div");r.style.font=HS(rC,i),r.style.fontSize=r.style.fontSize.replace(/\d+/,function(t){return e>0?Math.round(parseFloat(t)/n).toString():Math.round(parseFloat(t)*n).toString()});var o="".concat(r.style.fontSize," ").concat(r.style.fontFamily);i.style.getText().setFont(o),HS(QS,i).changed()}else HS(iC,i).call(i,t)}),this.init(KS(aC,this,lC).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;ZS(eC,this,qE()),ZS(QS,this,new Va({geometry:new No(t.position),name:HS(eC,this)})),t.offset||(t.offset=[0,0]);var e={text:t.content,font:"".concat(t.fontSize," ").concat(t.fontFamily||"sans-serif"),offsetX:t.offset[0],offsetY:t.offset[1],textAlign:t.textAlign,justify:t.justify,textBaseline:t.textBaseline,fill:new W_({color:t.fill}),stroke:new H_({color:t.stroke,width:t.borderWidth}),padding:t.padding,placement:"point",rotation:t.rotation},n=new tm({text:new DS(e)});if(this.style=n,HS(QS,this).setStyle(n),t.group)if(this.group=t.group,$S[t.group])this.layer=$S[t.group],this.layer.addFeature(HS(QS,this));else{var r=new IE({features:[HS(QS,this)],zIndex:(t.zIndex||0)+1e4});$S[t.group]=r,this.layer=r}else this.layer=new IE({features:[HS(QS,this)],zIndex:(t.zIndex||0)+1e4});t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable),t.scaleFactor&&(ZS(iC,this,t.scaleFactor),ZS(nC,this,t.fitZoom||14),ZS(rC,this,"".concat(t.fontSize||14," ").concat(t.fontFamily||"sans-serif")),this.setScaleFactor(t.scaleFactor),this.scaleFactorCallback())}},{key:"feature",get:function(){return HS(QS,this)}},{key:"getFitZoom",value:function(){return HS(nC,this)}},{key:"getScaleFactor",value:function(){return HS(iC,this)}},{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){HS(tC,this)&&(HS(tC,this).removeFeature(this.layer),this.getScaleFactor()&&HS(tC,this).map.getView().un("change:resolution",this.scaleFactorCallback)),t?(t.addFeature(this.layer),ZS(tC,this,t),ZS(sC,this,new VE(this,HS(tC,this).map)),this.getScaleFactor()&&HS(tC,this).map.getView().on("change:resolution",this.scaleFactorCallback)):HS(tC,this)&&HS(tC,this).removeFeature(this.layer)}},{key:"map",get:function(){return HS(tC,this)}},{key:"setPosition",value:function(t){HS(QS,this).getGeometry().setCoordinates(t)}},{key:"position",get:function(){return HS(QS,this).getGeometry().getCoordinates()}},{key:"setText",value:function(t){HS(QS,this).getStyle().getText().setText(t),HS(QS,this).changed()}},{key:"setRotation",value:function(t){HS(QS,this).getStyle().getText().setRotation(t),HS(QS,this).changed()}},{key:"eventList",get:function(){return HS(sC,this).eventList}},{key:"on",value:function(t,e){return HS(sC,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return HS(sC,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()})),HS(tC,this).map.addInteraction(this.modify);else{if(!this.modify)return;HS(tC,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"setScaleFactor",value:function(t){console.log("开启跟随缩放"),HS(oC,this)?(HS(tC,this).map.getView().un("change:resolution",HS(oC,this)),ZS(oC,this,void 0)):ZS(oC,this,GS().throttle(this.scaleFactorCallback,600)),t?HS(tC,this)&&HS(tC,this).map.getView().on("change:resolution",HS(oC,this)):HS(oC,this)&&(HS(tC,this).map.getView().un("change:resolution",HS(oC,this)),ZS(oC,this,void 0))}},{key:"destroy",value:function(){return!!HS(tC,this)&&(HS(tC,this).removeFeature(this.layer),!0)}}],e&&US(t.prototype,e),n&&US(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function lC(t){return t.position?t.content?(t.rotation||(t.rotation=0),zS(zS({},JS),t)):(console.error("content is error."),!1):(console.error("position is error."),!1)}function cC(t){return function(t){if(Array.isArray(t))return hC(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 hC(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)?hC(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 hC(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 fC(t){return fC="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},fC(t)}function pC(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 dC(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pC(Object(n),!0).forEach(function(e){yC(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pC(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function gC(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,vC(r.key),r)}}function yC(t,e,n){return(e=vC(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vC(t){var e=function(t,e){if("object"!=fC(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=fC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==fC(e)?e:e+""}function _C(t,e,n){mC(t,e),e.set(t,n)}function mC(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xC(t,e){return t.get(bC(t,e))}function wC(t,e,n){return t.set(bC(t,e),n),n}function bC(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 EC=new WeakMap,SC=[new tm({fill:new W_({color:[255,255,255,.5]})}),new tm({stroke:new H_({color:[255,255,255,1],width:5})}),new tm({stroke:new H_({color:[0,153,255,1],width:3})})],CC=new WeakMap,PC=new WeakMap,IC=new WeakMap,MC=new WeakMap,OC=new WeakMap,LC=new WeakMap,kC=new WeakMap,RC=new WeakMap,TC=new WeakMap,AC=new WeakMap,NC=new WeakSet,FC=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),mC(n=this,r=NC),r.add(n),_C(this,CC,{}),_C(this,PC,void 0),_C(this,IC,void 0),_C(this,MC,void 0),_C(this,OC,void 0),_C(this,LC,new Map),_C(this,kC,void 0),_C(this,RC,void 0),_C(this,TC,new WeakMap),_C(this,AC,0),yC(this,"_instance",void 0),yC(this,"isShowLength",!1),yC(this,"drawStartCB",function(t){t.feature.getGeometry().on("change",function(t){if(!i.isShowLength)return!1;var e=t.target,n=[];e.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,e){var n=xC(kC,i).textList[e];n?(n.setRotation(t.rotation),n.setText(t.content),n.setPosition(t.position)):(n=new uC(dC(dC({},t),{},{textBaseline:"bottom",fill:"#ffffff",stroke:"#2b2b2b",borderWidth:4,padding:[2,2,2,2],fontSize:"16px",map:i})),xC(kC,i).textList[e]=n)})})}),yC(this,"measureTooltipElement",void 0),yC(this,"measureTooltip",void 0),yC(this,"measureTooltipList",[]),yC(this,"count",0),yC(this,"measureSingleclickCB",function(t){i.measureTooltip.setPosition(t.coordinate),0===i.count&&(i.measureTooltipElement.innerHTML="");var e=new No(t.coordinate);return i.gageLengthLayer.getSource().addFeature(new Va(e)),i.measureTooltipElement.className="measure tooltip tooltip-static",bC(NC,i,BC).call(i),i.count++,!0}),yC(this,"gageLengthLayer",void 0),yC(this,"isMeasure",!1),this.DT_XYZ_URL=e.DT_XYZ_URL||"https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",this.BZ_XYZ_URL=e.BZ_XYZ_URL||"https://webst04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}";var o=null;if("string"==typeof e.target?o=document.getElementById(e.target):e.target&&(o=e.target),o&&EC.has(o)){var s=EC.get(o);s&&"function"==typeof s.destroy&&s.destroy()}e.undoCB&&(this.undoCB=e.undoCB),e.undoDrawCB&&(this.undoDrawCB=e.undoDrawCB);try{if(e._instance&&e._instance.map)return this._instance=e._instance,wC(PC,this,e._instance.map._instance._map),this}catch(n){console.error("instance error in options")}this.baseOptions=e,wC(CC,this,bC(NC,this,GC).call(this,e)),this.init(xC(CC,this)),wC(MC,this,new VE(this,xC(PC,this))),o&&EC.set(o,this)},e=[{key:"init",value:function(t){return t.zoom=2,console.log("init map",t),wC(PC,this,new Ga(dC({interactions:Fa({shiftDragZoom:!1}).extend([new Qs({condition:Xs})])},t))),this._instance=xC(PC,this),xC(PC,this)}},{key:"getZoom",value:function(){return xC(PC,this).getView().getZoom()}},{key:"getRotation",value:function(){return xC(PC,this).getView().getRotation()}},{key:"map",get:function(){return xC(PC,this)}},{key:"addFeature",value:function(t){if(xC(PC,this).getAllLayers().indexOf(t)>=0)return!1;xC(PC,this).addLayer(t)}},{key:"removeFeature",value:function(t){xC(PC,this).removeLayer(t)}},{key:"addLayer",value:function(t){return this.addFeature(t)}},{key:"removeLayer",value:function(t){return this.removeFeature(t)}},{key:"addMarker",value:function(t){if(!t)return!1;t.setMap(this)}},{key:"addTileLayer",value:function(t){if(!t)return!1;t.setMap(this)}},{key:"addOverlay",value:function(t){if(!t)return!1;xC(PC,this).addOverlay(t)}},{key:"removeOverlay",value:function(t){xC(PC,this).removeOverlay(t)}},{key:"addInfoWindow",value:function(t){if(!t||!t.setMap)return!1;t.setMap(this)}},{key:"addControl",value:function(t){if(!t||!t.setMap)return!1;t.setMap(this)}},{key:"eventList",get:function(){return xC(MC,this).eventList}},{key:"on",value:function(t,e){if("drawend"!==t)return xC(MC,this).on(t,e,NE);wC(RC,this,e)}},{key:"off",value:function(t,e){return xC(MC,this).off(t,e,NE)}},{key:"editGeom",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(xC(LC,this).get(t))return xC(LC,this).get(t);xC(TC,this).set(t,[]),this.undoCB&&this.undoCB(xC(TC,this).get(t).length,t);var o={source:t.layer.getSource(),condition:i};n&&(o.style=n),wC(OC,this,{geom:t,sourceStyle:t.style,modify:new iw(o),snap:new lw({source:t.layer.getSource()})}),xC(LC,this).set(t,xC(OC,this)),this.modify=xC(OC,this).modify,this.modify.on("modifystart",function(e){i(e);var n=e.features.item(0),o=new Va;o.setGeometry(n.getGeometry().clone()),o.setGeometryName(n.getGeometryName()),o.setStyle(n.getStyle()),o.ol_uid=n.ol_uid;var s=xC(TC,r).get(t);s.push(o),xC(TC,r).set(t,s),r.undoCB&&r.undoCB(xC(TC,r).get(t).length,t)}),this.modify.on("modifyend",function(t){i(t)}),this.snap=xC(OC,this).snap,this.snap.on("change:active",function(t){console.log("change:active",t)}),xC(PC,this).addInteraction(xC(OC,this).modify),xC(PC,this).addInteraction(xC(OC,this).snap),Array.isArray(t.feature)?t.feature.forEach(function(t){e?t.setStyle(e):t.setStyle(SC)}):e?t.feature.setStyle(e):t.feature.setStyle(SC)}},{key:"getEditGeom",value:function(t){return xC(LC,this).get(t)}},{key:"getAllEditGeom",value:function(){return xC(LC,this)}},{key:"getUndoStack",value:function(){return xC(TC,this)}},{key:"getUndoCountForGeom",value:function(t){return t?xC(TC,this).get(t).length:0}},{key:"undoEditForGeom",value:function(t){var e=xC(TC,this).get(t).pop();this.undoCB&&this.undoCB(xC(TC,this).get(t).length,t),console.log(e.ol_uid);var n=t.layer.getSource(),r=n.getFeatureByUid(e.ol_uid);n.removeFeature(r),n.addFeature(e)}},{key:"deletePointForGeom",value:function(t){if(!t)return!1;xC(LC,this).get(t).modify.removePoint()}},{key:"closeEditGeom",value:function(t){var e=xC(LC,this).get(t);return e&&(xC(LC,this).delete(t),xC(TC,this).delete(t),this.undoCB&&this.undoCB(0,t),this.closeEdit(e)),null==e?void 0:e.geom}},{key:"closeAllEditGeom",value:function(){var t=this;xC(LC,this).forEach(function(e){t.closeEdit(e)}),xC(LC,this).clear()}},{key:"closeEdit",value:function(t){xC(PC,this).removeInteraction(t.modify),xC(PC,this).removeInteraction(t.snap);var e=t.geom.layer.getSource().getFeatures();Array.isArray(e)?e.forEach(function(e){e.setStyle(t.sourceStyle)}):e.setStyle(t.sourceStyle)}},{key:"startDraw",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},r=arguments.length>3?arguments[3]:void 0;if(xC(kC,this))return!1;var i=this;"function"===fC(e).toLocaleLowerCase()&&wC(RC,this,e);var o={polygon:"Polygon",polyline:"LineString",smartPolygon:"Polygon",riskArea:"Polygon"},s=new IE([]),a=s.getSource(),u={type:o[t],source:a,snapTolerance:1,condition:function(t){var e;return wC(AC,i,(e=xC(AC,i),++e)),i.undoDrawCB&&i.undoDrawCB(xC(AC,i)),n(t)}};r&&(u.style=r);var l=new Dw(u),c=new lw({source:a});return wC(kC,this,{vectorLayer:s,draw:l,snap:c,type:t,textList:[]}),xC(PC,this).addLayer(s),xC(PC,this).addInteraction(l),xC(PC,this).addInteraction(c),xC(PC,this).getTargetElement().style.cursor="crosshair","Polygon"===o[t]&&l.on("drawstart",this.drawStartCB),l.once("drawend",function(e){i.stopDraw(e.feature.getGeometry().getCoordinates()),"Polygon"===o[t]&&l.un("drawstart",i.drawStartCB)}),s}},{key:"hideLength",value:function(){var t;this.isShowLength=!1,(null===(t=xC(kC,this))||void 0===t?void 0:t.textList.length)>0&&xC(kC,this).textList.forEach(function(t){return t.destroy()})}},{key:"showLength",value:function(){this.isShowLength=!0}},{key:"undoDraw",value:function(){var t;xC(kC,this)&&(xC(kC,this).draw.removeLastPoint(),wC(AC,this,(t=xC(AC,this),--t)),this.undoDrawCB&&this.undoDrawCB(xC(AC,this)))}},{key:"drawGeom",get:function(){return xC(kC,this)}},{key:"endDraw",value:function(){xC(kC,this)&&xC(kC,this).draw.finishDrawing()}},{key:"cancelDraw",value:function(){if(xC(kC,this)){xC(kC,this).draw.abortDrawing(),xC(PC,this).getTargetElement().style.cursor="auto";var t=xC(kC,this),e=t.vectorLayer,n=t.draw,r=t.snap;xC(kC,this).textList.length>0&&(xC(kC,this).textList.forEach(function(t){return t.destroy()}),xC(kC,this).textList=[]),wC(kC,this,void 0);var i=this;setTimeout(function(){xC(PC,i).removeLayer(e),xC(PC,i).removeInteraction(n),xC(PC,i).removeInteraction(r)},0)}}},{key:"stopDraw",value:function(t){if(!xC(kC,this))return!1;xC(PC,this).getTargetElement().style.cursor="auto";var e,n,r=xC(kC,this),i=r.vectorLayer,o=r.draw,s=r.snap,a=r.type;if(xC(kC,this).textList.length>0&&xC(kC,this).textList.forEach(function(t){return t.destroy()}),wC(kC,this,void 0),t)switch(a){case"polygon":n=new vS({path:t[0],map:this}),e={path:t[0],geom:n};break;case"polyline":e={path:t,geom:n=new AS({path:t,map:this})};break;case"riskArea":case"smartPolygon":n=new vS({path:t[0],map:this,borderWidth:1,strokeColor:"#ffffff",fillColor:"#ffffff80"}),e={path:t[0],geom:n};break;default:console.error("type is error.")}var u=this;setTimeout(function(){xC(PC,u).removeLayer(i),xC(PC,u).removeInteraction(o),xC(PC,u).removeInteraction(s)},0),"function"===fC(xC(RC,this)).toLocaleLowerCase()&&xC(RC,this).call(this,e)}},{key:"updateSize",value:function(){xC(PC,this).updateSize()}},{key:"setFitView",value:function(t,e){var n,r,i;Array.isArray(t)?t.forEach(function(t){var e;try{e=t.feature.getGeometry().getExtent()}catch(t){return}i||(i=e.map(function(t){return t})),i=st(i,e)}):i=t.feature.getGeometry().getExtent();var o={padding:null!==(n=e.avoid)&&void 0!==n?n:[0,0,0,0],duration:null!==(r=e.duration)&&void 0!==r?r:.3};xC(IC,this).fit(i,o)}},{key:"setFitForGeom",value:function(t,e){var n,r,i={padding:null!==(n=e.avoid)&&void 0!==n?n:[0,0,0,0],duration:null!==(r=e.duration)&&void 0!==r?r:.3};xC(IC,this).fit(t,i)}},{key:"openMeasure",value:function(t){if(this.isMeasure)return console.error("Measurement is currently turned on."),!1;if(this.isMeasure=!0,"length"!==(t=null!=t?t:"length")&&"area"!==t)return!1;this.measureType=t,this.gageLengthLayer=new IE([]),xC(PC,this).addLayer(this.gageLengthLayer);var e=new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#fff",width:2}),image:new X_({fill:new W_({color:"#e59810"}),stroke:new H_({color:"#ffffff",width:1}),radius:5})});this.gageLengthLayer.setStyle(e),this.gageLengthLayer.setZIndex(1e4);var n=this.gageLengthLayer.getSource(),r={type:"length"===t?"LineString":"Polygon",source:n,freehandCondition:function(){return!1},style:new tm({fill:new W_({color:"#ffffff4d"}),stroke:new H_({color:"#fff",width:2}),image:new X_({fill:new W_({color:"#e59810"}),stroke:new H_({color:"#ffffff",width:1}),radius:5})})};r.finishCondition="length"===t?function(){return!1}:function(t){var e,n=t.coordinate,r=null===(e=o.measureDraw)||void 0===e?void 0:e.sketchLineCoords_;if(r){var i=r.at(-3);if(i&&i[0]===n[0]&&i[1]===n[1])return!1}return!0};var i=new Dw(r);this.measureDraw=i,xC(PC,this).addInteraction(i),bC(NC,this,BC).call(this);var o=this;this.count=0,i.on("drawabort",function(t){console.log("drawabort",t)}),i.on("drawstart",function(e){o.sketch=e.feature;var r=e.coordinate;o.listener=o.sketch.getGeometry().on("change",function(e){var n,i=e.target;if("length"===t){var s=Bh(Qa(i.getCoordinates()));n=s<1?Math.round(1e3*s*100)/100+" m":Math.round(100*s)/100+" km",r=i.getLastCoordinate()}else{var a=i.getCoordinates()[0],u=Bh(Qa(a.slice(0,-1)));n=u<1?Math.round(1e3*u*100)/100+" m":Math.round(100*u)/100+" km";var l=WE(i.getCoordinates()[0])/2e3*3;o.measureCentroidText=l>1e4?Math.round(l/1e4*100)/100+" 万亩":Math.round(100*l)/100+" 亩",o.measureCentroid=i.getInteriorPoint().getCoordinates(),r=a.slice(-2)[0]}o.measureTooltipElement.innerHTML=n,o.measureTooltip.setPosition(r)}),"length"!==t?(xC(PC,o).on("click",o.measureSingleclickCB),xC(PC,o).once("dblclick",function(t){new No(t.coordinate),n.addFeature(new No(t.coordinate))})):(xC(PC,o).on("click",o.measureSingleclickCB),xC(PC,o).once("dblclick",function(t){i.finishDrawing()}))},this),i.on("drawend",function(t){if(console.log("drawend"),"length"===o.measureType)return!1;"area"===o.measureType&&(bC(NC,o,BC).call(o),o.measureTooltipElement.innerHTML=o.measureCentroidText,o.measureTooltip.setPosition(o.measureCentroid)),o.measureTooltipElement.className="measure tooltip tooltip-static",o.sketch=null,o.measureTooltipElement=null,o.count=0,Ee(o.listener),xC(PC,o).un("click",o.measureSingleclickCB),bC(NC,o,BC).call(o)},this)}},{key:"closeMeasure",value:function(){var t,e=this;this.isMeasure=!1,null===(t=this.gageLengthLayer)||void 0===t||t.getSource().clear(),xC(PC,this).removeLayer(this.gageLengthLayer),this.measureTooltipList.forEach(function(t){xC(PC,e).removeOverlay(t)}),this.measureTooltipList=[],xC(PC,this).removeInteraction(this.measureDraw),xC(PC,this).un("singleclick",this.measureSingleclickCB),xC(PC,this).un("dbclick",this.measureSingleclickCB),xC(PC,this).un("click",this.measureSingleclickCB)}},{key:"destroy",value:function(){try{var t=document.querySelector("#".concat(xC(CC,this).target)),e=t.cloneNode(),n=t.parentNode,r=document.createElement("div");n.insertBefore(r,t),n.removeChild(t),r.parentNode.insertBefore(e,r),n.removeChild(r),t&&EC.delete(t)}catch(t){console.error("target error in options.")}wC(PC,this,null),this._instance=null}}],e&&gC(t.prototype,e),n&&gC(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function DC(){return{target:"mapbox",zoom:15,zooms:[1,18],center:[116.4,39.9],layers:bC(NC,this,jC).call(this)}}function jC(){var t,e,n,r;this.baseOptions.zooms?n=this.baseOptions.zooms[1]:n=null!==(r=this.baseOptions.maxZoom)&&void 0!==r?r:18;return[new gb({name:"default_DT",zIndex:100,source:new Hb({minZoom:1,maxZoom:null!==(t=this.baseOptions.tileMax)&&void 0!==t?t:n,crossOrigin:"anonymous",url:this.DT_XYZ_URL})}),new gb({name:"default_BZ",zIndex:100,source:new Hb({minZoom:1,maxZoom:null!==(e=this.baseOptions.tileMax)&&void 0!==e?e:n,crossOrigin:"anonymous",url:this.BZ_XYZ_URL})})]}function GC(){var t,e,n,r,i,o,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=bC(NC,this,DC).call(this);s.target&&(a.target=s.target),s.layerConfig&&0!==s.layerConfig.layers.length&&(s.layerConfig.default||(a.layers=[]),a.layers=[].concat(cC(a.layers),cC(s.layerConfig.layers))),this.layers=a.layers,a.controls=Cs({attribution:null!==(t=null===(e=s.controls)||void 0===e?void 0:e.attribution)&&void 0!==t&&t,zoom:null!==(n=null===(r=s.controls)||void 0===r?void 0:r.zoom)&&void 0!==n&&n,rotate:null!==(i=null===(o=s.controls)||void 0===o?void 0:o.rotate)&&void 0!==i&&i});var u=dC({},OE);s.initViewConfig&&(u=dC(dC({},OE),s.initViewConfig)),s.zoom&&(u.zoom=s.zoom),Array.isArray(s.zooms)&&2===s.zooms.length&&(u.minZoom=s.zooms[0],u.maxZoom=s.zooms[1]),s.center&&(u.center=s.center);var l=new os(u);return wC(IC,this,l),a.view=l,a}function BC(){this.measureTooltipElement=document.createElement("div"),this.measureTooltipElement.className="measure tooltip tooltip-measure",this.measureTooltip&&this.measureTooltipList.push(this.measureTooltip),this.measureTooltip=new nE({element:this.measureTooltipElement,offset:[0,-15],positioning:"bottom-center"}),xC(PC,this).addOverlay(this.measureTooltip)}function zC(t){return zC="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},zC(t)}function VC(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,XC(r.key),r)}}function UC(t,e,n){return(e=XC(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function XC(t){var e=function(t,e){if("object"!=zC(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=zC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==zC(e)?e:e+""}function qC(t,e,n){WC(t,e),e.set(t,n)}function WC(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function YC(t,e){return t.get(ZC(t,e))}function HC(t,e,n){return t.set(ZC(t,e),n),n}function ZC(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 KC={},JC=new WeakMap,$C=new WeakMap,QC=new WeakMap,tP=new WeakMap,eP=new WeakMap,nP=new WeakSet,rP=new WeakMap,iP=new WeakMap,oP=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),WC(n=this,r=nP),r.add(n),qC(this,JC,void 0),qC(this,$C,void 0),qC(this,QC,void 0),qC(this,tP,void 0),qC(this,eP,0),UC(this,"draggable",!1),UC(this,"modify",void 0),qC(this,rP,!1),qC(this,iP,function(t){YC(rP,i)&&(i.moveBasePosition=i.startPosition,HC(rP,i,!1),HC(eP,i,0));var e=t.frameState.time,n=e-i.moveBaseTime;i.moveBaseTime=e;var r=parseFloat(i.moveMultiply||1);if(HC(eP,i,YC(eP,i)+i.moveSpeed*n/6e4*r),YC(eP,i)>i.moveLength)return i.pauseMove(),HC(rP,i,!0),i.moveFinishCB&&i.moveFinishCB(),!0;var o,s=YC(eP,i)/i.moveLength%2;if(i.ratio=s,i.movePathList){var a,u=null!==(a=i.movePathList.findIndex(function(t){return s>t[0]&&s<=t[1]}))&&void 0!==a?a:i.movePathList.length-1;-1===u&&(u=0);var l=i.movePathList[u],c=(s-l[0])/(l[1]-l[0]);o=i.movePath.getLineString(u).getLineString(u).getCoordinateAt(c>1?2-c:c)}else o=i.movePath.getCoordinateAt(s>1?2-s:s);if(i.setPosition(o),i.options.autoRotation){var h=o[0]-i.moveBasePosition[0],f=o[1]-i.moveBasePosition[1],p=-Math.atan2(f,h);YC(JC,i).getStyle().getImage().setRotation(i.options.rotation+p)}i.moveBasePosition=o,i.movePlayingCB&&i.movePlayingCB(s)}),this.options=e,this.init(ZC(nP,this,sP).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;var e;if(HC(QC,this,qE()),HC(JC,this,new Va({geometry:new No(t.position),name:YC(QC,this)})),t.src)t.activeSrc||(t.activeSrc=t.src),e=new tm({image:new Sx({anchor:t.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:t.src,offset:t.offset,rotation:t.rotation,scale:t.scale})});else{var n,r,i,o=new W_({color:null!==(n=t.color)&&void 0!==n?n:"rgba(37, 165, 247,0.6)"}),s=new H_({color:null!==(r=t.borderColor)&&void 0!==r?r:"#ffeeff",width:null!==(i=t.borderWidth)&&void 0!==i?i:2});e=new tm({image:new X_({fill:o,stroke:s,radius:t.radius})})}if(t.text){var a=t.fontSize,u=void 0===a?14:a,l=t.scale,c=void 0===l?1:l;u*=c;var h={text:t.text,font:"".concat(u,"px ").concat(t.fontFamily||"sans-serif"),textAlign:"center",textBaseline:"top",offsetY:-62*c,fill:new W_({color:"#fff"}),placement:"point"};e.setText(new DS(h))}if(this.style=e,this.options=t,YC(JC,this).setStyle(e),t.text&&t.fontSize&&this.setTextFontSize(t.fontSize),t.group)if(this.group=t.group,KC[t.group])this.layer=KC[t.group],this.layer.addFeature(YC(JC,this));else{var f=new IE({features:[],zIndex:(t.zIndex||0)+1e4,cursor:t.cursor});KC[t.group]=f,this.layer=f,this.layer.addFeature(YC(JC,this))}else this.layer=new IE({features:[YC(JC,this)],zIndex:(t.zIndex||0)+1e4,cursor:t.cursor});t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable)}},{key:"feature",get:function(){return YC(JC,this)}},{key:"setGroup",value:function(t){if(!t)return!1;this.group&&KC[this.group]&&KC[this.group].removeFeature(YC(JC,this)),KC[t]?(this.layer.removeFeature(YC(JC,this)),this.layer=KC[t],KC[t].addFeature(YC(JC,this))):KC[t]=this.layer,this.group=t}},{key:"getGroup",value:function(){return this.group}},{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:"setScale",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(e=parseFloat(e),isNaN(e))return!1;null===(t=this.style.getImage())||void 0===t||t.setScale(e),YC(JC,this).changed()}},{key:"setTextFontSize",value:function(t){var e,n,r,i,o,s,a="".concat(t,"px ").concat(this.options.fontFamily||"sans-serif");switch(null===(e=this.style.getText())||void 0===e||e.setFont(a),t){case 14:null===(n=this.style.getText())||void 0===n||n.setOffsetY(-25);break;case 12:null===(r=this.style.getText())||void 0===r||r.setOffsetY(-22);break;case 9:null===(i=this.style.getText())||void 0===i||i.setOffsetY(-18);break;case 7:null===(o=this.style.getText())||void 0===o||o.setOffsetY(-14);break;default:null===(s=this.style.getText())||void 0===s||s.setOffsetY(-25)}}},{key:"setMap",value:function(t){YC($C,this)&&YC($C,this).removeFeature(this.layer),t?(t.addFeature(this.layer),HC($C,this,t),HC(tP,this,new VE(this,YC($C,this).map))):YC($C,this)&&YC($C,this).removeFeature(this.layer)}},{key:"map",get:function(){return YC($C,this)}},{key:"setPosition",value:function(t){YC(JC,this).getGeometry().setCoordinates(t),YC(JC,this).changed()}},{key:"position",get:function(){return YC(JC,this).getGeometry().getCoordinates()}},{key:"moveAlong",value:function(t){var e,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;if(!this.map)return!1;if(this.startPosition=t[0],this.moveBaseTime=Date.now(),this.moveBasePosition=this.startPosition,Array.isArray(t[0][0])){this.movePath=new xw(t),e=nu(t);var s=0;this.moveLength=Bh(e,{units:"kilometers"}),this.movePathList=t.map(function(t){var e=Bh(Qa(t),{units:"kilometers"}),r=s,i=e/n.moveLength;return[r,s+=i]})}else this.movePath=new vw(t),e=Qa(t),this.moveLength=Bh(e,{units:"kilometers"});this.moveSpeed=r,this.layer.on("postrender",YC(iP,this)),this.map.map.render(),"function"===zC(i).toLocaleLowerCase()&&(this.moveFinishCB=i),"function"===zC(o).toLocaleLowerCase()&&(this.movePlayingCB=o)}},{key:"setMoveRatio",value:function(t){if(this.ratio=t,HC(eP,this,this.moveLength*t),YC(eP,this)>this.moveLength)return this.pauseMove(),HC(rP,this,!0),this.moveFinishCB&&this.moveFinishCB(),!0;var e;if(this.movePathList){var n,r=null!==(n=this.movePathList.findIndex(function(e){return t>e[0]&&t<=e[1]}))&&void 0!==n?n:this.movePathList.length-1;-1===r&&(r=0);var i=this.movePathList[r],o=(t-i[0])/(i[1]-i[0]);e=this.movePath.getLineString(r).getCoordinateAt(o>1?2-o:o)}else e=this.movePath.getCoordinateAt(t>1?2-t:t);this.setPosition(e)}},{key:"setMoveMultiply",value:function(t){isNaN(parseFloat(t))&&(t=1),this.moveMultiply=t}},{key:"getMoveMultiply",value:function(){var t;return null!==(t=this.moveMultiply)&&void 0!==t?t:1}},{key:"pauseMove",value:function(){this.layer.un("postrender",YC(iP,this))}},{key:"resumeMove",value:function(){this.map&&(this.moveBaseTime=Date.now(),this.layer.on("postrender",YC(iP,this)),this.map.map.render())}},{key:"setSrc",value:function(t){var e;if(t)e=new tm({image:new Sx({anchor:this.options.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:t,offset:this.options.offset,rotation:this.options.rotation})});else{var n,r,i,o=new W_({color:null!==(n=this.options.color)&&void 0!==n?n:"rgba(37, 165, 247,0.6)"}),s=new H_({color:null!==(r=this.options.borderColor)&&void 0!==r?r:"#ffeeff",width:null!==(i=this.options.borderWidth)&&void 0!==i?i:2});e=new tm({image:new X_({fill:o,stroke:s,radius:this.options.radius})})}this.style=e,YC(JC,this).setStyle(e)}},{key:"eventList",get:function(){return YC(tP,this).eventList}},{key:"on",value:function(t,e){if("dragstart"!==t){if("dragend"!==t)return YC(tP,this).featureOn(t,e,JE);this.dragEndCallback=e}else this.dragStartCallback=e}},{key:"off",value:function(t,e){if("dragstart"!==t){if("dragend"!==t)return YC(tP,this).off(t,e,JE);this.dragEndCallback=void 0}else this.dragStartCallback=void 0}},{key:"setDraggable",value:function(t){if(this.draggable=t,t){if(!this.modify){this.modify=new iw({hitDetection:this.layer,source:this.layer.getSource()});var e=this;this.modify.on("modifystart",function(t){"function"===zC(e.dragStartCallback).toLocaleLowerCase()&&e.dragStartCallback(t)}),this.modify.on("modifyend",function(t){"function"===zC(e.dragEndCallback).toLocaleLowerCase()&&e.dragEndCallback(t)})}YC($C,this).map.addInteraction(this.modify)}else{if(!this.modify)return;YC($C,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"setActive",value:function(t){if(this.active=t,!this.options.activeSrc)return!1;t?this.setSrc(this.options.activeSrc):this.setSrc(this.options.src)}},{key:"isActive",value:function(){return!!this.active}},{key:"destroy",value:function(){return!!YC($C,this)&&(YC($C,this).removeFeature(this.layer),this.group&&KC[this.group]&&KC[this.group].removeFeature(YC(JC,this)),!0)}}],n=[{key:"clearGroup",value:function(t){t&&KC[t]&&KC[t].getSource().clear()}},{key:"clearAllGroup",value:function(){Object.keys(KC).forEach(function(t){KC[t].getSource().clear()})}}],e&&VC(t.prototype,e),n&&VC(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function sP(t){var e,n,r;return t.position?(t.anchor||(t.anchor=[0,0]),t.offset||(t.offset=[0,0]),t.rotation||(t.rotation=0),t.scale=null!==(e=t.scale)&&void 0!==e?e:1,t.radius=null!==(n=t.radius)&&void 0!==n?n:5,t.cursor=null!==(r=t.cursor)&&void 0!==r?r:"pointer",t):(console.error("position is error."),!1)}function aP(t){return aP="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},aP(t)}function uP(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,lP(r.key),r)}}function lP(t){var e=function(t,e){if("object"!=aP(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=aP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==aP(e)?e:e+""}function cP(t,e,n){hP(t,e),e.set(t,n)}function hP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fP(t,e){return t.get(dP(t,e))}function pP(t,e,n){return t.set(dP(t,e),n),n}function dP(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 gP=new WeakMap,yP=new WeakMap,vP=new WeakMap,_P=new WeakMap,mP=new WeakSet,xP=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),hP(n=this,r=mP),r.add(n),cP(this,gP,void 0),cP(this,yP,void 0),cP(this,vP,void 0),cP(this,_P,void 0),this.init(dP(mP,this,wP).call(this,e))},e=[{key:"init",value:function(t){if(console.log("options",t),!t)return!1;if(!t.dom)throw new Error("dom is error.");pP(vP,this,qE());var e=t.dom;if("string"===aP(e).toLocaleLowerCase()&&(e=document.querySelector("#".concat(t.dom))),!(e instanceof Element))throw new Error("dom is error.");pP(gP,this,new nE({position:t.position,element:e})),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return fP(gP,this)}},{key:"setPosition",value:function(t){fP(gP,this).setPosition(t)}},{key:"getPosition",value:function(){return fP(gP,this).getPosition()}},{key:"isVisible",value:function(){return"none"!==this.feature.getElement().style.display}},{key:"show",value:function(){this.feature.getElement().style.display="block"}},{key:"hide",value:function(){this.feature.getElement().style.display="none"}},{key:"setMap",value:function(t){fP(yP,this)&&fP(yP,this).removeOverlay(fP(gP,this)),t?(t.addOverlay(fP(gP,this)),pP(yP,this,t),pP(_P,this,new VE(this,fP(yP,this).map))):fP(yP,this)&&fP(yP,this).removeOverlay(fP(gP,this))}},{key:"map",get:function(){return fP(yP,this)}},{key:"eventList",get:function(){return fP(_P,this).eventList}},{key:"on",value:function(t,e){return fP(_P,this).featureOn(t,e,JE)}},{key:"off",value:function(t,e){return fP(_P,this).off(t,e,JE)}},{key:"destroy",value:function(){return!!fP(yP,this)&&(fP(yP,this).removeOverlay(fP(gP,this)),!0)}}],e&&uP(t.prototype,e),n&&uP(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function wP(t){return t.position?(t.anchor||(t.anchor="bottom-center"),t.offset||(t.offset=[0,0]),t.fillColor||(t.fillColor="#1199ffaa"),t):(console.error("position is error."),!1)}function bP(t){return bP="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},bP(t)}function EP(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 SP(t,e,n){return(e=PP(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function CP(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,PP(r.key),r)}}function PP(t){var e=function(t,e){if("object"!=bP(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=bP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==bP(e)?e:e+""}function IP(t,e,n){MP(t,e),e.set(t,n)}function MP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function OP(t,e){return t.get(kP(t,e))}function LP(t,e,n){return t.set(kP(t,e),n),n}function kP(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 RP={name:qE(),minZoom:1,maxZoom:18,zIndex:101},TP=new WeakMap,AP=new WeakMap,NP=new WeakMap,FP=new WeakSet,DP=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),MP(n=this,r=FP),r.add(n),IP(this,TP,void 0),IP(this,AP,void 0),IP(this,NP,void 0),LP(TP,this,kP(FP,this,jP).call(this,e)),LP(AP,this,this.init(OP(TP,this))),OP(TP,this).map&&this.setMap(OP(TP,this).map)},e=[{key:"init",value:function(t){return!!t.tileUrl&&new gb({name:t.name,zIndex:t.zIndex,source:new Hb({minZoom:t.minZoom,maxZoom:t.maxZoom,url:t.tileUrl,crossOrigin:"anonymous"})})}},{key:"layer",get:function(){return OP(AP,this)}},{key:"getTileName",value:function(){return OP(TP,this).name}},{key:"setMap",value:function(t){OP(NP,this)&&OP(NP,this).removeFeature(OP(AP,this)),t?(t.addFeature(OP(AP,this)),LP(NP,this,t)):OP(NP,this)&&OP(NP,this).removeFeature(OP(AP,this))}}],e&&CP(t.prototype,e),n&&CP(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function jP(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?EP(Object(n),!0).forEach(function(e){SP(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):EP(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},RP);return t.zooms&&Array.isArray(t.zooms)&&(e.minZoom=t.zooms[0],e.maxZoom=t.zooms[1]),t.name&&(e.name=t.name),e.tileUrl=t.tileUrl,t.zIndex&&(e.zIndex=t.zIndex),e.map=t.map,e}var GP=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)}}(),BP=function(t){function e(e){var n=e||{};return t.call(this,n)||this}return GP(e,t),e}(Ze),zP=BP,VP=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)}}(),UP=function(t){function e(e){var n=t.call(this,e)||this;return n.image_=null,n}return VP(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,r=t.viewState,i=r.resolution,o=this.getLayer().getSource(),s=t.viewHints,a=t.extent;if(void 0!==e.extent&&(a=mt(a,Di(e.extent,r.projection))),!s[Ur]&&!s[Xr]&&!St(a))if(o){var u=r.projection,l=o.getImage(a,i,n,u);l&&(this.loadImage(l)?this.image_=l:l.getState()===N_&&(this.image_=null))}else this.image_=null;return!!this.image_},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),r=F(e.pixelToCoordinateTransform,t.slice()),i=n.getExtent();if(i&&!K(i,r))return null;var o=this.image_.getExtent(),s=this.image_.getImage(),a=bt(o),u=Math.floor(s.width*((r[0]-o[0])/a));if(u<0||u>=s.width)return null;var l=_t(o),c=Math.floor(s.height*((o[3]-r[1])/l));return c<0||c>=s.height?null:this.getImageData(s,u,c)},e.prototype.renderFrame=function(t,e){var n=this.image_,r=n.getExtent(),i=n.getResolution(),o=n.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,u=t.viewState,l=u.center,c=a*i/(u.resolution*o),h=t.extent,f=u.resolution,p=u.rotation,d=Math.round(bt(h)/f*a),g=Math.round(_t(h)/f*a);D(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,p,-d/2,-g/2),j(this.inversePixelTransform,this.pixelTransform);var y=G(this.pixelTransform);this.useContainer(e,y,this.getBackground(t));var v=this.context,_=v.canvas;_.width!=d||_.height!=g?(_.width=d,_.height=g):this.containerReused||v.clearRect(0,0,d,g);var m=!1,x=!0;if(s.extent){var w=Di(s.extent,u.projection);(m=(x=Et(w,t.extent))&&!J(w,t.extent))&&this.clipUnrotated(v,t,w)}var b=n.getImage(),E=D(this.tempTransform,d/2,g/2,c,c,0,o*(r[0]-l[0])/i,o*(l[1]-r[3])/i);this.renderedResolution=i*a/o;var S=b.width*E[0],C=b.height*E[3];if(this.getLayer().getSource().getInterpolate()||te(v,$w),this.preRender(v,t),x&&S>=.5&&C>=.5){var P=E[4],I=E[5],M=s.opacity,O=void 0;1!==M&&(O=v.globalAlpha,v.globalAlpha=M),v.drawImage(b,0,0,+b.width,+b.height,P,I,S,C),1!==M&&(v.globalAlpha=O)}return this.postRender(v,t),m&&v.restore(),te(v,Qw),y!==_.style.transform&&(_.style.transform=y),this.container},e}(Gm),XP=UP,qP=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)}}(),WP=function(t){function e(e){return t.call(this,e)||this}return qP(e,t),e.prototype.createRenderer=function(){return new XP(this)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(zP),YP=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)}}(),HP=function(t){function e(e,n,r,i,o,s,a){var u=this,l=e.getExtent(),c=n.getExtent(),h=c?mt(r,c):r,f=rb(e,n,dt(h),i),p=new Jw(e,n,h,l,.5*f,i),d=s(p.calculateSourceExtent(),f,o),g=d?k_:N_,y=d?d.getPixelRatio():1;return(u=t.call(this,r,i,y,g)||this).targetProj_=n,u.maxSourceExtent_=l,u.triangulation_=p,u.targetResolution_=i,u.targetExtent_=r,u.sourceImage_=d,u.sourcePixelRatio_=y,u.interpolate_=a,u.canvas_=null,u.sourceListenerKey_=null,u}return YP(e,t),e.prototype.disposeInternal=function(){this.state==R_&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==T_){var e=bt(this.targetExtent_)/this.targetResolution_,n=_t(this.targetExtent_)/this.targetResolution_;this.canvas_=ib(e,n,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==k_){this.state=R_,this.changed();var t=this.sourceImage_.getState();t==T_||t==A_?this.reproject_():(this.sourceListenerKey_=_e(this.sourceImage_,ae,function(t){var e=this.sourceImage_.getState();e!=T_&&e!=A_||(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){xe(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(dx),ZP=HP,KP=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)}}(),JP="imageloadstart",$P="imageloadend",QP="imageloaderror",tI=function(t){function e(e,n){var r=t.call(this,e)||this;return r.image=n,r}return KP(e,t),e}($t),eI=function(t){function e(e){var n=this,r=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(r=e.interpolate),(n=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state,interpolate:r})||this).on,n.once,n.un,n.resolutions_=void 0!==e.resolutions?e.resolutions:null,n.reprojectedImage_=null,n.reprojectedRevision_=0,n}return KP(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=h(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,n,r){var i=this.getProjection();if(i&&r&&!Si(i,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Si(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&ot(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new ZP(i,r,t,e,n,function(t,e,n){return this.getImageInternal(t,e,n,i)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(r=i),this.getImageInternal(t,e,n,r)},e.prototype.getImageInternal=function(t,e,n,r){return _()},e.prototype.handleImageChange=function(t){var e,n=t.target;switch(n.getState()){case R_:this.loading=!0,e=JP;break;case T_:this.loading=!1,e=$P;break;case A_:this.loading=!1,e=QP;break;default:return}this.hasListener(e)&&this.dispatchEvent(new tI(e,n))},e}(Gx);function nI(t,e){t.getImage().src=e}var rI=eI,iI="1.3.0";function oI(t,e){var n=[];Object.keys(e).forEach(function(t){null!==e[t]&&void 0!==e[t]&&n.push(t+"="+encodeURIComponent(e[t]))});var r=n.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}var sI=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)}}(),aI=[101,101],uI=function(t){function e(e){var n=this,r=e||{},i=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(i=r.interpolate),(n=t.call(this,{attributions:r.attributions,interpolate:i,projection:r.projection,resolutions:r.resolutions})||this).crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null,n.url_=r.url,n.imageLoadFunction_=void 0!==r.imageLoadFunction?r.imageLoadFunction:nI,n.params_=r.params||{},n.v13_=!0,n.updateV13_(),n.serverType_=r.serverType,n.hidpi_=void 0===r.hidpi||r.hidpi,n.image_=null,n.imageSize_=[0,0],n.renderedRevision_=0,n.ratio_=void 0!==r.ratio?r.ratio:1.5,n}return sI(e,t),e.prototype.getFeatureInfoUrl=function(t,e,n,r){if(void 0!==this.url_){var i=xi(n),o=this.getProjection();o&&o!==i&&(e=rb(o,i,t,e),t=Ii(t,i,o));var s=yt(t,e,0,aI),a={SERVICE:"WMS",VERSION:iI,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};te(a,this.params_,r);var u=jt((t[0]-s[0])/e,4),l=jt((s[3]-t[1])/e,4);return a[this.v13_?"I":"X"]=u,a[this.v13_?"J":"Y"]=l,this.getRequestUrl_(s,aI,1,o||i,a)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var n={SERVICE:"WMS",VERSION:iI,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var r=this.params_.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;n.LAYER=r}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;n.SCALE=t*i/28e-5}return te(n,e),oI(this.url_,n)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,n,r){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==n||this.hidpi_&&void 0!==this.serverType_||(n=1);var i=e/n,o=dt(t),s=yt(o,i,0,[Gt(bt(t)/i,4),Gt(_t(t)/i,4)]),a=yt(o,i,0,[Gt(this.ratio_*bt(t)/i,4),Gt(this.ratio_*_t(t)/i,4)]),u=this.image_;if(u&&this.renderedRevision_==this.getRevision()&&u.getResolution()==e&&u.getPixelRatio()==n&&J(u.getExtent(),s))return u;var l={SERVICE:"WMS",VERSION:iI,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};te(l,this.params_),this.imageSize_[0]=Dt(bt(a)/i,4),this.imageSize_[1]=Dt(_t(a)/i,4);var c=this.getRequestUrl_(a,this.imageSize_,n,r,l);return this.image_=new _x(a,e,n,c,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(ae,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,n,r,i){if(T(void 0!==this.url_,9),i[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(i.STYLES=""),1!=n)switch(this.serverType_){case"geoserver":var o=90*n+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case"mapserver":i.MAP_RESOLUTION=90*n;break;case"carmentaserver":case"qgis":i.DPI=90*n;break;default:T(!1,8)}i.WIDTH=e[0],i.HEIGHT=e[1];var s,a=r.getAxisOrientation();return s=this.v13_&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,i.BBOX=s.join(","),oI(this.url_,i)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){te(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||iI;this.v13_=function(t,e){for(var n=(""+t).split("."),r=(""+e).split("."),i=0;i<Math.max(n.length,r.length);i++){var o=parseInt(n[i]||"0",10),s=parseInt(r[i]||"0",10);if(o>s)return 1;if(s>o)return-1}return 0}(t,"1.3")>=0},e}(rI),lI=uI,cI=["zIndex","visible","name"];function hI(t){return hI="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},hI(t)}function fI(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,pI(r.key),r)}}function pI(t){var e=function(t,e){if("object"!=hI(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=hI(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==hI(e)?e:e+""}var dI={zIndex:10,visible:!0,ratio:1,serverType:"geoserver",crossOrigin:"anonymous"},gI=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=Object.assign({},dI,e),this.createLayer()},e=[{key:"createLayer",value:function(){var t=this.options,e=t.zIndex,n=t.visible,r=t.name,i=function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(t,cI);this.source=new lI(i),this.layer=new WP({source:this.source,zIndex:e,visible:n}),r&&this.layer.set("name",r)}},{key:"updateSource",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},this.options.params,t.params||{});this.source.updateParams(e),this.source.changed()}},{key:"setVisible",value:function(t){this.layer.setVisible(t)}},{key:"getVisible",value:function(){return this.layer.getVisible()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"getZIndex",value:function(){return this.layer.getZIndex()}},{key:"setOpacity",value:function(t){this.layer.setOpacity(t)}},{key:"getOpacity",value:function(){return this.layer.getOpacity()}},{key:"setMap",value:function(t){this.map&&this.map.removeFeature(this.layer),this.map=t,t&&t.addFeature(this.layer)}},{key:"destroy",value:function(){this.setMap(null),this.layer=null,this.source=null,this.options=null}},{key:"name",get:function(){return this.layer.get("name")},set:function(t){this.layer.set("name",t)}},{key:"setSource",value:function(t){this.layer.setSource(t),this.source=t}},{key:"getSource",value:function(){return this.layer.getSource()}}],e&&fI(t.prototype,e),n&&fI(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),yI=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)}}(),vI=function(t){function e(e,n,r,i,o){var s=this,a=void 0!==o?k_:T_;return(s=t.call(this,e,n,r,a)||this).loader_=void 0!==o?o:null,s.canvas_=i,s.error_=null,s}return yI(e,t),e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=A_):this.state=T_,this.changed()},e.prototype.load=function(){this.state==k_&&(this.state=R_,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(dx),_I=vI,mI=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)}}(),xI=function(t){function e(e){var n=this,r=e||{},i=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(i=r.interpolate),(n=t.call(this,{attributions:r.attributions,interpolate:i,projection:r.projection,resolutions:r.resolutions,state:r.state})||this).canvasFunction_=r.canvasFunction,n.canvas_=null,n.renderedRevision_=0,n.ratio_=void 0!==r.ratio?r.ratio:1.5,n}return mI(e,t),e.prototype.getImageInternal=function(t,e,n,r){e=this.findNearestResolution(e);var i=this.canvas_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==n&&J(i.getExtent(),t))return i;Ct(t=t.slice(),this.ratio_);var o=[bt(t)/e*n,_t(t)/e*n],s=this.canvasFunction_.call(this,t,e,n,o,r);return s&&(i=new _I(t,e,n,s)),this.canvas_=i,this.renderedRevision_=this.getRevision(),i},e}(rI),wI=xI;
|
|
74
74
|
/*!
|
|
75
75
|
* author: [object Object]
|
|
76
76
|
* @sakitam-gis/kriging v0.1.0
|
|
@@ -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}()});
|