@mapgis/webclient-leaflet-plugin 17.2.1 → 17.2.2
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.
|
@@ -102,4 +102,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
102
102
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
103
103
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
104
104
|
PERFORMANCE OF THIS SOFTWARE.
|
|
105
|
-
***************************************************************************** */var p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function d(t,e){var i=t[0],n=t[1];return[i*Math.cos(e)-n*Math.sin(e),i*Math.sin(e)+n*Math.cos(e)]}function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0;i<t.length;i++)if("number"!=typeof t[i])throw new Error("assertNumbers arguments["+i+"] is not a number. "+typeof t[i]+" == typeof "+t[i]);return!0}var y=Math.PI;function m(t,e,i){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var n=t.rX,r=t.rY,o=t.x,s=t.y;n=Math.abs(t.rX),r=Math.abs(t.rY);var a=d([(e-o)/2,(i-s)/2],-t.xRot/180*y),l=a[0],h=a[1],u=Math.pow(l,2)/Math.pow(n,2)+Math.pow(h,2)/Math.pow(r,2);1<u&&(n*=Math.sqrt(u),r*=Math.sqrt(u)),t.rX=n,t.rY=r;var c=Math.pow(n,2)*Math.pow(h,2)+Math.pow(r,2)*Math.pow(l,2),p=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(r,2)-c)/c)),f=n*h/r*p,g=-r*l/n*p,m=d([f,g],t.xRot/180*y);t.cX=m[0]+(e+o)/2,t.cY=m[1]+(i+s)/2,t.phi1=Math.atan2((h-g)/r,(l-f)/n),t.phi2=Math.atan2((-h-g)/r,(-l-f)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*y),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*y),t.phi1*=180/y,t.phi2*=180/y}function _(t,e,i){g(t,e,i);var n=t*t+e*e-i*i;if(0>n)return[];if(0===n)return[[t*i/(t*t+e*e),e*i/(t*t+e*e)]];var r=Math.sqrt(n);return[[(t*i+e*r)/(t*t+e*e),(e*i-t*r)/(t*t+e*e)],[(t*i-e*r)/(t*t+e*e),(e*i+t*r)/(t*t+e*e)]]}var v,x=Math.PI/180;function b(t,e,i){return(1-i)*t+i*e}function w(t,e,i,n){return t+Math.cos(n/180*y)*e+Math.sin(n/180*y)*i}function E(t,e,i,n){var r=e-t,o=i-e,s=3*r+3*(n-i)-6*o,a=6*(o-r),l=3*r;return Math.abs(s)<1e-6?[-l/a]:function(t,e,i){void 0===i&&(i=1e-6);var n=t*t/4-l/s;if(n<-i)return[];if(n<=i)return[-t/2];var r=Math.sqrt(n);return[-t/2-r,-t/2+r]}(a/s,0,1e-6)}function C(t,e,i,n,r){var o=1-r;return t*(o*o*o)+e*(3*o*o*r)+i*(3*o*r*r)+n*(r*r*r)}!function(t){function e(){return r(function(t,e,i){return t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=i),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=i),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=i),t.relative=!1),t})}function i(){var t=NaN,e=NaN,i=NaN,n=NaN;return r(function(r,o,s){return r.type&O.SMOOTH_CURVE_TO&&(r.type=O.CURVE_TO,t=isNaN(t)?o:t,e=isNaN(e)?s:e,r.x1=r.relative?o-t:2*o-t,r.y1=r.relative?s-e:2*s-e),r.type&O.CURVE_TO?(t=r.relative?o+r.x2:r.x2,e=r.relative?s+r.y2:r.y2):(t=NaN,e=NaN),r.type&O.SMOOTH_QUAD_TO&&(r.type=O.QUAD_TO,i=isNaN(i)?o:i,n=isNaN(n)?s:n,r.x1=r.relative?o-i:2*o-i,r.y1=r.relative?s-n:2*s-n),r.type&O.QUAD_TO?(i=r.relative?o+r.x1:r.x1,n=r.relative?s+r.y1:r.y1):(i=NaN,n=NaN),r})}function n(){var t=NaN,e=NaN;return r(function(i,n,r){if(i.type&O.SMOOTH_QUAD_TO&&(i.type=O.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?r:e,i.x1=i.relative?n-t:2*n-t,i.y1=i.relative?r-e:2*r-e),i.type&O.QUAD_TO){t=i.relative?n+i.x1:i.x1,e=i.relative?r+i.y1:i.y1;var o=i.x1,s=i.y1;i.type=O.CURVE_TO,i.x1=((i.relative?0:n)+2*o)/3,i.y1=((i.relative?0:r)+2*s)/3,i.x2=(i.x+2*o)/3,i.y2=(i.y+2*s)/3}else t=NaN,e=NaN;return i})}function r(t){var e=0,i=0,n=NaN,r=NaN;return function(o){if(isNaN(n)&&!(o.type&O.MOVE_TO))throw new Error("path must start with moveto");var s=t(o,e,i,n,r);return o.type&O.CLOSE_PATH&&(e=n,i=r),void 0!==o.x&&(e=o.relative?e+o.x:o.x),void 0!==o.y&&(i=o.relative?i+o.y:o.y),o.type&O.MOVE_TO&&(n=e,r=i),s}}function o(t,e,i,n,o,s){return g(t,e,i,n,o,s),r(function(r,a,l,h){var u=r.x1,c=r.x2,p=r.relative&&!isNaN(h),f=void 0!==r.x?r.x:p?0:a,d=void 0!==r.y?r.y:p?0:l;function g(t){return t*t}r.type&O.HORIZ_LINE_TO&&0!==e&&(r.type=O.LINE_TO,r.y=r.relative?0:l),r.type&O.VERT_LINE_TO&&0!==i&&(r.type=O.LINE_TO,r.x=r.relative?0:a),void 0!==r.x&&(r.x=r.x*t+d*i+(p?0:o)),void 0!==r.y&&(r.y=f*e+r.y*n+(p?0:s)),void 0!==r.x1&&(r.x1=r.x1*t+r.y1*i+(p?0:o)),void 0!==r.y1&&(r.y1=u*e+r.y1*n+(p?0:s)),void 0!==r.x2&&(r.x2=r.x2*t+r.y2*i+(p?0:o)),void 0!==r.y2&&(r.y2=c*e+r.y2*n+(p?0:s));var y=t*n-e*i;if(void 0!==r.xRot&&(1!==t||0!==e||0!==i||1!==n))if(0===y)delete r.rX,delete r.rY,delete r.xRot,delete r.lArcFlag,delete r.sweepFlag,r.type=O.LINE_TO;else{var m=r.xRot*Math.PI/180,_=Math.sin(m),v=Math.cos(m),x=1/g(r.rX),b=1/g(r.rY),w=g(v)*x+g(_)*b,E=2*_*v*(x-b),C=g(_)*x+g(v)*b,L=w*n*n-E*e*n+C*e*e,S=E*(t*n+e*i)-2*(w*i*n+C*t*e),P=w*i*i-E*t*i+C*t*t,I=(Math.atan2(S,L-P)+Math.PI)%Math.PI/2,M=Math.sin(I),T=Math.cos(I);r.rX=Math.abs(y)/Math.sqrt(L*g(T)+S*M*T+P*g(M)),r.rY=Math.abs(y)/Math.sqrt(L*g(M)-S*M*T+P*g(T)),r.xRot=180*I/Math.PI}return void 0!==r.sweepFlag&&0>y&&(r.sweepFlag=+!r.sweepFlag),r})}t.ROUND=function(t){function e(e){return Math.round(e*t)/t}return void 0===t&&(t=1e13),g(t),function(t){return void 0!==t.x1&&(t.x1=e(t.x1)),void 0!==t.y1&&(t.y1=e(t.y1)),void 0!==t.x2&&(t.x2=e(t.x2)),void 0!==t.y2&&(t.y2=e(t.y2)),void 0!==t.x&&(t.x=e(t.x)),void 0!==t.y&&(t.y=e(t.y)),void 0!==t.rX&&(t.rX=e(t.rX)),void 0!==t.rY&&(t.rY=e(t.rY)),t}},t.TO_ABS=e,t.TO_REL=function(){return r(function(t,e,i){return t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=i),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=i),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=i),t.relative=!0),t})},t.NORMALIZE_HVZ=function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),r(function(n,r,o,s,a){if(isNaN(s)&&!(n.type&O.MOVE_TO))throw new Error("path must start with moveto");return e&&n.type&O.HORIZ_LINE_TO&&(n.type=O.LINE_TO,n.y=n.relative?0:o),i&&n.type&O.VERT_LINE_TO&&(n.type=O.LINE_TO,n.x=n.relative?0:r),t&&n.type&O.CLOSE_PATH&&(n.type=O.LINE_TO,n.x=n.relative?s-r:s,n.y=n.relative?a-o:a),n.type&O.ARC&&(0===n.rX||0===n.rY)&&(n.type=O.LINE_TO,delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag),n})},t.NORMALIZE_ST=i,t.QT_TO_C=n,t.INFO=r,t.SANITIZE=function(t){void 0===t&&(t=0),g(t);var e=NaN,i=NaN,n=NaN,o=NaN;return r(function(r,s,a,l,h){var u=Math.abs,c=!1,p=0,f=0;if(r.type&O.SMOOTH_CURVE_TO&&(p=isNaN(e)?0:s-e,f=isNaN(i)?0:a-i),r.type&(O.CURVE_TO|O.SMOOTH_CURVE_TO)?(e=r.relative?s+r.x2:r.x2,i=r.relative?a+r.y2:r.y2):(e=NaN,i=NaN),r.type&O.SMOOTH_QUAD_TO?(n=isNaN(n)?s:2*s-n,o=isNaN(o)?a:2*a-o):r.type&O.QUAD_TO?(n=r.relative?s+r.x1:r.x1,o=r.relative?a+r.y1:r.y2):(n=NaN,o=NaN),r.type&O.LINE_COMMANDS||r.type&O.ARC&&(0===r.rX||0===r.rY||!r.lArcFlag)||r.type&O.CURVE_TO||r.type&O.SMOOTH_CURVE_TO||r.type&O.QUAD_TO||r.type&O.SMOOTH_QUAD_TO){var d=void 0===r.x?0:r.relative?r.x:r.x-s,g=void 0===r.y?0:r.relative?r.y:r.y-a;p=isNaN(n)?void 0===r.x1?p:r.relative?r.x:r.x1-s:n-s,f=isNaN(o)?void 0===r.y1?f:r.relative?r.y:r.y1-a:o-a;var y=void 0===r.x2?0:r.relative?r.x:r.x2-s,m=void 0===r.y2?0:r.relative?r.y:r.y2-a;u(d)<=t&&u(g)<=t&&u(p)<=t&&u(f)<=t&&u(y)<=t&&u(m)<=t&&(c=!0)}return r.type&O.CLOSE_PATH&&u(s-l)<=t&&u(a-h)<=t&&(c=!0),c?[]:r})},t.MATRIX=o,t.ROTATE=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),g(t,e,i);var n=Math.sin(t),r=Math.cos(t);return o(r,n,-n,r,e-e*r+i*n,i-e*n-i*r)},t.TRANSLATE=function(t,e){return void 0===e&&(e=0),g(t,e),o(1,0,0,1,t,e)},t.SCALE=function(t,e){return void 0===e&&(e=t),g(t,e),o(t,0,0,e,0,0)},t.SKEW_X=function(t){return g(t),o(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return g(t),o(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),g(t),o(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),g(t),o(1,0,0,-1,0,t)},t.A_TO_C=function(){return r(function(t,e,i){return O.ARC===t.type?function(t,e,i){var n,r,o,s;t.cX||m(t,e,i);for(var a=Math.min(t.phi1,t.phi2),l=Math.max(t.phi1,t.phi2)-a,h=Math.ceil(l/90),u=new Array(h),c=e,p=i,f=0;f<h;f++){var g=b(t.phi1,t.phi2,f/h),y=b(t.phi1,t.phi2,(f+1)/h),_=y-g,v=4/3*Math.tan(_*x/4),w=[Math.cos(g*x)-v*Math.sin(g*x),Math.sin(g*x)+v*Math.cos(g*x)],E=w[0],C=w[1],L=[Math.cos(y*x),Math.sin(y*x)],S=L[0],P=L[1],I=[S+v*Math.sin(y*x),P-v*Math.cos(y*x)],M=I[0],T=I[1];u[f]={relative:t.relative,type:O.CURVE_TO};var N=function(e,i){var n=d([e*t.rX,i*t.rY],t.xRot),r=n[0],o=n[1];return[t.cX+r,t.cY+o]};n=N(E,C),u[f].x1=n[0],u[f].y1=n[1],r=N(M,T),u[f].x2=r[0],u[f].y2=r[1],o=N(S,P),u[f].x=o[0],u[f].y=o[1],t.relative&&(u[f].x1-=c,u[f].y1-=p,u[f].x2-=c,u[f].y2-=p,u[f].x-=c,u[f].y-=p),c=(s=[u[f].x,u[f].y])[0],p=s[1]}return u}(t,t.relative?0:e,t.relative?0:i):t})},t.ANNOTATE_ARCS=function(){return r(function(t,e,i){return t.relative&&(e=0,i=0),O.ARC===t.type&&m(t,e,i),t})},t.CLONE=function(){return function(t){var e={};for(var i in t)e[i]=t[i];return e}},t.CALCULATE_BOUNDS=function(){var t=e(),o=n(),s=i(),a=r(function(e,i,n){var r=s(o(t(function(t){var e={};for(var i in t)e[i]=t[i];return e}(e))));function l(t){t>a.maxX&&(a.maxX=t),t<a.minX&&(a.minX=t)}function h(t){t>a.maxY&&(a.maxY=t),t<a.minY&&(a.minY=t)}if(r.type&O.DRAWING_COMMANDS&&(l(i),h(n)),r.type&O.HORIZ_LINE_TO&&l(r.x),r.type&O.VERT_LINE_TO&&h(r.y),r.type&O.LINE_TO&&(l(r.x),h(r.y)),r.type&O.CURVE_TO){l(r.x),h(r.y);for(var u=0,c=E(i,r.x1,r.x2,r.x);u<c.length;u++)0<(A=c[u])&&1>A&&l(C(i,r.x1,r.x2,r.x,A));for(var p=0,f=E(n,r.y1,r.y2,r.y);p<f.length;p++)0<(A=f[p])&&1>A&&h(C(n,r.y1,r.y2,r.y,A))}if(r.type&O.ARC){l(r.x),h(r.y),m(r,i,n);for(var d=r.xRot/180*Math.PI,g=Math.cos(d)*r.rX,y=Math.sin(d)*r.rX,v=-Math.sin(d)*r.rY,x=Math.cos(d)*r.rY,b=r.phi1<r.phi2?[r.phi1,r.phi2]:-180>r.phi2?[r.phi2+360,r.phi1+360]:[r.phi2,r.phi1],L=b[0],S=b[1],P=function(t){var e=t[0],i=t[1],n=180*Math.atan2(i,e)/Math.PI;return n<L?n+360:n},I=0,M=_(v,-g,0).map(P);I<M.length;I++)(A=M[I])>L&&A<S&&l(w(r.cX,g,v,A));for(var T=0,N=_(x,-y,0).map(P);T<N.length;T++){var A;(A=N[T])>L&&A<S&&h(w(r.cY,y,x,A))}}return e});return a.minX=1/0,a.maxX=-1/0,a.minY=1/0,a.maxY=-1/0,a}}(v||(v={}));var S,P=function(){function t(){}return t.prototype.round=function(t){return this.transform(v.ROUND(t))},t.prototype.toAbs=function(){return this.transform(v.TO_ABS())},t.prototype.toRel=function(){return this.transform(v.TO_REL())},t.prototype.normalizeHVZ=function(t,e,i){return this.transform(v.NORMALIZE_HVZ(t,e,i))},t.prototype.normalizeST=function(){return this.transform(v.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(v.QT_TO_C())},t.prototype.aToC=function(){return this.transform(v.A_TO_C())},t.prototype.sanitize=function(t){return this.transform(v.SANITIZE(t))},t.prototype.translate=function(t,e){return this.transform(v.TRANSLATE(t,e))},t.prototype.scale=function(t,e){return this.transform(v.SCALE(t,e))},t.prototype.rotate=function(t,e,i){return this.transform(v.ROTATE(t,e,i))},t.prototype.matrix=function(t,e,i,n,r,o){return this.transform(v.MATRIX(t,e,i,n,r,o))},t.prototype.skewX=function(t){return this.transform(v.SKEW_X(t))},t.prototype.skewY=function(t){return this.transform(v.SKEW_Y(t))},t.prototype.xSymmetry=function(t){return this.transform(v.X_AXIS_SYMMETRY(t))},t.prototype.ySymmetry=function(t){return this.transform(v.Y_AXIS_SYMMETRY(t))},t.prototype.annotateArcs=function(){return this.transform(v.ANNOTATE_ARCS())},t}(),I=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},M=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},T=function(t){function e(){var e=t.call(this)||this;return e.curNumber="",e.curCommandType=-1,e.curCommandRelative=!1,e.canParseCommandOrComma=!0,e.curNumberHasExp=!1,e.curNumberHasExpDigits=!1,e.curNumberHasDecimal=!1,e.curArgs=[],e}return f(e,t),e.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,e){var i=this;void 0===e&&(e=[]);for(var n=function(t){e.push(t),i.curArgs.length=0,i.canParseCommandOrComma=!0},r=0;r<t.length;r++){var o=t[r],s=!(this.curCommandType!==O.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),a=M(o)&&("0"===this.curNumber&&"0"===o||s);if(!M(o)||a)if("e"!==o&&"E"!==o)if("-"!==o&&"+"!==o||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==o||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){var l=Number(this.curNumber);if(isNaN(l))throw new SyntaxError("Invalid number ending at "+r);if(this.curCommandType===O.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>l)throw new SyntaxError('Expected positive number, got "'+l+'" at index "'+r+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+r+'"');this.curArgs.push(l),this.curArgs.length===N[this.curCommandType]&&(O.HORIZ_LINE_TO===this.curCommandType?n({type:O.HORIZ_LINE_TO,relative:this.curCommandRelative,x:l}):O.VERT_LINE_TO===this.curCommandType?n({type:O.VERT_LINE_TO,relative:this.curCommandRelative,y:l}):this.curCommandType===O.MOVE_TO||this.curCommandType===O.LINE_TO||this.curCommandType===O.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),O.MOVE_TO===this.curCommandType&&(this.curCommandType=O.LINE_TO)):this.curCommandType===O.CURVE_TO?n({type:O.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===O.SMOOTH_CURVE_TO?n({type:O.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===O.QUAD_TO?n({type:O.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===O.ARC&&n({type:O.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!I(o))if(","===o&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==o&&"-"!==o&&"."!==o)if(a)this.curNumber=o,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+r+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+o+'" at index '+r+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==o&&"Z"!==o)if("h"===o||"H"===o)this.curCommandType=O.HORIZ_LINE_TO,this.curCommandRelative="h"===o;else if("v"===o||"V"===o)this.curCommandType=O.VERT_LINE_TO,this.curCommandRelative="v"===o;else if("m"===o||"M"===o)this.curCommandType=O.MOVE_TO,this.curCommandRelative="m"===o;else if("l"===o||"L"===o)this.curCommandType=O.LINE_TO,this.curCommandRelative="l"===o;else if("c"===o||"C"===o)this.curCommandType=O.CURVE_TO,this.curCommandRelative="c"===o;else if("s"===o||"S"===o)this.curCommandType=O.SMOOTH_CURVE_TO,this.curCommandRelative="s"===o;else if("q"===o||"Q"===o)this.curCommandType=O.QUAD_TO,this.curCommandRelative="q"===o;else if("t"===o||"T"===o)this.curCommandType=O.SMOOTH_QUAD_TO,this.curCommandRelative="t"===o;else{if("a"!==o&&"A"!==o)throw new SyntaxError('Unexpected character "'+o+'" at index '+r+".");this.curCommandType=O.ARC,this.curCommandRelative="a"===o}else e.push({type:O.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=o,this.curNumberHasDecimal="."===o}else this.curNumber+=o,this.curNumberHasDecimal=!0;else this.curNumber+=o;else this.curNumber+=o,this.curNumberHasExp=!0;else this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp}return e},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(e,i){void 0===i&&(i=[]);for(var n=0,r=Object.getPrototypeOf(this).parse.call(this,e);n<r.length;n++){var o=r[n],s=t(o);Array.isArray(s)?i.push.apply(i,s):i.push(s)}return i}}})},e}(P),O=function(t){function e(i){var n=t.call(this)||this;return n.commands="string"==typeof i?e.parse(i):i,n}return f(e,t),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=v.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var e=[],i=0,n=this.commands;i<n.length;i++){var r=t(n[i]);Array.isArray(r)?e.push.apply(e,r):e.push(r)}return this.commands=e,this},e.encode=function(t){return function(t){var e="";Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];if(n.type===O.CLOSE_PATH)e+="z";else if(n.type===O.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===O.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===O.MOVE_TO)e+=(n.relative?"m":"M")+n.x+" "+n.y;else if(n.type===O.LINE_TO)e+=(n.relative?"l":"L")+n.x+" "+n.y;else if(n.type===O.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+" "+n.y1+" "+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===O.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===O.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+" "+n.y1+" "+n.x+" "+n.y;else if(n.type===O.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+" "+n.y;else{if(n.type!==O.ARC)throw new Error('Unexpected command type "'+n.type+'" at index '+i+".");e+=(n.relative?"a":"A")+n.rX+" "+n.rY+" "+n.xRot+" "+ +n.lArcFlag+" "+ +n.sweepFlag+" "+n.x+" "+n.y}}return e}(t)},e.parse=function(t){var e=new T,i=[];return e.parse(t,i),e.finish(i),i},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(P),N=((S={})[O.MOVE_TO]=2,S[O.LINE_TO]=2,S[O.HORIZ_LINE_TO]=1,S[O.VERT_LINE_TO]=1,S[O.CLOSE_PATH]=0,S[O.QUAD_TO]=4,S[O.SMOOTH_QUAD_TO]=2,S[O.CURVE_TO]=6,S[O.SMOOTH_CURVE_TO]=4,S[O.ARC]=7,S);const A=r.extend({},r.SVG.prototype);r.SVG.include({_updateStyle(t){const e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?("string"==typeof i.fill&&i.fill.match(/^url\(/)?this._fillPattern(t):e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updateShape:function(t){const e=t._point;let i=t.options.radius;const n=t.options.shape,r=t.options.rotation,o=t.options.xoffset,s=t.options.yoffset,a=t.options.path,l=e.x+o,h=e.y+s;if(t._path.setAttribute("transform",`rotate(${r},${l},${h})`),a){const e=new O(a).toAbs();let n=0,r=0,o=0,s=0;e.commands.forEach(t=>{const{x:e,y:i}=t;n=Math.min(e,n),r=Math.min(i,r),o=Math.max(e,o),s=Math.max(i,s)});const u=2*i/(o>s?o:s);return e.scale(u,u).translate(l-i,h-i),void this._setPath(t,e.encode())}if("arrow"===n){const e=`M${l-.85*i} ${h+.75*i} L${l} ${h} L${l+.85*i} ${h+.75*i} L${l} ${h-i} L${l-.85*i} ${h+.75*i}Z`;this._setPath(t,e)}if("diamond"===n){const e=`M${l-Math.sqrt(2)*i} ${h} L ${l} ${h-Math.sqrt(2)*i} L${l+Math.sqrt(2)*i} ${h} L${l} ${h+Math.sqrt(2)*i} L${l-Math.sqrt(2)*i} ${h}`;this._setPath(t,e)}if("square"===n){const e=`M${l-i} ${h-i} L ${l+i} ${h-i} L${l+i} ${h+i} L${l-i} ${h+i} L${l-i} ${h-i}`;this._setPath(t,e)}if("triangle"===n||"triangle-up"===n){const e=`M${l-1.3*i} ${h+.75*i} L${l} ${h-1.5*i} L${l+1.3*i} ${h+.75*i} Z`;this._setPath(t,e)}if("triangle-down"===n){const e=`M${l-1.3*i} ${h-.75*i} L${l} ${h+1.5*i} L${l+1.3*i} ${h-.75*i} Z`;this._setPath(t,e)}if("arrowhead"===n||"arrowhead-up"===n){const e=`M ${l+1.3*i} ${h+1.3*i} L ${l} ${h-1.3*i} L ${l-1.3*i} ${h+1.3*i} L ${l} ${h+.5*i} L ${l+1.3*i} ${h+1.3*i} Z`;this._setPath(t,e)}if("arrowhead-down"===n){const e=`M ${l-1.3*i} ${h-1.3*i} L ${l} ${h+1.3*i} L ${l+1.3*i} ${h-1.3*i} L ${l} ${h-.5*i} L ${l-1.3*i} ${h-1.3*i} Z`;this._setPath(t,e)}if("circle"===n){const e=`a${i},${i} 0 1,0 `,n=t._empty()?"M0 0":`M${l-i},${h}${e}${2*i},0 ${e}${2*-i},0 `;this._setPath(t,n)}if(n.startsWith("star")){const e=n.split(/[^0-9a-z]/gi,2),r=parseInt(e[1]);let o;o="star"===e[0]&&!isNaN(r)&&r>2?r:5;const s=.5*(1+Math.sqrt(5))+1,a=[];for(let t=0;t<o;t++)a.push(`${l+i/s*Math.sin(2*Math.PI/o*t)},${h+i/s*Math.cos(2*Math.PI/o*t)}`),a.push(`${l+i*Math.sin(1/o*Math.PI+2*Math.PI/o*t)},${h+i*Math.cos(1/o*Math.PI+2*Math.PI/o*t)}`);const u=`M${a.join("L")}Z`;this._setPath(t,u)}if("x"===n){const e=`M${l+(i/=2)},${h+i}L${l-i},${h-i}M${l-i},${h+i}L${l+i},${h-i}`;this._setPath(t,e)}if("cross"===n){const e=`M${l},${h+(i/=2)}L${l},${h-i}M${l+i},${h}L${l-i},${h}`;this._setPath(t,e)}},_fillPattern(t){const e=t._path,i=t.options,n=i.fillDetail;this._defs||(this._defs=r.SVG.create("defs"),this._container.appendChild(this._defs));const o=i.fill.substring(4,i.fill.length-1),s=o;let a;if(!Array.from(this._defs.children).some(t=>t.getAttribute("id")===s)){const t=new Image;t.src=o,(a=r.SVG.create("pattern")).setAttribute("id",s),a.setAttribute("patternUnits","userSpaceOnUse"),this._defs.appendChild(a);const e=r.SVG.create("image");e.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.appendChild(e),t.onload=function(){if(n){const{width:t=10,height:i=10,xoffset:r=0,yoffset:o=0,xscale:s=1,yscale:l=1}=n;a.setAttribute("x",r),a.setAttribute("y",o),e.setAttribute("x",r),e.setAttribute("y",o),a.setAttribute("width",t*s),a.setAttribute("height",i*l),e.style.transform=`scale(${s},${l})`,e.setAttribute("width",t),e.setAttribute("height",i)}else a.setAttribute("x","0"),a.setAttribute("y","0"),e.setAttribute("x","0"),e.setAttribute("y","0"),a.setAttribute("width",t.width),a.setAttribute("height",t.height),e.setAttribute("width",t.width),e.setAttribute("height",t.height)}}e.setAttribute("fill",`url(#${s})`)},_update(){A._update.call(this),this._map._rotate&&this.fire("update")}});const R=r.extend({},r.DivOverlay.prototype);r.DivOverlay.include({getEvents(){return r.extend(R.getEvents.call(this),{rotate:this._updatePosition})},_updatePosition(){if(!this._map)return;let t=this._map.latLngToLayerPoint(this._latlng),e=r.point(this.options.offset);const i=this._getAnchor();this._zoomAnimated?(this._map._rotate&&(t=this._map.rotatedPointToMapPanePoint(t)),r.DomUtil.setPosition(this._container,t.add(i))):e=e.add(t).add(i);const n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=`${n}px`,this._container.style.left=`${o}px`}});const k=r.extend({},r.Popup.prototype);r.Popup.include({_animateZoom(t){this._map._rotate||k._animateZoom.call(this,t);let e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);const i=this._getAnchor();e=this._map.rotatedPointToMapPanePoint(e),r.DomUtil.setPosition(this._container,e.add(i))},_adjustPan(){if(!this.options.autoPan||this._map._panAnim&&this._map._panAnim._inProgress)return;const t=this._map,e=parseInt(r.DomUtil.getStyle(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new r.Point(this._containerLeft,-i-this._containerBottom);o._add(r.DomUtil.getPosition(this._container));const s=o._add(this._map._getMapPanePos()),a=r.point(this.options.autoPanPadding),l=r.point(this.options.autoPanPaddingTopLeft||a),h=r.point(this.options.autoPanPaddingBottomRight||a),u=t.getSize();let c=0,p=0;s.x+n+h.x>u.x&&(c=s.x+n-u.x+h.x),s.x-c-l.x<0&&(c=s.x-l.x),s.y+i+h.y>u.y&&(p=s.y+i-u.y+h.y),s.y-p-l.y<0&&(p=s.y-l.y),(c||p)&&t.fire("autopanstart").panBy([c,p])}});const D=r.extend({},r.Tooltip.prototype);r.Tooltip.include({_updatePosition(){if(!this._map._rotate)return D._updatePosition.call(this);let t=this._map.latLngToLayerPoint(this._latlng);t=this._map.rotatedPointToMapPanePoint(t),this._setPosition(t)},_animateZoom(t){if(!this._map._rotate)return D._animateZoom.call(this,t);let e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);e=this._map.rotatedPointToMapPanePoint(e),this._setPosition(e)}});const z=1e-6,B=r.extend({},r.Map.prototype);r.Map.mergeOptions({rotate:!1,bearing:0}),r.Map.include({initialize(t,e){if(e.rotate&&(this._rotate=!0,this._bearing=0),e=r.Util.setOptions(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=r.Util.bind(this._onResize,this),this._initEvents(),this.options&&this.options.maxBounds){const t=this.options.zoomSnap;this.options.zoomSnap=z;const e=this.getBoundsZoom(this.options.maxBounds);this.options.zoomSnap=t,this.options.minZoom=e}e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(r.latLng(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=r.DomUtil.TRANSITION&&r.Browser.any3d&&!r.Browser.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),r.DomEvent.on(this._proxy,r.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)),this._addLayers(this.options.layers),this.options.rotate&&this.setBearing(this.options.bearing)},containerPointToLayerPoint(t){return this._rotate?r.point(t).subtract(this._getMapPanePos()).rotateFrom(-this._bearing,this._getRotatePanePos()).subtract(this._getRotatePanePos()):B.containerPointToLayerPoint.call(this,t)},getBounds(){if(!this._rotate)return B.getBounds.call(this);const t=this.getSize(),e=this.layerPointToLatLng(this.containerPointToLayerPoint([0,0])),i=this.layerPointToLatLng(this.containerPointToLayerPoint([t.x,0])),n=this.layerPointToLatLng(this.containerPointToLayerPoint([t.x,t.y])),o=this.layerPointToLatLng(this.containerPointToLayerPoint([0,t.y]));return new r.LatLngBounds([e,i,n,o])},_getBoundsCenterZoom(t,e){e=e||{},t=t.getBounds?t.getBounds():r.latLngBounds(t);const i=this.toPoint(e.paddingTopLeft||e.padding||[0,0]),n=this.toPoint(e.paddingBottomRight||e.padding||[0,0]);let o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};const s=n.subtract(i).divideBy(2),a=this.project(t.getNorthWest(),o),l=this.project(t.getSouthEast(),o);return{center:this.unproject(l.add(a).divideBy(2).add(s),o),zoom:o}},getGeoBoundsCoord(){const t=this.getPixelBounds(),e=this._zoom,i=this.options.crs.pointToGeoCoord(this.toPoint(t.getTopLeft()),e),n=this.options.crs.pointToGeoCoord(this.toPoint(t.getBottomRight()),e);return{xmin:i.x,ymin:n.y,xmax:n.x,ymax:i.y}},layerPointToGeo(t){const e=this.toPoint(t).add(this.getPixelOrigin()),i=this._zoom;return this.options.crs.pointToGeoCoord(this.toPoint(e),i)},layerPointToContainerPoint(t){return this._rotate?r.point(t).add(this._getRotatePanePos()).rotateFrom(this._bearing,this._getRotatePanePos()).add(this._getMapPanePos()):B.layerPointToContainerPoint.call(this,t)},setBearing(t){if(!r.Browser.any3d||!this._rotate)return;let e=this._getRotatePanePos();const i=this.getSize().divideBy(2),n=this._getMapPanePos();this._pivot=n.clone().multiplyBy(-1).add(i),e=e.rotateFrom(-this._bearing,this._pivot),this._bearing=t*r.DomUtil.DEG_TO_RAD,this._rotatePanePos=e.rotateFrom(this._bearing,this._pivot),r.DomUtil.setPositionBearing(this._rotatePane,e,this._bearing,this._pivot),this.fire("rotate")},getBearing(){return this._bearing*r.DomUtil.RAD_TO_DEG},_initPanes(){const t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),r.DomUtil.setPosition(this._mapPane,new r.Point(0,0)),this._rotate?(this._rotatePane=this.createPane("rotatePane",this._mapPane),this._norotatePane=this.createPane("norotatePane",this._mapPane),this.createPane("tilePane",this._rotatePane),this.createPane("overlayPane",this._rotatePane),this.createPane("shadowPane",this._norotatePane),this.createPane("markerPane",this._norotatePane),this.createPane("tooltipPane",this._norotatePane),this.createPane("popupPane",this._norotatePane)):(this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane")),this.options.markerZoomAnimation||(r.DomUtil.addClass(t.markerPane,"leaflet-zoom-hide"),r.DomUtil.addClass(t.shadowPane,"leaflet-zoom-hide"))},rotatedPointToMapPanePoint(t){return r.point(t).rotate(this._bearing)._add(this._getRotatePanePos())},mapPanePointToRotatedPoint(t){return r.point(t)._subtract(this._getRotatePanePos()).rotate(-this._bearing)},_getCenterOffset(t){let e=B._getCenterOffset.call(this,t);return this._rotate&&(e=e.rotate(this._bearing)),e},_getRotatePanePos(){return this._rotatePanePos||new r.Point(0,0)},_getNewPixelOrigin(t,e){const i=this.getSize()._divideBy(2);return this._rotate||B._getNewPixelOrigin.call(this,t,e),this.project(t,e).rotate(this._bearing)._subtract(i)._add(this._getMapPanePos())._add(this._getRotatePanePos()).rotate(-this._bearing)._round()},_handleGeolocationResponse(t){const e=t.coords.latitude,i=t.coords.longitude,n=t.coords.heading,o=new r.LatLng(e,i),s=o.toBounds(t.coords.accuracy),a=this._locateOptions;if(a.setView){const t=this.getBoundsZoom(s);this.setView(o,a.maxZoom?Math.min(t,a.maxZoom):t)}const l={latlng:o,bounds:s,timestamp:t.timestamp,heading:n};for(const e in t.coords)"number"==typeof t.coords[e]&&(l[e]=t.coords[e]);this.fire("locationfound",l)},toPoint:(t,e,i)=>t instanceof r.Point?t:Array.isArray(t)?new r.Point(t[0],t[1]):void 0===t||null===t?t:"object"==typeof t&&"x"in t&&"y"in t?new r.Point(t.x,t.y):new r.Point(t,e,i),panBy(t,e){if(t=this.toPoint(t).round(),e=e||{},t.x||t.y){if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new r.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){r.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");const i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this}}});var F=i(2);class V{static convertColorToRgb(t){return t instanceof n.Color?t.toCssRGBAString():n.Color.fromColor(t).toCssRGBAString()}static convertLngLatGeometry(t){return t&&t.spatialReference?t.spatialReference.isGeographic?t:n.Projection.project(t,new n.SpatialReference("EPSG:4326")):t}static convertClippingArea(t){if(!t)return t;let e=null;switch(t.type){case n.GeometryType.polygon:case n.GeometryType.multiPolygon:e=V.convertLngLatGeometry(t).toGeoJSON();break;case n.GeometryType.circle:e=V.convertLngLatGeometry(t).toPolygon().toGeoJSON();break;case n.GeometryType.extent:e=V.convertLngLatGeometry(t).toPolygon().toGeoJSON();break}return e}static convertClippAreaToPx(t,e){const i=[];for(let n=0;n<e.length;n++){const o=[];for(let i=0;i<e[n].length;i++){const s=t.project(r.latLng(e[n][i][1],e[n][i][0]),0);o.push([s.x,s.y])}i.push(o)}return i}static toTurfGeometry(t,e){let i=[];return"Polygon"===t.type?i.push(t.coordinates):i=t.coordinates,i.map(t=>{const i=V.convertClippAreaToPx(e,t);return F.polygon(i)})}static getClippingState(t,e){if(F.booleanContains(t,e))return{in:!0,geometry:null};if(F.booleanContains(e,t))return{intersect:!0,geometry:t};if(!F.booleanOverlap(t,e))return{out:!0,geometry:null};const i=F.intersect(t,e);return i?{intersect:!0,geometry:i}:{out:!0,geometry:null}}static convertLineDash(t,e){switch(t){case"dash":return e?[4,3]:[3,4];case"dash-dot":return e?[4,3,1,3]:[3,4,0,4];case"dot":return e?[1,3]:[0,4];case"long-dash":return e?[8,3]:[7,4];case"long-dash-dot":return e?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":return e?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":return e?[4,1]:[3,2];case"short-dash-dot":return e?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":return e?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":return e?[1,1]:[0,2];case"solid":case"none":default:return}}static calcLineMarkerDetail(t){(!t||Array.isArray(t)&&t.length<=1)&&n.Log.error("计算线样式首尾marker错误,传入几何数组不合法");const e=t[0],i=t[1],o=t[t.length-2],s=t[t.length-1],a=360-((180*Math.atan2(i[1]-e[1],i[0]-e[0])/Math.PI+180)%360-90),l=360-((180*Math.atan2(o[1]-s[1],o[0]-s[0])/Math.PI+180)%360-90),h=n.Projection.project(new n.Point({coordinates:e}),new n.SpatialReference("EPSG:4326")).coordinates,u=n.Projection.project(new n.Point({coordinates:s}),new n.SpatialReference("EPSG:4326")).coordinates;return{latlng1:r.latLng(h[1],h[0]),latlng2:r.latLng(u[1],u[0]),angle1:a,angle2:l}}static getTextWidth(t,e){const i=document.createElement("canvas").getContext("2d");return i.font=e,i.measureText(t).width}static getAreaCenter(t){let e;switch(t.type){case n.GeometryType.point:e=t;break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:case n.GeometryType.multiLineString:case n.GeometryType.multiPolygon:e=t.extent.center;break;case n.GeometryType.polygon:e=t.centroid;break;case n.GeometryType.extent:case n.GeometryType.circle:e=t.center;break;default:e=t.extent.center}const i=V.convertLngLatGeometry(e).coordinates;return r.latLng(i[1],i[0])}static setVisibleOpacity(t,e,i){t&&(t.layerOpacity=e,t.layerVisible=i,V.setGraphicVisibleOpacity(t,e,i))}static setGraphicVisibleOpacity(t,e,i){t.setStyle&&t.setStyle({opacity:i?e:0,fillOpacity:i?e:0}),t instanceof r.Marker&&t.setOpacity(i?e:0),t.eachLayer&&t.eachLayer(function(t){V.setGraphicVisibleOpacity(t,e,i)}),t._nonPointGroup&&V.setGraphicVisibleOpacity(t._nonPointGroup,e,i),t._featureGroup&&V.setGraphicVisibleOpacity(t._featureGroup,e,i)}static insertBefore(t,e){const i=t.parentNode;i&&e!==t&&i.insertBefore(t,e)}static getLeafletGroupLayers(t,e,i){if(i=i||(()=>!0),t instanceof r.LayerGroup)for(const n in t._layers){const r=t._layers[n];V.getLeafletGroupLayers(r,e,i)}else i(t)&&e.push(t)}static getInterceptorsUrl(t){const e=this._map.options.config;let i=r.InterceptorsUtils.serviceConfigRequestInterceptors(e,t),o=`${r.InterceptorsUtils.serviceConfigToken(e)}`;return!this.options||Object(n.isNull)(this.options.tokenKey)||Object(n.isNull)(this.options.tokenValue)||(o=""),!i||!o||t instanceof Object||(i.includes("?")?i+=`&${o}`:i+=`?${o}`),i}}var j=V;class G{}G.addIGSTileLayer=function(t){const{layer:e,innerView:i}=t;let n=G.initializeOptions(e);n.visible=t._getLayerViewVisible(e.visible);const{extendOptions:r={}}=e;n=Object.assign(n,r);const o=new yt(e.url,n).addTo(i);return o.id=e.id,o},G.initializeOptions=function(t){const e=nt(t),[i,r]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo);return{tileSize:t.tileSize,bounds:e,igsVersion:t._igsVersion,tokenKey:t.tokenKey,tokenValue:t.tokenValue,clippingArea:j.convertClippingArea(t.clippingArea),visible:t.visible,opacity:t.opacity,crsOptions:ot(t),minZoom:i,maxZoom:r}};var U=G;class H{}H.addIGSMapImageLayer=function(t){const{layer:e,innerView:i}=t,n=H.initializeOptions(e);n.visible=t._getLayerViewVisible(e.visible);const r=new bt(e._url,n).addTo(i);return r.id=e.id,r},H.initializeOptions=function(t){return _t(t)},H.updateIGSMapImageLayer=function(t){const{innerLayer:e,layer:i}=t,n=_t(i);n.visible=t._getLayerViewVisible(i.visible),r.Util.setOptions(e,n),e.refresh()};var q=H;class Z{}Z.addWMSLayer=function(t){const{layer:e,innerView:i}=t;let n=e.url;if(n.indexOf("igs/rest/services")>-1){const t=(n=`${n.replace("services","ogc/doc")}?`).split("igs/rest/ogc/doc/"),e=t[0];let i=t[1].split("/WMSServer")[0];n=`${e}igs/rest/ogc/doc/${i=i.replace("/",":")}/WMSServer?`}let r=Z.initializeOptions(e);r.visible=t._getLayerViewVisible(e.visible);const{extendOptions:o={}}=e;r=Object.assign(r,o);const s=new Lt(n,r).addTo(i);return s.id=e.id,s},Z.initializeOptions=function(t){const e=nt(t);return{layers:t.layers,format:t.imageFormat,version:t.version,visible:t.visible,opacity:t.opacity,noWrap:!0,tileSize:t.imageWidth,transparent:t.imageTransparency,bounds:e,clippingArea:j.convertClippingArea(t.clippingArea),isReverseBBOX:Object(n.isWMSReverse)(t.version,t.spatialReference),tokenKey:t.tokenKey,tokenValue:t.tokenValue}};var X=Z;class Y{}Y.addWMTSLayer=function(t){const{layer:e,innerView:i}=t;let r=e.url;switch(Object(n.getUrlType)(r)){case n.UrlServerType.igs_2:r=`${r.split("services")[0]}ogc/WMTSServer`}let o=Y.initializeOptions(e);o.visible=t._getLayerViewVisible(e.visible);const{extendOptions:s={}}=e;o=Object.assign(o,s);const a=new St(r,o).addTo(i);return a.id=e.id,a},Y.initializeOptions=function(t){const e=nt(t),{activeLayer:i}=t,r=t.getCurrentTileInfo(),[o,s]=n.TileInfoUtil.getLevelRangeByTileInfo(r);return{tilematrixSet:i.tileMatrixSetId,layer:i.identifier,tileSize:r.size[0],bounds:e,style:i.styleId,clippingArea:j.convertClippingArea(t.clippingArea),zoomOffset:0,visible:t.visible,opacity:t.opacity,crsOptions:ot(t),minZoom:o,maxZoom:s,tokenKey:t.tokenKey,tokenValue:t.tokenValue}};var W=Y;class ${}$.addArcGISMapImageLayer=function(t){const{layer:e,innerView:i}=t;let n=$.initializeOptions(e);n.visible=t._getLayerViewVisible(e.visible);const{extendOptions:r={}}=e;n=Object.assign(n,r);const o=new Ct(e.url,n).addTo(i);return o.id=e.id,o},$.initializeOptions=function(t){const e=nt(t);return{layers:t.layers,id:t.id,imageWidth:t.imageWidth,imageHeight:t.imageHeight,imageFormat:t.imageFormat,opacity:t.opacity,visible:t.visible,transparent:t.imageTransparency,bounds:e,tokenKey:t.tokenKey,tokenValue:t.tokenValue,tokenAttachType:t.tokenAttachType,spatialReference:t.spatialReference,httpMethod:t.httpMethod,renderMode:t.renderMode,mapServer:new n.ArcGISMapServer({url:t.url,tokenKey:t.tokenKey,tokenValue:t.tokenValue,enableGlobeFetch:!1,headers:t.headers})}};var K=$;class Q{}Q.addWebTileLayer=function(t){const{layer:e,innerView:i}=t,n=e.url;let r=Q.initializeOptions(e);r.visible=t._getLayerViewVisible(e.visible);const{extendOptions:o={}}=e;r=Object.assign(r,o);const s=new Pt(n,r).addTo(i);return s.id=e.id,s},Q.initializeOptions=function(t){const e=nt(t),[i,r]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo);return{tileSize:t.tileSize,bounds:e,visible:t.visible,opacity:t.opacity,tokenKey:t.tokenKey,tokenValue:t.tokenValue,clippingArea:j.convertClippingArea(t.clippingArea),crsOptions:ot(t),tms:"tms"===t.tileSliceType,subdomains:t.subDomains,minZoom:i,maxZoom:r}};var J=Q;var tt=class{static addVectorTileLayer(t){const{layer:e,innerView:i}=t;let r=this.initializeOptions(e);const{extendOptions:o={}}=e;r=Object.assign(r,o),t.innerLayer=new Mt(r).addTo(i),t.innerLayer.commonLayerId=e.id;const s=t.innerLayer.getMapboxMap();s.once("load",()=>{if(!(e instanceof n.IGSVectorTileLayer)){const i=t._getLayerViewVisible();this.setVisible(t.layer,s,i),this.setOpacity(t.layer,s,e.opacity)}})}static initializeOptions(t){let e,i;return t.style.layers.forEach(t=>{const{minzoom:n,maxzoom:r}=t;void 0===e&&(e=n),void 0===i&&(i=r),e=Math.min(n,e),i=Math.max(r,i)}),{style:JSON.parse(JSON.stringify(t.style)),noWrap:!0,clippingArea:j.convertClippingArea(t.clippingArea),tileSize:t.tileInfo.getTileSize(),crsOptions:ot(t),minZoom:e,maxZoom:i,tokenKey:t.tokenKey,tokenValue:t.tokenValue}}static setVisible(t,e,i){const{layers:n}=t.style,{style:r}=e;n.forEach(e=>{r.setLayoutProperty(e.id,"visibility",i?t._getBackupProperties(e.id,"visibility"):"none")}),e._update&&e._update(!0)}static setOpacity(t,e,i){const{layers:n}=t.style,{style:r}=e;n.forEach(e=>{const n=t._getBackupProperties(e.id,"opacities");n&&Object.keys(n).forEach(t=>{r.setPaintProperty(e.id,t,n[t]*i)})}),e._update&&e._update(!0)}static removeLayer(t){const{innerView:e,innerLayer:i}=t;e.removeLayer(i)}static setClippingArea(t,e){const{innerLayer:i}=t;i.setClippingArea(j.convertClippingArea(e))}static setPaintProperties(t,e,i){const{style:n}=t;Object.keys(i).forEach(t=>{n.setPaintProperty(e,t,i[t])}),t._update&&t._update(!0)}static setLayoutProperties(t,e,i){const{style:n}=t;Object.keys(i).forEach(t=>{n.setLayoutProperty(e,t,i[t])}),t._update&&t._update(!0)}};class et{}et.addArcGISTileLayer=function(t){const{layer:e,innerView:i}=t;let n=et.initializeOptions(e);n.visible=t._getLayerViewVisible(e.visible);const{extendOptions:r={}}=e;n=Object.assign(n,r);const o=new It(e.url,n).addTo(i);return o.id=e.id,o},et.initializeOptions=function(t){const e=nt(t);return{tileSize:t.tileSize,bounds:e,opacity:t.opacity,visible:t.visible,crsOptions:ot(t),tokenKey:t.tokenKey,tokenValue:t.tokenValue}};var it=et;function nt(t){let e=void 0;if("4326"===String(t.spatialReference.wkid)||"4214"===String(t.spatialReference.wkid)||"4490"===String(t.spatialReference.wkid)||"4610"===String(t.spatialReference.wkid)){const i=r.latLng(t.extent.ymin,t.extent.xmin),n=r.latLng(t.extent.ymax,t.extent.xmax);e=r.latLngBounds(i,n)}else if("3857"===String(t.spatialReference.wkid)||"900913"===String(t.spatialReference.wkid)){const i=n.Projection.projectMercatorToLonLat({x:t.extent.xmin,y:t.extent.ymin}),o=r.latLng(i.latitude,i.longitude),s=n.Projection.projectMercatorToLonLat({x:t.extent.xmax,y:t.extent.ymax}),a=r.latLng(s.latitude,s.longitude);e=r.latLngBounds(o,a)}else{const i=n.Projection.projectToGeographyPoints({points:[[t.extent.xmin,t.extent.ymin],[t.extent.xmax,t.extent.ymax]],wkid:t.spatialReference.wkid,proj4Defs:t.spatialReference.wkt}),o=r.latLng(i[0][1],i[0][0]),s=r.latLng(i[1][1],i[1][0]);e=r.latLngBounds(o,s)}return e}function rt(t){const e=t.getBounds(),i=e.getNorthWest(),n=e.getSouthEast(),o=e.getSouthWest(),s=e.getNorthEast(),a=t.latLngToLayerPoint(i),l=t.latLngToLayerPoint(n),h=t.latLngToLayerPoint(o),u=t.latLngToLayerPoint(s),c=r.bounds(a,l);c.extend(h),c.extend(u);const p=t.getSize(),f=t.containerPointToLayerPoint([0,0]),d=t.containerPointToLayerPoint([p.x,p.y]),g=r.bounds(f,d);return c.extend(g.getBottomLeft()),c.extend(g.getTopRight()),c}function ot(t){t&&t.spatialReference||n.Log.error("计算crsOptions错误");let e=t.tileInfo;t.type===n.LayerType.wmts&&(e=t.getCurrentTileInfo());const i=t.spatialReference,r=e.origin.coordinates,o=t.extent,s=e.lods.map(t=>t.clone());return{wkid:i.wkid,wkt:i.wkt,lods:s,origin:r,unit:i.isGeographic?"degree":void 0,extent:{xmin:o.xmin,ymin:o.ymin,xmax:o.xmax,ymax:o.ymax}}}function st(t,e){e=Object(n.defaultValue)(e,[t]);const i=Object(n.getValidLayers)(t,e),r=Object(n.getLayersExtent)(i,t.spatialReference),o=Object(n.getCrsOptions)(t,i,{fullExtent:r});return new l({wkid:o.spatialReference.wkid,wkt:o.spatialReference.wkt,lods:o.lods,origin:o.origin,extent:o.extent})}function at(t){switch(t.type){case n.LayerType.igsTile:return U.initializeOptions(t);case n.LayerType.igsMapImage:return q.initializeOptions(t);case n.LayerType.wms:return X.initializeOptions(t);case n.LayerType.wmts:return W.initializeOptions(t);case n.LayerType.arcgisMapImage:return K.initializeOptions(t);case n.LayerType.arcgisTile:return it.initializeOptions(t);case n.LayerType.webTileLayer:return J.initializeOptions(t);case n.LayerType.igsVectorTile:case n.LayerType.arcgisVectorTile:return tt.initializeOptions(t);default:n.Log.error(`暂不支持为${t.type}类型的图层构造实例化参数`)}}const lt=r.ImageOverlay.extend({options:{clippingArea:null,bboxBounds:null,pixBoundsSize:null,container:null},_initImage(){const t="IMG"===this._url.tagName,e=t?this._url:r.DomUtil.create("img"),i=this._map.project(this._bounds.getNorthWest()),n=this.options.pixBoundsSize,o=this._map.getZoomScale(this._map.getZoom(),0),s=document.createElement("canvas");s.width=n.x,s.height=n.y;const a=s.getContext("2d");this._image=s,r.DomUtil.addClass(s,"leaflet-image-layer"),this._zoomAnimated&&r.DomUtil.addClass(s,"leaflet-zoom-animated"),this.options.className&&r.DomUtil.addClass(s,this.options.className),s.onselectstart=r.Util.falseFn,s.onmousemove=r.Util.falseFn;let l=[];this.options.clippingArea&&(l=this._getTileGeometryAndState());e.onload=(()=>{s.complete=!0,setTimeout(()=>{const t=a.createPattern(e,"repeat");((t,e)=>{if(!Array.isArray(e)||0===e.length||e.some(t=>t.in))return!0;if(e.every(t=>t.out))return!1;const n=e.filter(t=>t.geometry).map(t=>t.geometry);return n.length>0?(t.beginPath(),n.forEach(e=>{const n=F.coordAll(e);let r=n[0][0]*o-i.x,s=n[0][1]*o-i.y;t.moveTo(r,s);for(let e=1;e<n.length;e++)r=n[e][0]*o-i.x,s=n[e][1]*o-i.y,t.lineTo(r,s)}),t.clip(),!0):void 0})(a,l)&&(a.beginPath(),a.rect(0,0,s.width,s.height),a.fillStyle=t,a.fill())},0),this.fire("load")}),e.onerror=(()=>{this._overlayOnError("error")}),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},getPane(){return this.options.container?this.options.container:r.ImageOverlay.prototype.getPane.call(this)},_toTurfGeometry(t){return j.toTurfGeometry(t,this._map)},_getClippingAreaPx(){return this._clippingAreaPx?this._clippingAreaPx:(this.options.clippingArea?this._clippingAreaPx=this._toTurfGeometry(this.options.clippingArea):this._clippingAreaPx=null,this._clippingAreaPx)},_getTileGeometryAndState(){if(!this.options.clippingArea)return null;const t=this._getClippingAreaPx(),e=this._map.getGeoBoundsCoord(),i=this._map.options.crs,n=i.scale(0),o=i.transformation._transform(r.point(e.xmin,e.ymin),n),s=i.transformation._transform(r.point(e.xmax,e.ymax),n),a=o.x,l=s.y,h=s.x,u=o.y,c=F.polygon([[[a,l],[h,l],[h,u],[a,u],[a,l]]]);return t.map(t=>j.getClippingState(t,c))},_animateZoom(t){if(!this._map._rotate||0===this._map._bearing)return r.ImageOverlay.prototype._animateZoom.call(this,t)},_reset(){const t=this._image,e=this._calcLayerPointBounds(),i=e.getSize(),n=i.divideBy(2);r.DomUtil.setPosition(t,e.getCenter().subtract(n)),t.style.width=`${i.x}px`,t.style.height=`${i.y}px`},_calcLayerPointBounds(){const t=this._map.getCenter(),e=this._map.getZoom(),i=this.options.bboxBounds,n=this._map.options.crs,o=n.unproject(i.getTopLeft()),s=n.unproject(i.getBottomRight());return new r.Bounds(this._map._latLngToNewLayerPoint(o,e,t),this._map._latLngToNewLayerPoint(s,e,t))}});r.ImageOverlay.clip=function(t,e,i){return new r.ImageOverlay.Clip(t,e,i)};var ht=lt;var ut=r.Layer.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:"",noWrap:!0,clippingArea:null,pane:"tilePane"},initialize(t,e){this.id=e.id,this.httpMethod=e.httpMethod,r.setOptions(this,e),r.stamp(this);const i=this.options.intervalTime||120;this.refresh=r.Util.throttle(this.refresh,i,this),this._currentImage=null,this._waitToUpdateImage=null,this.bboxBounds=null,this.pixBoundsSize=null,this.initBaseUrl(t,e)},onAdd(t){t.on("moveend",this.refresh,this),this._initContainer(),this._updateClippingArea(this.options.clippingArea),this.refresh()},_initContainer(){this._container||(this._container=r.DomUtil.create("div",`leaflet-layer ${this.options.className||""}`),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},onRemove(){this._waitToUpdateImage&&this._map.removeLayer(this._waitToUpdateImage),this._currentImage&&this._map.removeLayer(this._currentImage),r.DomUtil.remove(this._container),this._map.off("moveend",this.refresh,this)},refresh(){if(!this._map)return;const t=this._map.getZoom();if(t>(this._map.options.maxZoom||18)||t<(this._map.options.minZoom||0))return void(this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null));const e=this._baseUrl;e?this._requestImage(e):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null)},setOpacity(t){this.options.opacity=t,this._updateOpacity()},_updateOpacity(){this._container&&r.DomUtil.setOpacity(this._container,this.options.opacity)},setVisible(t){if((t=!!t)!==this.options.visible)if(this.options.visible=t,this._currentImage){this._currentImage.getElement().style.display=this.options.visible?"inline":"none"}else this.refresh()},setZIndex(t){this.options.zIndex=t,this._updateZIndex()},_updateZIndex(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_requestImage(t){const e=this,i=this._map;if(!i||!this.options.visible)return;const n=this._initAllRequestParams(),r=this._map.getBounds(),o=t=>{if(!i._mapPane)return;const n=e._currentImage;t._bounds&&t._bounds.equals(r)&&t._bounds.equals(i.getBounds())?(t.getElement().style.display=e.options.visible?"inline":"none",e._currentImage=t,n&&i.removeLayer(n)):i.removeLayer(t),e._waitToUpdateImage=null},s=t=>{i._mapPane&&i.removeLayer(t)};this.buildRequestImageSrc(t,n).then(t=>{if(!i._mapPane)return;let n=t;this.options&&"GET"===this.options.httpMethod&&(n=j.getInterceptorsUrl.call(this,n));const r=e._createImage(n,o,s);r.addTo(i),e._waitToUpdateImage=r})},_createImage(t,e,i){const n=this._map.getBounds(),r=new ht(t,n,{alt:this.options.alt,zIndex:this.options.zIndex,className:this.options.className,errorOverlayUrl:this.options.error,crossOrigin:this.options.crossOrigin,pane:this.options.pane||this.getPane(),interactive:this.options.interactive,clippingArea:this.options.clippingArea,bboxBounds:this.bboxBounds,pixBoundsSize:this.pixBoundsSize,container:this._container});return r.once("load",()=>{e(r)},self),r.once("error",()=>{i(r)},self),r},_initAllRequestParams(){const t=this._map,e=t.getZoom(),i=t.options.crs,n=rt(t).getSize().round(),o=n.y||512,s=n.x||512,a=t.project(t.getBounds().getNorthWest()),l=a.add(n),h=i.pointToGeoCoord(t.toPoint(a),e),u=i.pointToGeoCoord(t.toPoint(l),e),c=`${h.x},${u.y},${u.x},${h.y}`;this.bboxBounds=r.bounds(h,u),this.pixBoundsSize=n;const p={clientId:this.options.clientId,layers:this.options.layers,imageTransparent:this.options.imageTransparent,isAntialiasing:this.options.isAntialiasing,projectionSrs:this.options.crs};return this.buildRequestParamsObject(p,s,o,c),p},_toTurfGeometry(t){let e=[];return"Polygon"===t.type?e.push(t.coordinates):e=t.coordinates,e.map(t=>{const e=j.convertClippAreaToPx(this._map,t);return F.polygon(e)})},setClippingArea(t){return this.options.clippingArea=t,this._updateClippingArea(t),this.refresh(),this},_updateClippingArea(t){const e=this._map;this._clippingPolygons=t&&e?this._toTurfGeometry(t):null},initBaseUrl(t,e){this._baseUrl=t},buildRequestImageSrc:(t,e)=>new Promise(e=>{e(t)}),buildRequestParamsObject:(t,e,i,n)=>t});var ct=r.TileLayer.extend({options:{clippingArea:null,crsOptions:null},initialize(t,e){e=e||{},r.TileLayer.prototype.initialize.call(this,t,e),this._clippingAreaPx=null,this.httpMethod=Object(n.defaultValue)(e.httpMethod,n.FetchMethod.get)},createTile(t,e){const i=this.getTileUrl(t);return this._drawClippingTile(i,t,e)},onAdd(t){this._TileClippingGeometryCache={},r.TileLayer.prototype.onAdd.call(this,t)},setClippingArea(t){return this.options.clippingArea=t,this._clearClippingCache(),this._removeAllTiles(),this._resetView(),this},getClippingArea(){return this.options.clippingArea},_getTileGeometryAndState(t,e,i){if(!this.options.clippingArea)return null;const n=`${t},${e},${i}`;if(this._TileClippingGeometryCache[n])return this._TileClippingGeometryCache[n];const r=this._getClippingAreaPx(),o=this.options.tileSize,s=Math.pow(2,i-this.options.zoomOffset),a=t*o/s,l=e*o/s,h=(t+1)*o/s,u=(e+1)*o/s,c=F.polygon([[[a,l],[h,l],[h,u],[a,u],[a,l]]]),p=r.map(t=>j.getClippingState(t,c));return p.some(t=>t.geometry)&&(this._TileClippingGeometryCache[n]=p),p},_toTurfGeometry(t){return j.toTurfGeometry(t,this._map)},_getClippingAreaPx(){return this._clippingAreaPx?this._clippingAreaPx:(this.options.clippingArea?this._clippingAreaPx=this._toTurfGeometry(this.options.clippingArea):this._clippingAreaPx=null,this._clippingAreaPx)},_clearClippingCache(){this._clippingAreaPx=null,this._TileClippingGeometryCache={}},_drawClippingTile(t,e,i){const{x:n,y:r,z:o}=e,s=this._getTileGeometryAndState(n,r,o),a=document.createElement("img");if(!s||s.some(t=>t.in))return this._getTileImage(a,t,i);if(s.every(t=>t.out)){const t=document.createElement("canvas");return t.width=this.options.width,t.height=this.options.height,this._getTileImage(a,null,i)}const l=s.filter(t=>t.geometry).map(t=>t.geometry);if(l.length>0){this._getTileImage(a,t,i);const e=document.createElement("canvas");e.width=this.options.tileSize,e.height=this.options.tileSize;const s=e.getContext("2d"),h=this.options.tileSize,u=h*n,c=h*r,p=Math.pow(2,o-this.options.zoomOffset);return a.onload=function(){e.complete=!0,setTimeout(()=>{const t=s.createPattern(a,"repeat");let n,r;s.beginPath(),l.forEach(t=>{const e=F.coordAll(t);n=e[0][0]*p-u,r=e[0][1]*p-c,s.moveTo(n,r);for(let t=1;t<e.length;t++)n=e[t][0]*p-u,r=e[t][1]*p-c,s.lineTo(n,r)}),s.clip(),s.beginPath(),s.rect(0,0,e.width,e.height),s.fillStyle=t,s.fill(),i()},0)},this.options.crossOrigin&&(a.crossOrigin=""),e}},_getTileImage(t,e,i){if(!e)return t;r.DomEvent.on(t,"load",r.Util.bind(this._tileOnLoad,this,i,t)),r.DomEvent.on(t,"error",r.Util.bind(this._tileOnError,this,i,t)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(t.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(t.referrerPolicy=this.options.referrerPolicy),t.alt="";let o=e;if(!/data:image\/jpg;base64/.test(e)){o=j.getInterceptorsUrl.call(this,e);const i=this._map.options.config;t.onload=function(){r.InterceptorsUtils.serviceConfigResponseInterceptors(i,o,t)}}return this.httpMethod===n.FetchMethod.post?(t.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC",this._postImage(t,e)):t.src=o,t},_tileOnError(t,e,i){r.TileLayer.prototype._tileOnError.call(this,t,e,i),e instanceof Element&&(e.style.display="none")},_postImage(t,e){}});const{extend:pt,setOptions:ft,getParamString:dt}=r.Util;var gt=ct.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/png",transparent:!1,version:"1.1.1",isReverseBBOX:!1},options:{crs:null,uppercase:!1,visible:!0},initialize(t,e){e=e||{},this.options.lastOpacity=e.opacity,this._url=t;const i=pt({},this.defaultWmsParams);for(const t in e)t in this.options||(i[t]=e[t]);const n=(e=ft(this,e)).detectRetina&&r.Browser.retina?2:1,o=this.getTileSize();i.width=o.x*n,i.height=o.y*n,this.isReverseBBOX=e.isReverseBBOX,this.wmsParams=i},onAdd(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);const e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,ct.prototype.onAdd.call(this,t)},getTileUrl(t){const e=this._tileCoordsToNwSe(t),i=this._crs,n=r.bounds(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,a=(this.isReverseBBOX?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),l=ct.prototype.getTileUrl.call(this,t);return l+dt(this.wmsParams,l,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams(t,e){return pt(this.wmsParams,t),e||this.redraw(),this}});var yt=ct.extend({options:{noWrap:!0},initialize(t,e){this.igsVersion=e.igsVersion,this.tokenKey=e.tokenKey,this.tokenValue=e.tokenValue,this.zoomOffset=e.zoomOffset,"1.0"===this.igsVersion?this.url=`${t}`:this.url=`${t}/tileImage`,ct.prototype.initialize.apply(this,arguments),r.GridLayer.prototype.initialize(arguments[1]),r.setOptions(this,e),r.stamp(this)},onAdd(t){this._crs=this.options.crs||t.options.crs;const e=this._crs.projection.bounds,i=[e.min.x,e.max.y];this._origin=this.options.origin?this.options.origin:i,ct.prototype.onAdd.call(this,t)},getTileUrl(t){let e=void 0;"1.0"===this.igsVersion?(e=`${this.url}/{z}/{y}/{x}`,this.tokenKey&&this.tokenValue&&(e+=`?${this.tokenKey}=${this.tokenValue}`)):(e=`${this.url}/{z}/{y}/{x}?f=image`,this.tokenKey&&this.tokenValue&&(e+=`&${this.tokenKey}=${this.tokenValue}`));const i=this._getZoomForUrl();return e=e.replace("{x}",t.x.toString()).replace("{y}",t.y.toString()).replace("{z}",i)}});function mt(t){let e="?";return Object.keys(t).forEach(function(i){null!==t[i]&&void 0!==t[i]&&(e+=`${i}=${encodeURIComponent(t[i])}&`)}),e=e.substring(0,e.length-1)}function _t(t){const e=nt(t);let i={layers:t.layers,id:t.id,clientId:t.clientId,imageWidth:t.imageWidth,imageHeight:t.imageHeight,imageFormat:t.imageFormat,opacity:t.opacity,visible:t.visible,imageTransparent:t.imageTransparency,bounds:e,igsVersion:t._igsVersion,tokenKey:t.tokenKey,tokenValue:t.tokenValue,tokenAttachType:t.tokenAttachType,filters:t.getFilters(),httpMethod:t.httpMethod,clippingArea:j.convertClippingArea(t.clippingArea),mapServer:new n.MapServer({url:t.url,tokenKey:t.tokenKey,tokenValue:t.tokenValue,enableGlobeFetch:!1,headers:t.headers}),projectionSrs:Object(n.getProjectionSrs)(t.spatialReference),isAntialiasing:t.isAntialiasing,renderMode:t.renderMode};const r=Object(n.getIGSDynamicLayer)(t);r.length>0&&(i.dynamicLayers=r);const{extendOptions:o={}}=t;return i=Object.assign(i,o)}var vt=ct.extend({options:{noWrap:!0},initialize(t,e){this.id=e.id;const i=Object(n.formatBaseUrl)(t);this.httpMethod=e.httpMethod;const o=e.igsVersion;this.url="2.0"===o?encodeURI(`${i.baseUrl}/image`):encodeURI(`${i.baseUrl}`),e.tileSize=Math.max(e.imageWidth,e.imageHeight),r.setOptions(this,e),r.stamp(this),ct.prototype.initialize.apply(this,arguments),r.GridLayer.prototype.initialize(arguments[1])},onAdd(t){this._crs=t.options.crs,ct.prototype.onAdd.call(this,t),this._haveInnerLayer=!0},getTileUrl(t){const e=this._initAllRequestParams(t);if("POST"===this.httpMethod)return e;{const t=mt(e);return this.url+t}},_postImage(t,e){e.tokenAttachType=this.options.tokenAttachType,this.options.mapServer.exportImage(e).then(function(e){const i=new FileReader;i.onload=(e=>{t.src=e.target.result}),i.readAsDataURL(e),i.onerror=(()=>{})})},_initAllRequestParams(t){const e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i),s=e.unproject(n,t.z),a=e.unproject(o,t.z),l=new r.LatLngBounds(s,a),h=this._crs.project(l.getNorthWest()),u=this._crs.project(l.getSouthEast()),c={bbox:`${h.x},${u.y},${u.x},${h.y}`,clientId:this.options.clientId,layers:this.options.layers,imageTransparent:this.options.imageTransparent,isAntialiasing:this.options.isAntialiasing,projectionSrs:this.options.crs};return this.options.tokenKey&&this.options.tokenValue&&(c[this.options.tokenKey]=this.options.tokenValue),"2.0"===this.options.igsVersion?(c.size=`${this.options.imageWidth},${this.options.imageHeight}`,c.format=this.options.imageFormat,c.layerStyles=this.options.styles,c.layerFilters=JSON.stringify(this.options.filters),c.dynamicLayers=JSON.stringify(this.options.dynamicLayers),c.f="image",c.projectionSrs=this.options.projectionSrs):(c.w=this.options.imageWidth,c.h=this.options.imageHeight,c.style=this.options.styles,c.filters=JSON.stringify(this.options.filters),c.f="png"),c}});var xt=ut.extend({options:{imageFormat:null,clientId:null,imageTransparent:null,igsVersion:"2.0",tokenKey:"",tokenValue:"",filters:null,httpMethod:"GET",styles:null,layers:null,isAntialiasing:null,visible:!0,clippingArea:null,pane:"tilePane",mapServer:null},initBaseUrl(t,e){const i=Object(n.formatBaseUrl)(t);this.httpMethod=e.httpMethod;const r=e.igsVersion;this._baseUrl="2.0"===r?encodeURI(`${i.baseUrl}/image`):encodeURI(`${i.baseUrl}`)},buildRequestImageSrc(t,e){const i=this;return new Promise(n=>{if("POST"===this.options.httpMethod)e.tokenAttachType=this.options.tokenAttachType,this.options.mapServer.exportImage(e).then(function(t){const e=new FileReader;e.onload=(t=>{i._map?n(t.target.result):n("")}),e.readAsDataURL(t)});else{const i=mt(e);n(t+i)}})},buildRequestParamsObject(t,e,i,n){return t.bbox=n,this.options.tokenKey&&this.options.tokenValue&&(t[this.options.tokenKey]=this.options.tokenValue),"2.0"===this.options.igsVersion?(t.size=`${e},${i}`,t.format=this.options.imageFormat,t.layerStyles=this.options.styles,t.layerFilters=JSON.stringify(this.options.filters),t.dynamicLayers=JSON.stringify(this.options.dynamicLayers),t.f="image",t.projectionSrs=this.options.projectionSrs):(t.w=e,t.h=i,t.style=this.options.styles,t.filters=JSON.stringify(this.options.filters),t.f="png"),t}});var bt=class{constructor(t,e){let i;if((e=Object(n.defaultValue)(e,{})).renderMode=Object(n.defaultValue)(e.renderMode,"tile"),e.igsVersion=Object(n.defaultValue)(e.igsVersion,"2.0"),e.imageHeight=Object(n.defaultValue)(e.imageHeight,256),e.imageWidth=Object(n.defaultValue)(e.imageWidth,256),"tile"===e.renderMode){let n=t;"1.0"===e.igsVersion&&(n=n.replace("/mrcs/","/mrms/")),i=new vt(n,e)}else i=new xt(t,e);return i}};var wt=ut.extend({options:{imageFormat:null,imageTransparent:null,tokenKey:"",tokenValue:"",httpMethod:"GET",layers:null,visible:!0,clippingArea:null,pane:"tilePane",mapServer:null},initBaseUrl(t,e){this.httpMethod=e.httpMethod,this._baseUrl=t},buildRequestImageSrc(t,e){const i=this;return new Promise(n=>{if("POST"===this.options.httpMethod)e.tokenAttachType=this.options.tokenAttachType,this.options.mapServer.exportImage(e).then(function(t){const e=new FileReader;e.onload=(t=>{i._map?n(t.target.result):n("")}),e.readAsDataURL(t)});else{const i=mt(e);n(t+i)}})},buildRequestParamsObject(t,e,i,n){return t.bbox=n,this.options.tokenKey&&this.options.tokenValue&&(t[this.options.tokenKey]=this.options.tokenValue),t.size=`${e},${i}`,t.format=`${this.options.imageFormat}`,t.f="image",t.layers&&(t.layers=`${this.options.layers}`),void 0!==this.options.transparent&&null!==this.options.transparent&&(t.transparent=this.options.transparent),this.options.spatialReference&&(t.imageSR=`${this.options.spatialReference.wkid}`),Array.isArray(this.options.extensions)&&this.options.extensions.forEach(e=>{e.key&&e.value&&(t[e.key]=e.value)}),t}});var Et=ct.extend({options:{noWrap:!0},initialize(t,e){this.id=e.id,this.url=t,this._backUrl=t,e.tileSize=r.point(e.imageWidth,e.imageHeight),this.httpMethod=e.httpMethod,ct.prototype.initialize.apply(this,arguments),r.setOptions(this,e),r.stamp(this)},onAdd(t){this._crs=t.options.crs,this._initLayerUrl(),ct.prototype.onAdd.call(this,t)},getTileUrl(t){const e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i),s=e.unproject(n,t.z),a=e.unproject(o,t.z),l=new r.LatLngBounds(s,a),h=this._crs.project(l.getNorthWest()),u=this._crs.project(l.getSouthEast());if("POST"===this.httpMethod){const t=this._initAllRequestParams();return t.bbox=`${h.x},${u.y},${u.x},${h.y}`,t}{const t=`&bbox=${h.x},${u.y},${u.x},${h.y}`;return this._initLayerUrl(),this._layerUrl+encodeURI(t)}},_postImage(t,e){e.tokenAttachType=this.options.tokenAttachType,this.options.mapServer.exportImage(e).then(function(e){const i=new FileReader;i.onload=(e=>{t.src=e.target.result}),i.readAsDataURL(e),i.onerror=(()=>{})})},_initLayerUrl(){let t=`${this.url}?`;const e=this._initAllRequestParams();Object.keys(e).forEach(i=>{t+=`${i}=${encodeURIComponent(e[i])}&`}),t=t.substring(0,t.length-1),this._layerUrl=t},_initAllRequestParams(){const t=this.options||{},e={},i=t.imageHeight||256,n=t.imageWidth||256;return e.size=`${n},${i}`,e.format=`${t.imageFormat}`,e.f="image",t.layers&&(e.layers=`${t.layers}`),void 0!==t.transparent&&null!==t.transparent&&(e.transparent=t.transparent),t.spatialReference&&(e.imageSR=`${t.spatialReference.wkid}`),t.tokenKey&&t.tokenValue&&(e[`${t.tokenKey}`]=`${t.tokenValue}`),t.extensions&&t.extensions instanceof Array&&t.extensions.forEach(t=>{t.key&&t.value&&(e[t.key]=t.value)}),e}});var Ct=class{constructor(t,e){let i;return i="tile"===e.renderMode?new Et(`${t}/export`,e):new wt(`${t}/export`,e)}};var Lt=class{constructor(t,e){return new gt(t,e)}};var St=ct.extend({options:{version:"1.0.0",format:"image/png",tileSize:256,noWrap:!0},initialize(t,e){r.GridLayer.prototype.initialize.call(this,arguments[1]),this._url=encodeURI(t),this._url+="?service=WMTS&request=GetTile",this.options.origin=e.origin?e.origin:null,this.zoomOffset=e.zoomOffset,r.setOptions(this,e)},onAdd(t){this._crs=this.options.crs||t.options.crs;const e=this._crs.projection.bounds,i=[e.min.x,e.max.y];this._origin=this.options.origin?this.options.origin:i,ct.prototype.onAdd.call(this,t)},getTileUrl(t){const e=this._getZoomForUrl(),i=r.Util.template(this._url,{s:this._getSubdomain(t)}),n={version:this.options.version,style:this.options.style,tilematrixSet:this.options.tilematrixSet,format:this.options.format,layer:this.options.layer,tilematrix:e,tilerow:t.y,tilecol:t.x};return this.options.tokenKey&&this.options.tokenValue&&(n[this.options.tokenKey]=this.options.tokenValue),i+r.Util.getParamString(n,i)}});var Pt=ct.extend({options:{noWrap:!0},initialize(t,e){r.TileLayer.prototype.initialize.apply(this,arguments),r.GridLayer.prototype.initialize(arguments[1]),r.setOptions(this,e),r.stamp(this)},onAdd(t){r.TileLayer.prototype.onAdd.call(this,t)},getTileUrl(t){const e={r:r.Browser.retina?"@2x":"",s:this._getSubdomain(t),col:t.x,row:t.y,level:this._getZoomForUrl()};if(this._map&&!this.options.crs.infinite){const i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.row=i),e["-row"]=i}let i=r.Util.template(this._url,r.Util.extend(e,this.options));return this.options.tokenKey&&this.options.tokenValue&&(i+=`&${this.options.tokenKey}=${this.options.tokenValue}`),i}});var It=ct.extend({options:{noWrap:!0},initialize(t,e){this.tokenKey=e.tokenKey,this.tokenValue=e.tokenValue,this.url=encodeURI(`${t}/tile`),r.TileLayer.prototype.initialize.apply(this,arguments),r.GridLayer.prototype.initialize(arguments[1]),r.setOptions(this,e),r.stamp(this)},onAdd(t){this._crs=this.options.crs||t.options.crs;const e=this._crs.projection.bounds,i=[e.min.x,e.max.y];this._origin=this.options.origin?this.options.origin:i,r.TileLayer.prototype.onAdd.call(this,t)},getTileUrl(t){let e=`${this.url}/{z}/{y}/{x}`;return this.tokenKey&&this.tokenValue&&(e+=`?${this.tokenKey}=${this.tokenValue}`),e=e.replace("{x}",t.x.toString()).replace("{y}",t.y.toString()).replace("{z}",t.z.toString())}});var Mt=class{constructor(t){let e;return function(t,e){class i extends t.Projection{constructor(t,i){super();const n=(i||{}).def;if(!n)throw new Error("自定义参考系必须指定参数系信息def");if(this._def=n,!e)throw new Error("proj4对象不存在,自定义投影必须引入proj4对象");const r=this._isProj4Obj(t);this._proj=r?t:this._projFromCodeDef(t,n)}project(t){let e,i;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.lng,i=t.lat),this._proj.forward([e,i])}unproject(t){let e,i;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.x,i=t.y),this._proj.inverse([e,i])}_projFromCodeDef(t,i){if(i)e.defs(t,i);else if(void 0===e.defs[t]){const i=t.split(":");if(i.length>3&&(t=`${i[i.length-3]}:${i[i.length-1]}`),void 0===e.defs[t])throw`No projection definition for code ${t}`}return e(t)}_isProj4Obj(t){return void 0!==t.inverse&&void 0!==t.forward}}class n extends t.CRS{_parseParams(t){this._crsType="proj4",this.epsgCode=t[0],this.def=t[1];const e=t[2]||{};this._parseOptions(e)}_parseOptions(t){if(super._parseOptions(t),this._resolutions=t.resolutions,Array.isArray(this._resolutions)){const t={};this._resolutions.forEach((e,i)=>{t[i]=e}),this._resolutions=t}if(!this._resolutions)throw new Error("自定义坐标系时,未设置分辨率数组");if(!this.origin)throw new Error("自定义坐标系时,未设置原点");this.tileSize=t.tileSize||256}_setProjection(){this.projection=new i(this.getEpsgCode(),{origin:this.origin,def:this.def})}}t.Proj||(t.Proj={}),t.Proj.CRS=n,t.Proj.Projection=i}(e=i(4),n.proj4),function(t,e){t.mapboxgl&&t.MapboxGL||(t.MapboxGL=t.Layer.extend({options:{updateInterval:32,padding:0,interactive:!1,pane:"tilePane",clippingArea:null,zoomOffset:0,tileSize:256,zIndex:1,crsOptions:null},initialize(i){t.setOptions(this,i),i.accessToken&&(e.accessToken=i.accessToken),this._throttledUpdate=t.Util.throttle(this._update,this.options.updateInterval,this)},onAdd(e){this._container||this._initContainer();const i=this.getPaneName();e.getPane(i).appendChild(this._container),this._updateZIndex(),this._initGL(),this._offset=this._map.getBounds().getNorthWest(),e.options.zoomAnimation&&t.DomEvent.on(e._proxy,t.DomUtil.TRANSITION_END,this._transitionEnd,this),e._addZoomLimit(this)},onRemove(e){this._map._proxy&&this._map.options.zoomAnimation&&t.DomEvent.off(this._map._proxy,t.DomUtil.TRANSITION_END,this._transitionEnd,this);const i=this.getPaneName();e.getPane(i).removeChild(this._container)},setZIndex(t){this.options.zIndex=t,this._updateZIndex()},_updateZIndex(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},getEvents(){return{move:this._throttledUpdate,zoomanim:this._animateZoom,zoom:this._pinchZoom,zoomstart:this._zoomStart,zoomend:this._zoomEnd,resize:this._resize,rotate:this._rotate}},setClippingArea(t){this.options.clippingArea=t;const e=this.getMapboxMap(),i=this.options.style.sources;i&&Object.entries(i).forEach(i=>{const n=i[0],r=e.getSource(n);r&&"vector"===r.type&&r.setClippingArea&&r.setClippingArea(t)})},getClippingArea(){return this.options.clippingArea},getMapboxMap(){return this._glMap},getCanvas(){return this._glMap.getCanvas()},getSize(){return this._map.getSize().multiplyBy(1+2*this.options.padding)},getBounds(){const e=this.getSize().multiplyBy(.5),i=this._map.latLngToContainerPoint(this._clampCenter(this._map.getCenter()));return t.latLngBounds(this._map.containerPointToLatLng(i.subtract(e)),this._map.containerPointToLatLng(i.add(e)))},getContainer(){return this._container},getPaneName(){return this._map.getPane(this.options.pane)?this.options.pane:"tilePane"},_initContainer(){const e=this._container=t.DomUtil.create("div","leaflet-gl-layer"),i=this.getSize();e.style.width=`${i.x}px`,e.style.height=`${i.y}px`,e.style.position="absolute";const n=this._calcRotateOffset();t.DomUtil.setPosition(e,n)},_initGL(){let i;const n=this._map.options.crs,r=this._map.getCenter(),o=this.options.crsOptions;if(o){const t=o.extent,r={};o.lods.forEach(t=>{r[t.level]=t.resolution});const s=this.options.tileSize||256,a={resolutions:r,origin:o.origin,tileSize:s,bounds:[t.xmin,t.ymin,t.xmax,t.ymax],unit:o.unit};i=e.Proj&&e.Proj.CRS?new e.Proj.CRS(n.code,n.def,a):new e.CRS(n.code,a)}else i=n.code;const s=t.extend({},this.options,{container:this._container,center:[r.lng,r.lat],zoom:Math.max(0,this._map.getZoom()),attributionControl:!1,crs:i,minZoom:0,renderWorldCopies:!1});try{if(s.style){const t=s.style.sources;t&&Object.entries(t).forEach(t=>{"vector"===t[1].type&&(t[1].clippingArea=this.options.clippingArea)})}}catch(t){}this._glMap?(this._glMap.setCenter(s.center),this._glMap.setZoom(s.zoom)):this._glMap=new e.Map(s),this._glMap.transform.latRange=null,this._transformGL(this._glMap),this._glMap._canvas.canvas?this._glMap._actualCanvas=this._glMap._canvas.canvas:this._glMap._actualCanvas=this._glMap._canvas;const a=this._glMap._actualCanvas;t.DomUtil.addClass(a,"leaflet-image-layer"),t.DomUtil.addClass(a,"leaflet-zoom-animated"),this.options.interactive&&t.DomUtil.addClass(a,"leaflet-interactive"),this.options.className&&t.DomUtil.addClass(a,this.options.className)},_calcRotateOffset(){const t=this._map.getSize().multiplyBy(this.options.padding),e=this._map.getSize()._divideBy(2);return this._map._latLngToNewLayerPoint(this._map.getCenter(),this._map.getZoom(),this._map.getCenter()).subtract(e).subtract(t)},_update(t){if(!this._map)return;if(this._offset=this._map.getBounds().getNorthWest(),this._zooming)return;const e=this._glMap,i=this.getSize(),n=this._container;this._transformGL(e);const r=Math.round(i.x),o=Math.round(i.y);Math.round(e.transform.width)!==r||Math.round(e.transform.height)!==o?(n.style.width=`${r}px`,n.style.height=`${o}px`,e.transform.width=r,e.transform.height=o,null!==e._resize&&void 0!==e._resize?e._resize():e.resize()):null!==e._update&&void 0!==e._update?e._update():e.update()},_transformGL(i){const n=this._clampCenter(this._map.getCenter()),r=i.transform;r.resetZoomScale=!1;const o=this._getZoom();if(o<0)return;r.zoom=o,r.center=e.LngLat.convert([n.lng,n.lat]);const s=r.center,a=[0,0];if(Math.abs(s.lng-n.lng)>1e-7||Math.abs(s.lat-n.lat)>1e-7){const t=r.coordinatePoint(r.locationCoordinate(s)),e=r.coordinatePoint(r.locationCoordinate(n));a[0]=t.x-e.x,a[1]=t.y-e.y}const l=this._container,h=this._calcRotateOffset().add(a);t.DomUtil.setPosition(l,h)},_clampCenter(e){if(!e)return e;const i=Math.min(Math.max(e.lng,-180),180),n=Math.min(Math.max(e.lat,-90),90);return t.latLng(n,i)},_pinchZoom(t){this._glMap.jumpTo({zoom:Math.max(0,this._getZoom()),center:this._clampCenter(this._map.getCenter())})},_animateZoom(e){const i=this._map.getZoomScale(e.zoom),n=this._map.getSize().multiplyBy(this.options.padding*i),r=this.getSize()._divideBy(2),o=this._map.project(this._clampCenter(e.center),e.zoom)._subtract(r)._add(this._map._getMapPanePos().add(n))._round(),s=this._map.project(this._clampCenter(this._map.getBounds().getNorthWest()),e.zoom)._subtract(o),a=this._map.latLngToLayerPoint(this._offset)._add(this._map._getRotatePanePos());t.DomUtil.setTransform(this._glMap._actualCanvas,s.subtract(a),i)},_zoomStart(t){this._zooming=!0,this._container&&this._map._rotate&&0!==this._map._bearing&&(this._container.style.visibility="hidden")},_zoomEnd(){const e=this._map.getZoomScale(this._map.getZoom());t.DomUtil.setTransform(this._glMap._actualCanvas,null,e),this._zooming=!1,this._update(),this._container&&(this._container.style.visibility="visible")},_transitionEnd(e){t.Util.requestAnimFrame(function(){const e=this._map.getCenter(),i=this._map.latLngToContainerPoint(this._clampCenter(this._map.getBounds().getNorthWest()));t.DomUtil.setTransform(this._glMap._actualCanvas,i,1),this._glMap.once("moveend",t.Util.bind(function(){this._zoomEnd()},this)),this._glMap.jumpTo({center:this._clampCenter(e),zoom:Math.max(0,this._getZoom())})},this)},_resize(t){this._transitionEnd(t)},_getZoom(){const t=this._map.getSize()._divideBy(2),e=this._map._latLngToNewLayerPoint(this._map.getCenter(),this._map.getZoom(),this._map.getCenter()),i=e.subtract(t),n=e.add(t),r=this._map.layerPointToLatLng(i),o=this._map.layerPointToLatLng(n),s=[[Math.min(Math.max(o.lng,-180),180),Math.min(Math.max(r.lat,-90),90)],[Math.min(Math.max(r.lng,-180),180),Math.min(Math.max(o.lat,-90),90)]],a=this._map.getSize().multiplyBy(this.options.padding),l=this._glMap.cameraForBounds(s,{padding:{left:a.x,right:a.x,top:a.y,bottom:a.y}});return l?parseFloat(l.zoom.toFixed(10)):-1},_rotate(e){if(!this._map)return;const i=this._map.getSize(),n=this._map._bearing,r=t.point(i.x/2,i.y/2),o=t.point(0,0).rotateFrom(n,r),s=t.point(i.x,0).rotateFrom(n,r),a=t.point(i.x,i.y).rotateFrom(n,r),l=t.point(0,i.y).rotateFrom(n,r),h=t.bounds(o,l);h.extend(s),h.extend(a);const u=h.getSize(),c=(u.x-i.x)/i.x,p=(u.y-i.y)/i.y,f=Math.max(c,p)/2;this.options.padding=f,this._update()}}),t.mapboxGL=function(e){return new t.MapboxGL(e)})}(r,e),r.mapboxGL(t)}};var Tt=class{constructor(){return new r.FeatureGroup}};const Ot=window.mapv||{},Nt=Ot.baiduMapLayer?Ot.baiduMapLayer.__proto__:Function;var At=r.Layer.extend({initialize(t,e,i,n){this.map=t,this.dataset=e||{},this.mapvoption=i,n=n||{},this.render=this.render.bind(this),r.Util.setOptions(this,n),this._canvas=this._createCanvas(),r.stamp(this),this.innerMoveStartEvent=this.moveStartEvent.bind(this),this.innerMoveEndEvent=this.moveEndEvent.bind(this),this.innnerZoomstart=this.zoomStartEvent.bind(this),this.innerViewreset=this.viewresetEvent.bind(this),this.innerResize=this.resizeEvent.bind(this),this.innerRotate=this.rotateEvent.bind(this)},addData(t,e){this.mapvBaseLayer.addData(t,e)},updateData(t,e){this.mapvBaseLayer.updateData(t,e)},initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1},_createCanvas(){const t=document.createElement("canvas");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=this.options.zIndex||100;const e=this.map.getSize();t.width=e.x,t.height=e.y,t.style.width=`${e.x}px`,t.style.height=`${e.y}px`;const i=this.devicePixelRatio;return t.getContext("2d").scale(i,i),"2d"===this.mapvoption.context&&t.getContext("2d").scale(i,i),t},onAdd(t){const e=this.getPane("tilePane"),i=r.DomUtil.create("div","leaflet-layer",e);i.appendChild(this._canvas),this._container=i,this.mapvBaseLayer=new class extends Nt{constructor(t,e,i,n){super(t,e,i),Nt&&(this.map=t,this.dataSet=e,this.options=i,i=i||{},this.init(i),this.argCheck(i),this.initDevicePixelRatio(),this.canvasLayer=n,this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),this.bindEvent())}clickEvent(t){const e=this.map.containerPointToLayerPoint([0,0]),i=(this.devicePixelRatio,t.layerPoint);i.x,e.x,i.y,e.y}mousemoveEvent(t){if(!t)return;const e=this.map.containerPointToLayerPoint([0,0]),i=(this.devicePixelRatio,t.layerPoint);i.x,e.x,i.y,e.y}addAnimatorEvent(){}animatorMovestartEvent(){const t=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=t.stepsRange.start)}animatorMoveendEvent(){this.isEnabledTime()&&this.animator}bindEvent(){const t=this.map;this.options.methods&&(this.options.methods.click&&t.on("click",this.clickEvent),this.options.methods.mousemove&&t.on("mousemove",this.mousemoveEvent))}unbindEvent(){const t=this.map;this.options.methods&&(this.options.methods.click&&t.removeListener("click",this.clickEvent),this.options.methods.mousemove&&t.removeListener("mousemove",this.mousemoveEvent))}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}getContext(){return this.canvasLayer.getCanvas().getContext(this.context)}_canvasUpdate(t){if(!this.canvasLayer||this.canvasLayer.disposeFlag)return;const e=this,i=this.map,n=e.options.animation,o=this.getContext();if(e.isEnabledTime()){if(void 0===t)return void this.clear(o);"2d"===this.context&&(o.save(),o.globalCompositeOperation="destination-out",o.fillStyle="rgba(0, 0, 0, .1)",o.fillRect(0,0,o.canvas.width,o.canvas.height),o.restore())}else this.clear(o);if("2d"===this.context)for(const t in e.options)o[t]=e.options[t];else o.clear(o.COLOR_BUFFER_BIT);if(e.options.minZoom&&i.getZoom()<e.options.minZoom||e.options.maxZoom&&i.getZoom()>e.options.maxZoom)return;const s=i.getBounds().getNorthWest(),a=i.latLngToLayerPoint(s),l={transferCoordinate(t){const n=i.latLngToLayerPoint(new r.LatLng(t[1],t[0]));return"heatmap"===e.options.draw&&(n.x/=e.devicePixelRatio,n.y/=e.devicePixelRatio),[n.x-a.x,n.y-a.y]}};void 0!==t&&(l.filter=function(e){const i=n.trails||10;return t&&e.time>t-i&&e.time<t});const h=e.dataSet.get(l);this.processData(h),"m"===e.options.unit&&e.options.size,e.options._size=e.options.size;const u=i.latLngToLayerPoint(r.latLng(0,0)),c={x:u.x-a.x,y:u.y-a.y};this.drawContext(o,new Ot.DataSet(h),e.options,c),e.options.updateCallback&&e.options.updateCallback instanceof Function&&e.options.updateCallback(t)}init(t){const e=this;e.options=t,this.initDataRange(t),this.context=e.options.context||"2d",e.options.zIndex&&e.canvasLayer&&e.canvasLayer.setZIndex(e.options.zIndex),this.initAnimator()}updateData(t,e){let i=t;i&&i.get&&(i=i.get()),void 0!==i&&this.dataSet.set(i),super.update({options:e})}addData(t,e){let i=t;t&&t.get&&(i=t.get()),this.dataSet.add(i),this.update({options:e})}draw(){this.canvasLayer.draw()}clear(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)}}(t,this.dataset,this.mapvoption,this),this.bindEvent(),this.options.tileLoader&&this._initTileLoader(),this._reset(),this.fire("loaded")},bindEvent(){const t=this.map;t.on("movestart",this.innerMoveStartEvent),t.on("moveend",this.innerMoveEndEvent),t.on("zoomend",this.innerMoveEndEvent),t.on("zoomstart",this.innnerZoomstart),t.on("viewreset",this.innerViewreset),t.on("resize ",this.innerResize),t.on("rotate",this.innerRotate),this.mapvBaseLayer.bindEvent()},unbindEvent(){const t=this.map;t.off("movestart",this.innerMoveStartEvent),t.off("moveend",this.innerMoveEndEvent),t.on("zoomend",this.innerMoveEndEvent),t.off("zoomstart",this.innnerZoomstart),t.off("viewreset",this.innerViewreset),t.off("resize ",this.innerResize),t.off("rotate",this.innerRotate),this.removeAllData(),this.mapvBaseLayer.unbindEvent()},moveStartEvent(){this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()},moveEndEvent(){this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()},zoomStartEvent(){this._unvisiable()},viewresetEvent(){this._reset(),this._visiable()},resizeEvent(){this._reset(),this._visiable()},rotateEvent(){this._reset(),this._visiable()},_animateZoom(){this._animating||(this._animating=!0)},_endZoomAnim(){},getCanvas(){return this._canvas},getAttribution(){return this.options.attribution},draw(){return this._reset()},onRemove(){r.DomUtil.remove(this._container),this.unbindEvent(),this.disposeFlag=!0},setOpacity(t){this._canvas.style.opacity=t},setZIndex(t){this._canvas.style.zIndex=t},bringToFront(){return this},bringToBack(){return this},_reset(){this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render()},_visiable(){this.getCanvas().style.display="block"},_unvisiable(){this.getCanvas().style.display="none"},_render(){this.render()},fixPosition(){const t=this.map.getBounds().getNorthWest(),e=this.map.latLngToLayerPoint(t);t&&r.DomUtil.setPosition(this._canvas,{x:e.x,y:e.y})},resizeCanvas(){let t;t=this.map._rotate?rt(this.map).getSize():this.map.getSize();const e=this.getCanvas();e.width=t.x,e.height=t.y,e.style.width=`${t.x}px`,e.style.height=`${t.y}px`},redraw(t){this.resizeCanvas(),this.fixPosition(),this.render()},show(){this._visiable()},hide(){this._unvisiable()},destroy(){r.DomUtil.remove(this._container),this.unbindEvent(),this.disposeFlag=!0},update(t){void 0!==t&&this.mapvBaseLayer.updateData(t.data,t.options)},removeData(t){this.mapvBaseLayer&&this.mapvBaseLayer.removeData(t)},removeAllData(){},onResize(){},render(){this.mapvBaseLayer._canvasUpdate()}});const Rt=window.echarts;function kt(t,e){this._LeafletMap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e}kt.prototype.dimensions=["lng","lat"],kt.prototype.setMapOffset=function(t){this._mapOffset=t},kt.prototype.getBMap=function(){return this._LeafletMap},kt.prototype.dataToPoint=function(t){null===t[1]&&(t[1]=89.99);const e=new r.latLng(t[1],t[0]),i=this._LeafletMap.latLngToLayerPoint(e),n=this._mapOffset;return[i.x-n[0],i.y-n[1]]},kt.prototype.pointToData=function(t){const e=this._mapOffset,i=this._LeafletMap.layerPointToLatLng([t[0]+e[0],t[1]+e[1]]);return[i.lng,i.lat]},kt.prototype.getViewRect=function(){const t=this._api;return new Rt.graphic.BoundingRect(0,0,t.getWidth(),t.getHeight())},kt.prototype.getRoamTransform=function(){return Rt.matrix.create()},kt.prototype.prepareCustoms=function(){const t=Rt.util,e=this.getViewRect(),i=this;return{coordSys:{type:"leaflet",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:t.bind(this.dataToPoint,this),size:t.bind(function(e,n){return n=n||[0,0],t.map([0,1],function(t){const r=n[t],o=e[t]/2,s=[],a=[];return s[t]=r-o,a[t]=r+o,s[1-t]=n[1-t],a[1-t]=n[1-t],Math.abs(i.dataToPoint(s)[t]-i.dataToPoint(a)[t])},i)},this)}}},kt.dimensions=kt.prototype.dimensions,kt.create=function(t,e){let i;t.eachComponent("leaflet",function(t){const n=Rt.leafletMap;i||(i=new kt(n,e)),i.setMapOffset(t.__mapOffset||[0,0]),t.coordinateSystem=i}),t.eachSeries(function(t){if(!t.get("coordinateSystem")||"leaflet"===t.get("coordinateSystem")){if(!i){const t=Rt.leafletMap;i=new kt(t,e)}t.coordinateSystem=i,t.animation=!0===t.animation}})};var Dt=kt;const zt=window.echarts;var Bt=r.Layer.extend({map:null,chart:null,options:null,echartsInitOpts:null,canvas:null,initialize(t,e){this.map=t,this.options=e,this.echartsInitOpts=e.echartsInitOpts,this.layerId=e.layerId||"echartlayerdefaultid",this.layerClass=e.classId||"echartlayerdefaultclass",this.visible=!0,this.initDevicePixelRatio(),this.initOptions(this.options),this.initEcharts(),this._resizeCanvas()},initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1},initOptions(t){if(t){if(t.leaflet)return;this.options.leaflet={roam:!0}}},initEcharts(){zt.registerCoordinateSystem("leaflet",Dt),zt.extendComponentModel({type:"leaflet",getBMap(){return this.__leaflet},defaultOption:{roam:!1}}),zt.registerAction({type:"LeafletRoma",event:"LeafletRoma",update:"updateLayout"},function(){})},_visible(){this.visible=!0,this.canvas.style.visibility="visible"},_unvisible(){this.visible=!1,this.canvas.style.visibility="hidden"},onAdd(t){const e=this;this.map=t,this.canvas=this._createCanvas(),this.map.getPane("tilePane").appendChild(this.canvas),this.chart=zt.init(this.canvas,null,this.echartsInitOpts),zt.leafletMap=t;const i=this;t.on("resize",function(t){i.resize()}),t.on("zoomstart",function(){i._unvisible()}),t.on("rotate",()=>{i.resize()}),zt.extendComponentView({type:"leaflet",render(t,n,r){let o=!0;i._echartRenderApi||(i._echartRenderApi=r),i._mapModel||(i._mapModel=t);const s=zt.leafletMap,a=r.getZr().painter.getViewportRoot(),l=t.coordinateSystem,h=function(){if(o||!e.visible)return;const i=s.getBounds().getNorthWest(),n=s.latLngToLayerPoint(i),h=[parseInt(n.x,10)||0,parseInt(n.y,10)||0];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,l.setMapOffset(h),t.__mapOffset=h,r.dispatchAction({type:"LeafletRoma"})},u=function(){i._visible(),!o&&e.visible&&r.dispatchAction({type:"LeafletRoma"})};this._oldMoveHandler&&s.off("move",this._oldMoveHandler),this._oldZoomEndHandler&&s.off("zoomend",this._oldZoomEndHandler),s.on("move",h),s.on("zoomend",u),this._oldMoveHandler=h,this._oldZoomEndHandler=u,o=!1}}),this.chart.setOption(this.options)},onRemove(){this.chart.dispose()},_createCanvas(){const t=document.createElement("div");return t.id=this.layerId,t.style.top="0px",t.style.left="0px",t.height=`${this.map.getSize().y}px`,t.width=`${this.map.getSize().x}px`,t.style.height=`${this.map.getSize().y}px`,t.style.width=`${this.map.getSize().x}px`,t.style.zIndex=1e3,t.setAttribute("id",this.layerId),t.setAttribute("class",`leaflet-layer ${this.layerClass}`),this.canvas=t,t},_resizeCanvas(){window.onresize=this.resize.bind(this)},_calcRotateBounds(){return rt(this.map)},show(){this._visible()},hide(){this._unvisible()},resize(){const t=this,e=t._calcRotateBounds().getSize();if(t.canvas.style.width=`${e.x}px`,t.canvas.style.height=`${e.y}px`,t.canvas.width=e.x,t.canvas.height=e.y,t.chart.resize(),t._echartRenderApi&&t._mapModel&&t.map._rotate){const e=t._echartRenderApi,i=t._mapModel,n=e.getZr().painter.getViewportRoot(),r=i.coordinateSystem,o=t.map.getBounds().getNorthWest(),s=t.map.latLngToLayerPoint(o),a=[parseInt(s.x,10)||0,parseInt(s.y,10)||0];n.style.left=`${a[0]}px`,n.style.top=`${a[1]}px`,r.setMapOffset(a),i.__mapOffset=a,e.dispatchAction({type:"LeafletRoma"})}},update(t){this.chart.setOption(t)},remove(){return this.chart.clear(),this.canvas.parentElement&&this.canvas.parentElement.removeChild(this.canvas),this.map=void 0,this},setOpacity(t){this.canvas.style.opacity=t}});var Ft=class extends n.Evented{constructor(t){super();const e=Object(n.defaultValue)(t,{});if(this._id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._view=Object(n.defaultValue)(e.view,null),!this._view)throw new Error("视图不存在!");this._collection=new n.Collection}add(t){this._collection.add(t),t._addView()}remove(t){this._collection.remove(t),t._removeView(),t&&t.destroy&&t.destroy()}findControlById(t){return this._collection.filter(e=>e._id===t)}};class Vt{}Vt.getMouseEvent=function(t,e,i){const r=e._spatialReference;let o=void 0;return{mapPoint:o=r&&!r.isGeographic?n.Projection.project(new n.Point({coordinates:[t.latlng.lng,t.latlng.lat]}),r):new n.Point({coordinates:[t.latlng.lng,t.latlng.lat]}),x:t.containerPoint.x,y:t.containerPoint.y,button:t.originalEvent.button,buttons:t.originalEvent.buttons,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,type:i}},Vt.getKeyEvent=function(t,e,i){const n={key:t.originalEvent.key,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,type:i};return"key-down"===i&&(n.repeat=t.originalEvent.repeat),n},Vt.getViewChangeEvent=function(t,e,i){const n={event:t,target:e,type:i};return n.mapView=e,n.scale=e._scale,n.zoom=e._zoom,n.center=e.center,n.extent=e._extent,n},Vt.getDragEvent=function(t,e,i,n,r){return{x:t.originalEvent.layerX,y:t.originalEvent.layerY,button:void 0!==r?r:t.originalEvent.button,buttons:t.originalEvent.buttons,cancelable:t.originalEvent.cancelable,origin:i,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,action:n,type:"drag"}};var jt=Vt;var Gt=class extends n.LayerView{onAdd(){return this._layerViewVisible=this._getLayerViewVisible(this.layer.visble),tt.addVectorTileLayer(this),Promise.resolve(this)}onRemove(){return tt.removeLayer(this),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);const{innerLayer:e}=this;if(t.updateContent&&e&&e.getMapboxMap){const i=e.getMapboxMap();t.updateContent.forEach(t=>{t&&(i._loaded?this._onUpdate(t,i):i.once("load",()=>{this._onUpdate(t,i)}))})}return Promise.resolve(this)}_onUpdate(t,e){if(e[t.name])return void e[t.name].apply(e,t.params);const{params:i}=t;switch(t.name){case"setPaintProperties":tt.setPaintProperties(e,i[0],i[1]);break;case"setLayoutProperties":tt.setLayoutProperties(e,i[0],i[1]);break;case"setStyleLayer":case"deleteStyleLayer":e.setStyle(this.layer.style);break;case"opacity":tt.setOpacity(this.layer,e,i[0]);break;case"visible":{const t=this._getLayerViewVisible(i[0]);this._layerViewVisible!==t&&(tt.setVisible(this.layer,e,t),this._layerViewVisible=t);break}case"clippingArea":tt.setClippingArea(this,i[0])}}};var Ut=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=X.addWMSLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":this.innerLayer.redraw();break;case"sublayerVisible":this.innerLayer.setParams({layers:this.layer.layers});break;case"index":this.innerLayer.setZIndex(this.layer._realIndex);break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(j.convertClippingArea(t));break}}}return Promise.resolve(this)}};var Ht=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=W.addWMTSLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":this.innerLayer.redraw();break;case"index":this.innerLayer.setZIndex(this.layer._realIndex);break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(j.convertClippingArea(t));break}}}return Promise.resolve(this)}};var qt=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=U.addIGSTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":this.innerLayer.redraw();break;case"index":this.innerLayer.setZIndex(this.layer._realIndex);break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(j.convertClippingArea(t));break}}}return Promise.resolve(this)}};var Zt=class extends n.Evented{constructor(t){super(t),this.view=Object(n.defaultValue)(t.view,null),this.location=Object(n.defaultValue)(t.location,""),this.title=Object(n.defaultValue)(t.title,""),this.content=Object(n.defaultValue)(t.content,""),this.alignment=Object(n.defaultValue)(t.alignment,"bottom-center"),this.defaultButtons=Object(n.defaultValue)(t.defaultButtons,["toggle","close","zoom"]),this._popup=void 0,this._initPopup(),this._initDefaultClass()}_initPopup(){this._customPopup(),this.view._innerView.closePopupOnClick=!1}_customPopup(){r.CustomPopup=r.Popup.extend({_initLayout(){const t="leaflet-popup",e=r.DomUtil.create("div",`${t} ${this.options.className||""} leaflet-zoom-animated`);this._container=e,e.setAttribute("style","margin: 0;");const i=r.DomUtil.create("div",`zondy-popup__container ${t}-content-wrapper`,e);this._wrapper=i,this._contentNode=r.DomUtil.create("div",`${t}-content`,i),this._contentNode.setAttribute("style","margin:0"),r.DomEvent.disableClickPropagation(i).disableScrollPropagation(this._contentNode).on(i,"contextmenu",r.DomEvent.stopPropagation),this._tipContainer=r.DomUtil.create("div","",e),this._tipContainer.setAttribute("style","margin: auto;width: 40px;height: 20px;pointer-events: none;overflow: hidden;pointer-events: none;"),this._tip=r.DomUtil.create("div",`zondy-popup__tip ${t}-tip`,this._tipContainer)}})}_contentUI(t,e){const i=this;let n=void 0;const r=function(t){const e=document.createElement("div");return e.innerHTML=t,e.childNodes};(n=document.createElement("div")).setAttribute("id",`${this.id}-popup-default`);const o=document.createElement("div");o.setAttribute("class","zondy-popup__header"),o.setAttribute("style","display: flex;");const s=r('<div class="zondy-popup__toggle">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M5 13.793l7-7 7 7v1.414l-7-7-7 7z"></path></svg>\n </div>')[0],a=r('<div class="zondy-popup__close">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M3.98 11.303L7.281 8 3.98 4.697l.707-.707L7.99 7.293l.01-.01.01.01 3.304-3.303.707.707L8.718 8l3.303 3.303-.707.707L8.01 8.707l-.01.01-.01-.01-3.304 3.303z"></path></svg>\n </div>')[0];if(t){const e=r('<div class="zondy-popup__title" style="flex: 1;"></div>')[0];if(o.appendChild(e),"object"==typeof t?t instanceof Node?e.appendChild(t):t instanceof NodeList&&t.forEach(t=>{e.appendChild(t)}):e.innerHTML=t,this.defaultButtons.indexOf("toggle")>-1){o.appendChild(s);let t=!0;o.onclick=function(){t=!t,document.getElementById(`${i.id}-popup-default`).querySelector(".zondy-popup__content").style.display=t?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(o.appendChild(a),a.onclick=(()=>{this.close()}))}const l=document.createElement("div");if(l.setAttribute("class","zondy-popup__content"),e)if("object"==typeof e){if(e instanceof Node)l.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)l.appendChild(e[t]),t--}else l.innerHTML=e;const h=document.createElement("div");h.setAttribute("class","zondy-popup__footer");const u=r('<div class="zondy-popup__zoom" style="display: inline-block;width: 36px;height: 36px;line-height: 36px;text-align: center;">\n <svg class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M9 7H7v2H6V7H4V6h2V4h1v2h2zm6.805 7.861l-.943.942a.665.665 0 0 1-.943 0l-3.067-3.067a.667.667 0 0 1 0-.943l.129-.13-1.108-1.107A5.279 5.279 0 1 1 11.8 6.5a5.251 5.251 0 0 1-1.237 3.366l1.108 1.108.124-.124a.668.668 0 0 1 .943 0l3.067 3.068a.666.666 0 0 1 0 .943zM10.8 6.5a4.3 4.3 0 1 0-4.3 4.3 4.304 4.304 0 0 0 4.3-4.3zm4.062 7.89l-2.595-2.598-.473.473 2.597 2.595z"></path></svg>\n </div>')[0];return this.defaultButtons.indexOf("zoom")>-1&&(h.appendChild(u),u.onclick=function(){i.view.flyTo({zoom:i.view._zoom+1,center:i.location})}),h.childNodes.length>0&&h.setAttribute("class","zondy-popup__footer zondy-popup__footer-division"),n.appendChild(o),n.appendChild(l),n.appendChild(h),n}_initDefaultClass(){let t=!1;const e=document.head.getElementsByTagName("style");if(e)for(let i=0;i<e.length;i++)if(e[i].innerHTML.indexOf("styleDomString")>-1){t=!0;break}if(!t){const t=document.createElement("style");t.innerHTML="\n .zondy-popup__container{background-color: #fff;padding:0;border-radius: 10px;}\n .zondy-popup__tip{\n background-color: #fff;\n }\n .zondy-popup__header{\n padding: 8px;\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n }\n .zondy-popup__content{\n padding: 8px;\n }\n .zondy-popup__footer{\n }\n .zondy-popup__footer-division{\n border-top: 1px solid;\n }\n .zondy-popup__toggle,.zondy-popup__close{\n display: inline-block;width: 30px;text-align: center;\n }\n ",document.querySelector("head").append(t)}}open(t){this._popup?(this.close(),this._popup=void 0,this.openPopup(t)):this.openPopup(t)}openPopup(t){if(this.view=t.view?t.view:this.view,this.location=t.location?t.location:this.location,this.location.spatialReference.isGeographic?this._location=this.location:this._location=n.Projection.project(this.location,new n.SpatialReference({wkid:4326})),this.title=t.title?t.title:this.title,this.content=t.content?t.content:this.content,this.alignment=t.alignment?t.alignment:this.alignment,!this.view._innerView)return void n.Log.info("没有视图引擎!");const e=r.latLng(this._location.coordinates[1],this._location.coordinates[0]),i=this._contentUI(this.title,this.content);this._popup=new r.CustomPopup({className:"layerPopup",maxWidth:1900,minWidth:50,closeOnClick:!1,autoPan:!1}).setLatLng(e).setContent(i).openOn(this.view._innerView);const o=this._getOffset();this._popup=new r.CustomPopup({className:"layerPopup",maxWidth:1900,minWidth:50,closeOnClick:!1,offset:o,autoPan:!1}).setLatLng(e).setContent(i).openOn(this.view._innerView)}_getOffset(){let t=null;if(this._popup&&this._popup._container&&this.alignment){const e=this._popup._container.getBoundingClientRect(),i=this._getOffsetByAlignment(this.alignment,e.width,e.height);t=new r.Point(i.x,i.y)}return t}_getOffsetByAlignment(t,e,i){let n=0,r=0;switch(t){case"top-left":n=e/2,r=i;break;case"top-center":r=i;break;case"top-right":n=-e/2,r=i;break;case"bottom-left":n=e/2;break;case"auto":case"bottom-center":break;case"bottom-right":n=-e/2}return{x:n,y:r}}close(){this.view._innerView&&this.view._innerView.closePopup(this._popup)}destroy(){}},Xt=i(5),Yt=i(6);var Wt=function(t){t.Control.EasyPrint=t.Control.extend({options:{title:"Print map",position:"topleft",sizeModes:["Current"],filename:"map",exportOnly:!1,hidden:!1,tileWait:500,hideControlContainer:!0,hideClasses:[],customWindowTitle:window.document.title,spinnerBgCOlor:"#0DC5C1",customSpinnerClass:"epLoader",defaultSizeTitles:{Current:"Current Size",A4Landscape:"A4 Landscape",A4Portrait:"A4 Portrait"}},onAdd:function(){this.mapContainer=this._map.getContainer(),this.options.sizeModes=this.options.sizeModes.map(function(t){return"Current"===t?{name:this.options.defaultSizeTitles.Current,className:"CurrentSize"}:"A4Landscape"===t?{height:this._a4PageSize.height,width:this._a4PageSize.width,name:this.options.defaultSizeTitles.A4Landscape,className:"A4Landscape page"}:"A4Portrait"===t?{height:this._a4PageSize.width,width:this._a4PageSize.height,name:this.options.defaultSizeTitles.A4Portrait,className:"A4Portrait page"}:t},this);var e=t.DomUtil.create("div","leaflet-control-easyPrint leaflet-bar leaflet-control");if(!this.options.hidden){this._addCss(),t.DomEvent.addListener(e,"mouseover",this._togglePageSizeButtons,this),t.DomEvent.addListener(e,"mouseout",this._togglePageSizeButtons,this);var i="leaflet-control-easyPrint-button";this.options.exportOnly&&(i+="-export"),this.link=t.DomUtil.create("a",i,e),this.link.id="leafletEasyPrint",this.link.title=this.options.title,this.holder=t.DomUtil.create("ul","easyPrintHolder",e),this.options.sizeModes.forEach(function(e){var i=t.DomUtil.create("li","easyPrintSizeMode",this.holder);i.title=e.name,t.DomUtil.create("a",e.className,i),t.DomEvent.addListener(i,"click",this.printMap,this)},this),t.DomEvent.disableClickPropagation(e)}return e},printMap:async function(t,e){e&&(this.options.filename=e),this.options.format?("jpeg"==this.options.format.toLowerCase()?this.formatFun="toJpeg":"svg"==this.options.format.toLowerCase()?this.formatFun="toSvg":this.formatFun="toPng",this.format=this.options.format):(this.formatFun="toPng",this.format="png"),this.options.width=this.options.width?this.options.width:this.mapContainer.clientWidth,this.options.height=this.options.height?this.options.height:this.mapContainer.clientHeight,this.options.exportOnly||(this._page=window.open("","_blank","toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10, top=10, width=200, height=250, visible=none"),this._page.document.write(this._createSpinner(this.options.customWindowTitle,this.options.customSpinnerClass,this.options.spinnerBgCOlor))),this.originalState={mapWidth:this.mapContainer.style.width,widthWasAuto:!1,widthWasPercentage:!1,mapHeight:this.mapContainer.style.height,zoom:this._map.getZoom(),center:this._map.getCenter()},"auto"===this.originalState.mapWidth?(this.originalState.mapWidth=this._map.getSize().x+"px",this.originalState.widthWasAuto=!0):this.originalState.mapWidth.includes("%")&&(this.originalState.percentageWidth=this.originalState.mapWidth,this.originalState.widthWasPercentage=!0,this.originalState.mapWidth=this._map.getSize().x+"px"),this._map.fire("easyPrint-start",{event:t}),this.options.hidden||this._togglePageSizeButtons({type:null}),this.options.hideControlContainer&&this._toggleControls(),this.options.hideClasses&&this._toggleClasses(this.options.hideClasses);var i="string"!=typeof t?t.target.className:t;if("CurrentSize"===i)return await this._printOpertion(i);this.outerContainer=this._createOuterContainer(this.mapContainer),this.originalState.widthWasAuto&&(this.outerContainer.style.width=this.originalState.mapWidth),this._createImagePlaceholder(i)},_createImagePlaceholder:function(t){var e=this;Xt.toPng(this.mapContainer,{width:parseInt(this.originalState.mapWidth.replace("px")),height:parseInt(this.originalState.mapHeight.replace("px"))}).then(function(i){e.blankDiv=document.createElement("div");var n=e.blankDiv;e.outerContainer.parentElement.insertBefore(n,e.outerContainer),n.className="epHolder",n.style.backgroundImage='url("'+i+'")',n.style.position="absolute",n.style.zIndex=1011,n.style.display="initial",n.style.width=e.originalState.mapWidth,n.style.height=e.originalState.mapHeight,e._resizeAndPrintMap(t)}).catch(function(t){console.error("oops, something went wrong!",t)})},_resizeAndPrintMap:function(t){this.outerContainer.style.opacity=0;var e=this.options.sizeModes.filter(function(e){return e.className.indexOf(t)>-1});e=e[0],this.mapContainer.style.width=e.width+"px",this.mapContainer.style.height=e.height+"px",this.mapContainer.style.width>this.mapContainer.style.height?this.orientation="portrait":this.orientation="landscape",this._map.setView(this.originalState.center),this._map.setZoom(this.originalState.zoom),this._map.invalidateSize(),this.options.tileLayer?this._pausePrint(t):this._printOpertion(t)},_pausePrint:function(t){var e=this,i=setInterval(function(){e.options.tileLayer.isLoading()||(clearInterval(i),e._printOpertion(t))},e.options.tileWait)},_getValidDom:function(t){for(var e=t,i=e.getElementsByClassName("leaflet-tile"),n=0;n<i.length;n++){var r=i[n];!r.classList.contains("leaflet-tile-loaded")&&r.parentElement.classList.contains("leaflet-tile-container")&&(r.remove(),n--)}return t.parentNode.appendChild(e),e},_printOpertion:function(t){var e=this,i=this.mapContainer.style.width,n=this.options.isDownload;return(this.originalState.widthWasAuto&&"CurrentSize"===t||this.originalState.widthWasPercentage&&"CurrentSize"===t)&&(i=this.originalState.mapWidth),new Promise(t=>{Xt[this.formatFun](e._getValidDom(e.mapContainer),{width:parseInt(i),height:parseInt(e.mapContainer.style.height.replace("px"))}).then(function(i){var r=e._dataURItoBlob(i);e.options.exportOnly?n&&Yt.saveAs(r,e.options.filename+"."+e.format):e._sendToBrowserPrint(i,e.orientation),e._toggleControls(!0),e._toggleClasses(e.options.hideClasses,!0),e.outerContainer&&(e.originalState.widthWasAuto?e.mapContainer.style.width="auto":e.originalState.widthWasPercentage?e.mapContainer.style.width=e.originalState.percentageWidth:e.mapContainer.style.width=e.originalState.mapWidth,e.mapContainer.style.height=e.originalState.mapHeight,e._removeOuterContainer(e.mapContainer,e.outerContainer,e.blankDiv),e._map.invalidateSize(),e._map.setView(e.originalState.center),e._map.setZoom(e.originalState.zoom)),e._map.fire("easyPrint-finished"),t({dataUrl:i})}).catch(function(t){console.error("Print operation failed",t)})})},_sendToBrowserPrint:function(t,e){this._page.resizeTo(600,800);var i=this._createNewWindow(t,e,this);this._page.document.body.innerHTML="",this._page.document.write(i),this._page.document.close()},_createSpinner:function(t,e,i){return"<html><head><title>"+t+"</title></head><body><style>\n body{\n background: "+i+";\n }\n .epLoader,\n .epLoader:before,\n .epLoader:after {\n border-radius: 50%;\n }\n .epLoader {\n color: #ffffff;\n font-size: 11px;\n text-indent: -99999em;\n margin: 55px auto;\n position: relative;\n width: 10em;\n height: 10em;\n box-shadow: inset 0 0 0 1em;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n }\n .epLoader:before,\n .epLoader:after {\n position: absolute;\n content: '';\n }\n .epLoader:before {\n width: 5.2em;\n height: 10.2em;\n background: #0dc5c1;\n border-radius: 10.2em 0 0 10.2em;\n top: -0.1em;\n left: -0.1em;\n -webkit-transform-origin: 5.2em 5.1em;\n transform-origin: 5.2em 5.1em;\n -webkit-animation: load2 2s infinite ease 1.5s;\n animation: load2 2s infinite ease 1.5s;\n }\n .epLoader:after {\n width: 5.2em;\n height: 10.2em;\n background: #0dc5c1;\n border-radius: 0 10.2em 10.2em 0;\n top: -0.1em;\n left: 5.1em;\n -webkit-transform-origin: 0px 5.1em;\n transform-origin: 0px 5.1em;\n -webkit-animation: load2 2s infinite ease;\n animation: load2 2s infinite ease;\n }\n @-webkit-keyframes load2 {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n @keyframes load2 {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n </style>\n <div class=\""+e+'">Loading...</div></body></html>'},_createNewWindow:function(t,e,i){return"<html><head>\n <style>@media print {\n img { max-width: 98%!important; max-height: 98%!important; }\n @page { size: "+e+";}}\n </style>\n <script>function step1(){\n setTimeout('step2()', 10);}\n function step2(){window.print();window.close()}\n <\/script></head><body onload='step1()'>\n <img src=\""+t+'" style="display:block; margin:auto;"></body></html>'},_createOuterContainer:function(t){var e=document.createElement("div");return t.parentNode.insertBefore(e,t),t.parentNode.removeChild(t),e.appendChild(t),e.style.width=t.style.width,e.style.height=t.style.height,e.style.display="inline-block",e.style.overflow="hidden",e},_removeOuterContainer:function(t,e,i){e.parentNode&&(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(i),e.parentNode.removeChild(e))},_addCss:function(){var t=document.createElement("style");t.type="text/css",t.innerHTML=".leaflet-control-easyPrint-button { \n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMiA1MTI7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8cGF0aCBkPSJNMTI4LDMyaDI1NnY2NEgxMjhWMzJ6IE00ODAsMTI4SDMyYy0xNy42LDAtMzIsMTQuNC0zMiwzMnYxNjBjMCwxNy42LDE0LjM5OCwzMiwzMiwzMmg5NnYxMjhoMjU2VjM1Mmg5NiAgIGMxNy42LDAsMzItMTQuNCwzMi0zMlYxNjBDNTEyLDE0Mi40LDQ5Ny42LDEyOCw0ODAsMTI4eiBNMzUyLDQ0OEgxNjBWMjg4aDE5MlY0NDh6IE00ODcuMTk5LDE3NmMwLDEyLjgxMy0xMC4zODcsMjMuMi0yMy4xOTcsMjMuMiAgIGMtMTIuODEyLDAtMjMuMjAxLTEwLjM4Ny0yMy4yMDEtMjMuMnMxMC4zODktMjMuMiwyMy4xOTktMjMuMkM0NzYuODE0LDE1Mi44LDQ4Ny4xOTksMTYzLjE4Nyw0ODcuMTk5LDE3NnoiIGZpbGw9IiMwMDAwMDAiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);\n background-size: 16px 16px; \n cursor: pointer; \n }\n .leaflet-control-easyPrint-button-export { \n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDQzMy41IDQzMy41IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0MzMuNSA0MzMuNTsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxnIGlkPSJmaWxlLWRvd25sb2FkIj4KCQk8cGF0aCBkPSJNMzk1LjI1LDE1M2gtMTAyVjBoLTE1M3YxNTNoLTEwMmwxNzguNSwxNzguNUwzOTUuMjUsMTUzeiBNMzguMjUsMzgyLjV2NTFoMzU3di01MUgzOC4yNXoiIGZpbGw9IiMwMDAwMDAiLz4KCTwvZz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);\n background-size: 16px 16px; \n cursor: pointer; \n }\n .easyPrintHolder a {\n background-size: 16px 16px;\n cursor: pointer;\n }\n .easyPrintHolder .CurrentSize{\n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTZweCIgdmVyc2lvbj0iMS4xIiBoZWlnaHQ9IjE2cHgiIHZpZXdCb3g9IjAgMCA2NCA2NCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNjQgNjQiPgogIDxnPgogICAgPGcgZmlsbD0iIzFEMUQxQiI+CiAgICAgIDxwYXRoIGQ9Ik0yNS4yNTUsMzUuOTA1TDQuMDE2LDU3LjE0NVY0Ni41OWMwLTEuMTA4LTAuODk3LTIuMDA4LTIuMDA4LTIuMDA4QzAuODk4LDQ0LjU4MiwwLDQ1LjQ4MSwwLDQ2LjU5djE1LjQwMiAgICBjMCwwLjI2MSwwLjA1MywwLjUyMSwwLjE1NSwwLjc2N2MwLjIwMywwLjQ5MiwwLjU5NCwwLjg4MiwxLjA4NiwxLjA4N0MxLjQ4Niw2My45NDcsMS43NDcsNjQsMi4wMDgsNjRoMTUuNDAzICAgIGMxLjEwOSwwLDIuMDA4LTAuODk4LDIuMDA4LTIuMDA4cy0wLjg5OC0yLjAwOC0yLjAwOC0yLjAwOEg2Ljg1NWwyMS4yMzgtMjEuMjRjMC43ODQtMC43ODQsMC43ODQtMi4wNTUsMC0yLjgzOSAgICBTMjYuMDM5LDM1LjEyMSwyNS4yNTUsMzUuOTA1eiIgZmlsbD0iIzAwMDAwMCIvPgogICAgICA8cGF0aCBkPSJtNjMuODQ1LDEuMjQxYy0wLjIwMy0wLjQ5MS0wLjU5NC0wLjg4Mi0xLjA4Ni0xLjA4Ny0wLjI0NS0wLjEwMS0wLjUwNi0wLjE1NC0wLjc2Ny0wLjE1NGgtMTUuNDAzYy0xLjEwOSwwLTIuMDA4LDAuODk4LTIuMDA4LDIuMDA4czAuODk4LDIuMDA4IDIuMDA4LDIuMDA4aDEwLjU1NmwtMjEuMjM4LDIxLjI0Yy0wLjc4NCwwLjc4NC0wLjc4NCwyLjA1NSAwLDIuODM5IDAuMzkyLDAuMzkyIDAuOTA2LDAuNTg5IDEuNDIsMC41ODlzMS4wMjctMC4xOTcgMS40MTktMC41ODlsMjEuMjM4LTIxLjI0djEwLjU1NWMwLDEuMTA4IDAuODk3LDIuMDA4IDIuMDA4LDIuMDA4IDEuMTA5LDAgMi4wMDgtMC44OTkgMi4wMDgtMi4wMDh2LTE1LjQwMmMwLTAuMjYxLTAuMDUzLTAuNTIyLTAuMTU1LTAuNzY3eiIgZmlsbD0iIzAwMDAwMCIvPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==)\n }\n .easyPrintHolder .page {\n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTguMS4xLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDQ0NC44MzMgNDQ0LjgzMyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDQ0LjgzMyA0NDQuODMzOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4Ij4KPGc+Cgk8Zz4KCQk8cGF0aCBkPSJNNTUuMjUsNDQ0LjgzM2gzMzQuMzMzYzkuMzUsMCwxNy03LjY1LDE3LTE3VjEzOS4xMTdjMC00LjgxNy0xLjk4My05LjM1LTUuMzgzLTEyLjQ2N0wyNjkuNzMzLDQuNTMzICAgIEMyNjYuNjE3LDEuNywyNjIuMzY3LDAsMjU4LjExNywwSDU1LjI1Yy05LjM1LDAtMTcsNy42NS0xNywxN3Y0MTAuODMzQzM4LjI1LDQzNy4xODMsNDUuOSw0NDQuODMzLDU1LjI1LDQ0NC44MzN6ICAgICBNMzcyLjU4MywxNDYuNDgzdjAuODVIMjU2LjQxN3YtMTA4LjhMMzcyLjU4MywxNDYuNDgzeiBNNzIuMjUsMzRoMTUwLjE2N3YxMzAuMzMzYzAsOS4zNSw3LjY1LDE3LDE3LDE3aDEzMy4xNjd2MjI5LjVINzIuMjVWMzR6ICAgICIgZmlsbD0iIzAwMDAwMCIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=);\n }\n .easyPrintHolder .A4Landscape { \n transform: rotate(-90deg);\n }\n \n .leaflet-control-easyPrint-button{\n display: inline-block;\n }\n .easyPrintHolder{\n margin-top:-31px;\n margin-bottom: -5px;\n margin-left: 30px;\n padding-left: 0px;\n display: none;\n }\n \n .easyPrintSizeMode {\n display: inline-block;\n }\n .easyPrintHolder .easyPrintSizeMode a {\n border-radius: 0px;\n }\n \n .easyPrintHolder .easyPrintSizeMode:last-child a{\n border-top-right-radius: 2px;\n border-bottom-right-radius: 2px;\n margin-left: -1px;\n }\n \n .easyPrintPortrait:hover, .easyPrintLandscape:hover{\n background-color: #757570;\n cursor: pointer;\n }",document.body.appendChild(t)},_dataURItoBlob:function(t){for(var e=atob(t.split(",")[1]),i=t.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(e.length),r=new DataView(n),o=0;o<e.length;o++)r.setUint8(o,e.charCodeAt(o));return new Blob([n],{type:i})},_togglePageSizeButtons:function(t){var e=this.holder.style,i=this.link.style;"mouseover"===t.type?(e.display="block",i.borderTopRightRadius="0",i.borderBottomRightRadius="0"):(e.display="none",i.borderTopRightRadius="2px",i.borderBottomRightRadius="2px")},_toggleControls:function(t){var e=document.getElementsByClassName("leaflet-control-container")[0];if(t)return e.style.display="block";e.style.display="none"},_toggleClasses:function(t,e){t.forEach(function(t){var i=document.getElementsByClassName(t)[0];if(e)return i.style.display="block";i.style.display="none"})},_a4PageSize:{height:715,width:1045}}),t.EasyPrint=function(e){return new t.Control.EasyPrint(e)}};var $t=class{constructor(t){t=Object(n.defaultValue)(t,{}),this.view=Object(n.defaultValue)(t.view,null),this.format=Object(n.defaultValue)(t.format,n.PictureFormat.png),this.filename=Object(n.defaultValue)(t.filename,"screenshotFile"),this.width=Object(n.defaultValue)(t.width,void 0),this.height=Object(n.defaultValue)(t.height,void 0),this.x=Object(n.defaultValue)(t.x,0),this.y=Object(n.defaultValue)(t.y,0),this.isDownload=Object(n.defaultValue)(t.isDownload,!0),this._print=void 0,this._initEasyPrint()}_initEasyPrint(){Wt(r)}_addView(){const t=this.view._innerView;if(t){const e={format:this.format,sizeModes:["Current","A4Landscape","A4Portrait"],filename:"新地图",exportOnly:!0,hidden:!0,hideControlContainer:!0};return this._print=r.EasyPrint(e).addTo(t),new Promise(t=>{this._print.printMap("CurrentSize",this.filename).then(e=>{this._cutImage(e.dataUrl).then(e=>{t({dataUrl:e.dataUrl})})})})}}_cutImage(t){const e=this,i=document.createElement("canvas");i.width=this.width,i.height=this.height;const r=i.getContext("2d"),o=function(t,e){const i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click()};return new Promise(s=>{if(this.width&&this.height){const a=new Image;a.src=t,a.onload=function(){r.drawImage(a,e.x,e.y,e.width,e.height,0,0,e.width,e.height);let t=null;e.format===n.PictureFormat.png?t=i.toDataURL():e.format===n.PictureFormat.jpeg?t=i.toDataURL("image/jpeg"):"svg"===e.format&&(t=i.toDataURL()),e.isDownload&&o(t,e.filename),s({dataUrl:t})}}else e.isDownload&&o(t,this.filename),s({dataUrl:t})})}_removeView(){super._removeView();const t=this.view._innerView;t&&this._print&&(t.removeControl(this._print),this._print=null)}};var Kt=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=q.addIGSMapImageLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"sublayerVisible":case"refresh":this._refresh();break;case"index":this.innerLayer.setZIndex(this.layer._realIndex);break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(j.convertClippingArea(t));break}}}return Promise.resolve(this)}_refresh(){const{innerLayer:t}=this;q.updateIGSMapImageLayer(this),t.refresh()}};class Qt extends n.BaseGraphicsLayerView{onAdd(t){const e=this.layer,i=this.innerView,n=e.graphics||[],o=this;o.innerLayer=r.featureGroup().addTo(i),o.innerLayer.commonLayerId=e.id;const s=o._getLayerViewVisible();return j.setVisibleOpacity(o.innerLayer,e._opacity,s),n.forEach(t=>{o._addFeature(o.innerLayer,t)}),Promise.resolve(this)}onRemove(t){return this.innerView.removeLayer(this.innerLayer),this.innerLayer=null,Promise.resolve(this)}onUpdate(t){const e=this.layer,i=this.innerLayer;return t.updateContent&&i&&t.updateContent.forEach(t=>{if(t&&"property"===t.operationType)switch(t.name){case"opacity":j.setVisibleOpacity(this.innerLayer,e._opacity,e._visible);break;case"visible":{const i=t.params&&t.params.length>0?t.params[0]:void 0,n=this._getLayerViewVisible(i);j.setVisibleOpacity(this.innerLayer,e._opacity,n);break}}if(t&&"method"===t.operationType)switch(t.name){case"add":{const e=t.params;this._addFeature(i,e[0]),this._updateGraphicsInOrder();break}case"remove":{const e=t.params;this._removeFeature(i,e[0]);break}case"addMany":{let e=t.params[0];e instanceof n.FeatureSet&&(e=e.features),e.forEach(t=>{this._addFeature(i,t)}),this._updateGraphicsInOrder();break}case"removeMany":t.params[0].forEach(t=>{this._removeFeature(i,t)});break;case"removeAll":i.clearLayers()}}),Promise.resolve(this)}_addFeature(t,e){e.geometry&&!e.geometry.spatialReference&&(e.geometry.spatialReference=this.layer.spatialReference),this.render.drawFeature(t,[e])}_removeFeature(t,e){this.render.clearFeature(t,[e])}_updateGraphicsInOrder(){const t=this.view.allLayerViews.toArray(),e=t.findIndex(t=>t.id===this.id);if(e>-1){const i=t.slice(e+1).find(t=>t instanceof Qt);i&&i!==this&&this._insertBeforeLayerView(i)}}_insertBeforeLayerView(t){const e=[];j.getLeafletGroupLayers(this.innerLayer,e,t=>t instanceof r.Path);const i=[];if(j.getLeafletGroupLayers(t.innerLayer,i,t=>t instanceof r.Path),0===i.length||0===e.length)return;const n=i[0];e.forEach(t=>{j.insertBefore(t._path,n._path)})}}var Jt=Qt;class te{}te.addEchartsLayer=function(t){const{layer:e,innerView:i}=t,{extendOptions:n={}}=e,r=Object.assign(e.echartsOptions,n),o=new Bt(i,r).addTo(i);return o.id=e.id,o},te.removeLayer=function(t){t.remove()};var ee=te;var ie=class extends n.LayerView{onAdd(t){const e=this.layer;return this.innerLayer=ee.addEchartsLayer(this),this.innerLayer.commonLayerId=e.commonLayerId,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide(),Promise.resolve(this)}onRemove(t){return ee.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0;this._getLayerViewVisible(t)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};class ne{}ne.addMapVLayer=function(t){const{layer:e,innerView:i}=t,{extendOptions:n={}}=e,r=Object.assign(e.mapVOptions,n);return new At(i,e.data,r).addTo(i).id=e.id,At},ne.removeLayer=function(t){t.remove()};var re=ne;var oe=class extends n.LayerView{onAdd(t){const e=this.layer;return this.innerLayer=re.addMapVLayer(this),this.innerLayer.commonLayerId=e.id,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide(),Promise.resolve(this)}onRemove(t){return re.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0;this._getLayerViewVisible(t)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};const se=r.Icon.extend({options:{iconUrl:null,iconRetinaUrl:null,shadowUrl:null,iconSize:[0,0],iconAnchor:[0,0],popupAnchor:[0,0],shadowSize:[0,0],className:"",prefix:"",glyph:"text",glyphColor:"white",lineHeight:1,horizontalAlignment:"center",verticalAlignment:"middle",font:{family:"微软雅黑",size:9,style:"normal",weight:"normal"},haloSize:0,haloColor:"#000000",angle:0,rotated:!1,backgroundColor:void 0,borderLineColor:"#ff0000",borderLineSize:0,lineWidth:192,kerning:!1,calcWidth:1},createIcon(){const t=document.createElement("div"),e=this.options;return e.glyph&&(this._textGlyph=this._createGlyph(),t.appendChild(this._textGlyph)),this._setIconStyles(t,e.className),t},_createGlyph(){let t,e;const i=this.options;i.prefix?t="fab"===i.prefix||"fal"===i.prefix||"far"===i.prefix||"fas"===i.prefix?`fa-${i.glyph}`:i.glyph.slice(0,i.prefix.length+1)===`${i.prefix}-`?i.glyph:`${i.prefix}-${i.glyph}`:(t="",e=i.glyph);const n=r.DomUtil.create("div");n.style.width="100%",n.style.height="100%",n.style.boxSizing="content-box",i.backgroundColor&&(n.style.backgroundColor=i.backgroundColor),i.borderLineColor&&i.borderLineSize&&(n.style.border=`${i.borderLineSize}px solid ${i.borderLineColor}`),i.rotated&&n.style.setProperty("transform",`rotate(${i.angle}deg)`);const o=r.DomUtil.create("span",`${i.prefix} ${t}`),s=0!==i.haloSize?r.DomUtil.create("span",`${i.prefix} ${t}`):void 0;return[s,o].forEach(t=>{if(t){const{size:n,weight:r,style:o,family:s,decoration:a}=i.font;t.style.fontSize=`${n}px`,t.style.fontWeight=r,t.style.fontStyle=o,t.style.fontFamily=s,t.style.color=i.glyphColor,t.style.lineHeight=i.lineHeight,t.style.textAlign=i.horizontalAlignment,t.style.verticalAlign=i.verticalAlignment,t.style.pointerEvents="none",t.style.display="inline-block",t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.textDecoration=a,i.kerning&&(t.style.transformOrigin="left",t.style.transform=`scale(${i.iconSize[0]/i.calcWidth},1)`),e&&(t.innerHTML=e)}}),s&&(s.style.setProperty("-webkit-text-stroke",`${i.haloSize}px ${i.haloColor}`),s.style.color="transparent",n.appendChild(s)),n.appendChild(o),n},_setIconStyles(t,e){if("shadow"===e)return r.Icon.prototype._setIconStyles.call(this,t,e);const i=this.options,n=r.point(i.iconSize);let o=r.point(i.iconAnchor);!o&&n&&(o=n.divideBy(2,!0)),t.className=`leaflet-marker-icon leaflet-glyph-icon ${e}`;const s=this._getIconUrl("icon");s&&(t.style.backgroundImage=`url('${s}')`),i.bgPos&&(t.style.backgroundPosition=`${-i.bgPos.x}px ${-i.bgPos.y}px`),i.bgSize&&(t.style.backgroundSize=`${i.bgSize.x}px ${i.bgSize.y}px`),o&&(t.style.marginLeft=`${-o.x}px`,t.style.marginTop=`${-o.y}px`),n&&(t.style.width=`${n.x}px`,t.style.height=`${n.y}px`)}});se.prototype.options.iconUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAUlSURBVFjDrZdLiBxVFIb/e289uqt6kkx6zIiIoKgLRReKuMhCcaOIAUEIiCCE4CIPggZ8kBjooPgM0TiYEUUjqBGchZqAQlyYRTA+kJiJQiJGMjN5zYzT3dP1rrr3HBeTjDGTSfc8Dvyruud89Z9z6kIJdBj31763MivsJXKuZYF6dak5++2mh7NOcsXVHq6sHbhOK/24kOJJMO4AE1vKygwZhxlKSHGKiD+RSu09vOXB43OCrHz96y6T2lsh+OmKXzFdlbLne2UopSAupBhjECcZgjDMgiiSxPhcK/nCr1sfOtcWcm/tq9uEsL4rl0vdK67pKVu2jUwTMk0wBBAzpBCQAnAtiZIlwWQwPlHPglZQAFj1Y23VwVkh92zbd59U+Kanp+p2L12mooKQ5AbcpuclS6LiKoRhxOfHzhXMcs3PtVV7Z0DufXH/LSzpSG9vr1/p6kIz0dDUrvx/IYXAsrJCkWc4e/Z0Zpgf+KX26A/TkNtrXziesY9Xq8tvWNZdVfVYg7hzwKVv3O3ZiKMWj46OTrq5fdOh1x5pSADwjdzo2nbv0u6qqkca2jCIMGcZAuqRhu8vEX7ZK2V2WgMAcXdtvyeKbPS662+osCohzMycHVweniNREoShoZO5KYobpciSh23bFq7rIUgNiLFghRkBlg2v7GlpiccsCHrcryzxUk3zmsNskeYGvt/lxVH4hMWEu9xSWaQFYQ7L1B6iGZ5bBoy+zWKiHiltFHpqeIsVhWaosg1iqlgg4wAAEYEXsV3EmNppJmExMFYUxfVSuIs6E0sI5FkBBhLJzH9laQxLSjBj0WQJgSJPweDTkknvS4JGbCuxKOt7UY4lEQfNnAu9TzLxN2nUdAQTLAEw8YIlAVgAkmDCSBL75eCutSeY+GTUqqNkqUVxUbIl4qgJo4vWzecrhyQAMJldYf1MXLLl1EIsYBZgoGwpRI2zMTPtGBhYbSQAlJF9lieRzNMIriVBzPOWawvoIkYaNC0u9IcAIAHgp75NLQl8ENbPZJ6jgAU48RyFqHEuZyE+Pda/vjENAQBD5s209Y+kPJlyM4+r3lUS0AWSyVEhpHnjYu1pyO+7N4ywwPvhxHDiuwo8j1b5rkQwMZIziYHBXetPzIAAgIV8exZOSMoieI6aU5vKtgR0jqw1JtiYbZfW/R/kSN+mcWbxdtwYjn1XTd9B7cQAfNdCWB/OhBR7jvWv/3tWCAAoO3ktjyZZJ0HHbsq2AooERVQXzPKly2vOgPz29jNNBr+e1IcSz5YAM4hmFzPDtyWS+lDK4N2DfU+dbgsBAFHyd+oszE3agt/GjWcrUBEjj5sQBb96pXpXhAzueDJi4u1p41TsuQpCiFln4bkKeXMoJeadg++tG+sYAgBBXOo3RRrruAnfkWDmGfIdCeQhiiQgQbxjtlqzQk59vCZlNluL5lDiORLyMjcA4DsKeXM4AfDKxa97ThAAqPaMfaR1Nq6jOiqOAhOm5TsKJg1QZGGRedY7V6tzVcjBWk1D0JZ8cigt2RJSimkXnqOgW8MxQLUTb6wN5g0BgGPV0c9BekTH41xx5YXrQ8FkTRgdpxU7ea9djbYQ1GokmJ43wUhWtgRcS04tQjAcw9CWw29tThYOAXD03XVfMps/TTTOy30blDZgiqxFK6p7OsnvCDJ1UD9LyUjORoPDkUQyPfdHbXW+qJCjfRsOwOAoNY4z6Xz01rHq3k5zO4ZMHTabYSIhJD87MLB64f8Ys8WdG/tfBljMJedfwY+s/2P4Pv8AAAAASUVORK5CYII=";var ae=se;function le(t,e){if(!t)return e;e.stroke=!0,e.color=n.Color.fromColor(t.color).toCssRGBAString(),e.weight=Object(n.defaultValue)(t.width,3),e.lineJoin=Object(n.defaultValue)(t.join,"round"),e.lineCap=Object(n.defaultValue)(t.cap,"round");let i=j.convertLineDash(t.style,"butt"===t.cap);i&&Array.isArray(i)&&(i=i.map(e=>t.width*e)),e.dashArray=i,e.marker=t.marker,e.noClip=!0}function he(t,e){if(!t)return e;"solid"!==t.style?e.fill=`url(${Object(n.createSimpleFillSymbolCanvas)(t,{lineWidth:1}).toDataURL()})`:e.fill=!0,e.fillColor=n.Color.fromColor(t.color).toCssRGBAString();const i={};le(t.outline,i);for(const t in i)e[t]=i[t]}var ue=class{static convertSymboltoLeafletStyle(t){const e={};if(!t)return e;switch(t.type){case n.SymbolType.simpleMarker:!function(t,e){Object(n.defined)(t.size)&&(e.radius=Object(n.defaultValue)(parseFloat(t.size)/2,10)),e.xoffset=t.xoffset,e.yoffset=t.yoffset,e.rotation=t.angle,e.shape=t.style,e.path=t.path,e.fill=!0,e.fillColor=n.Color.fromColor(t.color).toCssRGBAString();const i={};le(t.outline,i);for(const t in i)e[t]=i[t]}(t,e);break;case n.SymbolType.pictureMarker:!function(t,e){const i={},o=[10,10];Object(n.defined)(t.width)&&(o[0]=parseFloat(t.width)),Object(n.defined)(t.height)&&(o[1]=parseFloat(t.height)),i.iconSize=o,Object(n.defined)(t.url)&&(i.iconUrl=t.url);const s=[o[0]/2,o[1]/2];Object(n.defined)(t.xoffset)&&(s[0]=t.xoffset+s[0]),Object(n.defined)(t.yoffset)&&(s[1]=t.yoffset+s[1]),i.iconAnchor=s;const a=r.icon(i);e.icon=a,e.rotationAngle=t.angle}(t,e);break;case n.SymbolType.simpleLine:le(t,e);break;case n.SymbolType.simpleFill:he(t,e);break;case n.SymbolType.pictureFill:!function(t,e){if(!t)return e;const{width:i,height:n,xscale:r,yscale:o,xoffset:s,yoffset:a,url:l}=t;e.fill=`url(${l})`,e.fillDetail={width:i,height:n,xscale:r,yscale:o,xoffset:s,yoffset:a};const h={};le(t.outline,h);for(const t in h)e[t]=h[t]}(t,e);break;case n.SymbolType.text:!function(t,e){const i=j.getTextWidth(t.text,`${t.font.weight} ${t.font.size}px ${t.font.family}`);let r=i<t.lineWidth?i:t.lineWidth,o=Math.ceil(i/r);t.kerning&&(r=t.lineWidth,o=1);const s=t.font.size*t.lineHeight*o;let a=0,l=0;switch(t.horizontalAlignment){case"left":a=0;break;case"right":a=r;break;case"center":a=r/2;break;default:a=0}switch(t.verticalAlignment){case"baseline":l=s/2;break;case"top":l=0;break;case"middle":l=s/2;break;case"bottom":l=s;break;default:l=0}const h=[t.xoffset+a,t.yoffset+l],u={glyph:t.text,iconUrl:null,iconSize:[r,s],font:t.font,lineHeight:t.lineHeight,iconAnchor:h,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,glyphColor:n.Color.fromColor(t.color).toCssRGBAString(),haloSize:t.haloSize,haloColor:n.Color.fromColor(t.haloColor).toCssRGBAString(),angle:t.angle,rotated:t.rotated,backgroundColor:t.backgroundColor?n.Color.fromColor(t.backgroundColor).toCssRGBAString():void 0,borderLineColor:t.borderLineColor?n.Color.fromColor(t.borderLineColor).toCssRGBAString():void 0,borderLineSize:t.borderLineSize,lineWidth:t.lineWidth,kerning:t.kerning,calcWidth:i},c=new ae(u);e.icon=c}(t,e);break;default:he(t,e)}return e}};const ce=r.Marker.extend({options:{textIcon:null},onAdd(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this._initTextIcon(),this.update()},onRemove(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeTextIcon(),this._removeShadow()},setTextIcon(t){return this.options.textIcon=t,this._map&&(this._initTextIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},_initTextIcon(){if(!this.options.textIcon)return;const t=this.options,e=`leaflet-zoom-${this._zoomAnimated?"animated":"hide"}`,i=t.textIcon.createIcon(this._textIcon);let n=!1;i!==this._textIcon&&(this._textIcon&&this._removeTextIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),r.DomUtil.addClass(i,e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._textIcon=i,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._textIcon),this._initTextIconInteraction()},_removeTextIcon(){this._textIcon&&(r.DomUtil.remove(this._textIcon),this.removeInteractiveTarget(this._textIcon),this._textIcon=null)},_setPos(t){this._icon&&r.DomUtil.setPosition(this._icon,t),this._textIcon&&r.DomUtil.setPosition(this._textIcon,t),this._shadow&&r.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t),this._textIcon&&(this._textIcon.style.zIndex=this._zIndex+t)},_initTextIconInteraction(){if(this.options.interactive&&this._textIcon&&(r.DomUtil.addClass(this._textIcon,"leaflet-interactive"),this.addInteractiveTarget(this._textIcon),r.MarkerDrag)){let t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new r.MarkerDrag(this),t&&this.dragging.enable()}},_updateOpacity(){const t=this.options.opacity;this._icon&&r.DomUtil.setOpacity(this._icon,t),this._textIcon&&r.DomUtil.setOpacity(this._textIcon,t),this._shadow&&r.DomUtil.setOpacity(this._shadow,t)}});function pe(t,e,i,n,r){!function t(e,i,n,r,o){for(;r>n;){if(r-n>600){const s=r-n+1,a=i-n+1,l=Math.log(s),h=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*h*(s-h)/s)*(a-s/2<0?-1:1),c=Math.max(n,Math.floor(i-a*h/s+u)),p=Math.min(r,Math.floor(i+(s-a)*h/s+u));t(e,i,c,p,o)}const s=e[i];let a=n,l=r;for(fe(e,n,i),o(e[r],s)>0&&fe(e,n,r);a<l;){for(fe(e,a,l),a++,l--;o(e[a],s)<0;)a++;for(;o(e[l],s)>0;)l--}0===o(e[n],s)?fe(e,n,l):fe(e,++l,r),l<=i&&(n=l+1),i<=l&&(r=l-1)}}(t,e,i||0,n||t.length-1,r||de)}function fe(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function de(t,e){return t<e?-1:t>e?1:0}function ge(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function ye(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function me(t,e){_e(t,0,t.children.length,e,t)}function _e(t,e,i,n,r){r||(r=Ie(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=e;o<i;o++){const e=t.children[o];ve(r,t.leaf?n(e):e)}return r}function ve(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function xe(t,e){return t.minX-e.minX}function be(t,e){return t.minY-e.minY}function we(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Ee(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Ce(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function Le(t,e){const i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-i)*Math.max(0,o-n)}function Se(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Pe(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Ie(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Me(t,e,i,n,r){const o=[e,i];for(;o.length;){if((i=o.pop())-(e=o.pop())<=n)continue;const s=e+Math.ceil((i-e)/n/2)*n;pe(t,s,e,i,r),o.push(e,s,s,i)}}r.MarkerWithText=ce,ge.prototype.all=function(){return this._all(this.data,[])},ge.prototype.search=function(t){let e=this.data;const i=[];if(!Pe(t,e))return i;const n=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?n(s):s;Pe(t,a)&&(e.leaf?i.push(s):Se(t,a)?this._all(s,i):r.push(s))}e=r.pop()}return i},ge.prototype.collides=function(t){let e=this.data;if(!Pe(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const r=e.children[n],o=e.leaf?this.toBBox(r):r;if(Pe(t,o)){if(e.leaf||Se(t,o))return!0;i.push(r)}}e=i.pop()}return!1},ge.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this},ge.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},ge.prototype.clear=function(){return this.data=Ie([]),this},ge.prototype.remove=function(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),r=[],o=[];let s,a,l;for(;i||r.length;){if(i||(i=r.pop(),a=r[r.length-1],s=o.pop(),l=!0),i.leaf){const n=ye(t,i.children,e);if(-1!==n)return i.children.splice(n,1),r.push(i),this._condense(r),this}l||i.leaf||!Se(i,n)?a?(s++,i=a.children[s],l=!1):i=null:(r.push(i),o.push(s),s=0,a=i,i=i.children[0])}return this},ge.prototype.toBBox=function(t){return t},ge.prototype.compareMinX=function(t,e){return t.minX-e.minX},ge.prototype.compareMinY=function(t,e){return t.minY-e.minY},ge.prototype.toJSON=function(){return this.data},ge.prototype.fromJSON=function(t){return this.data=t,this},ge.prototype._all=function(t,e){const i=[];for(;t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},ge.prototype._build=function(t,e,i,n){const r=i-e+1;let o,s=this._maxEntries;if(r<=s)return me(o=Ie(t.slice(e,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,n-1))),(o=Ie([])).leaf=!1,o.height=n;const a=Math.ceil(r/s),l=a*Math.ceil(Math.sqrt(s));Me(t,e,i,l,this.compareMinX);for(let r=e;r<=i;r+=l){const e=Math.min(r+l-1,i);Me(t,r,e,a,this.compareMinY);for(let i=r;i<=e;i+=a){const r=Math.min(i+a-1,e);o.children.push(this._build(t,i,r,n-1))}}return me(o,this.toBBox),o},ge.prototype._chooseSubtree=function(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){let i=1/0,n=1/0,r=void 0;for(let o=0;o<e.children.length;o++){const s=e.children[o],a=we(s),l=Ce(t,s)-a;l<n?(n=l,i=a<i?a:i,r=s):l===n&&a<i&&(i=a,r=s)}e=r||e.children[0]}return e},ge.prototype._insert=function(t,e,i){const n=i?t:this.toBBox(t),r=[],o=this._chooseSubtree(n,this.data,e,r);for(o.children.push(t),ve(o,n);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},ge.prototype._split=function(t,e){const i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const o=this._chooseSplitIndex(i,r,n),s=Ie(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,me(i,this.toBBox),me(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)},ge.prototype._splitRoot=function(t,e){this.data=Ie([t,e]),this.data.height=t.height+1,this.data.leaf=!1,me(this.data,this.toBBox)},ge.prototype._chooseSplitIndex=function(t,e,i){let n,r=1/0,o=1/0;for(let s=e;s<=i-e;s++){const e=_e(t,0,s,this.toBBox),a=_e(t,s,i,this.toBBox),l=Le(e,a),h=we(e)+we(a);l<r?(r=l,n=s,o=h<o?h:o):l===r&&h<o&&(o=h,n=s)}return n||i-e},ge.prototype._chooseSplitAxis=function(t,e,i){const n=t.leaf?this.compareMinX:xe,r=t.leaf?this.compareMinY:be;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)},ge.prototype._allDistMargin=function(t,e,i,n){t.children.sort(n);const r=this.toBBox,o=_e(t,0,e,r),s=_e(t,i-e,i,r);let a=Ee(o)+Ee(s);for(let n=e;n<i-e;n++){const e=t.children[n];ve(o,t.leaf?r(e):e),a+=Ee(o)}for(let n=i-e-1;n>=e;n--){const e=t.children[n];ve(s,t.leaf?r(e):e),a+=Ee(s)}return a},ge.prototype._adjustParentBBoxes=function(t,e,i){for(let n=i;n>=0;n--)ve(e[n],t)},ge.prototype._condense=function(t){for(let e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():me(t[e],this.toBBox)};const Te=r.MarkerClusterGroup=r.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:r.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{},maxClusterNum:0,deconflictionStrategy:"none"},initialize(t){r.Util.setOptions(this,t),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=r.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=r.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd},this._rbush=new ge;const e=r.DomUtil.TRANSITION&&this.options.animate;r.extend(this,e?this._withAnimation:this._noAnimation),this._markerCluster=e?r.MarkerCluster:r.MarkerClusterNonAnimated},addLayer(t){if(t instanceof r.LayerGroup)return this.addLayers([t]);if(!t.getLatLng)return this._nonPointGroup.addLayer(t),this.fire("layeradd",{layer:t}),this;if(!this._map)return this._needsClustering.push(t),this.fire("layeradd",{layer:t}),this;if(this.hasLayer(t))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(t,this._maxZoom),this.fire("layeradd",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();let e=t;const i=this._zoom;if(t.__parent)for(;e.__parent._zoom>=i;)e=e.__parent;return this._currentShownBounds.contains(e.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(t,e):this._animationAddLayerNonAnimated(t,e)),this},removeLayer(t){return t instanceof r.LayerGroup?this.removeLayers([t]):t.getLatLng?this._map?t.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(t)),this._removeLayer(t,!0),this.fire("layerremove",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),t.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(t)&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,t)&&this.hasLayer(t)&&this._needsRemoving.push({layer:t,latlng:t._latlng}),this.fire("layerremove",{layer:t}),this):(this._nonPointGroup.removeLayer(t),this.fire("layerremove",{layer:t}),this)},addLayers(t,e){if(!r.Util.isArray(t))return this.addLayer(t);const i=this._featureGroup,n=this._nonPointGroup,o=this.options.chunkedLoading,s=this.options.chunkInterval,a=this.options.chunkProgress;let l,h=t.length,u=0,c=!0;if(this._map){const f=(new Date).getTime();var p=r.bind(function(){const d=(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();u<h;u++){if(o&&u%200==0){if((new Date).getTime()-d>s)break}if((l=t[u])instanceof r.LayerGroup)c&&(t=t.slice(),c=!1),this._extractNonGroupLayers(l,t),h=t.length;else if(l.getLatLng){if(!this.hasLayer(l)&&(this._addLayer(l,this._maxZoom),e||this.fire("layeradd",{layer:l}),l.__parent&&2===l.__parent.getChildCount())){const t=l.__parent.getAllChildMarkers(),e=t[0]===l?t[1]:t[0];i.removeLayer(e)}}else n.addLayer(l),e||this.fire("layeradd",{layer:l})}a&&a(u,h,(new Date).getTime()-f),u===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds,this._rbush,this.options.deconflictionStrategy)):setTimeout(p,this.options.chunkDelay)},this);p()}else{const e=this._needsClustering;for(;u<h;u++)(l=t[u])instanceof r.LayerGroup?(c&&(t=t.slice(),c=!1),this._extractNonGroupLayers(l,t),h=t.length):l.getLatLng?this.hasLayer(l)||e.push(l):n.addLayer(l)}return this},removeLayers(t){let e,i,n=t.length;const o=this._featureGroup,s=this._nonPointGroup;let a=!0;if(!this._map){for(e=0;e<n;e++)(i=t[e])instanceof r.LayerGroup?(a&&(t=t.slice(),a=!1),this._extractNonGroupLayers(i,t),n=t.length):(this._arraySplice(this._needsClustering,i),s.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();const o=t.slice();let s=n;for(e=0;e<s;e++)(i=o[e])instanceof r.LayerGroup?(this._extractNonGroupLayers(i,o),s=o.length):this._unspiderfyLayer(i)}for(e=0;e<n;e++)(i=t[e])instanceof r.LayerGroup?(a&&(t=t.slice(),a=!1),this._extractNonGroupLayers(i,t),n=t.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),o.hasLayer(i)&&(o.removeLayer(i),i.clusterShow&&i.clusterShow())):(s.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(t){t.off(this._childMarkerEventHandlers,this),delete t.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds(){const t=new r.LatLngBounds;this._topClusterLevel&&t.extend(this._topClusterLevel._bounds);for(let e=this._needsClustering.length-1;e>=0;e--)t.extend(this._needsClustering[e].getLatLng());return t.extend(this._nonPointGroup.getBounds()),t},eachLayer(t,e){const i=this._needsClustering.slice(),n=this._needsRemoving;let r,o,s;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(i),o=i.length-1;o>=0;o--){for(r=!0,s=n.length-1;s>=0;s--)if(n[s].layer===i[o]){r=!1;break}r&&t.call(e,i[o])}this._nonPointGroup.eachLayer(t,e)},getLayers(){const t=[];return this.eachLayer(function(e){t.push(e)}),t},getLayer(t){let e=null;return t=parseInt(t,10),this.eachLayer(function(i){r.stamp(i)===t&&(e=i)}),e},hasLayer(t){if(!t)return!1;let e,i=this._needsClustering;for(e=i.length-1;e>=0;e--)if(i[e]===t)return!0;for(e=(i=this._needsRemoving).length-1;e>=0;e--)if(i[e].layer===t)return!1;return!(!t.__parent||t.__parent._group!==this)||this._nonPointGroup.hasLayer(t)},zoomToShowLayer(t,e){const i=this._map;"function"!=typeof e&&(e=function(){});var n=function(){!i.hasLayer(t)&&!i.hasLayer(t.__parent)||this._inZoomAnimation||(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(t)?e():t.__parent._icon&&(this.once("spiderfied",e,this),t.__parent.spiderfy()))};t._icon&&this._map.getBounds().contains(t.getLatLng())?e():t.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",n,this),this._map.panTo(t.getLatLng())):(this._map.on("moveend",n,this),this.on("animationend",n,this),t.__parent.zoomToBounds())},onAdd(t){let e,i,n;for(this._map=t,this._featureGroup.addTo(t),this._nonPointGroup.addTo(t),this._gridClusters||this._generateInitialClusters(),this._maxLat=t.options.crs.projection.MAX_LATITUDE,e=0,i=this._needsRemoving.length;e<i;e++)(n=this._needsRemoving[e]).newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(e=0,i=this._needsRemoving.length;e<i;e++)n=this._needsRemoving[e],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0),this.forceAnimation()},onRemove(t){t.off("zoomend",this._zoomEnd,this),t.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent(t){let e=t;for(;e&&!e._icon;)e=e.__parent;return e||null},_arraySplice(t,e){for(let i=t.length-1;i>=0;i--)if(t[i]===e)return t.splice(i,1),!0},_removeFromGridUnclustered(t,e){const i=this._map,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());for(;e>=r&&n[e].removeObject(t,i.project(t.getLatLng(),e));e--);},_childMarkerDragStart(t){t.target.__dragStart=t.target._latlng},_childMarkerMoved(t){if(!this._ignoreMove&&!t.target.__dragStart){const e=t.target._popup&&t.target._popup.isOpen();this._moveChild(t.target,t.oldLatLng,t.latlng),e&&t.target.openPopup()}},_moveChild(t,e,i){t._latlng=e,this.removeLayer(t),t._latlng=i,this.addLayer(t)},_childMarkerDragEnd(t){const e=t.target.__dragStart;delete t.target.__dragStart,e&&this._moveChild(t.target,e,t.target._latlng)},_removeLayer(t,e,i){const n=this._gridClusters,r=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());e&&this._removeFromGridUnclustered(t,this._maxZoom);let l=t.__parent;const h=l._markers;let u;for(this._arraySplice(h,t);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)e&&l._childCount<=1?(u=l._markers[0]===t?l._markers[1]:l._markers[0],n[l._zoom].removeObject(l,s.project(l._cLatLng,l._zoom)),r[l._zoom].addObject(u,s.project(u.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(u),u.__parent=l.__parent,l._icon&&(o.removeLayer(l),i||o.addLayer(u))):l._iconNeedsUpdate=!0,l=l.__parent;delete t.__parent},_isOrIsParent(t,e){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},fire(t,e,i){if(e&&e.layer instanceof r.MarkerCluster){if(e.originalEvent&&this._isOrIsParent(e.layer._icon,e.originalEvent.relatedTarget))return;t=`cluster${t}`}r.FeatureGroup.prototype.fire.call(this,t,e,i)},listens(t,e){return r.FeatureGroup.prototype.listens.call(this,t,e)||r.FeatureGroup.prototype.listens.call(this,`cluster${t}`,e)},_defaultIconCreateFunction(t){const e=t.getChildCount();let i=" marker-cluster-";return i+=e<10?"small":e<100?"medium":"large",new r.DivIcon({html:`<div><span>${e} <span aria-label="markers"></span>`+"</span></div>",className:`marker-cluster${i}`,iconSize:new r.Point(40,40)})},_bindEvents(){const t=this._map,e=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom;(e||n||r)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),t.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy(t){const e=t.layer;let i=e;if(!("clusterkeypress"===t.type&&t.originalEvent&&13!==t.originalEvent.keyCode||t.originalEvent.defaultPrevented)){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===e._childCount&&this.options.spiderfyOnMaxZoom?e.spiderfy():this.options.zoomToBoundsOnClick&&e.zoomToBounds(),this.options.spiderfyOnEveryZoom&&e.spiderfy(),t.originalEvent&&13===t.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage(t){const e=this._map;this._inZoomAnimation||(this._shownPolygon&&e.removeLayer(this._shownPolygon),t.layer.getChildCount()>2&&t.layer!==this._spiderfied&&(this._shownPolygon=new r.Polygon(t.layer.getConvexHull(),this.options.polygonOptions),e.addLayer(this._shownPolygon)))},_hideCoverage(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents(){const t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,r=this._map;(t||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),e&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),r.off("zoomend",this._hideCoverage,this))},_zoomEnd(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd(){if(this._inZoomAnimation)return;const t=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),t),this._currentShownBounds=t},_generateInitialClusters(){let t=Math.ceil(this._map.getMaxZoom());const e=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius;let n=i;if("function"!=typeof i&&(n=function(){return i}),null!==this.options.disableClusteringAtZoom&&(t=this.options.disableClusteringAtZoom-1),this._maxZoom=t,this._gridClusters={},this._gridUnclustered={},!isFinite(t))throw"Map has no maxZoom specified";if(!isFinite(e))throw"Map has no minZoom specified";for(let i=t;i>=e;i--)this._gridClusters[i]=new r.DistanceGrid(n(i)),this._gridUnclustered[i]=new r.DistanceGrid(n(i));this._topClusterLevel=new this._markerCluster(this,e-1)},_addLayer(t,e){const i=this._gridClusters,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());let o,s;this.options.singleMarkerMode&&this._overrideMarkerIcon(t),t.on(this._childMarkerEventHandlers,this);const a=this.options.maxClusterNum;for(;e>=r;e--){o=this._map.project(t.getLatLng(),e);const r=i[e].getNearObjectArr(o);if(r&&Array.isArray(r)&&r.length>0)for(let e=0;e<r.length;e++){const i=r[e].obj,n=i.getChildCount(),o=i.getAllChildMarkers();if(n>=a-1||o&&Array.isArray(o)&&o.length>0&&o[0].options&&t.options&&t.options.groupName===o[0].options.groupName)return i._addChild(t),void(t.__parent=i)}const u=n[e].getNearObjectArr(o);if(u&&Array.isArray(u)){let n=[],r=[];var l;const o=u.length;if(u.length>0)if(o>=a-1)u.forEach(t=>{n.push(t.obj),r.push(t.obj)}),r.push(t),l=r[0].__parent;else{for(let e=0;e<u.length;e++){const{obj:i,dist:o}=u[e];if(i.options&&t.options&&t.options.groupName===i.options.groupName){r=[i,t],n=[i];break}}r.length>0&&(l=r[0].__parent)}if(r.length>0&&l){n.forEach(t=>{t.__parent&&this._removeLayer(t,!1)});var h=new this._markerCluster(this,e);r.forEach(t=>{h._addChild(t),t.__parent=h}),i[e].addObject(h,this._map.project(h._cLatLng,e));let t=h;for(s=e-1;s>l._zoom;s--)t=new this._markerCluster(this,s,t),i[s].addObject(t,this._map.project(h._cLatLng,s));return l._addChild(t),void n.forEach(t=>{this._removeFromGridUnclustered(t,e)})}}n[e].addObject(t,o)}this._topClusterLevel._addChild(t),t.__parent=this._topClusterLevel},_refreshClustersIcons(){this._featureGroup.eachLayer(function(t){t instanceof r.MarkerCluster&&t._iconNeedsUpdate&&t._updateIcon()})},_enqueue(t){this._queue.push(t),this._queueTimeout||(this._queueTimeout=setTimeout(r.bind(this._processQueue,this),300))},_processQueue(){for(let t=0;t<this._queue.length;t++)this._queue[t].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters(){const t=Math.round(this._map._zoom);this._processQueue(),this._zoom<t&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,t)):this._zoom>t?(this._animationStart(),this._animationZoomOut(this._zoom,t)):this._moveEnd()},_getExpandedVisibleBounds(){return this.options.removeOutsideVisibleBounds?r.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat(t){const e=this._maxLat;return void 0!==e&&(t.getNorth()>=e&&(t._northEast.lat=1/0),t.getSouth()<=-e&&(t._southWest.lat=-1/0)),t},_animationAddLayerNonAnimated(t,e){if(e===t)this._featureGroup.addLayer(t);else if(2===e._childCount){e._addToMap();const t=e.getAllChildMarkers();this._featureGroup.removeLayer(t[0]),this._featureGroup.removeLayer(t[1])}else e._updateIcon()},_extractNonGroupLayers(t,e){const i=t.getLayers();let n,o=0;for(e=e||[];o<i.length;o++)(n=i[o])instanceof r.LayerGroup?this._extractNonGroupLayers(n,e):e.push(n);return e},_overrideMarkerIcon(t){return t.getChildCount=function(){return 1},t.getAllChildMarkers=function(){return[t]},t.options.icon=this.options.iconCreateFunction(t)},_animationCreateMarkerIcon(t){!t||t.isRefreshIcon||this.options.singleMarkerMode||(this._overrideMarkerIcon(t),t.isRefreshIcon=!0)}});r.MarkerClusterGroup.include({_mapBoundsInfinite:new r.LatLngBounds(new r.LatLng(-1/0,-1/0),new r.LatLng(1/0,1/0))}),r.MarkerClusterGroup.include({_noAnimation:{_animationStart(){},_animationZoomIn(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer(t,e){this._animationAddLayerNonAnimated(t,e)}},_withAnimation:{_animationStart(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn(t,e){const i=this._getExpandedVisibleBounds(),n=this._featureGroup,o=Math.floor(this._map.getMinZoom());let s;this._ignoreMove=!0,this._rbush.clear();const a=this;this._topClusterLevel._recursively(i,t,o,function(r){let o=r._latlng;const a=r._markers;let l;for(i.contains(o)||(o=null),r._isSingleParent()&&t+1===e?(n.removeLayer(r),r._recursivelyAddChildrenToMap(null,e,i)):(r.clusterHide(),r._recursivelyAddChildrenToMap(o,e,i)),s=a.length-1;s>=0;s--)l=a[s],i.contains(l._latlng)||n.removeLayer(l)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(i,e),n.eachLayer(function(t){t instanceof r.MarkerCluster||!t._icon||t.clusterShow()}),this._topClusterLevel._recursively(i,t,e,function(t){a._ignoreMove=!0,t._recursivelyRestoreChildPositions(e,a._rbush,a.options.deconflictionStrategy),a._ignoreMove=!1}),this._topClusterLevel._recursively(i,Math.floor(this._map.getMinZoom()),e-1,function(t){a._ignoreMove=!0,t._recursivelyRestoreChildMarkerPositions(e,i,a._rbush,a.options.deconflictionStrategy),a._ignoreMove=!1}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(i,t,o,function(t){n.removeLayer(t),t.clusterShow()}),this._animationEnd()})},_animationZoomOut(t,e){this._rbush.clear(),this._animationZoomOutSingle(this._topClusterLevel,t-1,e),this._ignoreMove=!0,this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds(),this._rbush,this.options.deconflictionStrategy),this._ignoreMove=!1,this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t,this._getExpandedVisibleBounds())},_animationAddLayer(t,e){const i=this,n=this._featureGroup;n.addLayer(t),e!==t&&(e._childCount>2?(e._updateIcon(),this._forceLayout(),this._animationStart(),t._setPos(this._map.latLngToLayerPoint(e.getLatLng())),t.clusterHide(),this._enqueue(function(){n.removeLayer(t),t.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(e,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle(t,e,i){const n=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());t._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,e+1,i);const o=this;this._forceLayout(),t._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===t._childCount){const e=t._markers[0];this._ignoreMove=!0,e.setLatLng(e.getLatLng()),this._ignoreMove=!1,e.clusterShow&&e.clusterShow()}else t._recursively(n,i,r,function(t){t._recursivelyRemoveChildrenFromMap(n,r,e+1)});o._animationEnd()})},_animationEnd(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout(){r.Util.falseFn(document.body.offsetWidth)},forceAnimation(){const t=this._map.getZoom();this._animationStart(),this._animationZoomIn(t-1,t)}}),r.markerClusterGroup=function(t){return new r.MarkerClusterGroup(t)};var Oe=r.MarkerCluster=r.MarkerWithText.extend({options:r.Icon.prototype.options,initialize(t,e,i,n){r.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new r.LatLng(0,0),{icon:this,pane:t.options.clusterPane}),this._group=t,this._zoom=e,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new r.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers(t,e){t=t||[];for(let i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(t,e);for(let i=this._markers.length-1;i>=0;i--)e&&this._markers[i].__dragStart||t.push(this._markers[i]);return t},getChildCount(){return this._childCount},zoomToBounds(t){let e=this._childClusters.slice();const i=this._group._map,n=i.getBoundsZoom(this._bounds);let r=this._zoom+1;const o=i.getZoom();let s;for(;e.length>0&&n>r;){r++;let t=[];for(s=0;s<e.length;s++)t=t.concat(e[s]._childClusters);e=t}n>r?this._group._map.setView(this._latlng,r):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,t)},getBounds(){const t=new r.LatLngBounds;return t.extend(this._bounds),t},_updateIcon(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow(){return this._iconObj.createShadow()},_addChild(t,e){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(t),t instanceof r.MarkerCluster?(e||(this._childClusters.push(t),t.__parent=this),this._childCount+=t._childCount):(e||this._markers.push(t),this._childCount++),this.__parent&&this.__parent._addChild(t,!0)},_setClusterCenter(t){this._cLatLng||(this._cLatLng=t._cLatLng||t._latlng)},_resetBounds(){const t=this._bounds;t._southWest&&(t._southWest.lat=1/0,t._southWest.lng=1/0),t._northEast&&(t._northEast.lat=-1/0,t._northEast.lng=-1/0)},_recalculateBounds(){const t=this._markers,e=this._childClusters;let i=0,n=0;const o=this._childCount;let s,a,l,h;if(0!==o){for(this._resetBounds(),s=0;s<t.length;s++)l=t[s]._latlng,this._bounds.extend(l),i+=l.lat,n+=l.lng;for(s=0;s<e.length;s++)(a=e[s])._boundsNeedUpdate&&a._recalculateBounds(),this._bounds.extend(a._bounds),l=a._wLatLng,h=a._childCount,i+=l.lat*h,n+=l.lng*h;this._latlng=this._wLatLng=new r.LatLng(i/o,n/o),this._boundsNeedUpdate=!1}},_addToMap(t){t&&(this._backupLatlng=this._latlng,this.setLatLng(t)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn(t,e,i){this._recursively(t,this._group._map.getMinZoom(),i-1,function(t){const i=t._markers;let n,r;for(n=i.length-1;n>=0;n--)(r=i[n])._icon&&(r._setPos(e),r.clusterHide())},function(t){const i=t._childClusters;let n,r;for(n=i.length-1;n>=0;n--)(r=i[n])._icon&&(r._setPos(e),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap(t,e,i,n){this._recursively(t,n,e,function(r){r._recursivelyAnimateChildrenIn(t,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(t,e,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible(t,e){this._recursively(t,this._group._map.getMinZoom(),e,null,function(t){t.clusterShow()})},_recursivelyAddChildrenToMap(t,e,i,n,r){const o=this;this._recursively(i,this._group._map.getMinZoom()-1,e,function(s){if(e!==s._zoom)for(let a=s._markers.length-1;a>=0;a--){const l=s._markers[a];i.contains(l._latlng)&&(t&&(l._backupLatlng=l.getLatLng(),l.setLatLng(t),l.clusterHide&&l.clusterHide()),s._group._animationCreateMarkerIcon(l),s._group._featureGroup.addLayer(l),"static"===r&&o._adjustClusterOrMarkerStatus(l,n,e))}},function(i){i._addToMap(t),"static"===r&&o._adjustClusterOrMarkerStatus(i,n,e)})},_getAdjustPoint(t,e,i){const n=2*i,o=r.point(e.x-t.x,e.y-t.y),s=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return t.add(o._divideBy(s)._multiplyBy(n))},_calcAdjustPoint(t,e,i,n){const o=n*Math.SQRT2;let s,a,l=i,h=n;a=t.search(l);do{let t,i,u,c;a.forEach(e=>{t=Math.min(void 0===t?e.minX:t,e.minX),i=Math.min(void 0===i?e.minY:i,e.minY),u=Math.max(void 0===u?e.maxX:u,e.maxX),c=Math.max(void 0===c?e.maxY:c,e.maxY)});const p=r.point((u+t)/2,(i+c)/2);if(s=this._getAdjustPoint(p,e,h),h>o)return null;h+=1,l={minX:s.x-n,minY:s.y-n,maxX:s.x+n,maxY:s.y+n,point:s}}while(t.collides(l));return s},_adjustClusterOrMarkerStatus(t,e,i){if(t&&e&&e){let n,r;i=i||this._zoom,t instanceof Oe?(n=t._group._map,r=t._iconObj):(n=t._map,r=t.options.icon);const o=n.latLngToLayerPoint(t.getLatLng(),i);if(!r)return;if(isNaN(o.x)||isNaN(o.y))return;const s=r.options.iconSize,a=Math.max(s.x,s.y)/2;let l={minX:o.x-a,minY:o.y-a,maxX:o.x+a,maxY:o.y+a,point:o,obj:t};if(e.collides(l)){e.search(l);const r=this._calcAdjustPoint(e,o,l,a);if(!r||isNaN(r.x)||isNaN(r.y))return void t.setOpacity(0);const s=n.layerPointToLatLng(r,i);t.setLatLng(s),l={minX:r.x-a,minY:r.y-a,maxX:r.x+a,maxY:r.y+a,point:r,obj:t}}e.insert(l)}},_recursivelyRestoreChildMarkerPositions(t,e,i,n){for(let r=this._markers.length-1;r>=0;r--){const o=this._markers[r];o._backupLatlng&&(o.setLatLng(o._backupLatlng),delete o._backupLatlng),o&&o._map&&e&&e.contains(o._latlng)&&"static"===n&&this._adjustClusterOrMarkerStatus(o,i,t)}},_recursivelyRestoreChildPositions(t,e,i){const n=this._childClusters.slice().sort((t,e)=>t._childCount-e._childCount);if(t-1===this._zoom)for(let r=n.length-1;r>=0;r--)n[r]._restorePosition(),"static"===i&&this._adjustClusterOrMarkerStatus(n[r],e,t);else for(let e=this._childClusters.length-1;e>=0;e--)this._childClusters[e]._recursivelyRestoreChildPositions(t)},_restorePosition(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap(t,e,i,n){let r,o;this._recursively(t,e-1,i-1,function(t){for(o=t._markers.length-1;o>=0;o--)r=t._markers[o],n&&n.contains(r._latlng)||(t._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(t){for(o=t._childClusters.length-1;o>=0;o--)r=t._childClusters[o],n&&n.contains(r._latlng)||(t._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively(t,e,i,n,r){const o=this._childClusters,s=this._zoom;let a,l;if(e<=s&&(r&&s===i&&r(this),n&&n(this)),o.sort((t,e)=>t._childCount-e._childCount),s<e||s<i)for(a=o.length-1;a>=0;a--)(l=o[a])._boundsNeedUpdate&&l._recalculateBounds(),t.intersects(l._bounds)&&l._recursively(t,e,i,n,r)},_isSingleParent(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});function Ne(t,e,i,n){return t.evaluate({$feature:e,$cluster_count:i,$is_same_group:n})}function Ae(t,e){for(let i=0;i<t.length;i++){const n=t[i];if(void 0!==n.value){if(n.value===e)return n}else if("undefined"!==n.minValue&&void 0!==n.maxValue&&(e=parseFloat(e),n.minValue<=e&&n.maxValue>e&&!isNaN(e)))return n}return null}function Re(t,e,i,n,r,o){const s=Ae(o,Ne(e,i,n,r));if(s){const e=t.findIndex(t=>t.object===s);if(e>-1)return t[e].groupName;{const e={groupName:String(t.length),object:s};return t.push(e),e.groupName}}return t[0].groupName}r.Marker.include({clusterHide(){const t=this.options.opacity;return this.setOpacity(0),this.options.opacity=t,this},clusterShow(){return this.setOpacity(this.options.opacity)}}),r.DistanceGrid=function(t){this._cellSize=t,this._sqCellSize=t*t,this._grid={},this._objectPoint={}},r.DistanceGrid.prototype={addObject(t,e){const i=this._getCoord(e.x),n=this._getCoord(e.y),o=this._grid,s=o[n]=o[n]||{},a=s[i]=s[i]||[],l=r.Util.stamp(t);this._objectPoint[l]=e,a.push(t)},updateObject(t,e){this.removeObject(t,e),this.addObject(t,e)},removeObject(t,e){const i=this._getCoord(e.x),n=this._getCoord(e.y),o=this._grid,s=o[n]=o[n]||{},a=s[i]=s[i]||[];let l,h;for(delete this._objectPoint[r.Util.stamp(t)],l=0,h=a.length;l<h;l++)if(a[l]===t)return a.splice(l,1),1===h&&delete s[i],!0},eachObject(t,e){let i,n,r,o,s,a,l;const h=this._grid;for(i in h)for(n in s=h[i])for(r=0,o=(a=s[n]).length;r<o;r++)(l=t.call(e,a[r]))&&(r--,o--)},getNearObject(t){const e=this._getCoord(t.x),i=this._getCoord(t.y);let n,o,s,a,l,h,u,c;const p=this._objectPoint;let f=this._sqCellSize,d=null;for(n=i-1;n<=i+1;n++)if(a=this._grid[n])for(o=e-1;o<=e+1;o++)if(l=a[o])for(s=0,h=l.length;s<h;s++)u=l[s],((c=this._sqDist(p[r.Util.stamp(u)],t))<f||c<=f&&null===d)&&(f=c,d=u);return d},getNearObjectArr(t,e){const i=this._getCoord(t.x),n=this._getCoord(t.y);let o,s,a,l,h,u,c,p;const f=this._objectPoint;let d=e||this._sqCellSize;const g=[];for(o=n-1;o<=n+1;o++)if(l=this._grid[o])for(s=i-1;s<=i+1;s++)if(h=l[s])for(a=0,u=h.length;a<u;a++)c=h[a],(p=this._sqDist(f[r.Util.stamp(c)],t))<=d&&(d=p,g.push({obj:c,dist:p,point:f[r.Util.stamp(c)]}));return g.sort((t,e)=>t.dist-e.dist),g},_getCoord(t){const e=Math.floor(t/this._cellSize);return isFinite(e)?e:t},_sqDist(t,e){const i=e.x-t.x,n=e.y-t.y;return i*i+n*n}},r.QuickHull={getDistant(t,e){const i=e[1].lat-e[0].lat;return(e[0].lng-e[1].lng)*(t.lat-e[0].lat)+i*(t.lng-e[0].lng)},findMostDistantPointFromBaseLine(t,e){let i=0,n=null;const r=[];let o,s,a;for(o=e.length-1;o>=0;o--)s=e[o],(a=this.getDistant(s,t))>0&&(r.push(s),a>i&&(i=a,n=s));return{maxPoint:n,newPoints:r}},buildConvexHull(t,e){let i=[];const n=this.findMostDistantPointFromBaseLine(t,e);return n.maxPoint?i=(i=i.concat(this.buildConvexHull([t[0],n.maxPoint],n.newPoints))).concat(this.buildConvexHull([n.maxPoint,t[1]],n.newPoints)):[t[0]]},getConvexHull(t){let e,i=!1,n=!1,r=!1,o=!1,s=null,a=null,l=null,h=null,u=null,c=null;for(e=t.length-1;e>=0;e--){const u=t[e];(!1===i||u.lat>i)&&(s=u,i=u.lat),(!1===n||u.lat<n)&&(a=u,n=u.lat),(!1===r||u.lng>r)&&(l=u,r=u.lng),(!1===o||u.lng<o)&&(h=u,o=u.lng)}return n!==i?(c=a,u=s):(c=h,u=l),[].concat(this.buildConvexHull([c,u],t),this.buildConvexHull([u,c],t))}},r.MarkerCluster.include({getConvexHull(){const t=this.getAllChildMarkers(),e=[];let i,n;for(n=t.length-1;n>=0;n--)i=t[n].getLatLng(),e.push(i);return r.QuickHull.getConvexHull(e)}}),r.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy(){if(this._group._spiderfied===this||this._group._inZoomAnimation)return;const t=this.getAllChildMarkers(null,!0),e=this._group._map.latLngToLayerPoint(this._latlng);let i;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?i=this._group.options.spiderfyShapePositions(t.length,e):t.length>=this._circleSpiralSwitchover?i=this._generatePointsSpiral(t.length,e):(e.y+=10,i=this._generatePointsCircle(t.length,e)),this._animationSpiderfy(t,i)},unspiderfy(t){this._group._inZoomAnimation||(this._animationUnspiderfy(t),this._group._spiderfied=null)},_generatePointsCircle(t,e){let i=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+t)/this._2PI;const n=this._2PI/t,o=[];let s,a;for(i=Math.max(i,35),o.length=t,s=0;s<t;s++)a=this._circleStartAngle+s*n,o[s]=new r.Point(e.x+i*Math.cos(a),e.y+i*Math.sin(a))._round();return o},_generatePointsSpiral(t,e){const i=this._group.options.spiderfyDistanceMultiplier;let n=i*this._spiralLengthStart;const o=i*this._spiralFootSeparation,s=i*this._spiralLengthFactor*this._2PI;let a=0;const l=[];let h;for(l.length=t,h=t;h>=0;h--)h<t&&(l[h]=new r.Point(e.x+n*Math.cos(a),e.y+n*Math.sin(a))._round()),n+=s/(a+=o/n+5e-4*h);return l},_noanimationUnspiderfy(){const t=this._group,e=t._map,i=t._featureGroup,n=this.getAllChildMarkers(null,!0);let r,o;for(t._ignoreMove=!0,this.setOpacity(1),o=n.length-1;o>=0;o--)r=n[o],i.removeLayer(r),r._preSpiderfyLatlng&&(r.setLatLng(r._preSpiderfyLatlng),delete r._preSpiderfyLatlng),r.setZIndexOffset&&r.setZIndexOffset(0),r._spiderLeg&&(e.removeLayer(r._spiderLeg),delete r._spiderLeg);t.fire("unspiderfied",{cluster:this,markers:n}),t._ignoreMove=!1,t._spiderfied=null}}),r.MarkerClusterNonAnimated=r.MarkerCluster.extend({_animationSpiderfy(t,e){const i=this._group,n=i._map,o=i._featureGroup,s=this._group.options.spiderLegPolylineOptions;let a,l,h,u;for(i._ignoreMove=!0,a=0;a<t.length;a++)u=n.layerPointToLatLng(e[a]),l=t[a],h=new r.Polyline([this._latlng,u],s),n.addLayer(h),l._spiderLeg=h,l._preSpiderfyLatlng=l._latlng,l.setLatLng(u),l.setZIndexOffset&&l.setZIndexOffset(1e6),o.addLayer(l);this.setOpacity(.3),i._ignoreMove=!1,i.fire("spiderfied",{cluster:this,markers:t})},_animationUnspiderfy(){this._noanimationUnspiderfy()}}),r.MarkerCluster.include({_animationSpiderfy(t,e){const i=this,n=this._group,o=n._map,s=n._featureGroup,a=this._latlng,l=o.latLngToLayerPoint(a),h=r.Path.SVG,u=r.extend({},this._group.options.spiderLegPolylineOptions);let c,p,f,d,g,y,m=u.opacity;for(void 0===m&&(m=r.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),h?(u.opacity=0,u.className=`${u.className||""} leaflet-cluster-spider-leg`):u.opacity=m,n._ignoreMove=!0,c=0;c<t.length;c++)p=t[c],n._animationCreateMarkerIcon(p),y=o.layerPointToLatLng(e[c]),f=new r.Polyline([a,y],u),o.addLayer(f),p._spiderLeg=f,h&&(g=(d=f._path).getTotalLength()+.1,d.style.strokeDasharray=g,d.style.strokeDashoffset=g),p.setZIndexOffset&&p.setZIndexOffset(1e6),p.clusterHide&&p.clusterHide(),s.addLayer(p),p._setPos&&p._setPos(l);for(n._forceLayout(),n._animationStart(),c=t.length-1;c>=0;c--)y=o.layerPointToLatLng(e[c]),(p=t[c])._preSpiderfyLatlng=p._latlng,p.setLatLng(y),p.clusterShow&&p.clusterShow(),h&&((d=(f=p._spiderLeg)._path).style.strokeDashoffset=0,f.setStyle({opacity:m}));this.setOpacity(.3),n._ignoreMove=!1,setTimeout(function(){n._animationEnd(),n.fire("spiderfied",{cluster:i,markers:t})},200)},_animationUnspiderfy(t){const e=this,i=this._group,n=i._map,o=i._featureGroup,s=t?n._latLngToNewLayerPoint(this._latlng,t.zoom,t.center):n.latLngToLayerPoint(this._latlng),a=this.getAllChildMarkers(null,!0),l=r.Path.SVG;let h,u,c,p,f,d;for(i._ignoreMove=!0,i._animationStart(),this.setOpacity(1),u=a.length-1;u>=0;u--)(h=a[u])._preSpiderfyLatlng&&(h.closePopup(),h.setLatLng(h._preSpiderfyLatlng),delete h._preSpiderfyLatlng,d=!0,h._setPos&&(h._setPos(s),d=!1),h.clusterHide&&(h.clusterHide(),d=!1),d&&o.removeLayer(h),l&&(f=(p=(c=h._spiderLeg)._path).getTotalLength()+.1,p.style.strokeDashoffset=f,c.setStyle({opacity:0})));i._ignoreMove=!1,setTimeout(function(){let t=0;for(u=a.length-1;u>=0;u--)(h=a[u])._spiderLeg&&t++;for(u=a.length-1;u>=0;u--)(h=a[u])._spiderLeg&&(h.clusterShow&&h.clusterShow(),h.setZIndexOffset&&h.setZIndexOffset(0),t>1&&o.removeLayer(h),n.removeLayer(h._spiderLeg),delete h._spiderLeg);i._animationEnd(),i.fire("unspiderfied",{cluster:e,markers:a})},200)}}),r.MarkerClusterGroup.include({_spiderfied:null,unspiderfy(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),r.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim(t){r.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(t))},_unspiderfyWrapper(){this._unspiderfy()},_unspiderfy(t){this._spiderfied&&this._spiderfied.unspiderfy(t)},_noanimationUnspiderfy(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer(t){t._spiderLeg&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),this._map.removeLayer(t._spiderLeg),delete t._spiderLeg)}}),r.MarkerClusterGroup.include({refreshClusters(t){return t?t instanceof r.MarkerClusterGroup?t=t._topClusterLevel.getAllChildMarkers():t instanceof r.LayerGroup?t=t._layers:t instanceof r.MarkerCluster?t=t.getAllChildMarkers():t instanceof r.Marker&&(t=[t]):t=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(t),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(t),this},_flagParentsIconsNeedUpdate(t){let e,i;for(e in t)for(i=t[e].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers(t){let e,i;for(e in t)i=t[e],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),r.Marker.include({refreshIconOptions(t,e){const i=this.options.icon;return r.setOptions(i,t),this.setIcon(i),e&&this.__parent&&this.__parent._group.refreshClusters(this),this}});class ke{static createClusterLayer(t,e,i){ke.isAddClusterCss||(Object(n.inputCss)("\n .leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {\n -webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;\n -moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;\n -o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;\n transition: transform 0.3s ease-out, opacity 0.3s ease-in;\n }\n .leaflet-cluster-spider-leg {\n /* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */\n -webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;\n -moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;\n -o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;\n transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;\n }\n "),ke.isAddClusterCss=!0);const o={},s=t.renderer,{defaultSymbol:a,defaultLabelSymbol:l,defaultLabelExpressionInfo:h,radius:u,clusterBoundSymbol:c,maxScale:p,isExpandOnClick:f,isHoverShowBound:d,valueExpression:g,minHybridClusterCount:y,deconflictionStrategy:m}=s,_=s.clusterInfos||[];let v=20;if(e){const t=p/96*.0254,i=e.unproject(r.point(0,0),0),n=e.unproject(r.point(0,1),0);let o=e.distance(i,n),s=0;for(;s<=20&&o>t;)s+=1,o/=2;v=Math.max(s-1,0)}o.disableClusteringAtZoom=v,o.singleMarkerMode=!1,o.maxClusterRadius=u,o.polygonOptions=ue.convertSymboltoLeafletStyle(c),o.zoomToBoundsOnClick=f,o.showCoverageOnHover=d,o.deconflictionStrategy=m,o.maxClusterNum=y;const x=n.ExpressionParser.createValueExpressionParser(),b=x.parse(g);let w;const E={};h&&h.expression&&(w=x.parse(h.expression));for(let t=0;t<_.length;t++){const e=_[t];e&&e.labelExpressionInfo&&e.labelExpressionInfo.expression&&(E[e.labelExpressionInfo.expression]=x.parse(e.labelExpressionInfo.expression))}o.iconCreateFunction=(t=>{const e=t.getChildCount();let i,o=!0;if(1===e)i=t;else{const e=t.getAllChildMarkers(),n={};for(let t=0;t<e.length;t++){const i=e[t];n[i.options.groupName]?n[i.options.groupName].count+=1:n[i.options.groupName]={count:1,marker:i}}let r;for(const t in n)(void 0===r||r&&n[t].count>r.count)&&(r=n[t]);i=r.marker,o=!(Object.keys(n).length>1)}const s=Ne(b,i.attributes,e,o),h=Ae(_,s);let u=a,c=l,p=w;if(h&&(u=h.symbol,c=h.labelSymbol,h.labelExpressionInfo&&h.labelExpressionInfo.expression&&E[h.labelExpressionInfo.expression]&&(p=E[h.labelExpressionInfo.expression])),t instanceof r.Marker)if(c&&p){const i=function(t,e){return t.evaluate({$cluster_count:e})}(p,e),n=c.clone();n.text=i;const r=ue.convertSymboltoLeafletStyle(n);t.setTextIcon(r.icon)}else t._removeTextIcon();return function(t){const e=document.createElement("div"),i=document.createElement("div");let o=[10,10],s=0,a="none";if(n.SymbolType.pictureMarker===t.type)Object(n.defined)(t.width)&&(e.style.width=`${parseFloat(t.width)}px`,o[0]=parseFloat(t.width)),Object(n.defined)(t.height)&&(e.style.height=`${parseFloat(t.height)}px`,o[1]=parseFloat(t.height)),Object(n.defined)(t.xoffset)&&(e.style.marginLeft=t.xoffset),Object(n.defined)(t.yoffset)&&(e.style.marginTop=t.yoffset),Object(n.defined)(t.angle)&&(e.style.transform=`rotate(${t.angle}deg)`),Object(n.defined)(t.url)&&(e.style.backgroundImage=`url(${t.url})`,e.style.backgroundSize="100% 100%");else{const{size:i=20,outline:r=null,style:l="circle",path:h="",angle:u=0,xoffset:c=0,yoffset:p=0,color:f}=t;if(Object(n.defined)(r)){const{width:t,color:n}=r;"circle"===l&&(e.style.borderRadius=`${i}px`,e.style.backgroundClip="padding-box"),s=t,a=j.convertColorToRgb(n)}Object(n.defined)(f)&&(e.style.backgroundColor=j.convertColorToRgb(f),e.style.backgroundSize="100% 100%"),Object(n.defined)(i)&&(o=[i,i],e.style.width=`${i}px`,e.style.height=`${i}px`),Object(n.defined)(c)&&(e.style.marginLeft=`${c}px`),Object(n.defined)(p)&&(e.style.marginTop=`${p}px`),Object(n.defined)(u)&&(e.style.transform=`rotate(${u}deg)`)}const l=o[0]+2*s,h=o[1]+2*s;return i.style=`border:none;background-color:${a};border-radius:${"circle"===t.style?`${l}px`:"none"};padding:${s}px;`,i.appendChild(e),new r.DivIcon({html:i,iconSize:new r.Point(l,h),className:""})}(u)});const C=new Te(o);i=i||[];const L=[{groupName:"0",object:null}];for(let t=0;t<i.length;t++){const e=i[t],n=new ce(j.getAreaCenter(e.geometry)),r=e.attributes,o=Re(L,b,r,0,!0,_);n.options.groupName=o,C.addLayer(n),n.attributes=r}return C}}var De=ke;var ze=class extends n.BaseFeatureLayerView{onAdd(t){return this._addInnerLayer()}_processData(){return new Promise(t=>{})}onRemove(t){return super.onRemove(t),this.innerView.removeLayer(this.innerLayer),this.innerLayer=null,Promise.resolve(this)}onUpdate(t){const e=this.layer,i=this.innerLayer;return t.updateContent&&i&&t.updateContent.forEach(t=>{if(t&&"property"===t.operationType)switch(t.name){case"opacity":j.setVisibleOpacity(this.innerLayer,e._opacity,e._visible);break;case"visible":{const i=t.params&&t.params.length>0?t.params[0]:void 0,n=this._getLayerViewVisible(i);j.setVisibleOpacity(this.innerLayer,e._opacity,n);break}}if(t&&"method"===t.operationType)switch(t.name){case"refresh":this.innerView.removeLayer(this.innerLayer),this._addInnerLayer()}}),Promise.resolve(this)}_addInnerLayer(){return this._processData().then(t=>{const e=this.layer,i=this,n=this.innerView,r=e.renderer;i._initInnerLayer(e,n,t,r);const o=i._getLayerViewVisible();return j.setVisibleOpacity(i.innerLayer,e._opacity,o),i.innerLayer.addTo(n),new Promise(t=>{t(i)})})}_initInnerLayer(t,e,i,o){let s;o=o||{};let a=!1;if(this._isCommonRenderer(o))a=!0,s=r.featureGroup();else switch(o.type){case n.RendererType.cluster:s=De.createClusterLayer(t,e,i.features);break;default:n.Log.error("无法解析renderer信息")}return j.setVisibleOpacity(s,t._opacity,t._visible),s.commonLayerId=t.id,s._realIndex=t._realIndex,this.innerLayer=s,a&&this._initFeatures(i.features,o),s}_rendererChangeAction(t){const{sourceEventData:e={}}=t;if("renderer"===e.key){const t=e.oldValue,i=e.value;if(!this._isCommonRenderer(t)||!this._isCommonRenderer(i))return this.innerView.removeLayer(this.innerLayer),void this._addInnerLayer()}const i=this.layer.renderer;this._isCommonRenderer(i)?super._rendererChangeAction(t):De.updateCluster(this.innerLayer,this.layer,this.view)}_isCommonRenderer(t){return t&&[n.RendererType.classBreak,n.RendererType.simple,n.RendererType.uniqueValue,n.RendererType.random,n.RendererType.rank].some(e=>e===t.type)}};var Be=class extends ze{_processData(){const t=this.layer;return Promise.resolve(t._source)}};class Fe{}Fe.addIGSVectorLayer=function(t,e,i){const o=new(r.TileLayer.extend({options:{gdbps:null,filters:null,style:null,f:null,keepCache:!0,guid:null,attribution:"Zondy Map vector Data",proj:null,noWrap:!0},initialize(t){t=t||{},this.url=t.url||"",this.layer=t.layer,r.setOptions(this,t),r.stamp(this)},onAdd(t){this._crs=t.options.crs,this._initLayerUrl(),r.TileLayer.prototype.onAdd.call(this,t)},getTileUrl(t){const e=this._tileCoordsToBounds(t),i=this._crs.project(e.getNorthWest()),n=this._crs.project(e.getSouthEast());let r=`&bbox=${i.x},${n.y},${n.x},${i.y}`;return this.options.keepCache||(r+=`&temp=${Math.random()}`),this._layerUrl+encodeURI(r)},_initLayerUrl(){let t=`${this.url}?`;t+=encodeURI(this._initAllRequestParams().join("&")),this._layerUrl=t},_initAllRequestParams(){const t=this.options||{},e=[];if("1.0"===this.layer._igsVersion){const i=t.f||"png";e.push(`f=${i}`),t.gdbps&&e.push(`gdbps=${t.gdbps}`);let o=this.options.tileSize;o instanceof r.Point||(o=r.point(o,o)),e.push(`w=${o.x}`),e.push(`h=${o.y}`),t.filters&&e.push(`filters=${t.filters}`),t.style&&e.push(`style=${JSON.stringify(t.style)}`),t.proj&&e.push(`proj=${t.proj}`);const s=t.guid||Object(n.getGUID)();e.push(`guid=${s}`),void 0!==t.isAntialiasing&&null!==t.isAntialiasing&&e.push(`isAntialiasing=${t.isAntialiasing}`),t.tokenKey&&t.tokenValue&&e.push(`${t.tokenKey}=${t.tokenValue}`)}else{const i=t.f||"image";e.push(`f=${i}`),t.gdbps&&e.push(`urls=${t.gdbps}`);let o=this.options.tileSize;o instanceof r.Point||(o=r.point(o,o)),e.push(`size=${o.x},${o.y}`),t.projectionSrs&&e.push(`projectionSrs=${t.projectionSrs}`);const s=t.clientId||Object(n.getGUID)();e.push(`clientId=${s}`),void 0!==t.isAntialiasing&&null!==t.isAntialiasing&&e.push(`isAntialiasing=${t.isAntialiasing}`),t.tokenKey&&t.tokenValue&&e.push(`${t.tokenKey}=${t.tokenValue}`)}return e},redraw(){if(this._map){this._removeAllTiles();const t=Object(n.getGUID)();this.options.guid=t,this._initLayerUrl(),this._update()}return this}}))({url:t,gdbps:[e.gdbp],tokenKey:e.tokenKey,tokenValue:e.tokenValue,filters:e.definitionExpression?`0:${e.definitionExpression}`:"",layer:e}).addTo(i);return o.id=e.id,o};var Ve=Fe;var je=class extends ze{_processData(){const t=this.layer,e=t._createQueryOption();return e.resultRecordCount=1e5,t.queryFeatures(e).then(t=>t)}onAdd(t){const e=this,i=this.layer,r=this.innerView;if("server"===i.renderMode){const t=i.url;if("1.0"===i._igsVersion){const o=Object(n.getBaseUrl)(t);e.innerLayer=Ve.addIGSVectorLayer(`${o}/igs/rest/mrms/layers`,i,r)}else{const o=Object(n.getBaseUrl)(t);e.innerLayer=Ve.addIGSVectorLayer(`${o}/igs/rest/mrms/layers`,i,r)}const o=e._getLayerViewVisible();return j.setVisibleOpacity(e.innerLayer,i._opacity,o),Promise.resolve(e)}return super.onAdd(t)}onRemove(t){const e=this;return this.layer.gdbp?(this.innerView.removeLayer(this.innerLayer),Promise.resolve(e)):super.onRemove(t)}};var Ge=class extends n.GroupLayerView{};var Ue=class extends ze{_processData(){return this.layer.queryFeatures().then(t=>t)}};var He=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=K.addArcGISMapImageLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"index":this.innerLayer.setZIndex(this.layer._realIndex)}}return Promise.resolve(this)}};var qe=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=it.addArcGISTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"index":this.innerLayer.setZIndex(this.layer._realIndex)}}return Promise.resolve(this)}};var Ze=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=J.addWebTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":this.innerLayer.redraw();break;case"index":this.innerLayer.setZIndex(this.layer._realIndex);break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(j.convertClippingArea(t));break}}}return Promise.resolve(this)}};function Xe(t){return t.length>2?new r.LatLng(t[1],t[0],t[2]):new r.LatLng(t[1],t[0])}function Ye(t,e,i){const n=[];for(let r,o=0,s=t.length;o<s;o++)r=e?Ye(t[o],e-1,i):(i||Xe)(t[o]),n.push(r);return n}function We(t,e){return t.isGeographic?e:(e.spatialReference=t,n.Projection.project(e,new n.SpatialReference("EPSG:4326")))}var $e=class{static toLeafletCoords(t,e){let i=[];const r=Object(n.defaultValue)(e,{}),o=Object(n.defaultValue)(r.additional,void 0);let s=Object(n.defaultValue)(n.SpatialReference.fromJSON(r.spatialReference),new n.SpatialReference("EPSG:4326"));switch(t.spatialReference&&(s=t.spatialReference),t.type){case n.GeometryType.point:{let e=t.clone();const n=(e=We(s,e)).coordinates;i.push(Xe(n));break}case n.GeometryType.multiPoint:{let e=t.clone();i=Ye((e=We(s,e)).coordinates,0,Xe);break}case n.GeometryType.lineString:{let e=t.clone();i=Ye((e=We(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,0,Xe);break}case n.GeometryType.multiLineString:case n.GeometryType.polygon:{let e=t.clone();i=Ye((e=We(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,1,Xe);break}case n.GeometryType.multiPolygon:{let e=t.clone();i=Ye((e=We(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,2,Xe);break}case n.GeometryType.extent:{let e=t.clone();const n=(e=We(s,e)).xmin,r=e.xmax,o=e.ymin,a=e.ymax;i.push([o,n]),i.push([a,r]);break}case n.GeometryType.circle:{let e=t.clone();const n=(e=We(s,e)).center;i.push([n[1],n[0]]);break}}return i}};var Ke=r.CircleMarker.extend({options:{fill:!0,shape:"circle",radius:10,rotation:0,xoffset:0,yoffset:0,path:""},setStyle(t){const e=t&&t.radius||this.options.radius||this._radius;r.Path.prototype.setStyle.call(this,t),this.setRadius(e)},setPath(t){return this.options.path=t,this.redraw()},getPath(){return this.options.path},setXoffset(t){return this.options.xoffset=t,this.redraw()},getXoffset(){return this.options.xoffset},setYoffset(t){return this.options.yoffset=t,this.redraw()},getYoffset(){return this.options.yoffset},setRadius(t){return this.options.radius=t,this.redraw()},getRadius(){return this.options.radius},setRotation(t){return this.options.rotation=t,this.redraw()},getRotation(){return this.options.rotation},_updatePath(){this._renderer._updateShape(this)},toGeoJSON(){return r.GeoJSON.getFeature(this,{type:"Point",coordinates:r.GeoJSON.latLngToCoords(this.getLatLng())})}});const Qe=$e.toLeafletCoords,Je=ue.convertSymboltoLeafletStyle;function ti(t,e,i){let o;switch(t){case n.SymbolType.simpleMarker:o=new Ke(e,i);break;case n.SymbolType.pictureMarker:o=r.marker(e,i);break;case n.SymbolType.line:o=r.polyline(e,i);break;case n.SymbolType.text:o=r.marker(e,i);break;case n.SymbolType.fill:case n.SymbolType.pictureFill:o=r.polygon(e,i);break;default:n.Log.error("符号类型错误,不合法的符号类型")}return o}function ei(t,e,i){const r=[];if(t){const{color:o,style:s,placement:a}=t,l=j.calcLineMarkerDetail(i),{angle1:h,angle2:u,latlng1:c,latlng2:p}=l,f=Je(new n.SimpleMarkerSymbol({angle:h,color:o,outline:{color:o,width:e},style:s,size:Math.max(15,4*e)})),d=ti(n.SymbolType.simpleMarker,c,f),g=ti(n.SymbolType.simpleMarker,p,Je(new n.SimpleMarkerSymbol({angle:u,color:o,outline:{color:o,width:e},style:s,size:Math.max(15,4*e)})));"begin"===a?r.push(d):"end"===a?r.push(g):(r.push(d),r.push(g))}return r}function ii(t,e){e.__marker__group&&e.removeLayer(e.__marker__group);const i=t.symbol.width,n=ei(t.symbol.marker,i,t.geometry.coordinates),o=new r.FeatureGroup(n);e.__marker__group=o,e.addLayer(o)}function ni(t,e){e.__marker__group&&e.removeLayer(e.__marker__group);const i=t.symbol.width,n=t.symbol.marker;let o=[];t.geometry.coordinates.forEach(t=>{const e=ei(n,i,t);o=o.concat(e)});const s=new r.FeatureGroup(o);e.__marker__group=s,e.addLayer(s)}function ri(t,e,i){let r;return r=n.SymbolType.simpleMarker===t||n.SymbolType.text===t||n.SymbolType.pictureMarker===t?j.getAreaCenter(e):Qe(e,{additional:i.additional})}function oi(t){const e=Je(t.symbol),i=t.symbol.type;return ti(i,ri(i,t.geometry.toPolygon(),t),e)}function si(t){let e=null;if(!(t instanceof n.Feature))return e;if(!t.geometry)return n.Log.error("几何不存在"),e;switch(t.geometry.type){case n.GeometryType.point:e=function(t){const e=Qe(t.geometry),i=Je(t.symbol);return ti(t.symbol.type,e[0],i)}(t);break;case n.GeometryType.lineString:e=function(t){const e=Qe(t.geometry,{additional:t.additional}),i=Je(t.symbol),n=t.symbol.type,o=new r.FeatureGroup,s=ti(n,e,i);return o.__line__graphic=s,o.addLayer(s),t.symbol.marker&&ii(t,o),o}(t);break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:e=function(t){const e=Je(t.symbol),i=t.symbol.type;return ti(i,ri(i,t.geometry,t),e)}(t);break;case n.GeometryType.extent:case n.GeometryType.circle:e=oi(t);break;case n.GeometryType.multiPoint:e=function(t){const e=Qe(t.geometry),i=Je(t.symbol),n=t.symbol.type,o=[];return e.forEach(t=>{const e=ti(n,t,i);o.push(e)}),new r.FeatureGroup(o)}(t);break;case n.GeometryType.multiLineString:e=function(t){const e=Qe(t.geometry,{additional:t.additional}),i=Je(t.symbol),n=t.symbol.type,o=new r.FeatureGroup,s=ti(n,e,i);return o.__line__graphic=s,o.addLayer(s),t.symbol.marker&&ni(t,o),o}(t)}return e}const ai=ue.convertSymboltoLeafletStyle;var li=class extends n.FeatureRender{drawFeature(t,e){if(t){const{layerVisible:i,layerOpacity:n}=t;e.forEach(e=>{if(e.visible){const r=si(e);r.commonFeatureId=e.id,r.commonLayerId=t.commonLayerId,j.setGraphicVisibleOpacity(r,n,i),t.addLayer(r)}})}}updateFeature(t,e,i){t&&(super.updateFeature(t,e,i),e.forEach((e,n)=>{const r=i[n];r&&e&&this._update(t,r.symbolUpdated,r.geometryUpdated,e)}))}_update(t,e,i,r){const o=r.geometry,s=r.symbol,a=!!i,l=!!e;let h=!1;const u=this._getGraphicByFeatureId(t,r.id);if(r.visible)if(u){if(e){const{key:t,oldValue:i,value:n}=e;i&&n&&i.type!==n.type&&(h=!0),"type"===t&&(h=!0)}if(!h)switch(o.type){case n.GeometryType.point:if(l){const t=ai(r.symbol)||{};u.setStyle(t)}if(a){const t=$e.toLeafletCoords(o);u.setLatLng(t[0])}break;case n.GeometryType.multiPoint:if(l){const t=ai(r.symbol);u.eachLayer(e=>{e.setStyle(t)})}if(a){const t=$e.toLeafletCoords(o),e=Object.keys(u._layers).map(t=>u._layers[t])||[],i=t.length;let n=e.length;if(n!==i)if(n>i){for(;n!==i;)u.removeLayer(e[n-1]),n-=1;let r=0;u.eachLayer(e=>{e.setLatLng(t[r]),r+=1})}else{const i=r.symbol.type,o=ai(r.symbol);t.forEach((t,r)=>{if(r<n)e[r].setLatLng(t);else{const e=ti(i,t,o);u.addLayer(e)}})}else{let e=0;u.eachLayer(i=>{i.setLatLng(t[e]),e+=1})}}break;case n.GeometryType.lineString:if(l){const t=ai(r.symbol);u.__line__graphic&&u.__line__graphic.setStyle(t)}if(a){const t=$e.toLeafletCoords(o);u.__line__graphic&&u.__line__graphic.setLatLngs(t)}s.marker&&ii(r,u);break;case n.GeometryType.multiLineString:if(l){const t=ai(r.symbol);u.__line__graphic&&u.__line__graphic.setStyle(t)}if(a){const t=$e.toLeafletCoords(o);u.__line__graphic&&u.__line__graphic.setLatLngs(t)}s.marker&&ni(r,u);break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:if(l){const t=ai(r.symbol);u.setStyle(t)}if(a){const t=ri(s.type,o,r);u.setLatLngs?u.setLatLngs(t):u.setLatLng&&u.setLatLng(t)}break;case n.GeometryType.extent:case n.GeometryType.circle:if(l){const t=ai(r.symbol);u.setStyle(t)}if(a){const t=ri(s.type,o.toPolygon(),r);u.setLatLngs?u.setLatLngs(t):u.setLatLng&&u.setLatLng(t)}}h&&this._redrawFeature(t,r)}else this.drawFeature(t,[r]);else this.clearFeature(t,[r])}clearFeature(t,e){t&&(super.clearFeature(t,e),e.forEach(e=>{const i=this._getGraphicByFeatureId(t,e.id);i&&t.removeLayer(i)}))}clear(t){t&&(super.clear(t),t.clearLayers())}_getGraphicByFeatureId(t,e){let i=null;return t&&e&&t.eachLayer(t=>{if(t.commonFeatureId===e)return i=t}),i}_redrawFeature(t,e){this.clearFeature(t,[e]),this.drawFeature(t,[e])}};function hi(t,e){console.log(e);let i=null;switch(e.type){case n.LayerType.igsVectorTile:case n.LayerType.arcgisVectorTile:i=new Gt({view:t,layer:e});break;case n.LayerType.wmts:i=new Ht({view:t,layer:e});break;case n.LayerType.igsMapImage:i=new Kt({view:t,layer:e});break;case n.LayerType.igsTile:i=new qt({view:t,layer:e});break;case n.LayerType.wms:i=new Ut({view:t,layer:e});break;case n.LayerType.echarts:i=new ie({view:t,layer:e});break;case n.LayerType.mapv:i=new oe({view:t,layer:e});break;case n.LayerType.graphics:i=new Jt({view:t,layer:e,render:new li});break;case n.LayerType.geojson:i=new Be({view:t,layer:e,render:new li});break;case n.LayerType.igsFeature:i=new je({view:t,layer:e,render:new li});break;case n.LayerType.group:i=new Ge({view:t,layer:e});break;case n.LayerType.wfs:i=new Ue({view:t,layer:e,render:new li});break;case n.LayerType.arcgisMapImage:i=new He({view:t,layer:e});break;case n.LayerType.arcgisTile:i=new qe({view:t,layer:e});break;case n.LayerType.webTileLayer:i=new Ze({view:t,layer:e})}return i}class ui extends n.MapView{constructor(t){if(super(t),t=Object(n.defaultValue)(t,{}),this._options=t,this._center=Object(n.defaultValue)(t.center,void 0),this._center&&Array.isArray(this._center)&&this._center.length>1&&(this._center=new n.Point({coordinates:[this._center[0],this._center[1]]})),this.crs=void 0,this._extent=Object(n.defaultValue)(t.extent,void 0),this.animation=Object(n.defaultValue)(t.animation,!0),this.width=void 0,this.height=void 0,this._zoom=Object(n.defaultValue)(t.zoom,0),this._resolution=0,this._scale=Object(n.defaultValue)(t.scale,void 0),this.maxScale=Object(n.defaultValue)(t.maxScale,void 0),this.minScale=Object(n.defaultValue)(t.minScale,void 0),this.popup=Object(n.defaultValue)(t.popup,void 0),this.preferCanvas=Object(n.defaultValue)(t.preferCanvas,!1),this._spatialReference=void 0,this._referenceLayer=void 0,this.spatialReferenceLocked=Object(n.defaultValue)(t.spatialReferenceLocked,!1),this._rotation=Object(n.defaultValue)(t.rotation,0),this.stationary=!0,this.engineType="leaflet",this._zoomSnap=Object(n.defaultValue)(t.zoomSnap,1),this._zoomDelta=Object(n.defaultValue)(t.zoomDelta,1),this._isCustomCrs=!1,this._map._initLeafletView=!0,this._screenshot=null,t.fullExtent){let e=n.Extent.fromJSON(t.fullExtent.toJSON());e.spatialReference.isGeographic||(e=n.Projection.project(e,new n.SpatialReference({wkid:4326}))),this._initFullExtent=e}this._fullExtent=this._initFullExtent,this._mapExtent=null}flyTo(t,e={animate:!0}){t=Object(n.defaultValue)(t,{});const i=Object(n.defaultValue)(t.zoom,1),r=this._getFlyToCenter(t),o=this._getFlyToExtent(t);if(this._innerView){if(this._zoomSnap>z&&(this._innerView.options.zoomSnap=z),this._zoomDelta>z&&(this._innerView.options.zoomDelta=z),r){let t=r.coordinates[1],o=r.coordinates[0];if(this._fullExtent&&((t>this._fullExtent.ymax||t<this._fullExtent.ymin)&&(t=(this._fullExtent.ymax+this._fullExtent.ymin)/2),(o>this._fullExtent.xmax||o<this._fullExtent.xmin)&&(o=(this._fullExtent.xmax+this._fullExtent.xmin)/2)),isFinite(t)&&isFinite(o)){let s=!1;const a=this._innerView.getCenter();if(i===this._zoom&&t===a.lat&&o===a.lng&&(s=!0),!s){let s;this._innerView&&this._innerView.options&&this._innerView.options.maxBounds&&(s=this._innerView._limitCenter({lat:t,lng:o},i,this._innerView.options.maxBounds)),s&&s.lat!==t&&s.lng!==o?n.Log.warning(`中心点${r}、层级${i}的视图,范围超过最大视图范围!`):this._innerView.setView([t,o],i,e)}}}else if(o){let t=o.xmin,i=o.xmax,n=o.ymin,r=o.ymax;this._fullExtent&&(t<this._fullExtent.xmin&&(t=this._fullExtent.xmin),i>this._fullExtent.xmax&&(i=this._fullExtent.xmax),n<this._fullExtent.ymin&&(n=this._fullExtent.ymin),r>this._fullExtent.ymax&&(r=this._fullExtent.ymax)),isFinite(t)&&isFinite(i)&&isFinite(n)&&isFinite(r)&&this._setViewExtent(o,e)}this._zoomSnap!==this._innerView.options.zoomSnap&&(this._innerView.options.zoomSnap=this._zoomSnap),this._zoomDelta!==this._innerView.options.zoomDelta&&(this._innerView.options.zoomDelta=this._zoomDelta)}}goTo(t={},e={}){let i,r,o=new Promise(t=>{t()});if(this._innerView){let s;if(Object(n.isNull)(t.center)&&Object(n.isNull)(t.zoom)&&Object(n.isNull)(t.scale)||(i=Object(n.isNull)(t.center)?this._center:this._getFlyToCenter({center:t.center}),r=!Object(n.isNull)(t.scale)&&t.scale>0?this._getZoomByScale(t.scale):!Object(n.isNull)(t.zoom)&&t.zoom>0?t.zoom:this._zoom),!Object(n.isNull)(t.target)){const e=this._getTargetExtent(t.target);e.xmin!==e.xmax&&e.ymin!==e.ymax?s=e:i=this._getFlyToCenter({center:new n.Point({coordinates:[e.xmin,e.ymin]})})}const a={animate:!0,duration:200};if(Object(n.isNull)(e)||(Object(n.isNull)(e.animate)||(a.animate=e.animate),Object(n.isNull)(e.duration)||(a.duration=e.duration)),this._zoomSnap>z&&(this._innerView.options.zoomSnap=z),this._zoomDelta>z&&(this._innerView.options.zoomDelta=z),i){let t=i.coordinates[1],e=i.coordinates[0];if(this._fullExtent&&((t>this._fullExtent.ymax||t<this._fullExtent.ymin)&&(t=(this._fullExtent.ymax+this._fullExtent.ymin)/2),(e>this._fullExtent.xmax||e<this._fullExtent.xmin)&&(e=(this._fullExtent.xmax+this._fullExtent.xmin)/2)),isFinite(t)&&isFinite(e)){let s=!1;const l=this._innerView.getCenter();if(r===this._zoom&&t===l.lat&&e===l.lng&&(s=!0),s)return o;let h;this._innerView&&this._innerView.options&&this._innerView.options.maxBounds&&(h=this._innerView._limitCenter({lat:t,lng:e},r,this._innerView.options.maxBounds)),h&&h.lat!==t&&h.lat!==e?n.Log.warning(`中心点${i}、层级${r}的视图,范围超过最大视图范围!`):o=new Promise(i=>{this._innerView.setView([t,e],r,a),this._innerView.once("moveend",()=>{i()})})}}else if(s){let t=s.xmin,e=s.xmax,i=s.ymin,n=s.ymax;this._fullExtent&&(t<this._fullExtent.xmin&&(t=this._fullExtent.xmin),e>this._fullExtent.xmax&&(e=this._fullExtent.xmax),i<this._fullExtent.ymin&&(i=this._fullExtent.ymin),n>this._fullExtent.ymax&&(n=this._fullExtent.ymax)),isFinite(t)&&isFinite(e)&&isFinite(i)&&isFinite(n)&&(o=this._setViewExtent(s,a))}this._zoomSnap!==this._innerView.options.zoomSnap&&(this._innerView.options.zoomSnap=this._zoomSnap),this._zoomDelta!==this._innerView.options.zoomDelta&&(this._innerView.options.zoomDelta=this._zoomDelta)}return o}_getFlyToExtent(t){let e=t.extent;if(!e)return;const i=n.Projection.project(new n.Point({coordinates:[e.xmin,e.ymax],spatialReference:e.spatialReference}),new n.SpatialReference("EPSG:4326")),r=n.Projection.project(new n.Point({coordinates:[e.xmax,e.ymin],spatialReference:e.spatialReference}),new n.SpatialReference("EPSG:4326"));return e=new n.Extent({xmin:i.coordinates[0],ymin:r.coordinates[1],xmax:r.coordinates[0],ymax:i.coordinates[1]})}_setViewExtent(t,e){t.spatialReference&&!t.spatialReference.isGeographic&&(t=n.Projection.project(t,new n.SpatialReference("EPSG:4326")));const i=t.xmin,o=t.ymin,s=t.xmax,a=t.ymax,l=this.getExtent();let h=!1;if(l.ymin===o&&l.xmin===i&&l.ymax===a&&l.xmax===s)h=!0;else{const i=this._innerView.getCenter(),n=this._innerView._getBoundsCenterZoom(r.latLngBounds(r.latLng(t.ymin,t.xmin),r.latLng(t.ymax,t.xmax)));if(n.zoom===this._zoom&&n.center.lat===i.lat&&n.center.lng===i.lng&&(h=!0),!h)return new Promise(t=>{this._innerView.setView([n.center.lat,n.center.lng],n.zoom,e),this._innerView.once("moveend",()=>{t()})})}return new Promise(t=>{t()})}_getLatLngFromExtent(t){const e=new n.SpatialReference("EPSG:4326"),i=n.Projection.project(t,e);return{northEastLatlng:new r.latLng(i.ymax,i.xmax),southWestLatlng:new r.latLng(i.ymin,i.xmin)}}_getLatLngFromPoint(t){const e=new n.SpatialReference("EPSG:4326"),i=n.Projection.project(t,e);return new r.latLng(i.coordinates[1],i.coordinates[0])}_initViewEvent(){super._initViewEvent();const t=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null,dragMouseUp:!1},t.fire(n.ViewEventType.loaded,{}),this._innerView.on("click",e=>{t._dragParams.dragMouseUp?t._dragParams.dragMouseUp=!1:(t._clickStore=setTimeout(function(){t._clickStore&&t.fire(n.ViewEventType.click,jt.getMouseEvent(e,t))},300),t.fire(n.ViewEventType.immediateClick,jt.getMouseEvent(e,t)))}),this._innerView.on("contextmenu",e=>{t._clickStore=setTimeout(function(){t._clickStore&&t.fire(n.ViewEventType.click,jt.getMouseEvent(e,t))},300),t.fire(n.ViewEventType.immediateClick,jt.getMouseEvent(e,t))}),this._innerView.on("dblclick",e=>{t._clickStore&&(clearTimeout(this._clickStore),t._clickStore=null),t.fire(n.ViewEventType.doubleClick,jt.getMouseEvent(e,t))}),this._innerView.on("mousedown",e=>{t.fire(n.ViewEventType.pointerDown,jt.getMouseEvent(e,t)),this._dragParams.isDrag||(this._dragParams.origin={x:e.originalEvent.layerX,y:e.originalEvent.layerY},this._dragParams.button=e.originalEvent.button,this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)}),this._innerView.on("mouseup",e=>{t.fire(n.ViewEventType.pointerUp,jt.getMouseEvent(e,t)),t._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",this._innerView.dragging._enabled||(t._dragParams.dragMouseUp=!0),t.fire(n.ViewEventType.drag,jt.getDragEvent(e,t,t._dragParams.origin,this._dragParams.action))),t._dragParams.isDrag=!1,t._dragParams.origin=null,t._dragParams.action="",t._dragParams.button=null}),this._innerView.on("mousemove",e=>{t.fire(n.ViewEventType.pointerMove,jt.getMouseEvent(e,t)),t._dragParams.isDrag?(t.fire(n.ViewEventType.drag,jt.getDragEvent(e,t,t._dragParams.origin,t._dragParams.action,t._dragParams.button)),t._dragParams.action="update"):"mouse-down"===this._dragParams.action&&(this._dragParams.action="start",t._dragParams.isDrag=!0)}),this._innerView.on("keydown",e=>{t.fire(n.ViewEventType.keyDown,jt.getKeyEvent(e,t,n.ViewEventType.keyDown))}),this._innerView.on("keyup",e=>{t.fire(n.ViewEventType.keyUp,jt.getKeyEvent(e,t,n.ViewEventType.keyUp))}),this._innerView.on("movestart",()=>{t.stationary=!1}),this._innerView.on("zoom",e=>{t.fire(n.ViewEventType.zoom,{zoom:e.target._zoom,event:e})}),this._innerView.on("zoomend",e=>{t._zoomEndHandler(),t.fire(n.ViewEventType.viewChange,jt.getViewChangeEvent(e,t))}),this._innerView.on("moveend",e=>{t._moveEndHandler(),t.fire(n.ViewEventType.viewChange,jt.getViewChangeEvent(e,t)),t.stationary=!0}),this._innerView.on("resize",e=>{t.fire(n.ViewEventType.resize,{oldWidth:e.oldSize.x,oldHeight:e.oldSize.y,width:e.newSize.x,height:e.newSize.y}),t._initSize()}),this.fire(n.ViewEventType.viewCreated,this._innerView)}_mapActionControl(t,e){this._innerView&&("drag-pan"===t?e?this._innerView.dragging.enable():this._innerView.dragging.disable():"double-click-zoom"===t&&(e?this._innerView.doubleClickZoom.enable():this._innerView.doubleClickZoom.disable()))}_initView(t,e){t&&!this._center&&this.fullExtent&&(this._center=this._fullExtent.center);const i=this._getMaxBounds();let o={preferCanvas:this.preferCanvas,attributionControl:Object(n.defaultValue)(e.attributionControl,!1),zoomControl:Object(n.defaultValue)(e.zoomControl,!0),doubleClickZoom:Object(n.defaultValue)(e.doubleClickZoom,!0),dragging:Object(n.defaultValue)(e.dragging,!0),zoomSnap:this._zoomSnap,zoomDelta:this._zoomDelta,trackResize:Object(n.defaultValue)(e.trackResize,!0),keyboard:Object(n.defaultValue)(e.keyboard,!0),keyboardPanDelta:Object(n.defaultValue)(e.keyboardPanDelta,80),scrollWheelZoom:Object(n.defaultValue)(e.scrollWheelZoom,!0),wheelDebounceTime:Object(n.defaultValue)(e.wheelDebounceTime,40),wheelPxPerZoomLevel:Object(n.defaultValue)(e.wheelDebounceTime,60),tapHold:Object(n.defaultValue)(e.tapHold,!0),tapTolerance:Object(n.defaultValue)(e.tapTolerance,15),touchZoom:Object(n.defaultValue)(e.touchZoom,!0),bounceAtZoomLimits:Object(n.defaultValue)(e.bounceAtZoomLimits,!0),crs:this.crs,center:this._center&&this._center.coordinates?[this._center.coordinates[1],this._center.coordinates[0]]:[0,0],maxBounds:i,zoom:this._zoom,zoomAnimation:this.animation,config:n.Config,rotate:!0,bearing:this._rotation};if(o=Object.assign(o,this.extendOptions),this._innerView=r.map(this._viewId,o),this.ui=new Ft({view:this}),this._initViewEvent(),this._extent){let t=this._extent;this._extent.spatialReference.isGeographic||(t=n.Projection.project(this._extent.clone(),new n.SpatialReference({wkid:4326}))),(t.xmax>this._fullExtent.xmax||t.ymax>this._fullExtent.ymax||t.xmin<this._fullExtent.xmin||t.ymin<this._fullExtent.ymin)&&(t=this._fullExtent),this.flyTo({extent:t},{animate:!1})}return!this._extent&&this._scale&&this._center&&t&&this._initScale(),this._initSize(),this._initScaleLimit(),this._initPopup(),this._initCursor(),this._innerView.whenReady(()=>{this.getZoom(),this.getCenter(),this.getExtent(),this.getScale()}),new Promise(t=>{t(self)})}_reCreateView(t){return this._innerView&&(this._innerView._animatingZoom=!1,this._innerView.remove()),this._initView(t,this._options)}_resetExtent(){this._extent&&(this._extent=void 0,this._zoom=Math.max(this.minZoom,0))}_createCrsObject(t){if(t.spatialReference&&t.lods&&t.origin&&t.extent)return new l({wkid:t.spatialReference.wkid,wkt:t.spatialReference.wkt,lods:t.lods,origin:t.origin,extent:t.extent})}_processEvent(t){super._processEvent(t),t.type===n.MapEventType.layerRemove&&(this._map._isRemoveMany||this._map._isRemoveAll||!this._map._canResetView||this._setSpatialReference()),t.type===n.MapEventType.layerRemoveMany&&this._map._canResetView&&t.layers&&this._setSpatialReference()}_initSize(){const t=this._innerView.getSize();this.width=t.x,this.height=t.y}destroy(){this._innerView.remove()}getCenter(){const t=this._innerView.getCenter();let e=new n.Point({coordinates:[t.lng,t.lat]});this._center=e;const i=this._spatialReference;return i.isGeographic||(e=n.Projection.project(e,i)),e}setCenter(t){this._innerView&&(Array.isArray(t)&&t.length>1?(this._center=new n.Point({coordinates:[t[0],t[1]],spatialReference:this._spatialReference}),this.flyTo({zoom:this._zoom,center:this._center})):t instanceof n.Point&&(this._center=t,this.flyTo({zoom:this._zoom,center:this._center})))}getZoom(){return this._zoom=this._innerView.getZoom(),this._zoom}setZoom(t){if(!this._innerView)return;const e=Math.max(this.minZoom,t);this.flyTo({zoom:e,center:this._center})}getMinZoom(){return this._innerView.getMinZoom()}getSize(){return this._innerView.getSize()}getMaxZoom(){return this._innerView.getMaxZoom()}getPixelExtent(){return this._innerView.getPixelBounds()}getPixelCenter(){return this._innerView.getPixelOrigin()}getPixelWorldExtent(){return this._innerView.getPixelWorldBounds()}toJSON(){const t=super.toJSON();return t.extent=Object(n.toJSON)(this._extent,n.Extent),t.animation=this.animation,t.width=this.width,t.height=this.height,t.preferCanvas=this.preferCanvas,t.spatialReferenceLocked=this.spatialReferenceLocked,t}clone(){return Object(n.cloneObject)(this)}static fromJSON(t){return new ui(t)}toMap(t){const e=this._innerView.containerPointToLatLng(t);let i=new n.Point({coordinates:[e.lng,e.lat]});const r=this._spatialReference;return r.isGeographic?i.spatialReference=r:i=n.Projection.project(i,r),i}toScreen(t){let e=n.Geometry.fromJSON(t);return e.spatialReference.isGeographic||(e=n.Projection.project(e,new n.SpatialReference({wkid:4326}))),this._innerView.latLngToContainerPoint([e.coordinates[1],e.coordinates[0]])}takeScreenshot(t){t.view=this;let e=null;return this._screenshot?e=this._screenshot._addView():(this._screenshot=new $t(t),e=this._screenshot._addView()),e}getExtent(){if(!this._innerView)return;const t=this._innerView.getGeoBoundsCoord(),e=new n.Extent({xmin:t.xmin,ymin:t.ymin,xmax:t.xmax,ymax:t.ymax,spatialReference:this._spatialReference});return this._extent=e,e}getZoomByExtent(t){let e=0;if(this._innerView){let i=n.Extent.fromJSON(t.toJSON());i.spatialReference.isGeographic||(i=n.Projection.project(i,new n.SpatialReference("EPSG:4326")));const o=r.latLng(i.ymin,i.xmin),s=r.latLng(i.ymax,i.xmax),a=r.latLngBounds(o,s);e=this._innerView.getBoundsZoom(a)}return e}setExtent(t){this._innerView&&(this._extent=t,this.flyTo({extent:t}))}_zoomEndHandler(){this.getExtent(),this.getZoom(),this.getCenter(),this.getScale(),this.getResolution(),this._showLayerByScale()}_moveEndHandler(){this.getCenter(),this.getExtent()}_initScaleLimit(){if(void 0!==this._options.minScale)if(this.minScale>0){const t=this._getZoomByScale(this.minScale);void 0!==t&&(this.minZoom=t,this._innerView.setMinZoom(this.minZoom))}else this.minZoom=void 0,this.minScale=0,this._innerView.setMinZoom(this.minZoom);else{const t=this._innerView.getMinZoom();isFinite(t)?(this.minZoom=t,this.minScale=this._getScaleByZoom(this.minZoom)):(this.minZoom=void 0,this.minScale=void 0)}if(void 0!==this._options.maxScale)if(this.maxScale>0){const t=this._getZoomByScale(this.maxScale);void 0!==t&&(this.maxZoom=t,this._innerView.setMaxZoom(this.maxZoom))}else this.maxScale<=0&&(this.maxZoom=void 0,this.maxScale=0,this._innerView.setMaxZoom(this.maxZoom));else{let t=this._innerView.getMaxZoom();const e=((this.crs||{}).options||{}).lods;e&&Array.isArray(e)&&t>=e.length-1&&(t=e.length-1,this._innerView.setMaxZoom(t)),isFinite(t)?(this.maxZoom=t,this.maxScale=this._getScaleByZoom(this.maxZoom)):(this.maxZoom=void 0,this.maxScale=void 0)}!this._scale||this._scale<=0?this._scale=this.minScale:this._scale>this.minScale?this._scale=this.minScale:this._scale<this.maxScale&&(this._scale=this.maxScale)}_limitZoomByExtent(t){this._innerView.getBoundsZoom(t);this._innerView.options.minZoom=this.minZoom}_getMaxBounds(){return function(t){if(t){const e=r.latLng(t.ymin,t.xmin),i=r.latLng(t.ymax,t.xmax);return r.latLngBounds(e,i)}return null}(this._fullExtent)}_initPopup(){this.popup=new Zt({view:this})}hitTest(t){let e=[];return e=this.preferCanvas?this._hitTestCanvas(t):this._hitTestSVG(t)}_hitTestSVG(t){const e=this,i=[],r=this._innerView._container.getBoundingClientRect();document.elementsFromPoint(r.x+t.x,r.y+t.y).forEach(t=>{t&&t._leaflet_id&&t.classList.contains("leaflet-interactive")&&t._leaflet_id&&i.push(e._innerView._targets[t._leaflet_id])});const o=[];return i.forEach(e=>{const i=this._getInnerLayerId(e);if(Object(n.isNull)(i.commonLayerId))return;const r=this.getLayer(i.commonLayerId);let s=null;if(r.type===n.LayerType.igsFeature||r.type===n.LayerType.geojson){s=this._getLayerView(r)._featureSetCache.filter(t=>{if(t.id===i.commonFeatureId)return t})}else r.type===n.LayerType.graphics&&(s=r.graphics.filter(t=>{if(t.id===i.commonFeatureId)return t}));const a={graphic:s&&s.items.length>0?s.items[0]:null,layer:r,mapPoint:this.toMap(t),type:"graphic"};o.push(a)}),o}_hitTestCanvas(t){const e=[],i=this._innerView._renderer,r={clientX:t.x,clientY:t.y},o=i._map.mouseEventToContainerPoint(r);for(let t=i._dragFirst;t;t=t.next){const n=t.layer;n.options.interactive&&n._containsPoint(o)&&("click"!==r.type&&"preclick"!==r.type||!i._map._draggableMoved(n))&&n.feature&&e.push(n)}const s=[];return e.forEach(e=>{const i=this._getInnerLayerId(e);if(Object(n.isNull)(i.commonLayerId))return;const r=this.getLayer(i.commonLayerId);let o=null;if(r.type===n.LayerType.igsFeature||r.type===n.LayerType.geojson){o=this.getLayerView(r)._featureSetCache.filter(t=>{if(t.id===i.commonFeatureId)return t})}else r.type===n.LayerType.graphics&&(o=r.graphics.filter(t=>{if(t.id===i.commonFeatureId)return t}));const a={graphic:o.items.length>0?o.items[0]:null,layer:r,mapPoint:this.toMap(t),type:"graphic"};s.push(a)}),s}_getInnerLayerId(t){let e;const i=function(t){let e,n;for(const r in t){if(void 0!==t[r].commonLayerId){e=t[r].commonLayerId,n=t[r].commonFeatureId;break}e=i(t[r]._eventParents)}return{commonLayerId:e,commonFeatureId:n}};return e=void 0===t.commonLayerId?i(t._eventParents):{commonLayerId:t.commonLayerId,commonFeatureId:t.commonFeatureId}}_initScale(){this._scale&&this._scale>0&&this.minScale>0&&this.maxScale>0&&this._scale<this.minScale&&this._scale>this.maxScale&&this.setScale()}_getZoomByScale(t){let e=void 0;if(this.crs&&this.crs.options&&this.crs.options.lods){let i=-1;for(let n=0;n<this.crs.options.lods.length;n++){const r=this.crs.options.lods[n],o=this.crs.options.lods[n-1];if(r.scale<=0)break;if(i<0&&(i=n),n===i){if(r.scale>0&&t>=r.scale){e=r.level;break}}else{if(t>=r.scale&&t<=o.scale&&o.scale!==r.scale){e=r.level-(t-r.scale)/(o.scale-r.scale);break}if(n===this.crs.options.lods.length-1&&r.scale>0&&t<=r.scale){e=r.level;break}}}}return e}_getScaleExtent(t){return this._getScaleDefaultExtent(t)}_getScaleDefaultExtent(t){const e=this.getSize(),i=e.x/96*.0254*t,r=e.y/96*.0254*t,o=Math.sqrt(i*i+r*r),s=180/Math.PI*Math.atan2(i,r),a=this._center.coordinates,l=(t,e,i)=>{t=n.T.point(t);return n.T.destination(t,e,i,{units:"kilometers"}).geometry.coordinates},h=l(a,o/2e3,-s),u=l(a,o/2e3,180-s);return new n.Extent({xmin:h[0],xmax:u[0],ymin:u[1],ymax:h[1]})}getScale(){const t=this._getScaleByZoom(this._zoom);return this._scale=t,t}_getScaleByZoom(t){let e;if(this.crs&&this.crs.options&&this.crs.options.lods&&!Object(n.isNull)(t))if(t%1==0){e=this.crs.options.lods[t].scale}else{const i=Math.floor(t),n=Math.ceil(t),r=this.crs.options.lods[i],o=this.crs.options.lods[n];e=void 0===r&&void 0===o?0:void 0===r?o.scale:void 0===o?r.scale:r.scale-(r.scale-o.scale)*(t-i)}return e}_getScaleByExtent(t){const e=this.getSize(),i=e.x/96*.0254,r=e.y/96*.0254,o=Math.sqrt(i*i+r*r),s=this._getLatLngFromExtent(t),a=n.T.point([s.southWestLatlng.lng,s.southWestLatlng.lat]),l=n.T.point([s.northEastLatlng.lng,s.northEastLatlng.lat]),h=1e3*n.T.distance(a,l,{units:"kilometers"})/o;return this._scale=h,h}_isEqualBounds(t,e){return t.equals(e)}setScale(t){if(!this._innerView)return;const e=this._getZoomByScale(t);e&&this.flyTo({center:this._center,zoom:e})}getExtentScale(t){const e=this.getSize(),i=e.x/96*.0254,r=e.y/96*.0254,o=Math.sqrt(i*i+r*r),s=n.T.point([t.xmin,t.ymax]),a=n.T.point([t.xmax,t.ymin]),l=1e3*n.T.distance(s,a,{units:"kilometers"})/o;return this._scale=l,l}getResolutionByScale(t){return this._resolution=.0254/96*t,this._resolution}getResolution(){const t=this.getSize(),e=Math.sqrt(t.x*t.x+t.y*t.y),i=this._innerView.getBounds(),r=n.T.point([i._southWest.lng,i._southWest.lat]),o=n.T.point([i._northEast.lng,i._northEast.lat]),s=n.T.distance(r,o,{units:"kilometers"});return this._resolution=1e3*s/e,this._resolution}_moveLayerView(t,e){if(this._isLayerViewSupportReorder(t)){const e=this.allLayerViews.toArray();for(let t=0;t<e.length;t++){const i=e[t];this._isLayerViewSupportReorder(i)&&i.innerLayer&&i.innerLayer.setZIndex&&i.innerLayer.setZIndex(t)}t instanceof Jt&&t._updateGraphicsInOrder()}}_createLayerViewObj(t){let e=null;return t&&t.autoAddTo2D&&(e=hi(this,t)),e}_isEqualCrs(t,e){let i=!1;if(!t||!e)return i;let r=void 0;t.code.split(":").length>1&&(r=t.code.split(":")[1]);const o=new n.SpatialReference({wkid:r,wkt:t.def});let s=void 0;e.code.split(":").length>1&&(s=e.code.split(":")[1]);const a=new n.SpatialReference({wkid:s,wkt:e.def});return o.equals(a)&&e.options&&t.options&&Object(n.compareObject)(e.options.lods,t.options.lods)&&Object(n.compareObject)(e.options.origin,t.options.origin)&&Object(n.compareObject)(e.options.bounds,t.options.bounds)&&(i=!0),i}}ui.fromJSON=function(t){return t=Object(n.defaultValue)(t,{}),new ui(t)},Object.defineProperties(ui.prototype,{scale:{get(){return this._scale},set(t){this.setScale(t)}},zoom:{get(){return this._zoom},set(t){this.setZoom(t)}},extent:{get(){return this._extent},set(t){this.setExtent(t)}},center:{get(){let t=this._center;if(this.crs){const e=this._spatialReference;e.isGeographic||(t=n.Projection.project(this._center,e))}return t},set(t){this.setCenter(t)}},spatialReference:{get(){return this._spatialReference},set(){}},rotation:{get(){return this._rotation},set(t){this._rotation=t,this._innerView&&this._innerView.setBearing(t)}}}),n.Zondy.MapViewLeaflet=ui;var ci=ui;var pi=class extends n.Evented{constructor(t){super();const e=Object(n.defaultValue)(t,{});if(this._id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._container=this._createContainer(e.container),this._visible=Object(n.defaultValue)(e.visible,!0),this._view=Object(n.defaultValue)(e.view,null),!this._view)throw new Error("视图不存在!")}_addView(){}_removeView(){}destroy(){}_createContainer(t){let e=t;return"string"==typeof e&&(e=document.getElementById(e)),t instanceof HTMLElement?e:e=document.createElement("div")}};var fi=class extends pi{constructor(t){super(t),t=Object(n.defaultValue)(t,{}),this.drawConfig=Object(n.defaultValue)(t.drawConfig,{polygon:{allowIntersection:!1,showArea:!0},circlemarker:!1}),this._complete=Object(n.defaultValue)(t.complete,function(){}),this._drawHandler=null,this._drawTool=null,this._initHandler(),this._initStyles()}_initHandler(){const t=this._view.getInnerView();this._processEvent=this._processEvent.bind(this),t&&t.on(L.Draw.Event.CREATED,this._processEvent)}_initStyles(){this.styles={circle:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},marker:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},polygon:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},polyline:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},rectangle:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0}}}_removeHandler(){const t=this._view.getInnerView();t&&t.off(L.Draw.Event.CREATED,this._processEvent)}_processEvent(t){if(t&&t.layer){let e,i;const r=t.layer.toGeoJSON();switch(e=r.geometry.type){case"LineString":i=new n.Feature({geometry:new n.LineString({coordinates:r.geometry.coordinates})});break;case"Polygon":i=new n.Feature({geometry:new n.Polygon({coordinates:r.geometry.coordinates})});break;case"Point":let o;o=t.layer._mRadius?new n.Circle({center:[r.geometry.coordinates[0],r.geometry.coordinates[1]],radius:t.layer._mRadius}):t.layer._radius?new n.Circle({center:[r.geometry.coordinates[0],r.geometry.coordinates[1]],radius:t.layer._radius}):new n.Point({coordinates:r.geometry.coordinates}),i=new n.Feature({geometry:o})}this._complete(e,i)}}_addView(){super._addView();const t=this._view.getInnerView();if(t&&this._visible){const e=L.featureGroup().addTo(t);this._drawTool=new L.Control.Draw({edit:{featureGroup:e,poly:{allowIntersection:!1}},draw:this.drawConfig}),t.addControl(this._drawTool)}}_removeView(){super._removeView();const t=this._view.getInnerView();t&&this._visible&&(this._removeHandler(),this._drawTool&&(t.removeControl(this._drawTool),this._print=null))}start(t,e){const i=this._view.getInnerView();if(i)switch(this._drawHandler&&this._drawHandler.disable(),t){case"lineString":this._drawHandler=new L.Draw.Polyline(i,{...this.styles.polyline,...e}),this._drawHandler.enable();break;case"polygon":this._drawHandler=new L.Draw.Polygon(i,{...this.styles.polygon,...e}),this._drawHandler.enable();break;case"rectangle":this._drawHandler=new L.Draw.Rectangle(i,{...this.styles.rectangle,...e}),this._drawHandler.enable();break;case"marker":this._drawHandler=new L.Draw.Marker(i,{...this.styles.marker,...e}),this._drawHandler.enable();break;case"circle":this._drawHandler=new L.Draw.Circle(i,{...this.styles.circle,...e}),this._drawHandler.enable()}}end(){this._drawHandler&&(this._drawHandler.disable(),this._drawHandler=null)}destory(){}};var di=class extends n.SketchEditor{constructor(t){super(t)}start(t,e){super.start(t,e)}startCustomDrawTool(t){super.startCustomDrawTool(t)}stop(){super.stop()}remove(){super.remove()}update(t,e){super.updateFeature(t,e)}addVertex(t,e){super.addVertex(t,e)}updateVertex(t,e){super.updateVertex(t,e)}removeVertex(t){super.removeVertex(t)}getSketchDataType(){super.getSketchDataType()}setSketchStyle(t){super.setSketchStyle(t)}getSketchStyle(){return super.getSketchStyle()}getGeometry(){return super.getGeometry()}union(t){return super.union(t)}split(t,e){return super.split(t,e)}drawPolylineToPolygon(t){super.drawPolylineToPolygon(t)}undo(){return super.undo()}redo(){return super.redo()}canUndo(){return super.canUndo()}canRedo(){return super.canRedo()}_hitTestSketchEvent(t=this._sketchInnerLayer){const e=this;e.testNum=0;const i=this.view.getInnerLayer(t);i&&i.on("layeradd",t=>{const i=t.layer;if(!i||!i.commonFeatureId||!e._drawTool)return;let n=e._drawTool._getDrawToolByFeatureId(i.commonFeatureId);if(!n){if(!e._drawTool.sketchStage.entityGraphic||"drawn"!==e._drawTool.state)return;{const t=e.view.getLayer(i.commonLayerId).graphics.filter(t=>{if(t.id===i.commonFeatureId)return t}),r=t&&t.items.length>0?t.items[0]:null;this._addFeatureToSketchEditor(r),n=e._drawTool._getDrawToolByFeatureId(i.commonFeatureId)}}n===e._drawTool&&"drawn"!==n.state||e._bindHit(n,i)})}_bindHit(t,e,i=this._sketchInnerLayer){const r=this,o=t.sketchStage.entityGraphic,s=t.editOption._hitTestMode;if(!e){const t=this.view.getInnerLayer(i);if(t)for(const i in t._layers){const n=t._layers[i];if(n.commonFeatureId===o.id){e=n;break}}if(!e)return}const a=function(e){if(!r._editable)return;if(void 0!==r._drawTool&&null!==r._drawTool&&3===r._drawTool._editMode)return;let i;if(i=new n.SpatialReference(r.view._spatialReference).isGeographic?new n.Point({coordinates:[e.latlng.lng,e.latlng.lat]}):n.Projection.project(new n.Point({coordinates:[e.latlng.lng,e.latlng.lat]}),new n.SpatialReference(r.view._spatialReference)),e.mapPoint=i,t._parent?r._drawTool._id!==t._parent._id&&r._drawTool._clearEditGraphics(r._editMode):r._drawTool?r._drawTool._id!==t._id&&(r._drawTool._clearEditGraphics(r._editMode),r._drawTool._stopAll(),r._drawTool=t,r._undoRedoManager.reset(),r._drawTools=[r._drawTool]):(r._drawTool=t,r._undoRedoManager.reset(),r._drawTools=[r._drawTool]),r.fire("selected",{isSelected:!0,selectedDrawTool:r._drawTool,selectedGeometry:r._drawTool.sketchStage.entityGraphic.geometry},r),!t._parent&&0===t._editMode){const e=new n.SketchEditorEvent({type:n.SketchEditorEventType.update,target:r,toolEventInfo:null,state:n.SketchEditorState.start,feature:r._drawTool.sketchStage.entityGraphic,geometry:r._drawTool.sketchStage.entityGraphic.geometry});t.fire(n.SketchEditorEventType.update,e)}t.hitTestFeature(o,e)};0===s?e.on("click",t=>{a(t)}):e.on("mousedown",t=>{a(t)})}_getCenterCoordinate(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}},gi=function(t,e,i){if(t=t||{},e)for(var n in e){var r=!1;if(i&&i.length)for(var o=0,s=i.length;o<s;o++)if(n===i[o]){r=!0;break}if(!0!==r){var a=e[n];void 0!==a&&"CLASS_NAME"!==n&&"function"!=typeof a&&(t[n]=a)}}return t},yi=function(t,e){if(t=t||{},e){for(var i in e){var n=e[i];void 0!==n&&(t[i]=n)}!("function"==typeof window.Event&&e instanceof window.Event)&&e.hasOwnProperty&&e.hasOwnProperty("toString")&&(t.toString=e.toString)}return t},mi=function(...t){class e{constructor(e){for(var i=0;i<t.length;i++)r(this,new t[i](e))}}for(var i=0;i<t.length;i++){var n=t[i];r(e,n),r(e.prototype,n.prototype),r(e.prototype,new n)}return e;function r(t,e){var i=Object.getOwnPropertyNames(e);Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(e)));for(var n=0;n<i.length;n++){var r=i[n];if("constructor"!==r&&"prototype"!==r&&"name"!==r&&"length"!==r){let i=Object.getOwnPropertyDescriptor(e,r);window.ActiveXObject?Object.defineProperty(t,r,i||{}):Object.defineProperty(t,r,i)}}}},_i=function(t,e){if(null==t)return-1;if("function"==typeof t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},vi=function(){for(var t="",e=1;e<=32;e++){t+=Math.floor(16*Math.random()).toString(16),8!=e&&12!=e&&16!=e&&20!=e||(t+="-")}return t},xi=function(t,e,i){for(var n in e)mergeItem(t,e,n,i);return t},bi=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Date)return(e=new Date).setTime(t.getTime()),e;if(t instanceof Array)return e=t.slice(0);if(t instanceof Object){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[i]=bi(t[i]));return e}throw new Error("Unable to copy obj! Its type isn't supported.")};class wi{constructor(){this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=!0,this.hoverable=!0,this.style=null,this.highlightStyle={},this.CLASS_NAME="Zondy.Feature.ShapeParameters"}destroy(){this.refOriginalPosition=null,this.refDataID=null,this.isHoverByRefDataID=null,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=null,this.hoverable=null,this.style=null,this.highlightStyle=null}}class Ei extends wi{constructor(t,e){super(t,e),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=6,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Point"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class Ci extends wi{constructor(t){super(t),this.pointList=t,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Line"}destroy(){this.pointList=null,super.destroy()}}class Li extends wi{constructor(t){super(t),this.pointList=t,this.holePolygonPointLists=null,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Polygon"}destroy(){this.pointList=null,this.holePolygonPointLists=null,super.destroy()}}class Si extends wi{constructor(t,e,i,n){super(t,e,i,n),this.x=isNaN(t)?0:t,this.y=isNaN(t)?0:e,this.width=isNaN(i)?0:i,this.height=isNaN(n)?0:n,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Rectangle"}destroy(){this.x=null,this.y=null,this.width=null,this.height=null,super.destroy()}}class Pi extends wi{constructor(t,e,i,n,r,o,s){super(t,e,i,n,r,o,s),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=isNaN(i)?0:i,this.startAngle=isNaN(n)?0:n,this.endAngle=isNaN(r)?0:r,this.r0=isNaN(o)?0:o,this.clockWise=s,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Sector"}destroy(){this.x=null,this.y=null,this.r=null,this.startAngle=null,this.endAngle=null,this.r0=null,this.clockWise=null,super.destroy()}}class Ii extends wi{constructor(t,e,i){super(t,e,i),this.x=t,this.y=e,this.text=i,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Label"}destroy(){this.x=null,this.y=null,this.text=null,super.destroy()}}class Mi extends wi{constructor(t,e,i,n,r,o,s,a,l){super(t,e,i,n,r,o,s,a,l),this.x=t,this.y=e,this.image=i,this.width=n,this.height=r,this.sx=o,this.sy=s,this.sWidth=a,this.sHeight=l,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Image"}destroy(){this.x=null,this.y=null,this.image=null,this.width=null,this.height=null,this.sx=null,this.sy=null,this.sWidth=null,this.sHeight=null,super.destroy()}}class Ti extends wi{constructor(t,e,i){super(t,e,i),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=isNaN(i)?0:i,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Circle"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class Oi{constructor(){this._handlers={},this.CLASS_NAME="Zondy.LevelRenderer.Eventful"}destroy(){this._handlers=null}one(t,e,i){var n=this._handlers;return e&&t?(n[t]||(n[t]=[]),n[t].push({h:e,one:!0,ctx:i||this}),this):this}bind(t,e,i){var n=this._handlers;return e&&t?(n[t]||(n[t]=[]),n[t].push({h:e,one:!1,ctx:i||this}),this):this}unbind(t,e){var i=this._handlers;if(!t)return this._handlers={},this;if(e){if(i[t]){for(var n=[],r=0,o=i[t].length;r<o;r++)i[t][r].h!==e&&n.push(i[t][r]);i[t]=n}i[t]&&0===i[t].length&&delete i[t]}else delete i[t];return this}dispatch(t){if(this._handlers[t]){var e=arguments,i=e.length;i>3&&(e=Array.prototype.slice.call(e,1));for(var n=this._handlers[t],r=n.length,o=0;o<r;){switch(i){case 1:n[o].h.call(n[o].ctx);break;case 2:n[o].h.call(n[o].ctx,e[1]);break;case 3:n[o].h.call(n[o].ctx,e[1],e[2]);break;default:n[o].h.apply(n[o].ctx,e)}n[o].one?(n.splice(o,1),r--):o++}}return this}dispatchWithContext(t){if(this._handlers[t]){var e=arguments,i=e.length;i>4&&(e=Array.prototype.slice.call(e,1,e.length-1));for(var n=e[e.length-1],r=this._handlers[t],o=r.length,s=0;s<o;){switch(i){case 1:r[s].h.call(n);break;case 2:r[s].h.call(n,e[1]);break;case 3:r[s].h.call(n,e[1],e[2]);break;default:r[s].h.apply(n,e)}r[s].one?(r.splice(s,1),o--):s++}}return this}}class Ni{constructor(){this.BUILTIN_OBJECT={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},this._ctx=null,this._canvas=null,this._pixelCtx=null,this._width=null,this._height=null,this._offsetX=0,this._offsetY=0,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Util"}clone(t){var e=this.BUILTIN_OBJECT;if("object"==typeof t&&null!==t){var i=t;if(t instanceof Array){i=[];for(var n=0,r=t.length;n<r;n++)i[n]=this.clone(t[n])}else if(!e[Object.prototype.toString.call(t)])for(var o in i={},t)t.hasOwnProperty(o)&&(i[o]=this.clone(t[o]));return i}return t}mergeItem(t,e,i,n){var r=this.BUILTIN_OBJECT;e.hasOwnProperty(i)&&("object"!=typeof t[i]||r[Object.prototype.toString.call(t[i])]?!n&&i in t||(t[i]=e[i]):this.merge(t[i],e[i],n))}merge(t,e,i){for(var n in e)this.mergeItem(t,e,n,i);return t}getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}getPixelContext(){return this._pixelCtx||(this._canvas=document.createElement("canvas"),this._width=this._canvas.width,this._height=this._canvas.height,this._pixelCtx=this._canvas.getContext("2d")),this._pixelCtx}adjustCanvasSize(t,e){var i,n=this._canvas,r=this._pixelCtx,o=this._width,s=this._height,a=this._offsetX,l=this._offsetY;t+a>o&&(o=t+a+100,n.width=o,i=!0),e+l>s&&(s=e+l+100,n.height=s,i=!0),t<-a&&(o+=a=100*Math.ceil(-t/100),n.width=o,i=!0),e<-l&&(s+=l=100*Math.ceil(-e/100),n.height=s,i=!0),i&&r.translate(a,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1}inherits(t,e){var i=t.prototype;function n(){}for(var r in n.prototype=e.prototype,t.prototype=new n,i)t.prototype[r]=i[r];t.constructor=t}}class Ai{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Vector"}create(t,e){var i=new(0,this.ArrayCtor)(2);return i[0]=t||0,i[1]=e||0,i}copy(t,e){return t[0]=e[0],t[1]=e[1],t}set(t,e,i){return t[0]=e,t[1]=i,t}add(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}scaleAndAdd(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t}sub(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}len(t){return Math.sqrt(this.lenSquare(t))}lenSquare(t){return t[0]*t[0]+t[1]*t[1]}mul(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t}div(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t}dot(t,e){return t[0]*e[0]+t[1]*e[1]}scale(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}normalize(t,e){var i=this.len(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t}distance(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}distanceSquare(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}negate(t,e){return t[0]=-e[0],t[1]=-e[1],t}lerp(t,e,i,n){return t[0]=e[0]+n*(i[0]-e[0]),t[1]=e[1]+n*(i[1]-e[1]),t}applyTransform(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t}min(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}max(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}length(t){return this.len(t)}lengthSquare(t){return this.lenSquare(t)}dist(t,e){return this.distance(t,e)}distSquare(t,e){return this.distanceSquare(t,e)}}class Ri{constructor(){this.vector=new Ai,this.EPSILON=1e-4,this.THREE_SQRT=Math.sqrt(3),this.ONE_THIRD=1/3,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Curve"}isAroundZero(t){return t>-this.EPSILON&&t<this.EPSILON}isNotAroundZero(t){return t>this.EPSILON||t<-this.EPSILON}cubicAt(t,e,i,n,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*n+3*o*i)}cubicDerivativeAt(t,e,i,n,r){var o=1-r;return 3*(((e-t)*o+2*(i-e)*r)*o+(n-i)*r*r)}cubicRootAt(t,e,i,n,r,o){var s=n+3*(e-i)-t,a=3*(i-2*e+t),l=3*(e-t),h=t-r,u=a*a-3*s*l,c=a*l-9*s*h,p=l*l-3*a*h,f=0;if(this.isAroundZero(u)&&this.isAroundZero(c))if(this.isAroundZero(a))o[0]=0;else{let t=-l/a;t>=0&&t<=1&&(o[f++]=t)}else{var d=c*c-4*u*p;if(this.isAroundZero(d)){var g=c/u;let t=-a/s+g,e=-g/2;t>=0&&t<=1&&(o[f++]=t),e>=0&&e<=1&&(o[f++]=e)}else if(d>0){let t=Math.sqrt(d),e=u*a+1.5*s*(-c+t),i=u*a+1.5*s*(-c-t),n=(-a-((e=e<0?-Math.pow(-e,this.ONE_THIRD):Math.pow(e,this.ONE_THIRD))+(i=i<0?-Math.pow(-i,this.ONE_THIRD):Math.pow(i,this.ONE_THIRD))))/(3*s);n>=0&&n<=1&&(o[f++]=n)}else{var y=(2*u*a-3*s*c)/(2*Math.sqrt(u*u*u)),m=Math.acos(y)/3,_=Math.sqrt(u),v=Math.cos(m);let t=(-a-2*_*v)/(3*s),e=(-a+_*(v+this.THREE_SQRT*Math.sin(m)))/(3*s),i=(-a+_*(v-this.THREE_SQRT*Math.sin(m)))/(3*s);t>=0&&t<=1&&(o[f++]=t),e>=0&&e<=1&&(o[f++]=e),i>=0&&i<=1&&(o[f++]=i)}}return f}cubicExtrema(t,e,i,n,r){var o=6*i-12*e+6*t,s=9*e+3*n-3*t-9*i,a=3*e-3*t,l=0;if(this.isAroundZero(s)){if(this.isNotAroundZero(o)){let t=-a/o;t>=0&&t<=1&&(r[l++]=t)}}else{var h=o*o-4*s*a;if(this.isAroundZero(h))r[0]=-o/(2*s);else if(h>0){let t=Math.sqrt(h),e=(-o+t)/(2*s),i=(-o-t)/(2*s);e>=0&&e<=1&&(r[l++]=e),i>=0&&i<=1&&(r[l++]=i)}}return l}cubicSubdivide(t,e,i,n,r,o){var s=(e-t)*r+t,a=(i-e)*r+e,l=(n-i)*r+i,h=(a-s)*r+s,u=(l-a)*r+a,c=(u-h)*r+h;o[0]=t,o[1]=s,o[2]=h,o[3]=c,o[4]=c,o[5]=u,o[6]=l,o[7]=n}cubicProjectPoint(t,e,i,n,r,o,s,a,l,h,u){var c,p=this.vector.create(),f=this.vector.create(),d=this.vector.create(),g=.005,y=1/0;p[0]=l,p[1]=h;for(let l=0;l<1;l+=.05){f[0]=this.cubicAt(t,i,r,s,l),f[1]=this.cubicAt(e,n,o,a,l);let h=this.vector.distSquare(p,f);h<y&&(c=l,y=h)}y=1/0;for(let l=0;l<32&&!(g<this.EPSILON);l++){let l=c-g,h=c+g;f[0]=this.cubicAt(t,i,r,s,l),f[1]=this.cubicAt(e,n,o,a,l);let u=this.vector.distSquare(f,p);if(l>=0&&u<y)c=l,y=u;else{d[0]=this.cubicAt(t,i,r,s,h),d[1]=this.cubicAt(e,n,o,a,h);let l=this.vector.distSquare(d,p);h<=1&&l<y?(c=h,y=l):g*=.5}}return u&&(u[0]=this.cubicAt(t,i,r,s,c),u[1]=this.cubicAt(e,n,o,a,c)),Math.sqrt(y)}quadraticAt(t,e,i,n){var r=1-n;return r*(r*t+2*n*e)+n*n*i}quadraticDerivativeAt(t,e,i,n){return 2*((1-n)*(e-t)+n*(i-e))}quadraticRootAt(t,e,i,n,r){var o=t-2*e+i,s=2*(e-t),a=t-n,l=0;if(this.isAroundZero(o)){if(this.isNotAroundZero(s)){var h=-a/s;h>=0&&h<=1&&(r[l++]=h)}}else{var u=s*s-4*o*a;if(this.isAroundZero(u)){let t=-s/(2*o);t>=0&&t<=1&&(r[l++]=t)}else if(u>0){let t=Math.sqrt(u),e=(-s+t)/(2*o),i=(-s-t)/(2*o);e>=0&&e<=1&&(r[l++]=e),i>=0&&i<=1&&(r[l++]=i)}}return l}quadraticExtremum(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n}quadraticProjectPoint(t,e,i,n,r,o,s,a,l){var h,u=this.vector.create(),c=this.vector.create(),p=this.vector.create(),f=.005,d=1/0;u[0]=s,u[1]=a;for(let s=0;s<1;s+=.05){c[0]=this.quadraticAt(t,i,r,s),c[1]=this.quadraticAt(e,n,o,s);let a=this.vector.distSquare(u,c);a<d&&(h=s,d=a)}d=1/0;for(let s=0;s<32&&!(f<this.EPSILON);s++){let s=h-f,a=h+f;c[0]=this.quadraticAt(t,i,r,s),c[1]=this.quadraticAt(e,n,o,s);let l=this.vector.distSquare(c,u);if(s>=0&&l<d)h=s,d=l;else{p[0]=this.quadraticAt(t,i,r,a),p[1]=this.quadraticAt(e,n,o,a);let s=this.vector.distSquare(p,u);a<=1&&s<d?(h=a,d=s):f*=.5}}return l&&(l[0]=this.quadraticAt(t,i,r,h),l[1]=this.quadraticAt(e,n,o,h)),Math.sqrt(d)}}class ki{constructor(){this.util=new Ni,this._ctx=null,this.palette=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],this._palette=this.palette,this.highlightColor="rgba(0,0,255,1)",this._highlightColor=this.highlightColor,this.colorRegExp=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,this._nameColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"},this.CLASS_NAME="Zondy.LevelRenderer.Tool.Color"}customPalette(t){this.palette=t}resetPalette(){this.palette=this._palette}getColor(t,e){return t|=0,(e=e||this.palette)[t%e.length]}customHighlight(t){this.highlightColor=t}resetHighlight(){this.highlightColor=this._highlightColor}getHighlightColor(){return this.highlightColor}getRadialGradient(t,e,i,n,r,o,s){var a=this.util;this._ctx||(this._ctx=a.getContext());for(var l=this._ctx.createRadialGradient(t,e,i,n,r,o),h=0,u=s.length;h<u;h++)l.addColorStop(s[h][0],s[h][1]);return l.__nonRecursion=!0,l}getLinearGradient(t,e,i,n,r){var o=this.util;this._ctx||(this._ctx=o.getContext());for(var s=this._ctx.createLinearGradient(t,e,i,n),a=0,l=r.length;a<l;a++)s.addColorStop(r[a][0],r[a][1]);return s.__nonRecursion=!0,s}getStepColors(t,e,i){t=this.toRGBA(t),e=this.toRGBA(e),t=this.getData(t);for(var n=[],r=((e=this.getData(e))[0]-t[0])/i,o=(e[1]-t[1])/i,s=(e[2]-t[2])/i,a=(e[3]-t[3])/i,l=0,h=t[0],u=t[1],c=t[2],p=t[3];l<i;l++)n[l]=this.toColor([this.adjust(Math.floor(h),[0,255]),this.adjust(Math.floor(u),[0,255]),this.adjust(Math.floor(c),[0,255]),p.toFixed(4)-0],"rgba"),h+=r,u+=o,c+=s,p+=a;return h=e[0],u=e[1],c=e[2],p=e[3],n[l]=this.toColor([h,u,c,p],"rgba"),n}getGradientColors(t,e){var i=[],n=t.length;if(void 0===e&&(e=20),1===n)i=this.getStepColors(t[0],t[0],e);else if(n>1)for(var r=0,o=n-1;r<o;r++){var s=this.getStepColors(t[r],t[r+1],e);r<o-1&&s.pop(),i=i.concat(s)}return i}toColor(t,e){if(e=e||"rgb",t&&(3===t.length||4===t.length)){if(t=this.map(t,function(t){return t>1?Math.ceil(t):t}),e.indexOf("hex")>-1)return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1);if(e.indexOf("hs")>-1){var i=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=i[0],t[2]=i[1]}return e.indexOf("a")>-1?(3===t.length&&t.push(1),t[3]=this.adjust(t[3],[0,1]),e+"("+t.slice(0,4).join(",")+")"):e+"("+t.slice(0,3).join(",")+")"}}toArray(t){(t=this.trim(t)).indexOf("rgba")<0&&(t=this.toRGBA(t));var e=[],i=0;return t.replace(/[\d.]+/g,function(t){i<3?t|=0:t=+t,e[i++]=t}),e}convert(t,e){if(!this.isCalculableColor(t))return t;var i=this.getData(t),n=i[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?i=this._HSV_2_RGB(i):t.indexOf("hsl")>-1&&(i=this._HSL_2_RGB(i)),e.indexOf("hsb")>-1||e.indexOf("hsv")>-1?i=this._RGB_2_HSB(i):e.indexOf("hsl")>-1&&(i=this._RGB_2_HSL(i)),i[3]=n,this.toColor(i,e)}toRGBA(t){return this.convert(t,"rgba")}toRGB(t){return this.convert(t,"rgb")}toHex(t){return this.convert(t,"hex")}toHSVA(t){return this.convert(t,"hsva")}toHSV(t){return this.convert(t,"hsv")}toHSBA(t){return this.convert(t,"hsba")}toHSB(t){return this.convert(t,"hsb")}toHSLA(t){return this.convert(t,"hsla")}toHSL(t){return this.convert(t,"hsl")}toName(t){for(var e in this._nameColors)if(this.toHex(this._nameColors[e])===this.toHex(t))return e;return null}trim(t){return String(t).replace(/\s+/g,"")}normalize(t){if(this._nameColors[t]&&(t=this._nameColors[t]),t=(t=this.trim(t)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(t)){var e=(3840&(t=parseInt(t.slice(1),16)))<<8,i=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(i<<4)+i+(n<<4)+n).toString(16).slice(1)}return t}lift(t,e){if(!this.isCalculableColor(t))return t;var i=e>0?1:-1;void 0===e&&(e=0),e=Math.abs(e)>1?1:Math.abs(e),t=this.toRGB(t);for(var n=this.getData(t),r=0;r<3;r++)n[r]=1===i?n[r]*(1-e)|0:(255-n[r])*e+n[r]|0;return"rgb("+n.join(",")+")"}reverse(t){if(!this.isCalculableColor(t))return t;var e=this.getData(this.toRGBA(t));return e=this.map(e,function(t){return 255-t}),this.toColor(e,"rgb")}mix(t,e,i){if(!this.isCalculableColor(t)||!this.isCalculableColor(e))return t;void 0===i&&(i=.5);for(var n=2*(i=1-this.adjust(i,[0,1]))-1,r=this.getData(this.toRGBA(t)),o=this.getData(this.toRGBA(e)),s=r[3]-o[3],a=((n*s==-1?n:(n+s)/(1+n*s))+1)/2,l=1-a,h=[],u=0;u<3;u++)h[u]=r[u]*a+o[u]*l;var c=r[3]*i+o[3]*(1-i);return c=Math.max(0,Math.min(1,c)),1===r[3]&&1===o[3]?this.toColor(h,"rgb"):(h[3]=c,this.toColor(h,"rgba"))}random(){return"#"+Math.random().toString(16).slice(2,8)}getData(t){var e,i,n=(t=this.normalize(t)).match(this.colorRegExp);if(null===n)throw new Error("The color format error");var r,o=[];if(n[2])r=[(e=n[2].replace("#","").split(""))[0]+e[1],e[2]+e[3],e[4]+e[5]],o=this.map(r,function(t){return ki.prototype.adjust.call(this,parseInt(t,16),[0,255])});else if(n[4]){var s=n[4].split(",");i=s[3],r=s.slice(0,3),o=this.map(r,function(t){return t=Math.floor(t.indexOf("%")>0?2.55*parseInt(t,0):t),ki.prototype.adjust.call(this,t,[0,255])}),void 0!==i&&o.push(this.adjust(parseFloat(i),[0,1]))}else if(n[5]||n[6]){var a=(n[5]||n[6]).split(","),l=parseInt(a[0],0)/360,h=a[1],u=a[2];i=a[3],(o=this.map([h,u],function(t){return ki.prototype.adjust.call(this,parseFloat(t)/100,[0,1])})).unshift(l),void 0!==i&&o.push(this.adjust(parseFloat(i),[0,1]))}return o}alpha(t,e){if(!this.isCalculableColor(t))return t;null===e&&(e=1);var i=this.getData(this.toRGBA(t));return i[3]=this.adjust(Number(e).toFixed(4),[0,1]),this.toColor(i,"rgba")}map(t,e){if("function"!=typeof e)throw new TypeError;for(var i=t?t.length:0,n=0;n<i;n++)t[n]=e(t[n]);return t}adjust(t,e){return t<=e[0]?t=e[0]:t>=e[1]&&(t=e[1]),t}isCalculableColor(t){return t instanceof Array||"string"==typeof t}_HSV_2_RGB(t){var e,i,n,r=t[0],o=t[1],s=t[2];if(0===o)e=255*s,i=255*s,n=255*s;else{var a=6*r;6===a&&(a=0);var l=0|a,h=s*(1-o),u=s*(1-o*(a-l)),c=s*(1-o*(1-(a-l))),p=0,f=0,d=0;0===l?(p=s,f=c,d=h):1===l?(p=u,f=s,d=h):2===l?(p=h,f=s,d=c):3===l?(p=h,f=u,d=s):4===l?(p=c,f=h,d=s):(p=s,f=h,d=u),e=255*p,i=255*f,n=255*d}return[e,i,n]}_HSL_2_RGB(t){var e,i,n,r=t[0],o=t[1],s=t[2];if(0===o)e=255*s,i=255*s,n=255*s;else{var a,l=2*s-(a=s<.5?s*(1+o):s+o-o*s);e=255*this._HUE_2_RGB(l,a,r+1/3),i=255*this._HUE_2_RGB(l,a,r),n=255*this._HUE_2_RGB(l,a,r-1/3)}return[e,i,n]}_HUE_2_RGB(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?t+6*(e-t)*i:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}_RGB_2_HSB(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(n,r,o),a=Math.max(n,r,o),l=a-s,h=a;if(0===l)e=0,i=0;else{i=l/a;var u=((a-n)/6+l/2)/l,c=((a-r)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?e=p-c:r===a?e=1/3+u-p:o===a&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,i*=100,h*=100]}_RGB_2_HSL(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(n,r,o),a=Math.max(n,r,o),l=a-s,h=(a+s)/2;if(0===l)e=0,i=0;else{i=h<.5?l/(a+s):l/(2-a-s);var u=((a-n)/6+l/2)/l,c=((a-r)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?e=p-c:r===a?e=1/3+u-p:o===a&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,i*=100,h*=100]}}class Di{static SUtil_smoothBezier(t,e,i,n,r){r&&2===r||(r=[0,0]);var o,s,a=r,l=[],h=[],u=[],c=[],p=!!n;if(p){o=[1/0,1/0],s=[-1/0,-1/0];let e=t.length;for(let i=0;i<e;i++)Di.Util_vector.min(o,o,[t[i][0]+a[0],t[i][1]+a[1]]),Di.Util_vector.max(s,s,[t[i][0]+a[0],t[i][1]+a[1]]);Di.Util_vector.min(o,o,n[0]),Di.Util_vector.max(s,s,n[1])}let f=t.length;for(let n=0;n<f;n++){let r,d,g=[t[n][0]+a[0],t[n][1]+a[1]];if(i)r=[t[n?n-1:f-1][0]+a[0],t[n?n-1:f-1][1]+a[1]],d=[t[(n+1)%f][0]+a[0],t[(n+1)%f][1]+a[1]];else{if(0===n||n===f-1){l.push([t[n][0]+a[0],t[n][1]+a[1]]);continue}r=[t[n-1][0]+a[0],t[n-1][1]+a[1]],d=[t[n+1][0]+a[0],t[n+1][1]+a[1]]}Di.Util_vector.sub(h,d,r),Di.Util_vector.scale(h,h,e);let y=Di.Util_vector.distance(g,r),m=Di.Util_vector.distance(g,d),_=y+m;0!==_&&(y/=_,m/=_),Di.Util_vector.scale(u,h,-y),Di.Util_vector.scale(c,h,m);let v=Di.Util_vector.add([],g,u),x=Di.Util_vector.add([],g,c);p&&(Di.Util_vector.max(v,v,o),Di.Util_vector.min(v,v,s),Di.Util_vector.max(x,x,o),Di.Util_vector.min(x,x,s)),l.push(v),l.push(x)}return i&&l.push(l.shift()),l}static SUtil_smoothSpline(t,e,i,n){n&&2===n||(n=[0,0]);var r=n,o=t.length,s=[],a=0;for(let e=1;e<o;e++)a+=Di.Util_vector.distance([t[e-1][0]+r[0],t[e-1][1]+r[1]],[t[e][0]+r[0],t[e][1]+r[1]]);var l=a/5;l=l<o?o:l;for(let i=0;i<l;i++){let n,a,u,c=i/(l-1)*(e?o:o-1),p=Math.floor(c),f=c-p,d=[t[p%o][0]+r[0],t[p%o][1]+r[1]];e?(n=[t[(p-1+o)%o][0]+r[0],t[(p-1+o)%o][1]+r[1]],a=[t[(p+1)%o][0]+r[0],t[(p+1)%o][1]+r[1]],u=[t[(p+2)%o][0]+r[0],t[(p+2)%o][1]+r[1]]):(n=[t[0===p?p:p-1][0]+r[0],t[0===p?p:p-1][1]+r[1]],a=[t[p>o-2?o-1:p+1][0]+r[0],t[p>o-2?o-1:p+1][1]+r[1]],u=[t[p>o-3?o-1:p+2][0]+r[0],t[p>o-3?o-1:p+2][1]+r[1]]);let g=f*f,y=f*g;s.push([h(n[0],d[0],a[0],u[0],f,g,y),h(n[1],d[1],a[1],u[1],f,g,y)])}return s;function h(t,e,i,n,r,o,s){var a=.5*(i-t),l=.5*(n-e);return(2*(e-i)+a+l)*s+(-3*(e-i)-2*a-l)*o+a*r+e}}static SUtil_dashedLineTo(t,e,i,n,r,o,s){var a=[5,5];if(o="number"!=typeof o?5:o,t.setLineDash)return a[0]=o,a[1]=o,s&&s instanceof Array?t.setLineDash(s):t.setLineDash(a),t.moveTo(e,i),void t.lineTo(n,r);var l=n-e,h=r-i,u=Math.floor(Math.sqrt(l*l+h*h)/o);l/=u,h/=u;for(var c=!0,p=0;p<u;++p)c?t.moveTo(e,i):t.lineTo(e,i),c=!c,e+=l,i+=h;t.lineTo(n,r)}}Di.Util_area=new class{constructor(){this.util=new Ni,this.curve=new Ri,this._ctx=null,this._textWidthCache={},this._textHeightCache={},this._textWidthCacheCounter=0,this._textHeightCacheCounter=0,this.TEXT_CACHE_MAX=5e3,this.PI2=2*Math.PI,this.roots=[-1,-1,-1],this.extrema=[-1,-1],this.CLASS_NAME="Zondy.LevelRenderer.Tool.Area"}normalizeRadian(t){return(t%=this.PI2)<0&&(t+=this.PI2),t}isInside(t,e,i,n){if(!e||!t)return!1;var r=t.type;this._ctx=this._ctx||this.util.getContext();var o=this._mathMethod(t,e,i,n);if(void 0!==o)return o;if(t.buildPath&&this._ctx.isPointInPath)return this._buildPathMethod(t,this._ctx,e,i,n);switch(r){case"ellipse":case"smicellipse":return!0;case"trochoid":var s="out"===e.location?e.r1+e.r2+e.d:e.r1-e.r2+e.d;return this.isInsideCircle(e,i,n,s);case"rose":return this.isInsideCircle(e,i,n,e.maxr);default:return!1}}_mathMethod(t,e,i,n){switch(t.type){case"bezier-curve":return void 0===e.cpX2?this.isInsideQuadraticStroke(e.xStart,e.yStart,e.cpX1,e.cpY1,e.xEnd,e.yEnd,e.lineWidth,i,n):this.isInsideCubicStroke(e.xStart,e.yStart,e.cpX1,e.cpY1,e.cpX2,e.cpY2,e.xEnd,e.yEnd,e.lineWidth,i,n);case"line":return this.isInsideLine(e.xStart,e.yStart,e.xEnd,e.yEnd,e.lineWidth,i,n);case"broken-line":return this.isInsideBrokenLine(e.pointList,e.lineWidth,i,n);case"smicbroken-line":{let r=i,o=n;return t.refOriginalPosition&&(r=i-t.refOriginalPosition[0],o=n-t.refOriginalPosition[1]),this.isInsideBrokenLine(e.pointList,e.lineWidth,r,o)}case"ring":return this.isInsideRing(e.x,e.y,e.r0,e.r,i,n);case"smicring":{let r=e.x,o=e.y;return t.refOriginalPosition&&(r=e.x+t.refOriginalPosition[0],o=e.y+t.refOriginalPosition[1]),this.isInsideRing(r,o,e.r0,e.r,i,n)}case"circle":return this.isInsideCircle(e.x,e.y,e.r,i,n);case"smicpoint":{let r=i,o=n;return t.refOriginalPosition&&(r=i-t.refOriginalPosition[0],o=n-t.refOriginalPosition[1]),this.isInsideCircle(e.x,e.y,e.r,r,o)}case"sector":{let t=e.startAngle*Math.PI/180,r=e.endAngle*Math.PI/180;return e.clockWise||(t=-t,r=-r),this.isInsideSector(e.x,e.y,e.r0,e.r,t,r,!e.clockWise,i,n)}case"smicsector":{let r=e.startAngle*Math.PI/180,o=e.endAngle*Math.PI/180;e.clockWise||(r=-r,o=-o);let s=e.x,a=e.y;return t.refOriginalPosition&&(s=e.x+t.refOriginalPosition[0],a=e.y+t.refOriginalPosition[1]),this.isInsideSector(s,a,e.r0,e.r,r,o,!e.clockWise,i,n)}case"path":return this.isInsidePath(e.pathArray,Math.max(e.lineWidth,5),e.brushType,i,n);case"polygon":case"star":case"smicstar":case"isogon":case"smicisogon":return this.isInsidePolygon(e.pointList,i,n);case"smicpolygon":{let u=i,c=n;if(t.refOriginalPosition&&(u=i-t.refOriginalPosition[0],c=n-t.refOriginalPosition[1]),t.holePolygonPointLists&&t.holePolygonPointLists.length>0){for(var r=this.isInsidePolygon(e.pointList,u,c),o=t.holePolygonPointLists,s=!1,a=0,l=o.length;a<l;a++){var h=o[a];!0===this.isInsidePolygon(h,u,c)&&(s=!0)}return!0===r&&!1===s}return this.isInsidePolygon(e.pointList,u,c)}case"text":var u=e.__rect||t.getRect(e);return this.isInsideRect(u.x,u.y,u.width,u.height,i,n);case"smictext":var c=t.getTextBackground(e);return this.isInsidePolygon(c,i,n);case"rectangle":case"image":return this.isInsideRect(e.x,e.y,e.width,e.height,i,n);case"smicimage":{let r=e.x,o=e.y;return t.refOriginalPosition&&(r=e.x+t.refOriginalPosition[0],o=e.y+t.refOriginalPosition[1]),this.isInsideRect(r,o,e.width,e.height,i,n)}}}_buildPathMethod(t,e,i,n,r){return e.beginPath(),t.buildPath(e,i),e.closePath(),e.isPointInPath(n,r)}isOutside(t,e,i,n){return!this.isInside(t,e,i,n)}isInsideLine(t,e,i,n,r,o,s){if(0===r)return!1;var a=Math.max(r,5),l=0;if(s>e+a&&s>n+a||s<e-a&&s<n-a||o>t+a&&o>i+a||o<t-a&&o<i-a)return!1;if(t===i)return Math.abs(o-t)<=a/2;var h=(l=(e-n)/(t-i))*o-s+(t*n-i*e)/(t-i);return h*h/(l*l+1)<=a/2*a/2}isInsideCubicStroke(t,e,i,n,r,o,s,a,l,h,u){if(0===l)return!1;var c=Math.max(l,5);return!(u>e+c&&u>n+c&&u>o+c&&u>a+c||u<e-c&&u<n-c&&u<o-c&&u<a-c||h>t+c&&h>i+c&&h>r+c&&h>s+c||h<t-c&&h<i-c&&h<r-c&&h<s-c)&&this.curve.cubicProjectPoint(t,e,i,n,r,o,s,a,h,u,null)<=c/2}isInsideQuadraticStroke(t,e,i,n,r,o,s,a,l){if(0===s)return!1;var h=Math.max(s,5);return!(l>e+h&&l>n+h&&l>o+h||l<e-h&&l<n-h&&l<o-h||a>t+h&&a>i+h&&a>r+h||a<t-h&&a<i-h&&a<r-h)&&this.curve.quadraticProjectPoint(t,e,i,n,r,o,a,l,null)<=h/2}isInsideArcStroke(t,e,i,n,r,o,s,a,l){var h=this.PI2;if(0===s)return!1;var u=Math.max(s,5);a-=t,l-=e;var c=Math.sqrt(a*a+l*l);if(c-u>i||c+u<i)return!1;if(Math.abs(n-r)>=h)return!0;if(o){var p=n;n=this.normalizeRadian(r),r=this.normalizeRadian(p)}else n=this.normalizeRadian(n),r=this.normalizeRadian(r);n>r&&(r+=h);var f=Math.atan2(l,a);return f<0&&(f+=h),f>=n&&f<=r||f+h>=n&&f+h<=r}isInsideBrokenLine(t,e,i,n){for(var r=Math.max(e,10),o=0,s=t.length-1;o<s;o++){var a=t[o][0],l=t[o][1],h=t[o+1][0],u=t[o+1][1];if(this.isInsideLine(a,l,h,u,r,i,n))return!0}return!1}isInsideRing(t,e,i,n,r,o){var s=(r-t)*(r-t)+(o-e)*(o-e);return s<n*n&&s>i*i}isInsideRect(t,e,i,n,r,o){return r>=t&&r<=t+i&&o>=e&&o<=e+n}isInsideCircle(t,e,i,n,r){return(n-t)*(n-t)+(r-e)*(r-e)<i*i}isInsideSector(t,e,i,n,r,o,s,a,l){return this.isInsideArcStroke(t,e,(i+n)/2,r,o,s,n-i,a,l)}isInsidePolygon(t,e,i){for(var n=t.length,r=0,o=0,s=n-1;o<n;o++){var a=t[s][0],l=t[s][1],h=t[o][0],u=t[o][1];r+=this.windingLine(a,l,h,u,e,i),s=o}return 0!==r}windingLine(t,e,i,n,r,o){return o>e&&o>n||o<e&&o<n?0:n==e?0:(o-e)/(n-e)*(i-t)+t>r?n<e?1:-1:0}swapExtrema(){var t=this.extrema[0];this.extrema[0]=this.extrema[1],this.extrema[1]=t}windingCubic(t,e,i,n,r,o,s,a,l,h){var u=this.curve,c=this.roots,p=this.extrema;if(h>e&&h>n&&h>o&&h>a||h<e&&h<n&&h<o&&h<a)return 0;var f=u.cubicRootAt(e,n,o,a,h,c);if(0===f)return 0;for(var d,g,y=0,m=-1,_=0;_<f;_++){var v=c[_];u.cubicAt(t,i,r,s,v)<l||(m<0&&(m=u.cubicExtrema(e,n,o,a,p),p[1]<p[0]&&m>1&&this.swapExtrema(),d=u.cubicAt(e,n,o,a,p[0]),m>1&&(g=u.cubicAt(e,n,o,a,p[1]))),2===m?v<p[0]?y+=d<e?1:-1:v<p[1]?y+=g<d?1:-1:y+=a<g?1:-1:v<p[0]?y+=d<e?1:-1:y+=a<d?1:-1)}return y}windingQuadratic(t,e,i,n,r,o,s,a){var l=this.curve,h=this.roots;if(a>e&&a>n&&a>o||a<e&&a<n&&a<o)return 0;var u=l.quadraticRootAt(e,n,o,a,h);if(0===u)return 0;var c=l.quadraticExtremum(e,n,o);if(c>=0&&c<=1){var p=0,f=l.quadraticAt(e,n,o,c);for(let n=0;n<u;n++)l.quadraticAt(t,i,r,h[n])>s||(h[n]<c?p+=f<e?1:-1:p+=o<f?1:-1);return p}return l.quadraticAt(t,i,r,h[0])>s?0:o<e?1:-1}windingArc(t,e,i,n,r,o,s,a){var l=this.roots,h=this.PI2;if((a-=e)>i||a<-i)return 0;let u=Math.sqrt(i*i-a*a);if(l[0]=-u,l[1]=u,Math.abs(n-r)>=h){n=0,r=h;var c=o?1:-1;return s>=l[0]+t&&s<=l[1]+t?c:0}if(o){let t=n;n=this.normalizeRadian(r),r=this.normalizeRadian(t)}else n=this.normalizeRadian(n),r=this.normalizeRadian(r);n>r&&(r+=h);var p=0;for(let e=0;e<2;e++){var f=l[e];if(f+t>s){let t=Math.atan2(a,f),e=o?1:-1;t<0&&(t=h+t),(t>=n&&t<=r||t+h>=n&&t+h<=r)&&(t>Math.PI/2&&t<1.5*Math.PI&&(e=-e),p+=e)}}return p}isInsidePath(t,e,i,n,r){for(var o=0,s=0,a=0,l=0,h=0,u=!0,c=!0,p="stroke"===(i=i||"fill")||"both"===i,f="fill"===i||"both"===i,d=0;d<t.length;d++){var g=t[d],y=g.points;if(u||"M"===g.command){if(d>0&&(f&&(o+=this.windingLine(s,a,l,h,n,r)),0!==o))return!0;l=y[y.length-2],h=y[y.length-1],u=!1,c&&"A"!==g.command&&(c=!1,s=l,a=h)}switch(g.command){case"M":s=y[0],a=y[1];break;case"L":if(p&&this.isInsideLine(s,a,y[0],y[1],e,n,r))return!0;f&&(o+=this.windingLine(s,a,y[0],y[1],n,r)),s=y[0],a=y[1];break;case"C":if(p&&this.isInsideCubicStroke(s,a,y[0],y[1],y[2],y[3],y[4],y[5],e,n,r))return!0;f&&(o+=this.windingCubic(s,a,y[0],y[1],y[2],y[3],y[4],y[5],n,r)),s=y[4],a=y[5];break;case"Q":if(p&&this.isInsideQuadraticStroke(s,a,y[0],y[1],y[2],y[3],e,n,r))return!0;f&&(o+=this.windingQuadratic(s,a,y[0],y[1],y[2],y[3],n,r)),s=y[2],a=y[3];break;case"A":var m=y[0],_=y[1],v=y[2],x=y[3],b=y[4],w=y[5],E=Math.cos(b)*v+m,C=Math.sin(b)*x+_;c?(c=!1,l=E,h=C):o+=this.windingLine(s,a,E,C);var L=(n-m)*x/v+m;if(p&&this.isInsideArcStroke(m,_,x,b,b+w,1-y[7],e,L,r))return!0;f&&(o+=this.windingArc(m,_,x,b,b+w,1-y[7],L,r)),s=Math.cos(b+w)*v+m,a=Math.sin(b+w)*x+_;break;case"z":if(p&&this.isInsideLine(s,a,l,h,e,n,r))return!0;u=!0}}return f&&(o+=this.windingLine(s,a,l,h,n,r)),0!==o}getTextWidth(t,e){var i=t+":"+e;if(this._textWidthCache[i])return this._textWidthCache[i];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e);for(var n=0,r=0,o=(t=(t+"").split("\n")).length;r<o;r++)n=Math.max(this._ctx.measureText(t[r]).width,n);return this._ctx.restore(),this._textWidthCache[i]=n,++this._textWidthCacheCounter>this.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),n}getTextHeight(t,e){var i=t+":"+e;if(this._textHeightCache[i])return this._textHeightCache[i];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e),t=(t+"").split("\n");var n=(this._ctx.measureText("ZH").width+2)*t.length;return this._ctx.restore(),this._textHeightCache[i]=n,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),n}},Di.Util_color=new ki,Di.Util_computeBoundingBox=new class{constructor(){3===arguments.length&&this.computeBoundingBox(arguments),this.CLASS_NAME="Zondy.LevelRenderer.Tool.ComputeBoundingBox"}computeBoundingBox(t,e,i){if(0!==t.length){for(var n=t[0][0],r=t[0][0],o=t[0][1],s=t[0][1],a=1;a<t.length;a++){var l=t[a];l[0]<n&&(n=l[0]),l[0]>r&&(r=l[0]),l[1]<o&&(o=l[1]),l[1]>s&&(s=l[1])}e[0]=n,e[1]=o,i[0]=r,i[1]=s}}cubeBezier(t,e,i,n,r,o){var s=new Ri,a=[];s.cubicExtrema(t[0],e[0],i[0],n[0],a);for(let r=0;r<a.length;r++)a[r]=s.cubicAt(t[0],e[0],i[0],n[0],a[r]);var l=[];s.cubicExtrema(t[1],e[1],i[1],n[1],l);for(let r=0;r<l.length;r++)l[r]=s.cubicAt(t[1],e[1],i[1],n[1],l[r]);a.push(t[0],n[0]),l.push(t[1],n[1]);var h=Math.min.apply(null,a),u=Math.max.apply(null,a),c=Math.min.apply(null,l),p=Math.max.apply(null,l);r[0]=h,r[1]=c,o[0]=u,o[1]=p}quadraticBezier(t,e,i,n,r){var o=new Ri,s=o.quadraticExtremum(t[0],e[0],i[0]),a=o.quadraticExtremum(t[1],e[1],i[1]),l=1-(s=Math.max(Math.min(s,1),0)),h=1-(a=Math.max(Math.min(a,1),0)),u=l*l*t[0]+2*l*s*e[0]+s*s*i[0],c=l*l*t[1]+2*l*s*e[1]+s*s*i[1],p=h*h*t[0]+2*h*a*e[0]+a*a*i[0],f=h*h*t[1]+2*h*a*e[1]+a*a*i[1];n[0]=Math.min(t[0],i[0],u,p),n[1]=Math.min(t[1],i[1],c,f),r[0]=Math.max(t[0],i[0],u,p),r[1]=Math.max(t[1],i[1],c,f)}arc(t,e,i,n,r,o,s,a){var l=new Ai,h=l.create(),u=l.create(),c=l.create();if(h[0]=Math.cos(n)*i+t,h[1]=Math.sin(n)*i+e,u[0]=Math.cos(r)*i+t,u[1]=Math.sin(r)*i+e,l.min(s,h,u),l.max(a,h,u),(n%=2*Math.PI)<0&&(n+=2*Math.PI),(r%=2*Math.PI)<0&&(r+=2*Math.PI),n>r&&!o?r+=2*Math.PI:n<r&&o&&(n+=2*Math.PI),o){var p=r;r=n,n=p}for(var f=0;f<r;f+=Math.PI/2)f>n&&(c[0]=Math.cos(f)*i+t,c[1]=Math.sin(f)*i+e,l.min(s,c,s),l.max(a,c,a))}},Di.Util_curve=new Ri,Di.Util_env=new class{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Tool.Env";var t=this;return function(e){var i=t.os={},n=t.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),o=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),a=e.match(/(iPod)(.*OS\s([\d_]+))?/),l=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),h=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),u=h&&e.match(/TouchPad/),c=e.match(/Kindle\/([\d.]+)/),p=e.match(/Silk\/([\d._]+)/),f=e.match(/(BlackBerry).*Version\/([\d.]+)/),d=e.match(/(BB10).*Version\/([\d.]+)/),g=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),y=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),_=e.match(/Firefox\/([\d.]+)/),v=e.match(/MSIE ([\d.]+)/),x=r&&e.match(/Mobile\//)&&!m,b=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m;return(n.webkit=!!r)&&(n.version=r[1]),o&&(i.android=!0,i.version=o[2]),l&&!a&&(i.ios=i.iphone=!0,i.version=l[2].replace(/_/g,".")),s&&(i.ios=i.ipad=!0,i.version=s[2].replace(/_/g,".")),a&&(i.ios=i.ipod=!0,i.version=a[3]?a[3].replace(/_/g,"."):null),h&&(i.webos=!0,i.version=h[2]),u&&(i.touchpad=!0),f&&(i.blackberry=!0,i.version=f[2]),d&&(i.bb10=!0,i.version=d[2]),g&&(i.rimtabletos=!0,i.version=g[2]),y&&(n.playbook=!0),c&&(i.kindle=!0,i.version=c[1]),p&&(n.silk=!0,n.version=p[1]),!p&&i.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),_&&(n.firefox=!0,n.version=_[1]),v&&(n.ie=!0,n.version=v[1]),x&&(e.match(/Safari/)||i.ios)&&(n.safari=!0),b&&(n.webview=!0),v&&(n.ie=!0,n.version=v[1]),i.tablet=!!(s||y||o&&!e.match(/Mobile/)||_&&e.match(/Tablet/)||v&&!e.match(/Phone/)&&e.match(/Touch/)),i.phone=!(i.tablet||i.ipod||!(o||l||h||f||d||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||_&&e.match(/Mobile/)||v&&e.match(/Touch/))),{browser:n,os:i,canvasSupported:!!document.createElement("canvas").getContext}}(navigator.userAgent)}destory(){return!0}},Di.Util_event=new class{constructor(){this.stop="function"==typeof window.addEventListener?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0},this.CLASS_NAME="Zondy.LevelRenderer.Tool.Event"}getX(t){return void 0!==t.zrenderX&&t.zrenderX||void 0!==t.offsetX&&t.offsetX||void 0!==t.layerX&&t.layerX||void 0!==t.clientX&&t.clientX}getY(t){return void 0!==t.zrenderY&&t.zrenderY||void 0!==t.offsetY&&t.offsetY||void 0!==t.layerY&&t.layerY||void 0!==t.clientY&&t.clientY}getDelta(t){return void 0!==t.zrenderDelta&&t.zrenderDelta||void 0!==t.wheelDelta&&t.wheelDelta||void 0!==t.detail&&-t.detail}},Di.Util_http=new class{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Tool.Http"}get(t,e,i){if("object"==typeof t){var n=t;t=n.url,e=n.onsuccess,i=n.onerror}var r=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");r.open("GET",t,!0),r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300||304===r.status?e&&e(r.responseText):i&&i(),r.onreadystatechange=new Function,r=null)},r.send(null)}},Di.Util_math=new class{constructor(){this._radians=window.Math.PI/180,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Math"}sin(t,e){return window.Math.sin(e?t*this._radians:t)}cos(t,e){return window.Math.cos(e?t*this._radians:t)}degreeToRadian(t){return t*this._radians}radianToDegree(t){return t/this._radians}},Di.Util_matrix=new class{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Matrix"}create(){var t=new(0,this.ArrayCtor)(6);return this.identity(t),t}identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}copy(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}mul(t,e,i){return t[0]=e[0]*i[0]+e[2]*i[1],t[1]=e[1]*i[0]+e[3]*i[1],t[2]=e[0]*i[2]+e[2]*i[3],t[3]=e[1]*i[2]+e[3]*i[3],t[4]=e[0]*i[4]+e[2]*i[5]+e[4],t[5]=e[1]*i[4]+e[3]*i[5]+e[5],t}translate(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+i[0],t[5]=e[5]+i[1],t}rotate(t,e,i){var n=e[0],r=e[2],o=e[4],s=e[1],a=e[3],l=e[5],h=Math.sin(i),u=Math.cos(i);return t[0]=n*u+s*h,t[1]=-n*h+s*u,t[2]=r*u+a*h,t[3]=-r*h+u*a,t[4]=u*o+h*l,t[5]=u*l-h*o,t}scale(t,e,i){var n=i[0],r=i[1];return t[0]=e[0]*n,t[1]=e[1]*r,t[2]=e[2]*n,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*r,t}invert(t,e){var i=e[0],n=e[2],r=e[4],o=e[1],s=e[3],a=e[5],l=i*s-o*n;return l?(l=1/l,t[0]=s*l,t[1]=-o*l,t[2]=-n*l,t[3]=i*l,t[4]=(n*a-s*r)*l,t[5]=(o*r-i*a)*l,t):null}mulVector(t,e,i){var n=e[0],r=e[2],o=e[4],s=e[1],a=e[3],l=e[5];return t[0]=i[0]*n+i[1]*r+o,t[1]=i[0]*s+i[1]*a+l,t}},Di.Util=new Ni,Di.Util_vector=new Ai;class zi{constructor(){this.position=[0,0],this.rotation=[0,0,0],this.scale=[1,1,0,0],this.needLocalTransform=!1,this.needTransform=!1,this.CLASS_NAME="Zondy.LevelRenderer.Transformable",this.lookAt=function(){var t=Di.Util_vector.create();return function(e){this.transform||(this.transform=Di.Util_matrix.create());var i=this.transform;function n(t){return t>-5e-5&&t<5e-5}Di.Util_vector.sub(t,e,this.position),n(t[0])&&n(t[1])||(Di.Util_vector.normalize(t,t),i[2]=t[0]*this.scale[1],i[3]=t[1]*this.scale[1],i[0]=t[1]*this.scale[0],i[1]=-t[0]*this.scale[0],i[4]=this.position[0],i[5]=this.position[1],this.decomposeTransform())}}()}destroy(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}updateNeedTransform(){function t(t){return t>5e-5||t<-5e-5}this.needLocalTransform=t(this.rotation[0])||t(this.position[0])||t(this.position[1])||t(this.scale[0]-1)||t(this.scale[1]-1)}updateTransform(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,this.needTransform){var t=[0,0],e=this.transform||Di.Util_matrix.create();if(Di.Util_matrix.identity(e),this.needLocalTransform){if(i(this.scale[0])||i(this.scale[1])){t[0]=-this.scale[2]||0,t[1]=-this.scale[3]||0;let n=i(t[0])||i(t[1]);n&&Di.Util_matrix.translate(e,e,t),Di.Util_matrix.scale(e,e,this.scale),n&&(t[0]=-t[0],t[1]=-t[1],Di.Util_matrix.translate(e,e,t))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){t[0]=-this.rotation[1]||0,t[1]=-this.rotation[2]||0;let n=i(t[0])||i(t[1]);n&&Di.Util_matrix.translate(e,e,t),Di.Util_matrix.rotate(e,e,this.rotation[0]),n&&(t[0]=-t[0],t[1]=-t[1],Di.Util_matrix.translate(e,e,t))}}else 0!==this.rotation&&Di.Util_matrix.rotate(e,e,this.rotation);(i(this.position[0])||i(this.position[1]))&&Di.Util_matrix.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?Di.Util_matrix.mul(this.transform,this.parent.transform,this.transform):Di.Util_matrix.copy(this.transform,this.parent.transform))}function i(t){return t>5e-5||t<-5e-5}}setTransform(t){if(this.needTransform){var e=this.transform;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}}decomposeTransform(){if(this.transform){var t=this.transform,e=t[0]*t[0]+t[1]*t[1],i=this.position,n=this.scale,r=this.rotation;s(e-1)&&(e=Math.sqrt(e));var o=t[2]*t[2]+t[3]*t[3];s(o-1)&&(o=Math.sqrt(o)),i[0]=t[4],i[1]=t[5],n[0]=e,n[1]=o,n[2]=n[3]=0,r[0]=Math.atan2(-t[1]/o,t[0]/e),r[1]=r[2]=0}function s(t){return t>5e-5||t<-5e-5}}}class Bi extends(mi(Oi,zi)){constructor(t){super(t),t=t||{},this.id=null,this.style={},this.highlightStyle=null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],this.invisible=!1,this.ignore=!1,this.zlevel=0,this.draggable=!1,this.clickable=!1,this.hoverable=!0,this.z=0,this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,yi(this,t),this.id=this.id||vi(),this.CLASS_NAME="Zondy.LevelRenderer.Shape",this.getTansform=function(){var t=[];return function(e,i){var n=[e,i];return this.needTransform&&this.transform&&(Di.Util_matrix.invert(t,this.transform),Di.Util_matrix.mulVector(n,t,[e,i,1]),e===n[0]&&i===n[1]&&this.updateNeedTransform()),n}}()}destroy(){this.id=null,this.style=null,this.highlightStyle=null,this.parent=null,this.__dirty=null,this.__clipShapes=null,this.invisible=null,this.ignore=null,this.zlevel=null,this.draggable=null,this.clickable=null,this.hoverable=null,this.z=null,this.refOriginalPosition=null,this.refDataID=null,this.refDataHoverGroup=null,this.isHoverByRefDataID=null,this.dataInfo=null,super.destroy()}brush(t,e){var i=this.beforeBrush(t,e);switch(t.beginPath(),this.buildPath(t,i),i.brushType){case"both":this.setCtxGlobalAlpha(t,"fill",i),t.fill(),i.lineWidth>0&&(this.setCtxGlobalAlpha(t,"stroke",i),t.stroke()),this.setCtxGlobalAlpha(t,"reset",i);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",i),i.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",i);break;default:this.setCtxGlobalAlpha(t,"fill",i),t.fill(),this.setCtxGlobalAlpha(t,"reset",i)}this.drawText(t,i,this.style),this.afterBrush(t)}beforeBrush(t,e){var i=this.style;return this.brushTypeOnly&&(i.brushType=this.brushTypeOnly),e&&(i=this.getHighlightStyle(i,this.highlightStyle||{},this.brushTypeOnly)),"stroke"===this.brushTypeOnly&&(i.strokeColor=i.strokeColor||i.color),t.save(),this.doClip(t),this.setContext(t,i),this.setTransform(t),i}afterBrush(t){t.restore()}setContext(t,e){for(var i=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],n=0,r=i.length;n<r;n++){var o=e[i[n][0]],s=i[n][1];void 0!==o&&(t[s]=o)}}doClip(t){var e=Di.Util_matrix.create();if(this.__clipShapes)for(var i=0;i<this.__clipShapes.length;i++){var n=this.__clipShapes[i];if(n.needTransform){let i=n.transform;Di.Util_matrix.invert(e,i),t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}if(t.beginPath(),n.buildPath(t,n.style),t.clip(),n.needTransform){let i=e;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}}}getHighlightStyle(t,e,i){var n={};for(let e in t)n[e]=t[e];var r=Di.Util_color.getHighlightColor();"stroke"!==t.brushType?(n.strokeColor=r,n.lineWidth=t.lineWidth||1,n.brushType="both"):"stroke"!==i?(n.strokeColor=r,n.lineWidth=t.lineWidth||1):n.strokeColor=e.strokeColor||Di.Util_color.mix(t.strokeColor,Di.Util_color.toRGB(r));for(let t in e)void 0!==e[t]&&(n[t]=e[t]);return n}getHighlightZoom(){return"text"!==this.type?6:2}drift(t,e){this.position[0]+=t,this.position[1]+=e}buildPath(t,e){}getRect(t){}isCover(t,e){var i=this.getTansform(t,e);t=i[0],e=i[1];var n=this.style.__rect;return n||(n=this.style.__rect=this.getRect(this.style)),t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height&&Di.Util_area.isInside(this,this.style,t,e)}drawText(t,e,i){if(void 0!==e.text&&!1!==e.text){var n=e.textColor||e.color||e.strokeColor;t.fillStyle=n;var r,o,s,a,l=10,h=e.textPosition||this.textPosition||"top",u=[];switch(u=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],h){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(i||e).__rect||this.getRect(i||e);switch(h){case"inside":s=c.x+c.width/2,a=c.y+c.height/2,r="center",o="middle","stroke"!==e.brushType&&n===e.color&&(t.fillStyle="#fff");break;case"left":s=c.x-l,a=c.y+c.height/2,r="end",o="middle";break;case"right":s=c.x+c.width+l,a=c.y+c.height/2,r="start",o="middle";break;case"top":s=c.x+c.width/2,a=c.y-l,r="center",o="bottom";break;case"bottom":s=c.x+c.width/2,a=c.y+c.height+l,r="center",o="top"}}break;case"start":case"end":var p=0,f=0,d=0,g=0;if(void 0!==e.pointList){var y=e.pointList;if(y.length<2)return;var m=y.length;switch(h){case"start":p=y[0][0]+u[0],f=y[1][0]+u[0],d=y[0][1]+u[1],g=y[1][1]+u[1];break;case"end":p=y[m-2][0]+u[0],f=y[m-1][0]+u[0],d=y[m-2][1]+u[1],g=y[m-1][1]+u[1]}}else p=e.xStart+u[0]||0,f=e.xEnd+u[0]||0,d=e.yStart+u[1]||0,g=e.yEnd+u[1]||0;switch(h){case"start":r=p<f?"end":"start",o=d<g?"bottom":"top",s=p,a=d;break;case"end":r=p<f?"start":"end",o=d<g?"top":"bottom",s=f,a=g}l-=4,p&&f&&p!==f?s-="end"===r?l:-l:r="center",d!==g?a-="bottom"===o?l:-l:o="middle";break;case"specific":s=e.textX||0,a=e.textY||0,r="start",o="middle"}e.labelXOffset&&!isNaN(e.labelXOffset)&&(s+=e.labelXOffset),e.labelYOffset&&!isNaN(e.labelYOffset)&&(a+=e.labelYOffset),null!=s&&null!=a&&Bi._fillText(t,e.text,s,a,e.textFont,e.textAlign||r,e.textBaseline||o)}}modSelf(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)}isSilent(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)}setCtxGlobalAlpha(t,e,i){t.globalAlpha="fill"===e?void 0===i.fillOpacity?void 0===i.opacity?1:i.opacity:i.fillOpacity:"stroke"===e?void 0===i.strokeOpacity?void 0===i.opacity?1:i.opacity:i.strokeOpacity:void 0===i.opacity?1:i.opacity}static _fillText(t,e,i,n,r,o,s){r&&(t.font=r),t.textAlign=o,t.textBaseline=s;var a=Bi._getTextRect(e,i,n,r,o,s);e=(e+"").split("\n");var l=Di.Util_area.getTextHeight("ZH",r);switch(s){case"top":n=a.y;break;case"bottom":n=a.y+l;break;default:n=a.y+l/2}for(var h=0,u=e.length;h<u;h++)t.fillText(e[h],i,n),n+=l}static _getTextRect(t,e,i,n,r,o){var s=Di.Util_area.getTextWidth(t,n),a=Di.Util_area.getTextHeight("ZH",n);switch(t=(t+"").split("\n"),r){case"end":case"right":e-=s;break;case"center":e-=s/2}switch(o){case"top":break;case"bottom":i-=a*t.length;break;default:i-=a*t.length/2}return{x:e,y:i,width:s,height:a*t.length}}}class Fi extends Bi{constructor(t){super(t),this.type="smicpoint",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicPoint"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;t.arc(e.x+i[0],e.y+i[1],e.r,0,2*Math.PI,!0)}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition;return t.__rect?t.__rect:(e="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(t.x+i[0]-t.r-e/2),y:Math.round(t.y+i[1]-t.r-e/2),width:2*t.r+e,height:2*t.r+e},t.__rect)}}class Vi extends Bi{constructor(t){super(t),this.type="smictext",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.SmicText"}destroy(){this.type=null,super.destroy()}brush(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=this.style;if(e&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),void 0!==n.text&&!1!==n.text){t.save(),this.doClip(t),this.setContext(t,n),this.setTransform(t),n.textFont&&(t.font=n.textFont),t.textAlign=n.textAlign||"start",t.textBaseline=n.textBaseline||"middle";var r,o=(n.text+"").split("\n"),s=Di.Util_area.getTextHeight("ZH",n.textFont),a=this.getRectNoRotation(n),l=n.x+i[0];r="top"===n.textBaseline?a.y:"bottom"===n.textBaseline?a.y+s:a.y+s/2;for(var h=n.x+i[0],u=n.y+i[1],c=0,p=o.length;c<p;c++){switch(n.labelRect&&(t.fillRect(a.x-2,a.y,a.width+4,a.height),t.fillStyle=n.strokeColor,t.strokeRect(a.x-2,a.y,a.width+4,a.height),t.fillStyle=n.textColor),n.brushType){case"stroke":this.setCtxGlobalAlpha(t,"stroke",n),n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?t.strokeText(o[c],0,s*c,n.maxWidth):t.strokeText(o[c],0,s*c):"bottom"===n.textBaseline?n.maxWidth?t.strokeText(o[c],0,s*(c+1)-a.height,n.maxWidth):t.strokeText(o[c],0,s*(c+1)-a.height):n.maxWidth?t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth):t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2),t.restore()):n.maxWidth?t.strokeText(o[c],l,r,n.maxWidth):t.strokeText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n);break;case"both":n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*c,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*c,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*c),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*c),this.setCtxGlobalAlpha(t,"reset",n)):"bottom"===n.textBaseline?n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height),this.setCtxGlobalAlpha(t,"reset",n)):n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height/2-s/2),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2),this.setCtxGlobalAlpha(t,"reset",n)),t.restore()):n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],l,r,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],l,r,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n));break;default:this.setCtxGlobalAlpha(t,"fill",n),n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?t.fillText(o[c],0,s*c,n.maxWidth):t.fillText(o[c],0,s*c):"bottom"===n.textBaseline?n.maxWidth?t.fillText(o[c],0,s*(c+1)-a.height,n.maxWidth):t.fillText(o[c],0,s*(c+1)-a.height):n.maxWidth?t.fillText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth):t.fillText(o[c],0,s*(c+1)-a.height/2-s/2),t.restore()):n.maxWidth?t.fillText(o[c],l,r,n.maxWidth):t.fillText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n)}r+=s}t.restore()}}getRect(t){if(t.__rect)return t.__rect;for(var e,i,n,r,o=this.getTextBackground(t,!0),s=0,a=o.length;s<a;s++){var l=o[s];0===s?(e=l[0],n=l[0],i=l[1],r=l[1]):(l[0]<e&&(e=l[0]),l[0]>n&&(n=l[0]),l[1]<i&&(i=l[1]),l[1]>r&&(r=l[1]))}return t.__rect={x:e,y:i,width:n-e,height:r-i},t.__rect}getRectNoRotation(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition,n=Di.Util_area.getTextHeight("ZH",t.textFont),r=Di.Util_area.getTextWidth(t.text,t.textFont),o=Di.Util_area.getTextHeight(t.text,t.textFont),s=t.x+i[0];"end"===t.textAlign||"right"===t.textAlign?s-=r:"center"===t.textAlign&&(s-=r/2),e="top"===t.textBaseline?t.y+i[1]:"bottom"===t.textBaseline?t.y+i[1]-o:t.y+i[1]-o/2;var a,l=!1;if(t.maxWidth){var h=parseInt(t.maxWidth);h<r&&(a=r,l=!0,r=h),s=t.x+i[0],"end"===t.textAlign||"right"===t.textAlign?s-=r:"center"===t.textAlign&&(s-=r/2)}t.textFont&&(t.textFont.toLowerCase().indexOf("italic")>-1&&(r+=a&&!0===l?n/3*(r/a):n/3));return{x:s,y:e,width:r,height:o}}getTextBackground(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;if((!e||!1===e)&&t.__textBackground)return t.__textBackground;var n=this.getRectNoRotation(t),r=t.x+i[0],o=t.y+i[1],s=[];if(t.textRotation&&0!==t.textRotation){let e=t.textRotation,i=this.getRotatedLocation(n.x,n.y,r,o,e),a=this.getRotatedLocation(n.x+n.width,n.y,r,o,e),l=this.getRotatedLocation(n.x+n.width,n.y+n.height,r,o,e),h=this.getRotatedLocation(n.x,n.y+n.height,r,o,e);s.push(i),s.push(a),s.push(l),s.push(h)}else{let t=[n.x,n.y],e=[n.x+n.width,n.y],i=[n.x+n.width,n.y+n.height],r=[n.x,n.y+n.height];s.push(t),s.push(e),s.push(i),s.push(r)}return t.__textBackground=s,t.__textBackground}getRotatedLocation(t,e,i,n,r){var o,s,a=new Array;return e=-e,n=-n,r=-r,o=(t-i)*Math.cos(r/180*Math.PI)-(e-n)*Math.sin(r/180*Math.PI)+i,s=(t-i)*Math.sin(r/180*Math.PI)+(e-n)*Math.cos(r/180*Math.PI)+n,a[0]=o,a[1]=-s,a}}class ji extends Bi{constructor(t){super(t),this.type="smiccircle",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.SmicCircle"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.x+i[0],r=e.y+i[1];return t.moveTo(n+e.r,r),t.arc(n,r,e.r,0,2*Math.PI,!0),!0}getRect(t){if(t.__rect)return t.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition,n=t.x+i[0],r=t.y+i[1],o=t.r;return e="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(n-o-e/2),y:Math.round(r-o-e/2),width:2*o+e,height:2*o+e},t.__rect}}class Gi extends Bi{constructor(t){super(t),this.type="smicpolygon",this.holePolygonPointLists=null,this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicPolygon"}destroy(){this.type=null,this.holePolygonPointLists=null,super.destroy()}brush(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.style;e&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),t.save(),this.setContext(t,i),this.setTransform(t);var n=!1;"fill"!==i.brushType&&"both"!==i.brushType&&void 0!==i.brushType||(t.beginPath(),"dashed"===i.lineType||"dotted"===i.lineType||"dot"===i.lineType||"dash"===i.lineType||"dashot"===i.lineType||"longdash"===i.lineType||"longdashdot"===i.lineType?this.buildPath(t,{lineType:"solid",lineWidth:i.lineWidth,pointList:i.pointList}):(this.buildPath(t,i),n=!0),t.closePath(),this.setCtxGlobalAlpha(t,"fill",i),t.fill(),this.setCtxGlobalAlpha(t,"reset",i)),i.lineWidth>0&&("stroke"===i.brushType||"both"===i.brushType)&&(n||(t.beginPath(),this.buildPath(t,i)),this.setCtxGlobalAlpha(t,"stroke",i),t.stroke(),this.setCtxGlobalAlpha(t,"reset",i)),this.drawText(t,i,this.style);var r=bi(i);if(r.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var o=this.holePolygonPointLists,s=o.length,a=0;a<s;a++){var l=o[a];r.pointList=l,t.globalCompositeOperation="destination-out",n=!1,"fill"!==r.brushType&&"both"!==r.brushType&&void 0!==r.brushType||(t.beginPath(),"dashed"===r.lineType||"dotted"===r.lineType||"dot"===r.lineType||"dash"===r.lineType||"dashot"===r.lineType||"longdash"===r.lineType||"longdashdot"===r.lineType?this.buildPath(t,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}):(this.buildPath(t,r),n=!0),t.closePath(),this.setCtxGlobalAlpha(t,"fill",r),t.fill(),this.setCtxGlobalAlpha(t,"reset",r)),r.lineWidth>0&&("stroke"===r.brushType||"both"===r.brushType)?(n||(t.beginPath(),this.buildPath(t,r)),t.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(t,"stroke",r),t.stroke(),this.setCtxGlobalAlpha(t,"reset",r)):t.globalCompositeOperation="source-over"}t.restore()}buildPath(t,e){e.showShadow&&(t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY),this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.pointList;if(!(n.length<2))if(e.smooth&&"spline"!==e.smooth){var r,o,s,a=Di.SUtil_smoothBezier(n,e.smooth,!0,e.smoothConstraint,i);t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(var l=n.length,h=0;h<l;h++)r=a[2*h],o=a[2*h+1],s=[n[(h+1)%l][0]+i[0],n[(h+1)%l][1]+i[1]],t.bezierCurveTo(r[0],r[1],o[0],o[1],s[0],s[1])}else if("spline"===e.smooth&&(n=Di.SUtil_smoothSpline(n,!0,null,i)),e.lineType&&"solid"!==e.lineType){if("dashed"===e.lineType||"dotted"===e.lineType||"dot"===e.lineType||"dash"===e.lineType||"longdash"===e.lineType){let r=e._dashLength||(e.lineWidth||1)*("dashed"===e.lineType?5:1);e._dashLength=r;let o=e.lineWidth||1,s=o,a=o;"dashed"===e.lineType&&(s*=5,a*=5,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"dotted"===e.lineType&&e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o),"dot"===e.lineType&&(a*=4,e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o)),"dash"===e.lineType&&(s*=4,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"longdash"===e.lineType&&(s*=8,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)Di.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a]);Di.SUtil_dashedLineTo(t,n[n.length-1][0]+i[0],n[n.length-1][1]+i[1],n[0][0]+i[0],n[0][1]+i[1],o,[s,a])}else if("dashot"===e.lineType||"longdashdot"===e.lineType){let r=e._dashLength||(e.lineWidth||1)*("dashed"===e.lineType?5:1);e._dashLength=r;let o=e.lineWidth||1,s=o,a=o,l=o,h=o;"dashot"===e.lineType&&(s*=4,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),"longdashdot"===e.lineType&&(s*=8,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)Di.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a,l,h]);Di.SUtil_dashedLineTo(t,n[n.length-1][0]+i[0],n[n.length-1][1]+i[1],n[0][0]+i[0],n[0][1]+i[1],o,[s,a,l,h])}}else{t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)t.lineTo(n[e][0]+i[0],n[e][1]+i[1]);t.lineTo(n[0][0]+i[0],n[0][1]+i[1])}}getRect(t,e){var i;if(e?i=e:(this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),i=this.refOriginalPosition),t.__rect)return t.__rect;for(var n,r=Number.MAX_VALUE,o=Number.MIN_VALUE,s=Number.MAX_VALUE,a=Number.MIN_VALUE,l=t.pointList,h=0,u=l.length;h<u;h++)l[h][0]+i[0]<r&&(r=l[h][0]+i[0]),l[h][0]+i[0]>o&&(o=l[h][0]+i[0]),l[h][1]+i[1]<s&&(s=l[h][1]+i[1]),l[h][1]+i[1]>a&&(a=l[h][1]+i[1]);return n="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(r-n/2),y:Math.round(s-n/2),width:o-r+n,height:a-s+n},t.__rect}}class Ui extends Bi{constructor(t){super(t),this.brushTypeOnly="stroke",this.textPosition="end",this.type="smicbroken-line",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicBrokenLine"}destroy(){this.brushTypeOnly=null,this.textPosition=null,this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.pointList;if(!(n.length<2)){var r=Math.min(e.pointList.length,Math.round(e.pointListLength||e.pointList.length));if(e.smooth&&"spline"!==e.smooth){var o,s,a,l=Di.SUtil_smoothBezier(n,e.smooth,!1,e.smoothConstraint,i);t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=0;e<r-1;e++)o=l[2*e],s=l[2*e+1],a=[n[e+1][0]+i[0],n[e+1][1]+i[1]],t.bezierCurveTo(o[0],o[1],s[0],s[1],a[0],a[1])}else if("spline"===e.smooth&&(r=(n=Di.SUtil_smoothSpline(n,null,null,i)).length),e.lineType&&"solid"!==e.lineType){if("dashed"===e.lineType||"dotted"===e.lineType||"dot"===e.lineType||"dash"===e.lineType||"longdash"===e.lineType){let o=e.lineWidth||1,s=o,a=o;"dashed"===e.lineType&&(s*=5,a*=5,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"dotted"===e.lineType&&e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o),"dot"===e.lineType&&(a*=4,e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o)),"dash"===e.lineType&&(s*=4,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"longdash"===e.lineType&&(s*=8,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(var h=1;h<r;h++)Di.SUtil_dashedLineTo(t,n[h-1][0]+i[0],n[h-1][1]+i[1],n[h][0]+i[0],n[h][1]+i[1],o,[s,a])}else if("dashot"===e.lineType||"longdashdot"===e.lineType){let o=e.lineWidth||1,s=o,a=o,l=o,h=o;"dashot"===e.lineType&&(s*=4,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),"longdashdot"===e.lineType&&(s*=8,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),o=(e.lineWidth||1)*("dashed"===e.lineType?5:1),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<r;e++)Di.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a,l,h])}}else{t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<r;e++)t.lineTo(n[e][0]+i[0],n[e][1]+i[1])}}}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition;return Gi.prototype.getRect.apply(this,[t,e])}brush(t,e){var i=this.beforeBrush(t,e);switch(t.beginPath(),this.buildPath(t,i),i.brushType){case"both":this.setCtxGlobalAlpha(t,"fill",i),i.lineWidth>0&&(this.setCtxGlobalAlpha(t,"stroke",i),t.stroke()),this.setCtxGlobalAlpha(t,"reset",i);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",i),i.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",i);break;default:this.setCtxGlobalAlpha(t,"fill",i),this.setCtxGlobalAlpha(t,"reset",i)}this.drawText(t,i,this.style),this.afterBrush(t)}}class Hi extends Bi{constructor(t){super(t),this.type="smicimage",this._imageCache={},this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicImage"}destroy(){this.type=null,this._imageCache=null,super.destroy()}brush(t,e,i){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var n=this.refOriginalPosition,r=this.style||{};e&&(r=this.getHighlightStyle(r,this.highlightStyle||{}));var o=r.image,s=this;if("string"==typeof o){var a=o;this._imageCache[a]?o=this._imageCache[a]:((o=new Image).onload=function(){o.onload=null,clearTimeout(Hi._refreshTimeout),Hi._needsRefresh.push(s),Hi._refreshTimeout=setTimeout(function(){i&&i(Hi._needsRefresh),Hi._needsRefresh=[]},10)},o.src=a,this._imageCache[a]=o)}if(o){if("IMG"===o.nodeName.toUpperCase())if(window.ActiveXObject){if("complete"!==o.readyState)return}else if(!o.complete)return;var l=r.width||o.width,h=r.height||o.height,u=r.x+n[0],c=r.y+n[1];if(!o.width||!o.height)return;if(t.save(),this.doClip(t),this.setContext(t,r),this.setTransform(t),r.sWidth&&r.sHeight){let e=r.sx+n[0]||0,i=r.sy+n[1]||0;t.drawImage(o,e,i,r.sWidth,r.sHeight,u,c,l,h)}else if(r.sx&&r.sy){let e=r.sx+n[0],i=r.sy+n[1];var p=l-e,f=h-i;t.drawImage(o,e,i,p,f,u,c,l,h)}else t.drawImage(o,u,c,l,h);r.width||(r.width=l),r.height||(r.height=h),this.style.width||(this.style.width=l),this.style.height||(this.style.height=h),this.drawText(t,r,this.style),t.restore()}}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition;return{x:t.x+e[0],y:t.y+e[1],width:t.width,height:t.height}}clearCache(){this._imageCache={}}}Hi._needsRefresh=[],Hi._refreshTimeout=null;class qi extends Bi{constructor(t){super(t),this.type="smicrectangle",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicRectangle"}destroy(){this.type=null,super.destroy()}_buildRadiusPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i,n,r,o,s,a=this.refOriginalPosition,l=e.x+a[0],h=e.y+a[1],u=e.width,c=e.height,p=e.radius;"number"==typeof p?i=n=r=o=p:p instanceof Array?1===p.length?i=n=r=o=p[0]:2===p.length?(i=r=p[0],n=o=p[1]):3===p.length?(i=p[0],n=o=p[1],r=p[2]):(i=p[0],n=p[1],r=p[2],o=p[3]):i=n=r=o=0,i+n>u&&(i*=u/(s=i+n),n*=u/s),r+o>u&&(r*=u/(s=r+o),o*=u/s),n+r>c&&(n*=c/(s=n+r),r*=c/s),i+o>c&&(i*=c/(s=i+o),o*=c/s),t.moveTo(l+i,h),t.lineTo(l+u-n,h),0!==n&&t.quadraticCurveTo(l+u,h,l+u,h+n),t.lineTo(l+u,h+c-r),0!==r&&t.quadraticCurveTo(l+u,h+c,l+u-r,h+c),t.lineTo(l+o,h+c),0!==o&&t.quadraticCurveTo(l,h+c,l,h+c-o),t.lineTo(l,h+i),0!==i&&t.quadraticCurveTo(l,h,l+i,h)}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;e.radius?this._buildRadiusPath(t,e):(t.moveTo(e.x+i[0],e.y+i[1]),t.lineTo(e.x+i[0]+e.width,e.y+i[1]),t.lineTo(e.x+i[0]+e.width,e.y+i[1]+e.height),t.lineTo(e.x+i[0],e.y+i[1]+e.height),t.lineTo(e.x+i[0],e.y+i[1])),t.closePath()}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition;return t.__rect?t.__rect:(e="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(t.x+i[0]-e/2),y:Math.round(t.y+i[1]-e/2),width:t.width+e,height:t.height+e},t.__rect)}}class Zi extends Bi{constructor(t){super(t),this.type="smicsector",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicSector"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.x+i[0],r=e.y+i[1],o=e.r0||0,s=e.r,a=e.startAngle,l=e.endAngle,h=e.clockWise||!1;a=Di.Util_math.degreeToRadian(a),l=Di.Util_math.degreeToRadian(l),h||(a=-a,l=-l);var u=Di.Util_math.cos(a),c=Di.Util_math.sin(a);t.moveTo(u*o+n,c*o+r),t.lineTo(u*s+n,c*s+r),t.arc(n,r,s,a,l,!h),t.lineTo(Di.Util_math.cos(l)*o+n,Di.Util_math.sin(l)*o+r),0!==o&&t.arc(n,r,o,l,a,h),t.closePath()}getRect(t){if(t.__rect)return t.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition,i=Di.Util_vector.create(),n=Di.Util_vector.create(),r=Di.Util_vector.create(),o=Di.Util_vector.create(),s=t.x+e[0],a=t.y+e[1],l=t.r0||0,h=t.r,u=Di.Util_math.degreeToRadian(t.startAngle),c=Di.Util_math.degreeToRadian(t.endAngle),p=t.clockWise;return p||(u=-u,c=-c),l>1?Di.Util_computeBoundingBox.arc(s,a,l,u,c,!p,i,r):(i[0]=r[0]=s,i[1]=r[1]=a),Di.Util_computeBoundingBox.arc(s,a,h,u,c,!p,n,o),Di.Util_vector.min(i,i,n),Di.Util_vector.max(r,r,o),t.__rect={x:i[0],y:i[1],width:r[0]-i[0],height:r[1]-i[1]},t.__rect}}class Xi{constructor(t){this.shapeParameters=t,this.CLASS_NAME="Zondy.Feature.ShapeFactory"}destroy(){this.shapeParameters=null}createShape(t){if(t&&(this.shapeParameters=t),!this.shapeParameters)return null;var e=this.shapeParameters;if(e instanceof Ei){let t=new Object;t.x=e.x,t.y=e.y,t.r=e.r,t=gi(t,e.style,["x","y"]);let i=new Fi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","style","highlightStyle"]),i}if(e instanceof Ci){if(!e.pointList)return null;let t=new Object;t.pointList=e.pointList,t=gi(t,e.style,["pointList"]);let i=new Ui;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["pointList","style","highlightStyle"]),i}if(e instanceof Li){if(!e.pointList)return null;let t=new Object;t.pointList=e.pointList,t=gi(t,e.style,["pointList"]);let i=new Gi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["pointList","style","highlightStyle"]),i}if(e instanceof Si){if(!e.x&&!e.y&!e.width&!e.height)return null;let t=new Object;t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t=gi(t,e.style,["x","y","width","height"]);let i=new qi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","width","height","style","highlightStyle"]),i}if(e instanceof Pi){let t=new Object;t.x=e.x,t.y=e.y,t.r=e.r,t.startAngle=e.startAngle,t.endAngle=e.endAngle,e.r0&&(t.r0=e.r0),e.clockWise&&(t.clockWise=e.clockWise),t=gi(t,e.style,["x","y","r","startAngle","endAngle","r0","endAngle"]);let i=new Zi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","r","startAngle","endAngle","r0","endAngle","style","highlightStyle"]),i}if(e instanceof Ii){let t=new Object;t.x=e.x,t.y=e.y,t.text=e.text,t=gi(t,e.style,["x","y","text"]);let i=new Vi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","text","style","highlightStyle"]),i}if(e instanceof Mi){let t=new Object;t.x=e.x,t.y=e.y,e.image&&(t.image=e.image),e.width&&(t.width=e.width),e.height&&(t.height=e.height),e.sx&&(t.sx=e.sx),e.sy&&(t.sy=e.sy),e.sWidth&&(t.sWidth=e.sWidth),e.sHeight&&(t.sHeight=e.sHeight),t=gi(t,e.style,["x","y","image","width","height","sx","sy","sWidth","sHeight"]);let i=new Hi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","image","width","height","style","highlightStyle"]),i}if(e instanceof Ti){let t=new Object;t.x=e.x,t.r=e.r,t.y=e.y,t=gi(t,e.style,["x","y","r"]);let i=new ji;return i.style=new Xi.transformStyle(t),i.highlightStyle=new Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","r","style","highlightStyle","lineWidth","text","textPosition"]),i}return null}static transformStyle(t){var e={},i=["normal","normal","normal","12","arial,sans-serif"],n=[!0,!1];for(var r in t)switch(r){case"fill":n[0]=t[r];break;case"fillColor":e.color=t[r];break;case"stroke":n[1]=t[r];break;case"strokeWidth":e.lineWidth=t[r];break;case"strokeLinecap":e.lineCap=t[r];break;case"strokeLineJoin":e.lineJoin=t[r];break;case"strokeDashstyle":e.lineType=t[r];break;case"pointRadius":e.r=t[r];break;case"label":e.text=t[r];break;case"labelRect":e.labelRect=t[r];break;case"fontColor":e.textColor=t[r];break;case"fontStyle":i[0]=t[r];break;case"fontVariant":i[1]=t[r];break;case"fontWeight":i[2]=t[r];break;case"fontSize":var o="";t[r]&&t[r].toString().indexOf("px")<0&&(o="px"),i[3]=t[r]+o;break;case"fontFamily":i[4]=t[r];break;case"fontOpacity":e.opacity=t[r];break;case"labelPosition":e.textPosition=t[r];break;case"labelAlign":e.textAlign=t[r];break;case"labelBaseline":e.textBaseline=t[r];break;case"labelRotation":e.textRotation=t[r];break;default:e[r]=t[r]}return e.textFont=i.join(" "),!0===n[0]&&!1===n[1]?e.brushType="fill":!1===n[0]&&!0===n[1]?e.brushType="stroke":!0===n[0]&&!0===n[1]?e.brushType="both":e.brushType="fill",null==e.lineWidth&&(e.lineWidth=1),e}static Background(t,e,i){var n=i||{},r=new Si(e[0],e[3],Math.abs(e[2]-e[0]),Math.abs(e[3]-e[1]));return r.style={fillColor:"#f3f3f3"},n.backgroundStyle&&gi(r.style,n.backgroundStyle),n.backgroundRadius&&(r.style.radius=n.backgroundRadius),r.clickable=!1,r.hoverable=!1,t.createShape(r)}static GraphAxis(t,e,i,n){var r=e,o=i||{},s=[],a=[],l=!!o.useXReferenceLine&&o.useXReferenceLine,h=o.axisYTick&&!isNaN(o.axisYTick)?o.axisYTick:0,u=[],c=[];if(0===h){if(c.push([r[0],r[3]-5]),c.push([r[0],r[1]]),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){let t=parseInt(o.axis3DParameter),e=[r[0]-t,r[1]+t];o.axisUseArrow?(u.push([e[0]+1.5,e[1]-7.5]),u.push([e[0]-1,e[1]+1]),u.push([e[0]+7.5,e[1]-1.5]),c.push([e[0],e[1]])):c.push([e[0],e[1]]),c.push([r[0],r[1]])}c.push([r[2]+5,r[1]])}else{var p=Math.abs(r[1]-r[3])/h,f=r[3];c.push([r[0],f-5]);for(var d=0;d<h;d++){if(c.push([r[0],f]),c.push([r[0]-5,f]),c.push([r[0],f]),l){var g=new Ci([[r[0],f],[r[2],f]]);g.style={strokeColor:"#cfcfcf",strokeLinecap:"butt",strokeLineJoin:"round",strokeWidth:1},g.clickable=!1,g.hoverable=!1,o.xReferenceLineStyle&&gi(g.style,o.xReferenceLineStyle),s.push(t.createShape(g))}f+=p}if(c.push([r[0],r[1]]),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){let t=parseInt(o.axis3DParameter),e=[r[0]-t,r[1]+t];o.axisUseArrow?(u.push([e[0]+1.5,e[1]-7.5]),u.push([e[0]-1,e[1]+1]),u.push([e[0]+7.5,e[1]-1.5]),c.push([e[0],e[1]])):c.push([e[0],e[1]]),c.push([r[0],r[1]])}c.push([r[2]+5,r[1]])}if(o.axisUseArrow){var y=[[r[2]+5,r[1]+4],[r[2]+13,r[1]],[r[2]+5,r[1]-4]],m=[[r[0]-4,r[3]-5],[r[0],r[3]-13],[r[0]+4,r[3]-5]],_=new Li(y);_.style={fillColor:"#008acd"},gi(_.style,o.axisStyle),a.push(t.createShape(_));var v=new Li(m);if(v.style={fillColor:"#008acd"},gi(v.style,o.axisStyle),a.push(t.createShape(v)),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){var x=new Li(u);x.style={fillColor:"#008acd"},gi(x.style,o.axisStyle),a.push(t.createShape(x))}}var b=new Ci(c);b.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},o.axisStyle&&gi(b.style,o.axisStyle),b.clickable=!1,b.hoverable=!1;var w=[t.createShape(b)],E=[];if(o.axisYLabels&&o.axisYLabels.length&&o.axisYLabels.length>0){var C=o.axisYLabels;let e=C.length;var L=[0,0];if(o.axisYLabelsOffset&&o.axisYLabelsOffset.length&&(L=o.axisYLabelsOffset),1===e){let e=new Ii(r[0]-5+L[0],r[3]+L[1],C[0]);e.style={labelAlign:"right"},o.axisYLabelsStyle&&gi(e.style,o.axisYLabelsStyle),e.clickable=!1,e.hoverable=!1,E.push(t.createShape(e))}else for(var S=r[3],P=Math.abs(r[1]-r[3])/(e-1),I=0;I<e;I++){let e=new Ii(r[0]-5+L[0],S+L[1],C[I]);e.style={labelAlign:"right"},o.axisYLabelsStyle&&gi(e.style,o.axisYLabelsStyle),e.clickable=!1,e.hoverable=!1,E.push(t.createShape(e)),S+=P}}var M=[];if(o.axisXLabels&&o.axisXLabels.length&&o.axisXLabels.length>0){let e=o.axisXLabels,i=e.length,s=[0,0];if(o.axisXLabelsOffset&&o.axisXLabelsOffset.length&&(s=o.axisXLabelsOffset),n&&n.xPositions&&n.xPositions.length&&n.xPositions.length===i){let a=n.xPositions;for(let n=0;n<i;n++){let i=new Ii(a[n]+s[0],r[1]+s[1],e[n]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&gi(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i))}}else if(1===i){let i=new Ii(r[0]-5+s[0],r[1]+s[0],e[0]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&gi(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i))}else{let n=r[0],a=Math.abs(r[2]-r[0])/(i-1);for(let l=0;l<i;l++){let i=new Ii(n+s[0],r[1]+s[1],e[l]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&gi(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i)),n+=a}}}return s.concat(w).concat(E).concat(M).concat(a)}static ShapeStyleTool(t,e,i,n,r,o){var s=t||{};if(e&&gi(s,e),i&&i.length&&void 0!==r&&!isNaN(r)&&r>=0&&i[r]&&gi(s,i[r]),n&&n.length&&void 0!==o)for(var a=n,l=a.length,h=parseFloat(o),u=0;u<l;u++)if(a[u].start<=h&&h<a[u].end){gi(s,a[u].style);break}return s}}class Yi{constructor(t,e){t&&e&&e.map&&e.renderer&&(this.id=vi(),this.lonlat=null,this.location=[],this.data=t,this.shapes=[],this.layer=e,this.CLASS_NAME="Zondy.Feature.Theme")}destroy(){this.data=null,this.id=null,this.lonlat=null,this.location=null,this.shapes=null,this.layer=null}}class Wi extends Yi{constructor(t,e,i,n,r,o){if(super(t,e,i,n,r,o),this.shapeFactory=new Xi,this.shapeParameters=null,this.RelativeCoordinate=!1,this.setting=null,this.origonPoint=null,this.chartBox=null,this.chartBounds=null,this.width=null,this.height=null,this.XOffset=0,this.YOffset=0,this.DVBParameter=null,this.dataViewBox=null,this.DVBCodomain=null,this.DVBCenterPoint=null,this.DVBUnitValue=null,this.DVBOrigonPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.origonPointOffset=null,this.fields=i||[],this.dataValues=null,r)this.lonlat=r;else if(o&&o.calGravity){let t;const e=this.data.geometry;switch(e.type){case"Point":t=e.clone();break;case"MultiPoint":case"LineString":case"MultiLineString":case"MultiPolygon":t=e.extent.center;break;case"Polygon":t=e.centroid;break;case"Extent":case"Circle":t=e.center;break;default:t=e.extent.center}const i=t.coordinates;this.lonlat=[i[0],i[1]]}else{const t=feature.geometry.extent.center.coordinates;this.lonlat=[t[0],t[1]]}n&&n.width&&n.height&&n.codomain&&(this.setting=n),this.CLASS_NAME="Zondy.Feature.Theme.Graph"}destroy(){this.shapeFactory=null,this.shapeParameters=null,this.width=null,this.height=null,this.origonPoint=null,this.chartBox=null,this.dataViewBox=null,this.chartBounds=null,this.DVBParameter=null,this.DVBOrigonPoint=null,this.DVBCenterPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.DVBCodomain=null,this.DVBUnitValue=null,this.origonPointOffset=null,this.XOffset=null,this.YOffset=null,this.fields=null,this.dataValues=null,this.setting=null,super.destroy()}initBaseParameter(){if(!this.setting)return!1;var t=this.setting;if(!(t.width&&t.height&&t.codomain))return!1;var e=void 0===t.decimalNumber||isNaN(t.decimalNumber)?-1:t.decimalNumber,i=Yi.getDataValues(this.data,this.fields,e);this.dataValues=i||[],this.width=parseFloat(t.width),this.height=parseFloat(t.height),this.DVBCodomain=t.codomain,this.XOffset=t.XOffset?t.XOffset:0,this.YOffset=t.YOffset?t.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=t.dataViewBoxParameter?t.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var n=this.width,r=this.height,o=this.location;this.origonPoint=[o[0]-n/2,o[1]-r/2];var s=this.origonPoint;this.chartBox=[s[0],s[1]+r,s[0]+n,s[1]];var a=this.chartBox,l=this.DVBParameter;this.dataViewBox=[a[0]+l[0],a[1]-l[1],a[2]-l[2],a[3]+l[3]];var h=this.dataViewBox;return!(h[0]>=h[2]||h[1]<=h[3])&&(this.DVBOrigonPoint=[h[0],h[3]],this.DVBWidth=Math.abs(h[2]-h[0]),this.DVBHeight=Math.abs(h[1]-h[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-s[0],this.DVBOrigonPoint[1]-s[1]],!0)}resetLocation(t){t&&(this.lonlat=t);var e=this.getLocalXY(this.lonlat);e[0]+=this.XOffset,e[1]+=this.YOffset,this.location=e;var i=this.width,n=this.height,r=this.location;return this.chartBounds=[r[0]-i/2,r[1]-n/2,r[0]+i/2,r[1]+n/2],this.chartBounds.xmin=r[0]-i/2,this.chartBounds.ymin=r[1]-n/2,this.chartBounds.xmax=r[0]+i/2,this.chartBounds.ymax=r[1]+n/2,this.resetLinearGradient(),r}resetLinearGradient(){}shapesConvertToRelativeCoordinate(){for(var t=this.shapes,e=this.location,i=0,n=t.length;i<n;i++){t[i].refOriginalPosition=e;var r=t[i].style;for(var o in r)switch(o){case"pointList":for(var s=r[o],a=0,l=s.length;a<l;a++)s[a][0]-=e[0],s[a][1]-=e[1];break;case"x":r[o]-=e[0];break;case"y":r[o]-=e[1]}}this.RelativeCoordinate=!0}assembleShapes(){}getLocalXY(t){return this.layer.getLocalXY(t)}getCenterOfGravityPoint(t){var e=[],i=0,n=0,r=0;if(t.ftype===Zondy.Enum.FeatureType.Reg)for(var o=t.fGeom.RegGeom,s=0;s<o.length;s++){var a=o[s];if(null!=a&&null!=a.Rings)for(var l=a.Rings,h=0;h<l.length;h++){var u=l[h];if(null!=u&&null!=u.Arcs)for(var c=u.Arcs,p=0;p<c.length;p++){var f=c[p];if(null!=f&&null!=f.Dots)for(var d=f.Dots,g=0;g<d.length;g++)e.push(d[g])}}}for(h=1;h<=e.length;h++){var y=e[h%e.length].x,m=e[h%e.length].y,_=e[h-1].x,v=e[h-1].y,x=(y*v-m*_)/2;i+=x,n+=x*(y+_)/3,r+=x*(m+v)/3}return[n/=i,r/=i]}}Yi.getDataValues=function(t,e,i){if(!t.attributes)return!1;for(var n=[],r=t.attributes,o=0;o<e.length;o++)for(var s in r)if(s===e[o]&&null!==r[s]&&void 0!==r[s])try{!isNaN(i)&&i>=0?n.push(parseFloat(r[s].toString()).toFixed(i)):n.push(parseFloat(r[s].toString()))}catch(t){throw new Error("not a number")}return n.length===e.length&&n};class $i extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.setting=null,n&&n.codomain&&(this.setting=n,this.DVBCodomain=this.setting.codomain),this.CLASS_NAME="Zondy.Theme.RankSymbol"}destroy(){this.setting=null,super.destroy()}initBaseParameter(){if(!this.setting)return!1;var t=this.setting;t.XOffset&&(this.XOffset=t.XOffset),t.YOffset&&(this.YOffset=t.YOffset),this.XOffset=t.XOffset?t.XOffset:0,this.YOffset=t.YOffset?t.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=t.dataViewBoxParameter?t.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var e=this.width,i=this.height,n=this.location;this.origonPoint=[n[0]-e/2,n[1]-i/2];var r=this.origonPoint;this.chartBox=[r[0],r[1]+i,r[0]+e,r[1]];var o=this.chartBox,s=this.DVBParameter;this.dataViewBox=[o[0]+s[0],o[1]-s[1],o[2]-s[2],o[3]+s[3]];var a=this.dataViewBox;return!(a[0]>=a[2]||a[1]<=a[3])&&(this.DVBOrigonPoint=[a[0],a[3]],this.DVBWidth=Math.abs(a[2]-a[0]),this.DVBHeight=Math.abs(a[1]-a[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-r[0],this.DVBOrigonPoint[1]-r[1]],!0)}}class Ki extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Point"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,15,15,15]:t.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var e=this.dataViewBox,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.DVBUnitValue,r=this.dataValues,o=this.calculateXShapeInfo();if(o){var s,a,l=o.xPositions;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,t)),this.shapes=this.shapes.concat(Xi.GraphAxis(this.shapeFactory,e,t,o));for(var h=0,u=r.length;h<u;h++){if(r[h]<i[0]||r[h]>i[1])return null;s=l[h],a=e[1]-(r[h]-i[0])/n;var c=new Ei(s,a);c.style=Xi.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,h,r[h]),c.highlightStyle=Xi.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(c.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(c.clickable=t.pointClickAble),c.refDataID=this.data.id,c.dataInfo={field:this.fields[h],value:r[h]},this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=this.DVBWidth,s=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2===i.xShapeBlank.length){var a=o-((t=i.xShapeBlank)[0]+t[1]);if(a<=n)return null;s=a/(n-1)}else t=[s=o/(n+1),s,s];for(var l=0,h=0;h<n;h++)0===h?l=t[0]:l+=s,r.push(e[0]+l);return{xPositions:r,width:0}}}class Qi extends Yi{constructor(t,e,i,n,r){if(super(t,e),t.fGeom){this.dataBounds=t.bound,this.nodesClipPixel=2,this.isHoverAble=!0,this.isMultiHover=!0,this.isClickAble=!0,this.highlightStyle=null,this.shapeOptions={},this.style=i||{},this.CLASS_NAME="Zondy.Theme.ThemeVector",this.style=i||{},n&&gi(this,n,["shapeOptions","dataBounds"]),r&&gi(this.shapeOptions,r);t.fGeom;switch(this.lonlat=[(this.dataBounds.xmin+this.dataBounds.xmax)/2,(this.dataBounds.ymin+this.dataBounds.ymax)/2],this.location=this.getLocalXY(this.lonlat),t.ftype){case 0:break;case 1:this.pointsToTF(t.fGeom.PntGeom);break;case 2:this.linesToTF(t.fGeom.LinGeom);break;case 3:this.regsToTF(t.fGeom.RegGeom)}}}destroy(){this.style=null,this.dataBounds=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.highlightStyle=null,this.shapeOptions=null,super.destroy()}pointsToTF(t){if(!(null==t||t.length<=0)){t.components;for(var e=[],i=[],n=this.location,r=[],o=this.nodesClipPixel,s=0;s<t.length;s++){var a=t[s];if(i=[],e=this.getLocalXY([a.Dot.x,a.Dot.y]),i[0]=e[0]-n[0],i[1]=e[1]-n[1],r.length>0){var l=r[r.length-1];if(Math.abs(l[0]-i[0])<=o&&Math.abs(l[1]-i[1])<=o)continue}r.push(i);var h=new Object;h.r=6,(h=gi(h,this.style)).x=i[0],h.y=i[1];var u=new Fi({style:h,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(u.highlightStyle=this.highlightStyle),u.refOriginalPosition=n,u.refDataID=this.data.id,u.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&gi(u,this.shapeOptions),this.shapes.push(u)}}}linesToTF(t){if(!(null==t||t.length<=0))for(var e=0;e<t.length;e++)this.lineToTF(t[e])}lineToTF(t){var e=[];if(null!=t.Line&&null!=t.Line.Arcs&&t.Line.Arcs.length>0)for(var i=t.Line.Arcs,n=0;n<i.length;n++)for(var r=i[n].Dots,o=0;o<r.length;o++)e.push([r[o].x,r[o].y]);if(!(e.length<=0)){var s=[],a=[],l=this.location,h=[],u=this.nodesClipPixel;for(n=0;n<e.length;n++){var c=e[n];if(a=[],s=this.getLocalXY(c),a[0]=s[0]-l[0],a[1]=s[1]-l[1],h.length>0){var p=h[h.length-1];if(Math.abs(p[0]-a[0])<=u&&Math.abs(p[1]-a[1])<=u)continue}h.push(a)}if(h.length<2)return null;var f=new Object;(f=gi(f,this.style,["pointList"])).pointList=h;var d=new Ui({style:f,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(d.highlightStyle=this.highlightStyle),d.refOriginalPosition=this.location,d.refDataID=this.data.id,d.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&gi(d,this.shapeOptions),this.shapes.push(d)}}regsToTF(t){if(!(null==t||t.length<=0))for(var e=0;e<t.length;e++)this.regToTF(t[e])}regToTF(t){var e=t.Rings;if(!(null==e||e.length<=0)){for(var i=[],n=[],r=this.location,o=[],s=[],a=[],l=this.nodesClipPixel,h=0;h<e.length;h++){if(0===h){if(o=[],null!=e[h]&&null!=e[h].Arcs&&e[h].Arcs.length>0)for(var u=e[h].Arcs,c=0;c<u.length;c++)for(var p=u[c].Dots,f=0;f<p.length;f++){if(n=[],i=this.getLocalXY([p[f].x,p[f].y]),n[0]=i[0]-r[0],n[1]=i[1]-r[1],o.length>0){var d=o[o.length-1];if(Math.abs(d[0]-n[0])<=l&&Math.abs(d[1]-n[1])<=l)continue}o.push(n)}}else if(s=[],null!=e[h]&&null!=e[h].Arcs&&e[h].Arcs.length>0)for(u=e[h].Arcs,c=0;c<u.length;c++)for(p=u[c].Dots,f=0;f<p.length;f++){if(n=[],i=this.getLocalXY([p[f].x,p[f].y]),n[0]=i[0]-r[0],n[1]=i[1]-r[1],s.length>0){var g=s[s.length-1];if(Math.abs(g[0]-n[0])<=l&&Math.abs(g[1]-n[1])<=l)continue}s.push(n)}s.length<2||a.push(s)}if(!(o.length<2)){var y={};(y=gi(y,this.style,["pointList"])).pointList=o;var m=new Gi({style:y,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(m.highlightStyle=this.highlightStyle),m.refOriginalPosition=this.location,m.refDataID=this.data.id,m.isHoverByRefDataID=this.isMultiHover,a.length>0&&(m.holePolygonPointLists=a),this.shapeOptions&&gi(m,this.shapeOptions),this.shapes.push(m)}}}updateAndAddShapes(){var t=this.getLocalXY(this.lonlat);this.location=t;for(var e=this.layer.renderer,i=0,n=this.shapes.length;i<n;i++){var r=this.shapes[i];r.refOriginalPosition=t,e.addShape(r)}}getShapesCount(){return this.shapes.length}getLocalXY(t){return this.layer.getLocalXY(t)}}class Ji extends(mi(Oi,zi)){constructor(t){super(t),t=t||{},this.id=null,this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,this.ignore=!1,yi(this,t),this.id=this.id||vi(),this.CLASS_NAME="Zondy.LevelRenderer.Group"}destroy(){this.id=null,this.type=null,this.clipShape=null,this._children=null,this._storage=null,this.__dirty=null,this.ignore=null,super.destroy()}children(){return this._children.slice()}childAt(t){return this._children[t]}addChild(t){t!==this&&t.parent!==this&&(t.parent&&t.parent.removeChild(t),this._children.push(t),t.parent=this,this._storage&&this._storage!==t._storage&&(this._storage.addToMap(t),t instanceof Ji&&t.addChildrenToStorage(this._storage)))}removeChild(t){var e=_i(this._children,t);this._children.splice(e,1),t.parent=null,this._storage&&(this._storage.delFromMap(t.id),t instanceof Ji&&t.delChildrenFromStorage(this._storage))}eachChild(t,e){for(var i=!!e,n=0;n<this._children.length;n++){var r=this._children[n];i?t.call(e,r):t(r)}}traverse(t,e){for(var i=!!e,n=0;n<this._children.length;n++){var r=this._children[n];i?t.call(e,r):t(r),"group"===r.type&&r.traverse(t,e)}}addChildrenToStorage(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.addToMap(i),"group"===i.type&&i.addChildrenToStorage(t)}}delChildrenFromStorage(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.delFromMap(i.id),"group"===i.type&&i.delChildrenFromStorage(t)}}modSelf(){this.__dirty=!0}}class tn{constructor(){this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],this._shapeListOffset=0,this.CLASS_NAME="Zondy.LevelRenderer.Storage"}destroy(){this.dispose(),this._shapeList=null,this._shapeListOffset=null}iterShape(t,e){if(!e){e={hover:!1,normal:"down",update:!1}}if(e.hover)for(var i=0,n=this._hoverElements.length;i<n;i++){var r=this._hoverElements[i];if(r.updateTransform(),t(r))return this}switch(e.update&&this.updateShapeList(),e.normal){case"down":{let e=this._shapeList.length;for(;e--;)if(t(this._shapeList[e]))return this;break}default:for(let e=0,i=this._shapeList.length;e<i;e++)if(t(this._shapeList[e]))return this}return this}getHoverShapes(t){var e=[],i=this._hoverElements.length;for(let t=0;t<i;t++){e.push(this._hoverElements[t]);var n=this._hoverElements[t].hoverConnect;if(n)for(var r,o=0,s=(n=n instanceof Array?n:[n]).length;o<s;o++)(r=n[o].id?n[o]:this.get(n[o]))&&e.push(r)}if(e.sort(tn.shapeCompareFunc),t)for(let t=0,i=e.length;t<i;t++)e[t].updateTransform();return e}getShapeList(t){return t&&this.updateShapeList(),this._shapeList}updateShapeList(){this._shapeListOffset=0;var t=this._roots.length;for(let e=0;e<t;e++){let t=this._roots[e];this._updateAndAddShape(t)}this._shapeList.length=this._shapeListOffset;var e=this._shapeList.length;for(let t=0;t<e;t++)this._shapeList[t].__renderidx=t;this._shapeList.sort(tn.shapeCompareFunc)}_updateAndAddShape(t,e){if(!t.ignore)if(t.updateTransform(),"group"===t.type){t.clipShape&&(t.clipShape.parent=t,t.clipShape.updateTransform(),e?(e=e.slice()).push(t.clipShape):e=[t.clipShape]);for(var i=0;i<t._children.length;i++){var n=t._children[i];n.__dirty=t.__dirty||n.__dirty,this._updateAndAddShape(n,e)}t.__dirty=!1}else t.__clipShapes=e,this._shapeList[this._shapeListOffset++]=t}mod(t,e){var i=this._elements[t];if(i&&(i.modSelf(),e))if(e.parent||e._storage||e.__startClip){var n={};for(var r in e)"parent"!==r&&"_storage"!==r&&"__startClip"!==r&&e.hasOwnProperty(r)&&(n[r]=e[r]);xi(i,n,!0)}else xi(i,e,!0);return this}drift(t,e,i){var n=this._elements[t];return n&&(n.needTransform=!0,"horizontal"===n.draggable?i=0:"vertical"===n.draggable&&(e=0),(!n.ondrift||n.ondrift&&!n.ondrift(e,i))&&n.drift(e,i)),this}addHover(t){return t.updateNeedTransform(),this._hoverElements.push(t),this}delHover(){return this._hoverElements=[],this}hasHoverShape(){return this._hoverElements.length>0}addRoot(t){t instanceof Ji&&t.addChildrenToStorage(this),this.addToMap(t),this._roots.push(t)}delRoot(t){if(void 0===t){for(var e=0;e<this._roots.length;e++){var i=this._roots[e];i instanceof Ji&&i.delChildrenFromStorage(this)}return this._elements={},this._hoverElements=[],void(this._roots=[])}if(t instanceof Array){var n=t.length;for(let e=0;e<n;e++)this.delRoot(t[e])}else{var r;r="string"==typeof t?this._elements[t]:t;var o=_i(this._roots,r);o>=0&&(this.delFromMap(r.id),this._roots.splice(o,1),r instanceof Ji&&r.delChildrenFromStorage(this))}}addToMap(t){return t instanceof Ji&&(t._storage=this),t.modSelf(),this._elements[t.id]=t,this}get(t){return this._elements[t]}delFromMap(t){var e=this._elements[t];return e&&(delete this._elements[t],e instanceof Ji&&(e._storage=null)),this}dispose(){this._elements=null,this._roots=null,this._hoverElements=null}static shapeCompareFunc(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.__renderidx-e.__renderidx:t.z-e.z:t.zlevel-e.zlevel}}class en{}en.EVENT={RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300},en.catchBrushException=!1,en.debugMode=0;class nn{constructor(t,e){this.root=t,this.storage=e,this._domRoot=null,this._layers={},this._zlevelList=[],this._layerConfig={},this._bgDom=null,this.shapeToImage=null,nn.devicePixelRatio=Math.max(window.devicePixelRatio||1,1),this.CLASS_NAME="Zondy.LevelRenderer.Painter",this.root.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var i=document.createElement("div");this._domRoot=i,i.style.position="relative",i.style.overflow="hidden",i.style.width=this._width+"px",i.style.height=this._height+"px",this.root.appendChild(i),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=nn.createDom(vi(),"div",this),i.appendChild(this._bgDom),this._bgDom.onselectstart=o,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none",this._bgDom.style["-webkit-touch-callout"]="none";var n=new rn(vi(),this);this._layers.hover=n,i.appendChild(n.dom),n.initContext(),n.dom.onselectstart=o,n.dom.style["-webkit-user-select"]="none",n.dom.style["user-select"]="none",n.dom.style["-webkit-touch-callout"]="none";var r=this;function o(){return!1}this.updatePainter=function(t,e){r.refreshShapes(t,e)}}destroy(){this.dispose(),this._zlevelList=null,this._layerConfig=null,this._bgDom=null,this.shapeToImage=null}render(t){return this.refresh(t,!0),this}refresh(t,e){var i=this.storage.getShapeList(!0);return this._paintList(i,e),"function"==typeof t&&t(),this}_paintList(t,e){var i,n,r;for(var o in void 0===e&&(e=!1),this._updateLayerStatus(t),this._layers)"hover"!==o&&(this._layers[o].unusedCount++,this._layers[o].updateTransform());for(var s=[],a=0,l=t.length;a<l;a++){var h=t[a];if(n!==h.zlevel&&(i&&i.needTransform&&r.restore(),r=(i=this.getLayer(h.zlevel)).ctx,n=h.zlevel,i.unusedCount=0,(i.dirty||e)&&i.clear(),i.needTransform&&(r.save(),i.setTransform(r))),r&&h.__startClip){var u=h.__startClip;if(r.save(),u.needTransform){let t=u.transform;Di.Util_matrix.invert(s,t),r.transform(t[0],t[1],t[2],t[3],t[4],t[5])}if(r.beginPath(),u.buildPath(r,u.style),r.clip(),u.needTransform){let t=s;r.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}if((i&&i.dirty||e)&&!h.invisible&&(!h.onbrush||h.onbrush&&!h.onbrush(r,!1)))if(en.catchBrushException)try{h.brush(r,!1,this.updatePainter)}catch(t){}else h.brush(r,!1,this.updatePainter);r&&h.__stopClip&&r.restore(),h.__dirty=!1}r&&i&&i.needTransform&&r.restore();for(let t in this._layers)if("hover"!==t){var c=this._layers[t];c.dirty=!1,1===c.unusedCount&&c.clear()}}getLayer(t){var e=this._layers[t];if(!e){var i=this._zlevelList.length,n=null,r=-1;if(i>0&&t>this._zlevelList[0]){for(r=0;r<i-1&&!(this._zlevelList[r]<t&&this._zlevelList[r+1]>t);r++);n=this._layers[this._zlevelList[r]]}this._zlevelList.splice(r+1,0,t),e=new rn(vi(),this);var o=n?n.dom:this._bgDom;o.nextSibling?o.parentNode.insertBefore(e.dom,o.nextSibling):o.parentNode.appendChild(e.dom),e.initContext(),this._layers[t]=e,this._layerConfig[t]&&(new Ni).merge(e,this._layerConfig[t],!0),e.updateTransform()}return e}getLayers(){return this._layers}_updateLayerStatus(t){var e=this._layers,i={};for(let t in e)"hover"!==t&&(i[t]=e[t].elCount,e[t].elCount=0);for(let i=0;i<t.length;i++){var n=t[i],r=e[n.zlevel];if(r){if(r.elCount++,r.dirty)continue;r.dirty=n.__dirty}}for(let t in e)"hover"!==t&&i[t]!==e[t].elCount&&(e[t].dirty=!0)}refreshShapes(t,e){for(var i=0,n=t.length;i<n;i++){var r=t[i];this.storage.mod(r.id)}return this.refresh(e),this}clear(){for(var t in this._layers)"hover"!==t&&this._layers[t].clear();return this}modLayer(t,e){if(e){this._layerConfig[t]?(new Ni).merge(this._layerConfig[t],e,!0):this._layerConfig[t]=e;var i=this._layers[t];i&&(new Ni).merge(i,this._layerConfig[t],!0)}}delLayer(t){var e=this._layers[t];e&&(this.modLayer(t,{position:e.position,rotation:e.rotation,scale:e.scale}),e.dom.parentNode.removeChild(e.dom),delete this._layers[t],this._zlevelList.splice((new Ni).indexOf(this._zlevelList,t),1))}refreshHover(){this.clearHover();for(var t=this.storage.getHoverShapes(!0),e=0,i=t.length;e<i;e++)this._brushHover(t[e]);return this.storage.delHover(),this}clearHover(){var t=this._layers.hover;return t&&t.clear(),this}resize(){var t=this._domRoot;t.style.display="none";var e=this._getWidth(),i=this._getHeight();if(t.style.display="",this._width!==e||i!==this._height){for(var n in this._width=e,this._height=i,t.style.width=e+"px",t.style.height=i+"px",this._layers)this._layers[n].resize(e,i);this.refresh(null,!0)}return this}clearLayer(t){var e=this._layers[t];e&&e.clear()}dispose(){this.root.innerHTML="",this.root=null,this.storage=null,this._domRoot=null,this._layers=null}getDomHover(){return this._layers.hover.dom}toDataURL(t,e,i){var n=nn.createDom(vi(),"canvas",this);this._bgDom.appendChild(n);var r=n.getContext("2d");1!==nn.devicePixelRatio&&r.scale(nn.devicePixelRatio,nn.devicePixelRatio),r.fillStyle=e||"#fff",r.rect(0,0,this._width*nn.devicePixelRatio,this._height*nn.devicePixelRatio),r.fill();var o=this;this.storage.iterShape(function(t){if(!t.invisible&&(!t.onbrush||t.onbrush&&!t.onbrush(r,!1)))if(en.catchBrushException)try{t.brush(r,!1,o.updatePainter)}catch(t){}else t.brush(r,!1,o.updatePainter)},{normal:"up",update:!0});var s=n.toDataURL(t,i);return r=null,this._bgDom.removeChild(n),s}getWidth(){return this._width}getHeight(){return this._height}_getWidth(){var t=this.root,e=t.currentStyle||document.defaultView.getComputedStyle(t);return((t.clientWidth||parseInt(e.width,10))-parseInt(e.paddingLeft,10)-parseInt(e.paddingRight,10)).toFixed(0)-0}_getHeight(){var t=this.root,e=t.currentStyle||document.defaultView.getComputedStyle(t);return((t.clientHeight||parseInt(e.height,10))-parseInt(e.paddingTop,10)-parseInt(e.paddingBottom,10)).toFixed(0)-0}_brushHover(t){var e=this._layers.hover.ctx;if(!t.onbrush||t.onbrush&&!t.onbrush(e,!0)){var i=this.getLayer(t.zlevel);if(i.needTransform&&(e.save(),i.setTransform(e)),en.catchBrushException)try{t.brush(e,!0,this.updatePainter)}catch(t){}else t.brush(e,!0,this.updatePainter);i.needTransform&&e.restore()}}_shapeToImage(t,e,i,n,r){var o=document.createElement("canvas"),s=o.getContext("2d"),a=r||window.devicePixelRatio||1;o.style.width=i+"px",o.style.height=n+"px",o.setAttribute("width",i*a),o.setAttribute("height",n*a),s.clearRect(0,0,i*a,n*a);var l={position:e.position,rotation:e.rotation,scale:e.scale};e.position=[0,0,0],e.rotation=0,e.scale=[1,1],e&&e.brush(s,!1);var h=new Hi({id:t,style:{x:0,y:0,image:o}});return null!=l.position&&(h.position=e.position=l.position),null!=l.rotation&&(h.rotation=e.rotation=l.rotation),null!=l.scale&&(h.scale=e.scale=l.scale),h}_createShapeToImageProcessor(){var t=this;return function(e,i,n,r){return t._shapeToImage(e,i,n,r,nn.devicePixelRatio)}}updateHoverLayer(t){if(!(t instanceof Array))return this;this.clearHover(),this.storage.delHover();for(var e=0;e<t.length;e++)this.storage.addHover(t[e]),this._brushHover(t[e])}static createDom(t,e,i){var n=document.createElement(e),r=i._width,o=i._height;return n.style.position="absolute",n.style.left=0,n.style.top=0,n.style.width=r+"px",n.style.height=o+"px",n.setAttribute("width",r*nn.devicePixelRatio),n.setAttribute("height",o*nn.devicePixelRatio),n.setAttribute("id",t),n}}class rn extends zi{constructor(t,e){super(t,e),this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=e,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=1/0,this.minZoom=0,this.ctx=null,this.dom=nn.createDom(vi(),"canvas",e),this.dom.onselectstart=function(){return!1},this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none",this.CLASS_NAME="Zondy.LevelRenderer.Painter.Layer"}destroy(){this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=null,this.unusedCount=null,this.config=null,this.dirty=null,this.elCount=null,this.clearColor=null,this.motionBlur=null,this.lastFrameAlpha=null,this.zoomable=null,this.panable=null,this.maxZoom=null,this.minZoom=null,this.ctx=null,zi.destroy.apply(this,arguments)}initContext(){this.ctx=this.dom.getContext("2d"),1!==nn.devicePixelRatio&&this.ctx.scale(nn.devicePixelRatio,nn.devicePixelRatio)}createBackBuffer(){this.domBack=nn.createDom(vi(),"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d"),1!==nn.devicePixelRatio&&this.ctxBack.scale(nn.devicePixelRatio,nn.devicePixelRatio)}resize(t,e){this.dom.style.width=t+"px",this.dom.style.height=e+"px",this.dom.setAttribute("width",t*nn.devicePixelRatio),this.dom.setAttribute("height",e*nn.devicePixelRatio),1!==nn.devicePixelRatio&&this.ctx.scale(nn.devicePixelRatio,nn.devicePixelRatio),this.domBack&&(this.domBack.setAttribute("width",t*nn.devicePixelRatio),this.domBack.setAttribute("height",e*nn.devicePixelRatio),1!==nn.devicePixelRatio&&this.ctxBack.scale(nn.devicePixelRatio,nn.devicePixelRatio))}clear(){var t=this.dom,e=this.ctx,i=t.width,n=t.height,r=this.clearColor,o=this.motionBlur,s=this.lastFrameAlpha;if(o&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(t,0,0,i/nn.devicePixelRatio,n/nn.devicePixelRatio)),r?(e.save(),e.fillStyle=this.config.clearColor,e.fillRect(0,0,i/nn.devicePixelRatio,n/nn.devicePixelRatio),e.restore()):e.clearRect(0,0,i/nn.devicePixelRatio,n/nn.devicePixelRatio),o){var a=this.domBack;e.save(),e.globalAlpha=s,e.drawImage(a,0,0,i/nn.devicePixelRatio,n/nn.devicePixelRatio),e.restore()}}}class on extends Oi{constructor(t,e,i){super(t,e,i),this.root=t,this.storage=e,this.painter=i,this._lastX=0,this._lastY=0,this._mouseX=0,this._mouseY=0,this._findHover=null,this._domHover=null,this._findHover=function(t,e){return function(i,n,r){return t.call(e,i,n,r)}}(function(t,e,i){var n=this;if(n._draggingTarget&&n._draggingTarget.id===t.id||t.isSilent())return!1;var r=n._event;if(t.isCover(e,i)){if(t.hoverable)if(t.isHoverByRefDataID&&!0===t.isHoverByRefDataID){if(t.refDataID){var o=t.refDataID,s=null;t.refDataHoverGroup&&(s=t.refDataHoverGroup);for(var a=n.storage._shapeList,l=0,h=a.length;l<h;l++){var u=a[l];u.refDataID&&o===u.refDataID&&(s?u.refDataHoverGroup&&s===u.refDataHoverGroup&&n.storage.addHover(u):n.storage.addHover(u))}}}else n.storage.addHover(t);for(var c=t.parent;c;){if(c.clipShape&&!c.clipShape.isCover(n._mouseX,n._mouseY))return!1;c=c.parent}return n._lastHover!==t&&(n._processOutShape(r),n._processDragLeave(r),n._lastHover=t,n._processDragEnter(r)),n._processOverShape(r),n._processDragOver(r),n._hasfound=1,!0}return!1},this),this._domHover=i.getDomHover(),this.CLASS_NAME="Zondy.LevelRenderer.Handler";var n={resize:function(t){t=t||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(en.EVENT.RESIZE,t)},click:function(t){t=this._zrenderEventFixed(t);var e=this._lastHover;(e&&e.clickable||!e)&&this._clickThreshold<10&&this._dispatchAgency(e,en.EVENT.CLICK,t),this._mousemoveHandler(t)},dblclick:function(t){t=t||window.event,t=this._zrenderEventFixed(t);var e=this._lastHover;(e&&e.clickable||!e)&&this._clickThreshold<5&&this._dispatchAgency(e,en.EVENT.DBLCLICK,t),this._mousemoveHandler(t)},mousewheel:function(t){var e=((t=this._zrenderEventFixed(t)).wheelDelta||-t.detail)>0?1.1:1/1.1,i=this.painter.getLayers(),n=!1;for(var r in i)if("hover"!==r){var o=i[r],s=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var a=o.__zoom;a*=e,e=(a=Math.max(Math.min(o.maxZoom,a),o.minZoom))/o.__zoom,o.__zoom=a,s[0]-=(this._mouseX-s[0])*(e-1),s[1]-=(this._mouseY-s[1])*(e-1),o.scale[0]*=e,o.scale[1]*=e,o.dirty=!0,n=!0}}n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,en.EVENT.MOUSEWHEEL,t),this._mousemoveHandler(t)},mousemove:function(t){this._clickThreshold++,t=this._zrenderEventFixed(t),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=Di.Util_event.getX(t),this._mouseY=Di.Util_event.getY(t);var e=this._mouseX-this._lastX,i=this._mouseY-this._lastY;this._processDragStart(t),this._hasfound=0,this._event=t,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!==this._draggingTarget)&&(this._processOutShape(t),this._processDragLeave(t)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var n="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,e,i),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var r=this.painter.getLayers(),o=!1;for(var s in r)if("hover"!==s){var a=r[s];a.panable&&(n="move",a.position[0]+=e,a.position[1]+=i,o=!0,a.dirty=!0)}o&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?n="move":this._hasfound&&this._lastHover.clickable&&(n="pointer"),this.root.style.cursor=n,this._dispatchAgency(this._lastHover,en.EVENT.MOUSEMOVE,t),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(t){var e=(t=this._zrenderEventFixed(t)).toElement||t.relatedTarget;if(e!==this.root)for(;e&&9!==e.nodeType;){if(e===this.root)return void this._mousemoveHandler(t);e=e.parentNode}t.zrenderX=this._lastX,t.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(t),this._processDrop(t),this._processDragEnd(t),this.painter.refreshHover(),this.dispatch(en.EVENT.GLOBALOUT,t)},mousedown:function(t){if(this._clickThreshold=0,2===this._lastDownButton)return this._lastDownButton=t.button,void(this._mouseDownTarget=null);this._lastMouseDownMoment=new Date,t=this._zrenderEventFixed(t),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,en.EVENT.MOUSEDOWN,t),this._lastDownButton=t.button},mouseup:function(t){t=this._zrenderEventFixed(t),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,en.EVENT.MOUSEUP,t),this._processDrop(t),this._processDragEnd(t)},touchstart:function(t){t=this._zrenderEventFixed(t,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(t),this._mousedownHandler(t)},touchmove:function(t){t=this._zrenderEventFixed(t,!0),this._mousemoveHandler(t),this._isDragging&&Di.Util_event.stop(t)},touchend:function(t){t=this._zrenderEventFixed(t,!0),this._mouseupHandler(t);var e=new Date;e-this._lastTouchMoment<en.EVENT.touchClickDelay&&(this._mobildFindFixed(t),this._clickHandler(t),e-this._lastClickMoment<en.EVENT.touchClickDelay/2&&(this._dblclickHandler(t),this._lastHover&&this._lastHover.clickable&&Di.Util_event.stop(t)),this._lastClickMoment=e),this.painter.clearHover()}};function r(t,e){return function(i){return t.call(e,i)}}!function(t){var e=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],i=e.length;for(;i--;){var o=e[i];t["_"+o+"Handler"]=r(n[o],t)}}(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),Di.Util_env.os.tablet||Di.Util_env.os.phone?(t.addEventListener("touchstart",this._touchstartHandler),t.addEventListener("touchmove",this._touchmoveHandler),t.addEventListener("touchend",this._touchendHandler)):(t.addEventListener("click",this._clickHandler),t.addEventListener("dblclick",this._dblclickHandler),t.addEventListener("mousewheel",this._mousewheelHandler),t.addEventListener("mousemove",this._mousemoveHandler),t.addEventListener("mousedown",this._mousedownHandler),t.addEventListener("mouseup",this._mouseupHandler)),t.addEventListener("DOMMouseScroll",this._mousewheelHandler),t.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),t.attachEvent("onclick",this._clickHandler),t.ondblclick=this._dblclickHandler,t.attachEvent("onmousewheel",this._mousewheelHandler),t.attachEvent("onmousemove",this._mousemoveHandler),t.attachEvent("onmouseout",this._mouseoutHandler),t.attachEvent("onmousedown",this._mousedownHandler),t.attachEvent("onmouseup",this._mouseupHandler))}destroy(){this.dispose(),this._lastX=null,this._lastY=null,this._mouseX=null,this._mouseY=null,this._findHover=null,Oi.prototype.destroy.apply(this,arguments)}on(t,e){return this.bind(t,e),this}un(t,e){return this.unbind(t,e),this}trigger(t,e){var i=en.EVENT;switch(t){case i.RESIZE:case i.CLICK:case i.DBLCLICK:case i.MOUSEWHEEL:case i.MOUSEMOVE:case i.MOUSEDOWN:case i.MOUSEUP:case i.MOUSEOUT:this["_"+t+"Handler"](e)}}dispose(){var t=this.root;window.removeEventListener?(window.removeEventListener("resize",this._resizeHandler),Di.Util_env.os.tablet||Di.Util_env.os.phone?(t.removeEventListener("touchstart",this._touchstartHandler),t.removeEventListener("touchmove",this._touchmoveHandler),t.removeEventListener("touchend",this._touchendHandler)):(t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblclickHandler),t.removeEventListener("mousewheel",this._mousewheelHandler),t.removeEventListener("mousemove",this._mousemoveHandler),t.removeEventListener("mousedown",this._mousedownHandler),t.removeEventListener("mouseup",this._mouseupHandler)),t.removeEventListener("DOMMouseScroll",this._mousewheelHandler),t.removeEventListener("mouseout",this._mouseoutHandler)):(window.detachEvent("onresize",this._resizeHandler),t.detachEvent("onclick",this._clickHandler),t.detachEvent("dblclick",this._dblclickHandler),t.detachEvent("onmousewheel",this._mousewheelHandler),t.detachEvent("onmousemove",this._mousemoveHandler),t.detachEvent("onmouseout",this._mouseoutHandler),t.detachEvent("onmousedown",this._mousedownHandler),t.detachEvent("onmouseup",this._mouseupHandler)),this.root=null,this._domHover=null,this.storage=null,this.painter=null,this.un()}_processDragStart(t){var e=this._lastHover;if(this._isMouseDown&&e&&e.draggable&&!this._draggingTarget&&this._mouseDownTarget===e){if(e.dragEnableTime&&new Date-this._lastMouseDownMoment<e.dragEnableTime)return;var i=e;this._draggingTarget=i,this._isDragging=1,i.invisible=!0,this.storage.mod(i.id),this._dispatchAgency(i,en.EVENT.DRAGSTART,t),this.painter.refresh()}}_processDragEnter(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,en.EVENT.DRAGENTER,t,this._draggingTarget)}_processDragOver(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,en.EVENT.DRAGOVER,t,this._draggingTarget)}_processDragLeave(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,en.EVENT.DRAGLEAVE,t,this._draggingTarget)}_processDrop(t){this._draggingTarget&&(this._draggingTarget.invisible=!1,this.storage.mod(this._draggingTarget.id),this.painter.refresh(),this._dispatchAgency(this._lastHover,en.EVENT.DROP,t,this._draggingTarget))}_processDragEnd(t){this._draggingTarget&&(this._dispatchAgency(this._draggingTarget,en.EVENT.DRAGEND,t),this._lastHover=null),this._isDragging=0,this._draggingTarget=null}_processOverShape(t){this._dispatchAgency(this._lastHover,en.EVENT.MOUSEOVER,t)}_processOutShape(t){this._dispatchAgency(this._lastHover,en.EVENT.MOUSEOUT,t)}_dispatchAgency(t,e,i,n){var r="on"+e,o={type:e,event:i,target:t,cancelBubble:!1},s=t;for(n&&(o.dragged=n);s&&(s[r]&&(o.cancelBubble=s[r](o)),s.dispatch(e,o),s=s.parent,!o.cancelBubble););t?o.cancelBubble||this.dispatch(e,o):n||this.dispatch(e,{type:e,event:i})}_iterateAndFindHover(){for(var t,e=Di.Util_matrix.create(),i=this.storage.getShapeList(),n=[0,0],r=i.length-1;r>=0;r--){var o=i[r];if(void 0!==o.zlevel&&(t=this.painter.getLayer(o.zlevel,t),n[0]=this._mouseX,n[1]=this._mouseY,t.needTransform&&(Di.Util_matrix.invert(e,t.transform),Di.Util_vector.applyTransform(n,n,e))),this._findHover(o,n[0],n[1]))break}}_mobildFindFixed(t){var e=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=t.zrenderX,this._mouseY=t.zrenderY,this._event=t,this._iterateAndFindHover();for(var i=0;!this._lastHover&&i<e.length;i++){var n=e[i];n.x&&(this._mouseX+=n.x),n.y&&(this._mouseX+=n.y),this._iterateAndFindHover()}this._lastHover&&(t.zrenderX=this._mouseX,t.zrenderY=this._mouseY)}_zrenderEventFixed(t,e){if(t.zrenderFixed)return t;if(e){var i="touchend"!==t.type?t.targetTouches[0]:t.changedTouches[0];if(i){var n=this.root.getBoundingClientRect();t.zrenderX=i.clientX-n.left,t.zrenderY=i.clientY-n.top}}else{var r=(t=t||window.event).toElement||t.relatedTarget||t.srcElement||t.target;r&&r!==this._domHover&&(t.zrenderX=(void 0!==t.offsetX?t.offsetX:t.layerX)+r.offsetLeft,t.zrenderY=(void 0!==t.offsetY?t.offsetY:t.layerY)+r.offsetTop)}return t.zrenderFixed=1,t}getLastHoverOne(){return this._lastHover?this._lastHover:null}}class sn{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Animation.Easing"}destroy(){}Linear(t){return t}QuadraticIn(t){return t*t}QuadraticOut(t){return t*(2-t)}QuadraticInOut(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}CubicIn(t){return t*t*t}CubicOut(t){return--t*t*t+1}CubicInOut(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}QuarticIn(t){return t*t*t*t}QuarticOut(t){return 1- --t*t*t*t}QuarticInOut(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}QuinticIn(t){return t*t*t*t*t}QuinticOut(t){return--t*t*t*t*t+1}QuinticInOut(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}SinusoidalIn(t){return 1-Math.cos(t*Math.PI/2)}SinusoidalOut(t){return Math.sin(t*Math.PI/2)}SinusoidalInOut(t){return.5*(1-Math.cos(Math.PI*t))}ExponentialIn(t){return 0===t?0:Math.pow(1024,t-1)}ExponentialOut(t){return 1===t?1:1-Math.pow(2,-10*t)}ExponentialInOut(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}CircularIn(t){return 1-Math.sqrt(1-t*t)}CircularOut(t){return Math.sqrt(1- --t*t)}CircularInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}ElasticIn(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))}ElasticOut(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)}ElasticInOut(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)}BackIn(t){var e=1.70158;return t*t*((e+1)*t-e)}BackOut(t){var e=1.70158;return--t*t*((e+1)*t+e)+1}BackInOut(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}BounceIn(t){return 1-this.BounceOut(1-t)}BounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}BounceInOut(t){return t<.5?.5*this.BounceIn(2*t):.5*this.BounceOut(2*t-1)+.5}}class an{constructor(t){this._targetPool=t.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=t.life||1e3,this._delay=t.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+1e3*this._life,this.loop=void 0!==t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this.CLASS_NAME="Zondy.LevelRenderer.Animation.Clip"}destroy(){}step(t){var e=new sn,i=(t-this._startTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n="string"==typeof this.easing?e[this.easing]:this.easing,r="function"==typeof n?n(i):i;return this.fire("frame",r),1===i?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}}restart(){var t=((new Date).getTime()-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap}fire(t,e){for(var i=0,n=this._targetPool.length;i<n;i++)this["on"+t]&&this["on"+t](this._targetPool[i],e)}}class ln extends Oi{constructor(t){super(t),t=t||{},this.stage={},this.onframe=function(){},this._clips=[],this._running=!1,this._time=0,yi(this,t),this.CLASS_NAME="Zondy.LevelRenderer.Animation"}add(t){this._clips.push(t)}remove(t){var e=(new Ni).indexOf(this._clips,t);e>=0&&this._clips.splice(e,1)}_update(){var t=(new Date).getTime(),e=t-this._time,i=this._clips,n=i.length,r=[],o=[];for(let e=0;e<n;e++){var s=i[e],a=s.step(t);a&&(r.push(a),o.push(s))}this.stage.update&&this.stage.update();for(let t=0;t<n;)i[t]._needsRemove?(i[t]=i[n-1],i.pop(),n--):t++;n=r.length;for(let t=0;t<n;t++)o[t].fire(r[t]);this._time=t,this.onframe(e),this.dispatch("frame",e)}start(){var t=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){setTimeout(t,16)},e=this;this._running=!0,this._time=(new Date).getTime(),t(function i(){e._running&&(e._update(),t(i))})}stop(){this._running=!1}clear(){this._clips=[]}animate(t,e){var i=new hn(t,(e=e||{}).loop,e.getter,e.setter);return i.animation=this,i}static _interpolateNumber(t,e,i){return(e-t)*i+t}static _interpolateArray(t,e,i,n,r){var o=t.length;if(1===r)for(let r=0;r<o;r++)n[r]=ln._interpolateNumber(t[r],e[r],i);else{var s=t[0].length;for(let r=0;r<o;r++)for(let o=0;o<s;o++)n[r][o]=ln._interpolateNumber(t[r][o],e[r][o],i)}}static _isArrayLike(t){switch(typeof t){case"undefined":case"string":return!1}return void 0!==t.length}static _catmullRomInterpolateArray(t,e,i,n,r,o,s,a,l){var h=t.length;if(1===l)for(let l=0;l<h;l++)a[l]=ln._catmullRomInterpolate(t[l],e[l],i[l],n[l],r,o,s);else{var u=t[0].length;for(let l=0;l<h;l++)for(var c=0;c<u;c++)a[l][c]=ln._catmullRomInterpolate(t[l][c],e[l][c],i[l][c],n[l][c],r,o,s)}}static _catmullRomInterpolate(t,e,i,n,r,o,s){var a=.5*(i-t),l=.5*(n-e);return(2*(e-i)+a+l)*s+(-3*(e-i)-2*a-l)*o+a*r+e}static _cloneValue(t){var e=Array.prototype.slice;if(ln._isArrayLike(t)){var i=t.length;if(ln._isArrayLike(t[0])){for(var n=[],r=0;r<i;r++)n.push(e.call(t[r]));return n}return e.call(t)}return t}static rgba2String(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}}class hn{constructor(t,e,i,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||function(t,e){return t[e]},this._setter=n||function(t,e,i){t[e]=i},this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[],this.CLASS_NAME="Zondy.LevelRenderer.Animation.Animator"}when(t,e){for(var i in e)this._tracks[i]||(this._tracks[i]=[],0!==t&&this._tracks[i].push({time:0,value:ln._cloneValue(this._getter(this._target,i))})),this._tracks[i].push({time:parseInt(t,10),value:e[i]});return this}during(t){return this._onframeList.push(t),this}start(t){var e=this,i=this._setter,n=this._getter,r=e._onframeList.length,o="spline"===t,s=function(){if(e._clipCount--,0===e._clipCount){e._tracks={};for(var t=e._doneList.length,i=0;i<t;i++)e._doneList[i].call(e)}},a=function(a,l){var h=a.length;if(h){var u=a[0].value,c=ln._isArrayLike(u),p=!1,f=c&&ln._isArrayLike(u[0])?2:1;a.sort(function(t,e){return t.time-e.time});var d=a[h-1].time,g=[],y=[];for(let t=0;t<h;t++){g.push(a[t].time/d);var m=a[t].value;"string"==typeof m&&(0===(m=Di.Util_color.toArray(m)).length&&(m[0]=m[1]=m[2]=0,m[3]=1),p=!0),y.push(m)}var _,v,x,b,w,E,C,L=0,S=0;if(p)var P=[0,0,0,0];var I=new an({target:e._target,life:d,loop:e._loop,delay:e._delay,onframe:function(t,s){if(s<S){for(_=Math.min(L+1,h-1),v=_;v>=0&&!(g[v]<=s);v--);v=Math.min(v,h-2)}else{for(v=L;v<h&&!(g[v]>s);v++);v=Math.min(v-1,h-2)}L=v,S=s;var a=g[v+1]-g[v];if(0!==a){if(x=(s-g[v])/a,o)if(w=y[v],b=y[0===v?v:v-1],E=y[v>h-2?h-1:v+1],C=y[v>h-3?h-1:v+2],c)ln._catmullRomInterpolateArray(b,w,E,C,x,x*x,x*x*x,n(t,l),f);else{let e;e=p?ln.rgba2String(P):ln._catmullRomInterpolate(b,w,E,C,x,x*x,x*x*x),i(t,l,e)}else if(c)ln._interpolateArray(y[v],y[v+1],x,n(t,l),f);else{let e;p?(ln._interpolateArray(y[v],y[v+1],x,P,1),e=ln.rgba2String(P)):e=ln._interpolateNumber(y[v],y[v+1],x),i(t,l,e)}for(v=0;v<r;v++)e._onframeList[v](t,s)}},ondestroy:s});t&&"spline"!==t&&(I.easing=t),e._clipList.push(I),e._clipCount++,e.animation.add(I)}};for(var l in this._tracks)a(this._tracks[l],l);return this}stop(){for(var t=0;t<this._clipList.length;t++){var e=this._clipList[t];this.animation.remove(e)}this._clipList=[]}delay(t){return this._delay=t,this}done(t){return t&&this._doneList.push(t),this}}class un{constructor(t,e){this.id=t,this.storage=new tn,this.painter=new nn(e,this.storage),this.handler=new on(e,this.storage,this.painter),this.animatingElements=[],this.animation=new ln({stage:{update:un.getFrameCallback(this)}}),this._needsRefreshNextFrame=!1,this.animation.start(),this.CLASS_NAME="Zondy.LevelRenderer.Render"}destroy(){this.id=null,this.storage=null,this.painter=null,this.handler=null,this.animatingElements=null,this.animation=null,this._needsRefreshNextFrame=null}getId(){return this.id}addShape(t){return this.storage.addRoot(t),this}addGroup(t){return this.storage.addRoot(t),this}delShape(t){return this.storage.delRoot(t),this}delGroup(t){return this.storage.delRoot(t),this}modShape(t,e){return this.storage.mod(t,e),this}modGroup(t,e){return this.storage.mod(t,e),this}modLayer(t,e){return this.painter.modLayer(t,e),this}addHoverShape(t){return this.storage.addHover(t),this}render(t){return this.painter.render(t),this._needsRefreshNextFrame=!1,this}refresh(t){return this.painter.refresh(t),this._needsRefreshNextFrame=!1,this}refreshNextFrame(){return this._needsRefreshNextFrame=!0,this}refreshHover(t){return this.painter.refreshHover(t),this}refreshShapes(t,e){return this.painter.refreshShapes(t,e),this}resize(){return this.painter.resize(),this}animate(t,e,i){if("string"==typeof t&&(t=this.storage.get(t)),t){var n;if(e){for(var r=e.split("."),o=t,s=0,a=r.length;s<a;s++)o&&(o=o[r[s]]);o&&(n=o)}else n=t;if(!n)return;var l=this.animatingElements;return void 0===t.__aniCount&&(t.__aniCount=0),0===t.__aniCount&&l.push(t),t.__aniCount++,this.animation.animate(n,{loop:i}).done(function(){if(t.__aniCount--,0===t.__aniCount){var e=_i(l,t);l.splice(e,1)}})}}clearAnimation(){this.animation.clear()}getWidth(){return this.painter.getWidth()}getHeight(){return this.painter.getHeight()}toDataURL(t,e,i){return this.painter.toDataURL(t,e,i)}shapeToImage(t,e,i){var n=vi();return this.painter.shapeToImage(n,t,e,i)}on(t,e){return this.handler.on(t,e),this}un(t,e){return this.handler.un(t,e),this}trigger(t,e){return this.handler.trigger(t,e),this.handler.dispatch(t,e),this}clear(){return this.storage.delRoot(),this.painter.clear(),this}dispose(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=null,this.animatingElements=null,this.storage=null,this.painter=null,this.handler=null}updateHoverShapes(t){return this.painter.updateHoverLayer(t),this}getAllShapes(){return this.storage._shapeList}clearAll(){return this.clear(),this.painter.clearHover(),this}getHoverOne(){return this.handler.getLastHoverOne()}static getFrameCallback(t){return function(){var e=t.animatingElements;if(e instanceof Array){for(var i=0,n=e.length;i<n;i++)t.storage.mod(e[i].id);(e.length||t._needsRefreshNextFrame)&&t.refresh()}}}}class cn{constructor(){cn._instances={},cn.Tool={},this.CLASS_NAME="Zondy.LevelRenderer"}destroy(){this.dispose()}init(t){var e=new un(vi(),t);return cn._instances[e.id]=e,e}dispose(t){if(t)t.dispose(),this.delInstance(t.id);else{for(var e in cn._instances)cn._instances[e].dispose();cn._instances={}}return this}getInstance(t){return cn._instances[t]}delInstance(t){return delete cn._instances[t],this}}const pn={Bar:class extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Bar"}destroy(){super.destroy()}assembleShapes(){var t={showShadow:!0,shadowBlur:8,shadowColor:"rgba(100,100,100,0.8)",shadowOffsetX:2,shadowOffsetY:2},e=this.setting;if(e.barLinearGradient||(e.barLinearGradient=[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]),e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.dataViewBox,r=this.dataValues;if(!(r.length<1)){for(let t=0,e=r.length;t<e;t++)if(r[t]<i[0]||r[t]>i[1])return;var o=this.calculateXShapeInfo();if(o){var s=o.xPositions,a=o.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,e)),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(Xi.GraphAxis(this.shapeFactory,n,e,o)));for(var l=0;l<r.length;l++){var h=n[1]-(r[l]-i[0])/this.DVBUnitValue,u=[[s[l]-a/2,n[1]-1],[s[l]+a/2,n[1]-1],[s[l]+a/2,h],[s[l]-a/2,h]],c=new Li(u);if(void 0===e.showShadow||e.showShadow){if(e.barShadowStyle){var p=e.barShadowStyle;p.shadowBlur&&(t.shadowBlur=p.shadowBlur),p.shadowColor&&(t.shadowColor=p.shadowColor),p.shadowOffsetX&&(t.shadowOffsetX=p.shadowOffsetX),p.shadowOffsetY&&(t.shadowOffsetY=p.shadowOffsetY)}c.style={},gi(c.style,t)}c.refDataID=this.data.id,c.dataInfo={field:this.fields[l],value:r[l]},void 0!==e.barHoverAble&&(c.hoverable=e.barHoverAble),void 0!==e.barClickAble&&(c.clickable=e.barClickAble),this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=0,s=this.DVBWidth;if(i.xShapeBlank&&i.xShapeBlank.length&&3===i.xShapeBlank.length){var a=s-((t=i.xShapeBlank)[0]+t[2]+(n-1)*t[1]);if(a<=n)return null;o=a/n}else t=[o=s/(2*n+1),o,o];for(var l=0,h=0;h<n;h++)0===h?l=t[0]+o/2:l+=o+t[1],r.push(e[0]+l);return{xPositions:r,width:o}}resetLinearGradient(){if(this.RelativeCoordinate)for(var t=this.shapes.length,e=this.setting.barLinearGradient,i=-1,n=0;n<t;n++){var r=this.shapes[n];if("Zondy.LevelRenderer.Shape.SmicPolygon"===r.CLASS_NAME){var o=r.style,s=this.location[0]+o.pointList[0][0],a=this.location[0]+o.pointList[1][0];++i>=e.length&&(i%=e.length);var l=e[i][0],h=e[i][1],u=(new ki).getLinearGradient(s,0,a,0,[[0,l],[1,h]]);r.style.color=u}}}},Bar3D:class extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Bar3D"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,25,20,20]:t.dataViewBoxParameter=[5,5,5,5]),t.axisUseArrow=void 0===t.axisUseArrow||t.axisUseArrow,t.axisXLabelsOffset=void 0!==t.axisXLabelsOffset?t.axisXLabelsOffset:[-10,10],this.initBaseParameter()){var e=this.DVBCodomain;this.DVBUnitValue=(e[1]-e[0])/this.DVBHeight;var i=this.dataViewBox,n=this.dataValues;if(!(n.length<1)){for(let t=0,i=n.length;t<i;t++)if(n[t]<e[0]||n[t]>e[1])return;var r=this.calculateXShapeInfo();if(r){var o=r.xPositions,s=r.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,t)),(!t.axis3DParameter||isNaN(t.axis3DParameter)||t.axis3DParameter<15)&&(t.axis3DParameter=20),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(Xi.GraphAxis(this.shapeFactory,i,t,r)));var a=t.bar3DParameter&&!isNaN(t.bar3DParameter)?t.bar3DParameter:10;for(let r=0;r<n.length;r++){var l=i[1]-(n[r]-e[0])/this.DVBUnitValue,h=o[r]-s/2,u=o[r]+s/2,c=[[h,l],[u,l],[u-a,l+a],[h-a,l+a]],p=[[u,l],[u-a,l+a],[u-a,i[1]+a],[u,i[1]]],f=[[h-a,i[1]+a],[u-a,i[1]+a],[u-a,l+a],[h-a,l+a]];a<=0&&(f=[[h,i[1]],[u,i[1]],[u,l],[h,l]]);var d=new Li(c),g=new Li(p),y=new Li(f);t.barSideStyle=t.barSideStyle?t.barSideStyle:t.barFaceStyle,t.barSideStyleByFields=t.barSideStyleByFields?t.barSideStyleByFields:t.barFaceStyleByFields,t.barSideStyleByCodomain=t.barSideStyleByCodomain?t.barSideStyleByCodomain:t.barFaceStyleByCodomain,t.barTopStyle=t.barTopStyle?t.barTopStyle:t.barFaceStyle,t.barTopStyleByFields=t.barTopStyleByFields?t.barTopStyleByFields:t.barFaceStyleByFields,t.barTopStyleByCodomain=t.barTopStyleByCodomain?t.barTopStyleByCodomain:t.barFaceStyleByCodomain,y.style=Xi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barFaceStyle,t.barFaceStyleByFields,t.barFaceStyleByCodomain,r,n[r]),g.style=Xi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barSideStyle,t.barSideStyleByFields,t.barSideStyleByCodomain,r,n[r]),d.style=Xi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barTopStyle,t.barTopStyleByFields,t.barTopStyleByCodomain,r,n[r]),t.barSideHoverStyle=t.barSideHoverStyle?t.barSideHoverStyle:t.barFaceHoverStyle,t.barTopHoverStyle=t.barTopHoverStyle?t.barTopHoverStyle:t.barFaceHoverStyle,y.highlightStyle=Xi.ShapeStyleTool({stroke:!0},t.barFaceHoverStyle),g.highlightStyle=Xi.ShapeStyleTool({stroke:!0},t.barSideHoverStyle),d.highlightStyle=Xi.ShapeStyleTool({stroke:!0},t.barTopHoverStyle),d.refDataID=g.refDataID=y.refDataID=this.data.id,d.isHoverByRefDataID=g.isHoverByRefDataID=y.isHoverByRefDataID=!0,d.refDataHoverGroup=g.refDataHoverGroup=y.refDataHoverGroup=vi(),d.dataInfo=g.dataInfo=y.dataInfo={field:this.fields[r],value:n[r]},void 0!==t.barHoverAble&&(d.hoverable=g.hoverable=y.hoverable=t.barHoverAble),void 0!==t.barClickAble&&(d.clickable=g.clickable=y.clickable=t.barClickAble),this.shapes.push(this.shapeFactory.createShape(g)),this.shapes.push(this.shapeFactory.createShape(d)),this.shapes.push(this.shapeFactory.createShape(y))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=0,s=this.DVBWidth;if(i.xShapeBlank&&i.xShapeBlank.length&&3===i.xShapeBlank.length){var a=s-((t=i.xShapeBlank)[0]+t[2]+(n-1)*t[1]);if(a<=n)return null;o=a/n}else t=[o=s/(2*n+1),o,o];for(var l=0,h=0;h<n;h++)0===h?l=t[0]+o/2:l+=o+t[1],r.push(e[0]+l);return{xPositions:r,width:o}}},OverlayCircle:class extends $i{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Circle"}destroy(){super.destroy()}assembleShapes(){if(!this.setting)return!1;var t=this.setting;if(!t.codomain)return!1;var e=void 0===t.decimalNumber||isNaN(t.decimalNumber)?-1:t.decimalNumber,i=Yi.getDataValues(this.data,this.fields,e);this.dataValues=i||[];var n=this.dataValues;t.maxR||(t.maxR=100),t.minR||(t.minR=0);var r=this.DVBCodomain;r&&r[1]-r[0]>0?this.DVBUnitValue=t.maxR/(r[1]-r[0]):this.DVBUnitValue=t.maxR;var o=this.DVBUnitValue,s=n[0]*o+t.minR;if(this.width=2*s,this.height=2*s,this.initBaseParameter()&&(!r||!(n[0]<r[0]||n[0]>r[1]))){var a=this.DVBCenterPoint,l=new Ti(a[0],a[1],s);l.style=Xi.ShapeStyleTool(null,t.circleStyle,null,null,0),void 0!==t.fillColor?l.style.fillColor=t.fillColor:l.style.fillColor="#ff9277",l.highlightStyle=Xi.ShapeStyleTool(null,t.circleHoverStyle),void 0!==t.circleHoverAble&&(l.hoverable=t.circleHoverAble),void 0!==t.circleClickAble&&(l.clickable=t.circleClickAble),l.refDataID=this.data.id,l.dataInfo={field:this.fields[0],r:s,value:n[0]},this.shapes.push(this.shapeFactory.createShape(l)),this.shapesConvertToRelativeCoordinate()}}}};pn.Graph=Wi,pn.Line=class extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Line"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,15,15,15]:t.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var e=this.dataViewBox,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.DVBUnitValue,r=this.dataValues;if(!(r.length<1)){var o=this.calculateXShapeInfo();if(o){var s,a,l=o.xPositions;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,t)),this.shapes=this.shapes.concat(Xi.GraphAxis(this.shapeFactory,e,t,o));for(var h=[],u=[],c=0,p=r.length;c<p;c++){if(r[c]<i[0]||r[c]>i[1])return null;s=l[c],a=e[1]-(r[c]-i[0])/n;var f=new Ei(s,a);f.style=Xi.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,c,r[c]),f.highlightStyle=Xi.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(f.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(f.clickable=t.pointClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[c],value:r[c]},u.push(this.shapeFactory.createShape(f));var d=[s,a];h.push(d)}var g=new Ci(h);g.style=Xi.ShapeStyleTool({strokeColor:"#ee9900"},t.lineStyle),g.clickable=!1,g.hoverable=!1;var y=this.shapeFactory.createShape(g);this.shapes.push(y),this.shapes=this.shapes.concat(u),this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=this.DVBWidth,s=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2===i.xShapeBlank.length){var a=o-((t=i.xShapeBlank)[0]+t[1]);if(a<=n)return null;s=a/(n-1)}else t=[s=o/(n+1),s,s];for(var l=0,h=0;h<n;h++)0===h?l=t[0]:l+=s,r.push(e[0]+l);return{xPositions:r,width:0}}},pn.Pie=class extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Pie"}destroy(){super.destroy()}assembleShapes(){var t=this.setting,e=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}];if(this.initBaseParameter()){t.useBackground&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,t));var i=this.dataValues;if(!(i.length<1)){var n=this.DVBCodomain;for(let t=0;t<i.length;t++)if(i[t]<n[0]||i[t]>n[1])return;var r=0;for(let t=0;t<i.length;t++)r+=Math.abs(i[t]);this.DVBUnitValue=360/r;for(var o=this.DVBUnitValue,s=this.DVBCenterPoint,a=0,l=0,h=a,u=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,c=0;c<i.length;c++){var p=Math.abs(i[c]);(l=0===c?a+p*o:c===p.length-1?h:a+p*o)-a>=360&&(l=359.9999999);var f=new Pi(s[0],s[1],u,a,l);if(void 0===t.sectorStyleByFields){var d=c%e.length;f.style=Xi.ShapeStyleTool(null,t.sectorStyle,e,null,d)}else f.style=Xi.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,c,i[c]);f.highlightStyle=Xi.ShapeStyleTool(null,t.sectorHoverStyle),void 0!==t.sectorHoverAble&&(f.hoverable=t.sectorHoverAble),void 0!==t.sectorClickAble&&(f.clickable=t.sectorClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[c],value:i[c]},this.shapes.push(this.shapeFactory.createShape(f)),a=l}this.shapesConvertToRelativeCoordinate()}}}},pn.OverlayPoint=Ki,pn.RankSymbol=$i,pn.Ring=class extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Ring"}destroy(){super.destroy()}assembleShapes(){if(this.initBaseParameter()){var t=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}],e=this.setting;e.useBackground&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,e));var i=this.dataValues;if(!(i.length<1)){var n=this.DVBCodomain;for(let t=0;t<i.length;t++)if(i[t]<n[0]||i[t]>n[1])return;var r=0;for(let t=0;t<i.length;t++)r+=Math.abs(i[t]);this.DVBUnitValue=360/r;for(var o=this.DVBUnitValue,s=this.DVBCenterPoint,a=0,l=0,h=a,u=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,c=e.innerRingRadius>=0&&e.innerRingRadius<u,p=void 0!==e.innerRingRadius&&!isNaN(e.innerRingRadius)&&c?e.innerRingRadius:0,f=0;f<i.length;f++){var d=Math.abs(i[f]);l=0===f?a+d*o:f===d.length-1?h:a+d*o;var g=new Pi(s[0],s[1],u,a,l,p);if(void 0===e.sectorStyleByFields){var y=f%t.length;g.style=Xi.ShapeStyleTool(null,e.sectorStyle,t,null,y)}else g.style=Xi.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,f,i[f]);g.highlightStyle=Xi.ShapeStyleTool(null,e.sectorHoverStyle),void 0!==e.sectorHoverAble&&(g.hoverable=e.sectorHoverAble),void 0!==e.sectorClickAble&&(g.clickable=e.sectorClickAble),g.refDataID=this.data.id,g.dataInfo={field:this.fields[f],value:i[f]},this.shapes.push(this.shapeFactory.createShape(g)),a=l}this.shapesConvertToRelativeCoordinate()}}}},pn.ThemeVector=Qi,pn.Point=Ki;var fn=r.Layer.extend({options:{name:null,opacity:1,TFEvents:null},initialize(t,e){r.Util.setOptions(this,e),this.options.name=t,this.features=[],this.TFEvents=e&&e.TFEvents?e.TFEvents:[],this.levelRenderer=new cn,this.movingOffset=[0,0]},getEvents(){const t=this,e={zoomend:t._reset,moveend:t._reset,resize:t._resize};return this._map._zoomAnimated&&(e.zoomanim=t._zoomAnim),e},onRemove(t){r.DomUtil.remove(this.container),t.off("mousemove",this.mouseMoveHandler)},onAdd(t){const e=this;if(e.map=e._map=t,e._initContainer(),!e.levelRenderer)return void t.removeLayer(e);const i=t.getSize();e.container.style.width=`${i.x}px`,e.container.style.height=`${i.y}px`,e._updateOpacity(),e.renderer=e.levelRenderer.init(e.container),e.renderer.clear(),e.features&&e.features.length>0&&e._reset(),e.addTFEvents(),e.mouseMoveHandler=function(t){const i=t.layerPoint;e.currentMousePosition=r.point(i.x+e.movingOffset[0],i.y+e.movingOffset[1])},t.on("mousemove",e.mouseMoveHandler),e.update()},addFeatures(t){},redrawThematicFeatures(t){},destroyFeatures(t){if(void 0===t&&(t=this.features),t){this.removeFeatures(t);for(let e=t.length-1;e>=0;e--)t[e].destroy()}},removeFeatures(t){const e=this;if(!t||0===t.length)return;if(t===e.features)return e.removeAllFeatures();r.Util.isArray(t)||(t=[t]);const i=[];for(let o=t.length-1;o>=0;o--){var n=t[o];const s=r.Util.indexOf(e.features,n);-1!==s?e.features.splice(s,1):i.push(n)}const o=[];for(let t=0,i=e.features.length;t<i;t++)n=e.features[t],o.push(n);e.features=[],e.addFeatures(o),e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures());const s=0===i.length;e.fire("featuresremoved",{features:i,succeed:s})},removeAllFeatures(){const t=this;t.renderer&&t.renderer.clear(),t.features=[],t.fire("featuresremoved",{features:[],succeed:!0})},getFeatures(){const t=this,e=t.features.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=t.features[n];return i},getFeatureBy(t,e){return this.features.find(i=>{const n=i.attributes;if(i[t]===e||n[t]===e)return i})},getFeatureById(t){return this.getFeatureBy("id",t)},getFeaturesByAttribute(t,e){const i=this;let n;const r=[];for(const o in i.features)(n=i.features[o])&&n.attributes&&n.attributes[t]===e&&r.push(n);return r},update(t){const e=this._map.containerPointToLayerPoint([0,0]);r.DomUtil.setPosition(this.container,e);const i=this;i.renderer&&i.redrawThematicFeatures(t),i.currentMousePosition&&(i.currentMousePosition=r.point(i.currentMousePosition.x-i.movingOffset[0],i.currentMousePosition.y-i.movingOffset[1])),i.movingOffset=[0,0],i._zoom=i._map.getZoom(),i._center=i._map.getCenter()},setOpacity(t){const e=this;t!==e.options.opacity&&(isNaN(t)||(e.options.opacity=t,e._updateOpacity()))},redraw(){const t=this;return!!t.renderer&&(t._map?t.redrawThematicFeatures(t._map.getBounds()):t.redrawThematicFeatures(),!0)},on(t,e,i){return this.renderer?this.renderer.on(t,e):r.Layer.prototype.on.call(this,t,e),this},off(t,e,i){const n=this;return n.renderer?n.renderer.un(t,e):r.Layer.prototype.off.call(this,t,e),this},fire(t,e,i){return this.renderer&&this.renderer.trigger(t,e),r.Layer.prototype.fire.call(this,t,e,i),this},addTFEvents(){const t=this,e=t.TFEvents,i=e.length;for(let n=0;n<i;n++)t.renderer.on(e[n][0],e[n][1])},getLocalXY(t){if(!this._map)return t;let e=t;r.Util.isArray(t)?e=r.point(t[0],t[1]):t instanceof r.Point||(e=t instanceof Zondy.LonLat?r.point(t.lon,t.lat):r.point(t.x,t.y));const i=this._map.latLngToContainerPoint(this._map.options.crs.unproject(e));return[i.x,i.y]},_initContainer(){const t=this.getPane(),e=this._map.options.zoomAnimation&&r.Browser.any3d;let i=this.options.name||"themeLayer";i+=` leaflet-layer leaflet-zoom-${e?"animated":"hide"}`,this.container=r.DomUtil.create("div",i,t);const n=r.DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);this.container.style[n]="50% 50%",this.container.style.position="absolute",this.container.style.zIndex=200},_zoomAnim(t){const e=this._map.getZoomScale(t.zoom),i=this._map._getCenterOffset(t.center)._multiplyBy(-e).subtract(this._map._getMapPanePos());r.DomUtil.setTransform?r.DomUtil.setTransform(this.container,i,e):this.container.style[r.DomUtil.TRANSFORM]=`${r.DomUtil.getTranslateString(i)} scale(${e})`},_updateOpacity(){const t=this;!function(t,e,i,n,r,o,s,a){e&&(t.id=e),i&&(t.style.left=i.x+"px",t.style.top=i.y+"px"),n&&(t.style.width=n.w+"px",t.style.height=n.h+"px"),r&&(t.style.position=r),o&&(t.style.border=o),s&&(t.style.overflow=s),parseFloat(a)>=0&&parseFloat(a)<1?(t.style.filter="alpha(opacity="+100*a+")",t.style.opacity=a):1===parseFloat(a)&&(t.style.filter="",t.style.opacity="")}(t.container,null,null,null,null,null,null,t.options.opacity),null!==t._map&&t._map.fire("changelayer",{layer:t,property:"opacity"})},_reset(){const t=this,e=t._map.getBounds();t.update(e);const i=t._map.getSize(),n=this._map.containerPointToLayerPoint([0,0]);r.DomUtil.setPosition(this.container,n),parseFloat(t.container.width)!==parseFloat(i.x)&&(t.container.width=`${i.x}px`),parseFloat(t.container.height)!==parseFloat(i.y)&&(t.container.height=`${i.y}px`),t.redraw()},_resize(){const t=this._map.getSize();this.container.style.width=`${t.x}px`,this.container.style.height=`${t.y}px`,this.renderer.resize()}});var dn=fn.extend({options:{nodesClipPixel:2,isHoverAble:!1,isMultiHover:!1,isClickAble:!0,isAllowFeatureStyle:!1},initialize(t,e){fn.prototype.initialize.call(this,t,e),r.Util.setOptions(this,e);this.cache={},this.cacheFields=[],this.style={},this.highlightStyle={}},addFeatures(t){const e=this;if(e.fire("beforefeaturesadded",{features:t}),t instanceof n.FeatureSet){const i=null,n=t.AttStruct,r=t.SFEleArray;if(null!==r&&r.length>0)for(let t=0;t<r.length;t++){const o=r[t];if(null!==o.AttValue&&o.AttValue.length>0){const t={};for(let e=0;e<o.AttValue.length;e++)t[n.FldName[e]]=o.AttValue[e];t.FID=o.FID}o.attributes=i,e.features.push(o)}}e.isCustomSetMaxCacheCount||(e.maxCacheCount=5*e.features.length),e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures())},removeFeatures(t){this.clearCache(),fn.prototype.removeFeatures.call(this,arguments)},removeAllFeatures(){this.clearCache(),fn.prototype.removeAllFeatures.call(this,arguments)},redrawThematicFeatures(t){const e=this,i=e.renderer.getHoverOne();let o=null;if(i&&i.refDataID&&(o=i.refDataID),t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent(t.min.x,t.min.y,t.max.x,t.max.y)}e.renderer.clearAll();const s=e.features,a=e.cache,l=e.cacheFields,h=e._map.getZoom(),u=e.maxCacheCount;for(let i=0,n=s.length;i<n;i++){const n=s[i],r=n.bound;if(t&&!t.intersectsBounds(r))continue;const o=`${n.FID}_zoom_${h.toString()}`;if(a[o]){a[o].updateAndAddShapes();continue}const c=e.createThematicFeature(s[i]);if(!(c.getShapesCount()<1)&&(a[o]=c,l.push(o),l.length>u)){const t=l[0];l.splice(0,1),delete a[t]}}if(e.renderer.render(),o&&e.options.isHoverAble&&e.options.isMultiHover){const t=this.getShapesByFeatureID(o);this.renderer.updateHoverShapes(t)}},createThematicFeature(t){const e=this,i=e.getStyleByData(t),n={};n.nodesClipPixel=e.options.nodesClipPixel,n.isHoverAble=e.options.isHoverAble,n.isMultiHover=e.options.isMultiHover,n.isClickAble=e.options.isClickAble,n.highlightStyle=Xi.transformStyle(e.highlightStyle);const r=new Qi(t,e,Xi.transformStyle(i),n);for(let t=0;t<r.shapes.length;t++)e.renderer.addShape(r.shapes[t]);return r},getStyleByData(t){},redraw(){return this.clearCache(),fn.prototype.redraw.apply(this,arguments)},clearCache(){this.cache={},this.cacheFields=[]},clear(){this.renderer.clearAll(),this.renderer.refresh(),this.removeAllFeatures(),this.clearCache()},getCacheCount(){return this.cacheFields.length},setMaxCacheCount(t){isNaN(t)||(this.maxCacheCount=t,this.isCustomSetMaxCacheCount=!0)},getShapesByFeatureID(t){const e=[],i=this.renderer.getAllShapes();if(!t)return i;for(let n=0,r=i.length;n<r;n++){const r=i[n];r.refDataID&&t===r.refDataID&&e.push(r)}return e}});dn.extend({initialize(t,e){dn.prototype.initialize.call(this,t,e),this.style=[],this.themeField=null,this.styleGroups=[]},getStyleByData(t){const e=this,i=t;let n=gi({},e.style);const r=e.styleGroups;let o=!1,s=null;const a=e.styleGroups&&e.styleGroups.length>0;if(e.themeField&&a&&i.attributes){const t=e.themeField,n=i.attributes;for(const e in n)if(t===e){o=!0,s=n[e];break}}if(o&&a)for(let t=0,e=r.length;t<e;t++){if(t===e-1?s>=r[t].start&&s<=r[t].end:s>=r[t].start&&s<r[t].end){const e=r[t].style;n=gi(n,e)}}return n}});dn.extend({initialize(t,e){dn.prototype.initialize.call(this,t,e),this.style=[],this.themeField=null,this.styleGroups=[]},getStyleByData(t){const e=this,i=t;let n=gi({},e.style);const r=e.styleGroups;let o=!1,s=null;const a=e.styleGroups&&e.styleGroups.length>0;if(e.themeField&&a&&i.attributes){const t=e.themeField,n=i.attributes;for(const e in n)if(t===e){o=!0,s=n[e];break}}if(o&&a)for(let t=0,e=r.length;t<e;t++)if(!s&&!r[t].value||s&&r[t].value&&s.toString()===r[t].value.toString()){const e=r[t].style;n=gi(n,e);break}return n}});var gn=fn.extend({options:{isOverLay:!0},initialize(t,e,i){const n=[];n.push(t),n.push(i),fn.prototype.initialize.apply(this,n),this.chartsType=e,this.themeFields=i&&i.themeFields?i.themeFields:null,this.charts=i&&i.charts?i.charts:[],this.cache=i&&i.cache?i.cache:{},this.chartsSetting=i&&i.chartsSetting?i.chartsSetting:{}},setChartsType(t){this.chartsType=t,this.redraw()},addFeatures(t){const e=this;if(e.fire("beforefeaturesadded",{features:t}),t instanceof n.FeatureSet){const i=t.features;if(Array.isArray(i)&&i.length>0)for(let t=0;t<i.length;t++){const n=i[t];e.features.push(n)}}e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures())},redrawThematicFeatures(t){const e=this;e.renderer.clearAll();const i=e.features;if(t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent({xmin:t.min.x,ymin:t.min.y,xmax:t.max.x,ymax:t.max.y})}for(let n=0,r=i.length;n<r;n++){const r=i[n];if(!r||!r.geometry)continue;const o=r.geometry.extent;if(t&&!t.intersects(o))continue;const s=e.cache,a=r.id;if(!s[a]){s[a]=a;const t=e.createThematicFeature(r),i=e.overlayWeightField&&r.attributes[e.overlayWeightField]&&!isNaN(r.attributes[e.overlayWeightField]);t&&i&&(t.__overlayWeight=r.attributes[e.overlayWeightField]),t&&e.charts.push(t)}}e.drawCharts()},createThematicFeature(t){const e=this;let i;return pn[e.chartsType]&&e.themeFields&&e.chartsSetting&&(i=new pn[e.chartsType](t,e,e.themeFields,e.chartsSetting,null,e.options)),!!i&&(i.assembleShapes(),i)},drawCharts(){const t=this;t.renderer&&(t.overlayWeightField&&t._sortChart(),t.options&&!t.options.isOverLay?t._addOverlayShape():t._addNoOverlayShape(),t.renderer.render())},getShapesByFeatureID(t){const e=[],i=this.renderer.getAllShapes();if(!t)return i;for(let n=0,r=i.length;n<r;n++){const r=i[n];r.refDataID&&t===r.refDataID&&e.push(r)}return e},isQuadrilateralOverLap(t,e){const i=[{x:t.xmin,y:t.ymin},{x:t.xmax,y:t.ymin},{x:t.xmax,y:t.ymax},{x:t.xmin,y:t.ymax}],r=[{x:e.xmin,y:e.ymin},{x:e.xmax,y:e.ymin},{x:e.xmax,y:e.ymax},{x:e.xmin,y:e.ymax}],o=this,s=i.length,a=r.length;if(4!==s||4!==a)return null;let l=!1;for(let t=0;t<s;t++)if(o.isPointInPoly(i[t],r)){l=!0;break}for(let t=0;t<a;t++)if(o.isPointInPoly(r[t],i)){l=!0;break}for(let t=0;t<s-1&&!l;t++)for(let e=0;e<a-1;e++){const s=o.lineIntersection(i[t],i[t+1],r[e],r[e+1]);if(s&&s.type===n.GeometryType.point){l=!0;break}}return l},lineIntersection(t,e,i,r){let o,s,a=null;const l=(r.x-i.x)*(t.y-i.y)-(r.y-i.y)*(t.x-i.x),h=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),u=(r.y-i.y)*(e.x-t.x)-(r.x-i.x)*(e.y-t.y);if(0!==u)s=h/u,a=(o=l/u)>=0&&s<=1&&o<=1&&s>=0?new n.Point({coordinates:[t.x+o*(e.x-t.x),t.y+o*(e.y-t.y)]}):"No Intersection";else if(0===l&&0===h){const n=Math.max(t.y,e.y),o=Math.min(t.y,e.y),s=Math.max(t.x,e.x),l=Math.min(t.x,e.x);a=(i.y>=o&&i.y<=n||r.y>=o&&r.y<=n)&&i.x>=l&&i.x<=s||r.x>=l&&r.x<=s?"Coincident":"Parallel"}else a="Parallel";return a},isPointInPoly(t,e){for(var i=!1,n=-1,r=e.length,o=r-1;++n<r;o=n)(e[n].y<=t.y&&t.y<e[o].y||e[o].y<=t.y&&t.y<e[n].y)&&t.x<(e[o].x-e[n].x)*(t.y-e[n].y)/(e[o].y-e[n].y)+e[n].x&&(i=!i);return i},isChartInMap(t,e){const i=t;let n=!1;const r=[{x:e.xmin,y:e.ymin},{x:e.xmax,y:e.ymin},{x:e.xmax,y:e.ymax},{x:e.xmin,y:e.ymax}];for(let t=0,e=r.length;t<e;t++){const e=r[t];if(e.x>=i.xmin&&e.x<=i.xmax&&e.y>=i.ymin&&e.y<=i.ymax){n=!0;break}}return n},isSuitableChart:(t,e,i)=>Math.abs(i)<=1,clearCache(){this.cache={},this.charts=[]},removeFeatures(t){this.clearCache(),fn.prototype.removeFeatures.apply(this,arguments)},removeAllFeatures(){this.clearCache(),fn.prototype.removeAllFeatures.apply(this,arguments)},redraw(){return this.clearCache(),fn.prototype.redraw.apply(this,arguments)},clear(){const t=this;t.renderer&&(t.renderer.clearAll(),t.renderer.refresh()),t.removeAllFeatures(),t.clearCache()},getWeightFieldValue(t,e,i){if((void 0===i||isNaN(i))&&(i=0),!t.attributes)return i;let n=t.attributes[e];return(void 0===n||isNaN(n))&&(n=i),n},_sortChart(){this.charts&&this.charts.sort(function(t,e){return void 0===t.__overlayWeight&&void 0===e.__overlayWeight?0:void 0!==t.__overlayWeight&&void 0===e.__overlayWeight?-1:void 0===t.__overlayWeight&&void 0!==e.__overlayWeight?1:void 0!==t.__overlayWeight&&void 0!==e.__overlayWeight?parseFloat(t.__overlayWeight)<parseFloat(e.__overlayWeight)?1:-1:0})},_addOverlayShape(){const t=this,e=t.charts;for(let i=0,n=e.length;i<n;i++){const n=e[i],r=n.resetLocation(),o=n.shapes;for(let e=0,i=o.length;e<i;e++)o[e].refOriginalPosition=r,t.renderer.addShape(o[e])}},_addNoOverlayShape(){const t=this;let e=t._map.getBounds();const i=this._map.options.crs;e=r.bounds(i.project(e.getSouthWest()),i.project(e.getNorthEast()));const o=t.charts,s=[],a=t.getLocalXY(e.min),l=t.getLocalXY(e.max),h=new n.Extent({xmin:Math.min(parseFloat(a[0]),parseFloat(l[0])),xmax:Math.max(parseFloat(a[0]),parseFloat(l[0])),ymin:Math.min(parseFloat(a[1]),parseFloat(l[1])),ymax:Math.max(parseFloat(a[1]),parseFloat(l[1]))});for(let e=0,i=o.length;e<i;e++){const i=o[e],n=i.resetLocation(),r=i.chartBounds;if(h&&!t.isChartInMap(h,r))continue;const a=t._map.getZoom()-t.options.fitZoom;if(h&&t.options.fitZoom>-1&&!t.isSuitableChart(h,r,a))continue;let l=!1;for(let e=0;e<s.length;e++)if(t.isQuadrilateralOverLap(r,s[e])){l=!0;break}if(l)continue;s.push(r);const u=i.shapes;for(let e=0,i=u.length;e<i;e++)u[e].refOriginalPosition=n,t.renderer.addShape(u[e])}}});dn.extend({initialize(t,e){dn.prototype.initialize.call(this,t,e),this.style=[],this.keepStyle=!0},getColor(){const t="0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f".split(",");let e="#";for(let i=0;i<6;i++)e+=t[Math.floor(16*Math.random())];return e},getStyleByData(){const t=gi({},this.style);return t.fillColor=this.getColor(),t},onAdd(t){const e=this;if(e.map=e._map=t,e._initContainer(),!e.levelRenderer)return void t.removeLayer(e);const i=t.getSize();e.container.style.width=`${i.x}px`,e.container.style.height=`${i.y}px`,e._updateOpacity(),e.renderer=e.levelRenderer.init(e.container),e.renderer.clear(),e.features&&e.features.length>0&&e._reset(),e.addTFEvents(),e.mouseMoveHandler=function(t){const i=t.layerPoint;e.currentMousePosition=r.point(i.x+e.movingOffset[0],i.y+e.movingOffset[1])},t.on("mousemove",e.mouseMoveHandler),e.zoomstartHandler=function(t){e.keepStyle=!1},t.on("zoomstart ",e.zoomstartHandler),e.zoomendHandler=function(t){e.keepStyle=!0},t.on("zoomend",e.zoomendHandler),e.update()},redrawThematicFeatures(t){const e=this,i=e.renderer.getHoverOne();let o=null;i&&i.refDataID&&(o=i.refDataID);const s=e.features;if(t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent({xmin:t.min.x,ymin:t.min.y,xmax:t.max.x,ymax:t.max.y})}e.renderer.clearAll();const a=e.cache,l=e.cacheFields,h=e._map.getZoom(),u=e.maxCacheCount;for(let i=0,n=s.length;i<n;i++){const n=s[i];if(!n||!n.geometry)continue;const r=n.geometry.extent;if(t&&!t.intersects(r))continue;const o=`${n.FID}_zoom_${h.toString()}`;if(a[o]&&e.keepStyle){a[o].updateAndAddShapes();continue}const c=e.createThematicFeature(s[i]);if(!(c.getShapesCount()<1)&&(a[o]=c,l.push(o),l.length>u)){const t=l[0];l.splice(0,1),delete a[t]}}if(e.renderer.render(),o&&e.options.isHoverAble&&e.options.isMultiHover){const t=this.getShapesByFeatureID(o);this.renderer.updateHoverShapes(t)}},redraw(){return this.keepStyle||this.clearCache(),fn.prototype.redraw.apply(this,arguments)}});dn.extend({initialize(t,e){dn.prototype.initialize.call(this,t,e),this.style=[]},getColor(){const t="0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f".split(",");let e="#";for(let i=0;i<6;i++)e+=t[Math.floor(16*Math.random())];return e},getStyleByData(){const t=this,e=gi({},t.style);return null===e.fillColor&&(e.fillColor=t.getColor()),t.style=e,e},redraw(){return fn.prototype.redraw.apply(this,arguments)}});gn.extend({initialize(t,e,i){gn.prototype.initialize.apply(this,arguments),this.symbolType=e,this.symbolSetting={}},setSymbolType(t){this.symbolType=t,this.redraw()},createThematicFeature(t){const e=this;let i;return Yi[e.symbolType]&&e.themeField&&e.symbolSetting&&(i=new Yi[e.symbolType](t,e,[e.themeField],e.symbolSetting,null,e.options)),!!i&&(i.assembleShapes(),i)},_addNoOverlayShape(){const t=this;let e=t._map.getBounds();const i=this._map.options.crs;e=r.bounds(i.project(e.getSouthWest()),i.project(e.getNorthEast()));const o=t.getLocalXY(e.min),s=t.getLocalXY(e.max),a=new n.Extent({xmin:Math.min(parseFloat(o[0]),parseFloat(s[0])),xmax:Math.max(parseFloat(o[0]),parseFloat(s[0])),ymin:Math.min(parseFloat(o[1]),parseFloat(s[1])),ymax:Math.max(parseFloat(o[1]),parseFloat(s[1]))}),l=t.charts,h=[];for(let e=0,i=l.length;e<i;e++){const i=l[e],n=i.resetLocation(),r=i.chartBounds;if(a&&!t.isChartInMap(a,r))continue;const o=t._map.getZoom();t.options.fitZoom;if(a&&t.options.fitZoom>-1&&Math.abs(o-t.options.fitZoom)>1)continue;let s=!1;for(let e=0;e<h.length;e++)if(t.isQuadrilateralOverLap(r,h[e])){s=!0;break}if(s)continue;h.push(r);const u=i.shapes;for(let e=0,i=u.length;e<i;e++)u[e].refOriginalPosition=n,t.renderer.addShape(u[e])}}});var yn=class{constructor(t){t=t||{},this.fill=!0,this.fillColor="#000000",this.fillOpacity=1,this.stroke=!1,this.strokeColor="#000000",this.strokeOpacity=1,this.strokeWidth=1,this.strokeLinecap="butt",this.strokeLineJoin="miter",this.strokeDashstyle="solid",this.pointRadius=6,this.shadowBlur=0,this.shadowColor="#000000",this.shadowOffsetX=0,this.shadowOffsetY=0,this.label="",this.labelRect=!1,this.fontColor="",this.fontSize=12,this.fontStyle="normal",this.fontVariant="normal",this.fontWeight="normal",this.fontFamily="arial,sans-serif",this.labelPosition="top",this.labelAlign="center",this.labelBaseline="middle",this.labelXOffset=0,this.labelYOffset=0,yi(this,t)}};class mn{}mn.convertFeature=si;var _n=mn;i.d(e,"MapViewLeaflet",function(){return ci}),i.d(e,"MapView",function(){return ci}),i.d(e,"Popup",function(){return Zt}),i.d(e,"Screenshot",function(){return $t}),i.d(e,"DrawControl",function(){return fi}),i.d(e,"SketchEditorLeaflet",function(){return di}),i.d(e,"SketchEditor",function(){return di}),i.d(e,"GraphThemeLayer",function(){return gn}),i.d(e,"ThemeStyle",function(){return yn}),i.d(e,"getLayerView",function(){return hi}),i.d(e,"initializeOptions",function(){return at}),i.d(e,"initializeCRS",function(){return st}),i.d(e,"IGSTileLayer",function(){return yt}),i.d(e,"IGSMapImageLayer",function(){return bt}),i.d(e,"ArcGISMapImageLayer",function(){return Ct}),i.d(e,"WebMapServiceLayer",function(){return Lt}),i.d(e,"WebMapTileServiceLayer",function(){return St}),i.d(e,"WebTileLayer",function(){return Pt}),i.d(e,"ArcGISTileLayer",function(){return It}),i.d(e,"VectorTileLayer",function(){return Mt}),i.d(e,"FeatureLayer",function(){return Tt}),i.d(e,"MapVLayer",function(){return At}),i.d(e,"EchartsLayer",function(){return Bt}),i.d(e,"FeatureLayerUtil",function(){return _n}),i.d(e,"L",function(){return r}),window.L=r,n.zondy.leaflet={},n.zondy.leaflet.layer={},n.zondy.leaflet.layer.IGSTileLayer=yt,n.zondy.leaflet.layer.IGSMapImageLayer=bt,n.zondy.leaflet.layer.ArcGISMapImageLayer=Ct,n.zondy.leaflet.layer.WebMapServiceLayer=Lt,n.zondy.leaflet.layer.WebMapTileServiceLayer=St,n.zondy.leaflet.layer.WebTileLayer=Pt,n.zondy.leaflet.layer.ArcGISTileLayer=It,n.zondy.leaflet.layer.VectorTileLayer=Mt,n.zondy.leaflet.layer.FeatureLayer=Tt,n.zondy.leaflet.layer.MapVLayer=At,n.zondy.leaflet.layer.EchartsLayer=Bt,n.zondy.leaflet.GraphThemeLayer=gn,n.zondy.leaflet.tool={},n.zondy.leaflet.tool.sketch={},n.zondy.leaflet.tool.sketch.SketchEditor=di,n.zondy.leaflet.tool.Screenshot=$t,n.zondy.leaflet.widget={},n.zondy.leaflet.widget.DrawControl=fi,n.zondy.leaflet.widget.Popup=Zt,n.zondy.leaflet.util={},n.zondy.leaflet.util.getLayerView=hi,n.zondy.leaflet.util.initializeOptions=at,n.zondy.leaflet.util.initializeCRS=st,n.zondy.leaflet.util.FeatureLayerUtil=_n,n.zondy.leaflet.MapView=ci,n.zondy.leaflet.object={},n.zondy.leaflet.object.theme={},n.zondy.leaflet.object.theme.ThemeStyle=yn,n.zondy.leaflet.VERSION="17.2.1",n.Zondy.SketchEditorLeaflet=di,n.Zondy.PluginVersion=n.zondy.leaflet.VERSION,window.MapGISLeafletPlugin={MapViewLeaflet:ci,MapView:ci,Popup:Zt,Screenshot:$t,DrawControl:fi,SketchEditorLeaflet:di,SketchEditor:di,GraphThemeLayer:gn,ThemeStyle:yn,getLayerView:hi,initializeOptions:at,initializeCRS:st,IGSTileLayer:yt,IGSMapImageLayer:bt,ArcGISMapImageLayer:Ct,WebMapServiceLayer:Lt,WebMapTileServiceLayer:St,WebTileLayer:Pt,ArcGISTileLayer:It,VectorTileLayer:Mt,FeatureLayer:Tt,MapVLayer:At,EchartsLayer:Bt,FeatureLayerUtil:_n,L:r}}]);
|
|
105
|
+
***************************************************************************** */var p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function d(t,e){var i=t[0],n=t[1];return[i*Math.cos(e)-n*Math.sin(e),i*Math.sin(e)+n*Math.cos(e)]}function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0;i<t.length;i++)if("number"!=typeof t[i])throw new Error("assertNumbers arguments["+i+"] is not a number. "+typeof t[i]+" == typeof "+t[i]);return!0}var y=Math.PI;function m(t,e,i){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var n=t.rX,r=t.rY,o=t.x,s=t.y;n=Math.abs(t.rX),r=Math.abs(t.rY);var a=d([(e-o)/2,(i-s)/2],-t.xRot/180*y),l=a[0],h=a[1],u=Math.pow(l,2)/Math.pow(n,2)+Math.pow(h,2)/Math.pow(r,2);1<u&&(n*=Math.sqrt(u),r*=Math.sqrt(u)),t.rX=n,t.rY=r;var c=Math.pow(n,2)*Math.pow(h,2)+Math.pow(r,2)*Math.pow(l,2),p=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(r,2)-c)/c)),f=n*h/r*p,g=-r*l/n*p,m=d([f,g],t.xRot/180*y);t.cX=m[0]+(e+o)/2,t.cY=m[1]+(i+s)/2,t.phi1=Math.atan2((h-g)/r,(l-f)/n),t.phi2=Math.atan2((-h-g)/r,(-l-f)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*y),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*y),t.phi1*=180/y,t.phi2*=180/y}function _(t,e,i){g(t,e,i);var n=t*t+e*e-i*i;if(0>n)return[];if(0===n)return[[t*i/(t*t+e*e),e*i/(t*t+e*e)]];var r=Math.sqrt(n);return[[(t*i+e*r)/(t*t+e*e),(e*i-t*r)/(t*t+e*e)],[(t*i-e*r)/(t*t+e*e),(e*i+t*r)/(t*t+e*e)]]}var v,x=Math.PI/180;function b(t,e,i){return(1-i)*t+i*e}function w(t,e,i,n){return t+Math.cos(n/180*y)*e+Math.sin(n/180*y)*i}function E(t,e,i,n){var r=e-t,o=i-e,s=3*r+3*(n-i)-6*o,a=6*(o-r),l=3*r;return Math.abs(s)<1e-6?[-l/a]:function(t,e,i){void 0===i&&(i=1e-6);var n=t*t/4-l/s;if(n<-i)return[];if(n<=i)return[-t/2];var r=Math.sqrt(n);return[-t/2-r,-t/2+r]}(a/s,0,1e-6)}function C(t,e,i,n,r){var o=1-r;return t*(o*o*o)+e*(3*o*o*r)+i*(3*o*r*r)+n*(r*r*r)}!function(t){function e(){return r(function(t,e,i){return t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=i),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=i),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=i),t.relative=!1),t})}function i(){var t=NaN,e=NaN,i=NaN,n=NaN;return r(function(r,o,s){return r.type&O.SMOOTH_CURVE_TO&&(r.type=O.CURVE_TO,t=isNaN(t)?o:t,e=isNaN(e)?s:e,r.x1=r.relative?o-t:2*o-t,r.y1=r.relative?s-e:2*s-e),r.type&O.CURVE_TO?(t=r.relative?o+r.x2:r.x2,e=r.relative?s+r.y2:r.y2):(t=NaN,e=NaN),r.type&O.SMOOTH_QUAD_TO&&(r.type=O.QUAD_TO,i=isNaN(i)?o:i,n=isNaN(n)?s:n,r.x1=r.relative?o-i:2*o-i,r.y1=r.relative?s-n:2*s-n),r.type&O.QUAD_TO?(i=r.relative?o+r.x1:r.x1,n=r.relative?s+r.y1:r.y1):(i=NaN,n=NaN),r})}function n(){var t=NaN,e=NaN;return r(function(i,n,r){if(i.type&O.SMOOTH_QUAD_TO&&(i.type=O.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?r:e,i.x1=i.relative?n-t:2*n-t,i.y1=i.relative?r-e:2*r-e),i.type&O.QUAD_TO){t=i.relative?n+i.x1:i.x1,e=i.relative?r+i.y1:i.y1;var o=i.x1,s=i.y1;i.type=O.CURVE_TO,i.x1=((i.relative?0:n)+2*o)/3,i.y1=((i.relative?0:r)+2*s)/3,i.x2=(i.x+2*o)/3,i.y2=(i.y+2*s)/3}else t=NaN,e=NaN;return i})}function r(t){var e=0,i=0,n=NaN,r=NaN;return function(o){if(isNaN(n)&&!(o.type&O.MOVE_TO))throw new Error("path must start with moveto");var s=t(o,e,i,n,r);return o.type&O.CLOSE_PATH&&(e=n,i=r),void 0!==o.x&&(e=o.relative?e+o.x:o.x),void 0!==o.y&&(i=o.relative?i+o.y:o.y),o.type&O.MOVE_TO&&(n=e,r=i),s}}function o(t,e,i,n,o,s){return g(t,e,i,n,o,s),r(function(r,a,l,h){var u=r.x1,c=r.x2,p=r.relative&&!isNaN(h),f=void 0!==r.x?r.x:p?0:a,d=void 0!==r.y?r.y:p?0:l;function g(t){return t*t}r.type&O.HORIZ_LINE_TO&&0!==e&&(r.type=O.LINE_TO,r.y=r.relative?0:l),r.type&O.VERT_LINE_TO&&0!==i&&(r.type=O.LINE_TO,r.x=r.relative?0:a),void 0!==r.x&&(r.x=r.x*t+d*i+(p?0:o)),void 0!==r.y&&(r.y=f*e+r.y*n+(p?0:s)),void 0!==r.x1&&(r.x1=r.x1*t+r.y1*i+(p?0:o)),void 0!==r.y1&&(r.y1=u*e+r.y1*n+(p?0:s)),void 0!==r.x2&&(r.x2=r.x2*t+r.y2*i+(p?0:o)),void 0!==r.y2&&(r.y2=c*e+r.y2*n+(p?0:s));var y=t*n-e*i;if(void 0!==r.xRot&&(1!==t||0!==e||0!==i||1!==n))if(0===y)delete r.rX,delete r.rY,delete r.xRot,delete r.lArcFlag,delete r.sweepFlag,r.type=O.LINE_TO;else{var m=r.xRot*Math.PI/180,_=Math.sin(m),v=Math.cos(m),x=1/g(r.rX),b=1/g(r.rY),w=g(v)*x+g(_)*b,E=2*_*v*(x-b),C=g(_)*x+g(v)*b,L=w*n*n-E*e*n+C*e*e,S=E*(t*n+e*i)-2*(w*i*n+C*t*e),P=w*i*i-E*t*i+C*t*t,I=(Math.atan2(S,L-P)+Math.PI)%Math.PI/2,M=Math.sin(I),T=Math.cos(I);r.rX=Math.abs(y)/Math.sqrt(L*g(T)+S*M*T+P*g(M)),r.rY=Math.abs(y)/Math.sqrt(L*g(M)-S*M*T+P*g(T)),r.xRot=180*I/Math.PI}return void 0!==r.sweepFlag&&0>y&&(r.sweepFlag=+!r.sweepFlag),r})}t.ROUND=function(t){function e(e){return Math.round(e*t)/t}return void 0===t&&(t=1e13),g(t),function(t){return void 0!==t.x1&&(t.x1=e(t.x1)),void 0!==t.y1&&(t.y1=e(t.y1)),void 0!==t.x2&&(t.x2=e(t.x2)),void 0!==t.y2&&(t.y2=e(t.y2)),void 0!==t.x&&(t.x=e(t.x)),void 0!==t.y&&(t.y=e(t.y)),void 0!==t.rX&&(t.rX=e(t.rX)),void 0!==t.rY&&(t.rY=e(t.rY)),t}},t.TO_ABS=e,t.TO_REL=function(){return r(function(t,e,i){return t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=i),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=i),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=i),t.relative=!0),t})},t.NORMALIZE_HVZ=function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),r(function(n,r,o,s,a){if(isNaN(s)&&!(n.type&O.MOVE_TO))throw new Error("path must start with moveto");return e&&n.type&O.HORIZ_LINE_TO&&(n.type=O.LINE_TO,n.y=n.relative?0:o),i&&n.type&O.VERT_LINE_TO&&(n.type=O.LINE_TO,n.x=n.relative?0:r),t&&n.type&O.CLOSE_PATH&&(n.type=O.LINE_TO,n.x=n.relative?s-r:s,n.y=n.relative?a-o:a),n.type&O.ARC&&(0===n.rX||0===n.rY)&&(n.type=O.LINE_TO,delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag),n})},t.NORMALIZE_ST=i,t.QT_TO_C=n,t.INFO=r,t.SANITIZE=function(t){void 0===t&&(t=0),g(t);var e=NaN,i=NaN,n=NaN,o=NaN;return r(function(r,s,a,l,h){var u=Math.abs,c=!1,p=0,f=0;if(r.type&O.SMOOTH_CURVE_TO&&(p=isNaN(e)?0:s-e,f=isNaN(i)?0:a-i),r.type&(O.CURVE_TO|O.SMOOTH_CURVE_TO)?(e=r.relative?s+r.x2:r.x2,i=r.relative?a+r.y2:r.y2):(e=NaN,i=NaN),r.type&O.SMOOTH_QUAD_TO?(n=isNaN(n)?s:2*s-n,o=isNaN(o)?a:2*a-o):r.type&O.QUAD_TO?(n=r.relative?s+r.x1:r.x1,o=r.relative?a+r.y1:r.y2):(n=NaN,o=NaN),r.type&O.LINE_COMMANDS||r.type&O.ARC&&(0===r.rX||0===r.rY||!r.lArcFlag)||r.type&O.CURVE_TO||r.type&O.SMOOTH_CURVE_TO||r.type&O.QUAD_TO||r.type&O.SMOOTH_QUAD_TO){var d=void 0===r.x?0:r.relative?r.x:r.x-s,g=void 0===r.y?0:r.relative?r.y:r.y-a;p=isNaN(n)?void 0===r.x1?p:r.relative?r.x:r.x1-s:n-s,f=isNaN(o)?void 0===r.y1?f:r.relative?r.y:r.y1-a:o-a;var y=void 0===r.x2?0:r.relative?r.x:r.x2-s,m=void 0===r.y2?0:r.relative?r.y:r.y2-a;u(d)<=t&&u(g)<=t&&u(p)<=t&&u(f)<=t&&u(y)<=t&&u(m)<=t&&(c=!0)}return r.type&O.CLOSE_PATH&&u(s-l)<=t&&u(a-h)<=t&&(c=!0),c?[]:r})},t.MATRIX=o,t.ROTATE=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),g(t,e,i);var n=Math.sin(t),r=Math.cos(t);return o(r,n,-n,r,e-e*r+i*n,i-e*n-i*r)},t.TRANSLATE=function(t,e){return void 0===e&&(e=0),g(t,e),o(1,0,0,1,t,e)},t.SCALE=function(t,e){return void 0===e&&(e=t),g(t,e),o(t,0,0,e,0,0)},t.SKEW_X=function(t){return g(t),o(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return g(t),o(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),g(t),o(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),g(t),o(1,0,0,-1,0,t)},t.A_TO_C=function(){return r(function(t,e,i){return O.ARC===t.type?function(t,e,i){var n,r,o,s;t.cX||m(t,e,i);for(var a=Math.min(t.phi1,t.phi2),l=Math.max(t.phi1,t.phi2)-a,h=Math.ceil(l/90),u=new Array(h),c=e,p=i,f=0;f<h;f++){var g=b(t.phi1,t.phi2,f/h),y=b(t.phi1,t.phi2,(f+1)/h),_=y-g,v=4/3*Math.tan(_*x/4),w=[Math.cos(g*x)-v*Math.sin(g*x),Math.sin(g*x)+v*Math.cos(g*x)],E=w[0],C=w[1],L=[Math.cos(y*x),Math.sin(y*x)],S=L[0],P=L[1],I=[S+v*Math.sin(y*x),P-v*Math.cos(y*x)],M=I[0],T=I[1];u[f]={relative:t.relative,type:O.CURVE_TO};var N=function(e,i){var n=d([e*t.rX,i*t.rY],t.xRot),r=n[0],o=n[1];return[t.cX+r,t.cY+o]};n=N(E,C),u[f].x1=n[0],u[f].y1=n[1],r=N(M,T),u[f].x2=r[0],u[f].y2=r[1],o=N(S,P),u[f].x=o[0],u[f].y=o[1],t.relative&&(u[f].x1-=c,u[f].y1-=p,u[f].x2-=c,u[f].y2-=p,u[f].x-=c,u[f].y-=p),c=(s=[u[f].x,u[f].y])[0],p=s[1]}return u}(t,t.relative?0:e,t.relative?0:i):t})},t.ANNOTATE_ARCS=function(){return r(function(t,e,i){return t.relative&&(e=0,i=0),O.ARC===t.type&&m(t,e,i),t})},t.CLONE=function(){return function(t){var e={};for(var i in t)e[i]=t[i];return e}},t.CALCULATE_BOUNDS=function(){var t=e(),o=n(),s=i(),a=r(function(e,i,n){var r=s(o(t(function(t){var e={};for(var i in t)e[i]=t[i];return e}(e))));function l(t){t>a.maxX&&(a.maxX=t),t<a.minX&&(a.minX=t)}function h(t){t>a.maxY&&(a.maxY=t),t<a.minY&&(a.minY=t)}if(r.type&O.DRAWING_COMMANDS&&(l(i),h(n)),r.type&O.HORIZ_LINE_TO&&l(r.x),r.type&O.VERT_LINE_TO&&h(r.y),r.type&O.LINE_TO&&(l(r.x),h(r.y)),r.type&O.CURVE_TO){l(r.x),h(r.y);for(var u=0,c=E(i,r.x1,r.x2,r.x);u<c.length;u++)0<(A=c[u])&&1>A&&l(C(i,r.x1,r.x2,r.x,A));for(var p=0,f=E(n,r.y1,r.y2,r.y);p<f.length;p++)0<(A=f[p])&&1>A&&h(C(n,r.y1,r.y2,r.y,A))}if(r.type&O.ARC){l(r.x),h(r.y),m(r,i,n);for(var d=r.xRot/180*Math.PI,g=Math.cos(d)*r.rX,y=Math.sin(d)*r.rX,v=-Math.sin(d)*r.rY,x=Math.cos(d)*r.rY,b=r.phi1<r.phi2?[r.phi1,r.phi2]:-180>r.phi2?[r.phi2+360,r.phi1+360]:[r.phi2,r.phi1],L=b[0],S=b[1],P=function(t){var e=t[0],i=t[1],n=180*Math.atan2(i,e)/Math.PI;return n<L?n+360:n},I=0,M=_(v,-g,0).map(P);I<M.length;I++)(A=M[I])>L&&A<S&&l(w(r.cX,g,v,A));for(var T=0,N=_(x,-y,0).map(P);T<N.length;T++){var A;(A=N[T])>L&&A<S&&h(w(r.cY,y,x,A))}}return e});return a.minX=1/0,a.maxX=-1/0,a.minY=1/0,a.maxY=-1/0,a}}(v||(v={}));var S,P=function(){function t(){}return t.prototype.round=function(t){return this.transform(v.ROUND(t))},t.prototype.toAbs=function(){return this.transform(v.TO_ABS())},t.prototype.toRel=function(){return this.transform(v.TO_REL())},t.prototype.normalizeHVZ=function(t,e,i){return this.transform(v.NORMALIZE_HVZ(t,e,i))},t.prototype.normalizeST=function(){return this.transform(v.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(v.QT_TO_C())},t.prototype.aToC=function(){return this.transform(v.A_TO_C())},t.prototype.sanitize=function(t){return this.transform(v.SANITIZE(t))},t.prototype.translate=function(t,e){return this.transform(v.TRANSLATE(t,e))},t.prototype.scale=function(t,e){return this.transform(v.SCALE(t,e))},t.prototype.rotate=function(t,e,i){return this.transform(v.ROTATE(t,e,i))},t.prototype.matrix=function(t,e,i,n,r,o){return this.transform(v.MATRIX(t,e,i,n,r,o))},t.prototype.skewX=function(t){return this.transform(v.SKEW_X(t))},t.prototype.skewY=function(t){return this.transform(v.SKEW_Y(t))},t.prototype.xSymmetry=function(t){return this.transform(v.X_AXIS_SYMMETRY(t))},t.prototype.ySymmetry=function(t){return this.transform(v.Y_AXIS_SYMMETRY(t))},t.prototype.annotateArcs=function(){return this.transform(v.ANNOTATE_ARCS())},t}(),I=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},M=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},T=function(t){function e(){var e=t.call(this)||this;return e.curNumber="",e.curCommandType=-1,e.curCommandRelative=!1,e.canParseCommandOrComma=!0,e.curNumberHasExp=!1,e.curNumberHasExpDigits=!1,e.curNumberHasDecimal=!1,e.curArgs=[],e}return f(e,t),e.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,e){var i=this;void 0===e&&(e=[]);for(var n=function(t){e.push(t),i.curArgs.length=0,i.canParseCommandOrComma=!0},r=0;r<t.length;r++){var o=t[r],s=!(this.curCommandType!==O.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),a=M(o)&&("0"===this.curNumber&&"0"===o||s);if(!M(o)||a)if("e"!==o&&"E"!==o)if("-"!==o&&"+"!==o||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==o||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){var l=Number(this.curNumber);if(isNaN(l))throw new SyntaxError("Invalid number ending at "+r);if(this.curCommandType===O.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>l)throw new SyntaxError('Expected positive number, got "'+l+'" at index "'+r+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+r+'"');this.curArgs.push(l),this.curArgs.length===N[this.curCommandType]&&(O.HORIZ_LINE_TO===this.curCommandType?n({type:O.HORIZ_LINE_TO,relative:this.curCommandRelative,x:l}):O.VERT_LINE_TO===this.curCommandType?n({type:O.VERT_LINE_TO,relative:this.curCommandRelative,y:l}):this.curCommandType===O.MOVE_TO||this.curCommandType===O.LINE_TO||this.curCommandType===O.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),O.MOVE_TO===this.curCommandType&&(this.curCommandType=O.LINE_TO)):this.curCommandType===O.CURVE_TO?n({type:O.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===O.SMOOTH_CURVE_TO?n({type:O.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===O.QUAD_TO?n({type:O.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===O.ARC&&n({type:O.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!I(o))if(","===o&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==o&&"-"!==o&&"."!==o)if(a)this.curNumber=o,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+r+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+o+'" at index '+r+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==o&&"Z"!==o)if("h"===o||"H"===o)this.curCommandType=O.HORIZ_LINE_TO,this.curCommandRelative="h"===o;else if("v"===o||"V"===o)this.curCommandType=O.VERT_LINE_TO,this.curCommandRelative="v"===o;else if("m"===o||"M"===o)this.curCommandType=O.MOVE_TO,this.curCommandRelative="m"===o;else if("l"===o||"L"===o)this.curCommandType=O.LINE_TO,this.curCommandRelative="l"===o;else if("c"===o||"C"===o)this.curCommandType=O.CURVE_TO,this.curCommandRelative="c"===o;else if("s"===o||"S"===o)this.curCommandType=O.SMOOTH_CURVE_TO,this.curCommandRelative="s"===o;else if("q"===o||"Q"===o)this.curCommandType=O.QUAD_TO,this.curCommandRelative="q"===o;else if("t"===o||"T"===o)this.curCommandType=O.SMOOTH_QUAD_TO,this.curCommandRelative="t"===o;else{if("a"!==o&&"A"!==o)throw new SyntaxError('Unexpected character "'+o+'" at index '+r+".");this.curCommandType=O.ARC,this.curCommandRelative="a"===o}else e.push({type:O.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=o,this.curNumberHasDecimal="."===o}else this.curNumber+=o,this.curNumberHasDecimal=!0;else this.curNumber+=o;else this.curNumber+=o,this.curNumberHasExp=!0;else this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp}return e},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(e,i){void 0===i&&(i=[]);for(var n=0,r=Object.getPrototypeOf(this).parse.call(this,e);n<r.length;n++){var o=r[n],s=t(o);Array.isArray(s)?i.push.apply(i,s):i.push(s)}return i}}})},e}(P),O=function(t){function e(i){var n=t.call(this)||this;return n.commands="string"==typeof i?e.parse(i):i,n}return f(e,t),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=v.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var e=[],i=0,n=this.commands;i<n.length;i++){var r=t(n[i]);Array.isArray(r)?e.push.apply(e,r):e.push(r)}return this.commands=e,this},e.encode=function(t){return function(t){var e="";Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];if(n.type===O.CLOSE_PATH)e+="z";else if(n.type===O.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===O.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===O.MOVE_TO)e+=(n.relative?"m":"M")+n.x+" "+n.y;else if(n.type===O.LINE_TO)e+=(n.relative?"l":"L")+n.x+" "+n.y;else if(n.type===O.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+" "+n.y1+" "+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===O.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===O.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+" "+n.y1+" "+n.x+" "+n.y;else if(n.type===O.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+" "+n.y;else{if(n.type!==O.ARC)throw new Error('Unexpected command type "'+n.type+'" at index '+i+".");e+=(n.relative?"a":"A")+n.rX+" "+n.rY+" "+n.xRot+" "+ +n.lArcFlag+" "+ +n.sweepFlag+" "+n.x+" "+n.y}}return e}(t)},e.parse=function(t){var e=new T,i=[];return e.parse(t,i),e.finish(i),i},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(P),N=((S={})[O.MOVE_TO]=2,S[O.LINE_TO]=2,S[O.HORIZ_LINE_TO]=1,S[O.VERT_LINE_TO]=1,S[O.CLOSE_PATH]=0,S[O.QUAD_TO]=4,S[O.SMOOTH_QUAD_TO]=2,S[O.CURVE_TO]=6,S[O.SMOOTH_CURVE_TO]=4,S[O.ARC]=7,S);const A=r.extend({},r.SVG.prototype);r.SVG.include({_updateStyle(t){const e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?("string"==typeof i.fill&&i.fill.match(/^url\(/)?this._fillPattern(t):e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updateShape:function(t){const e=t._point;let i=t.options.radius;const n=t.options.shape,r=t.options.rotation,o=t.options.xoffset,s=t.options.yoffset,a=t.options.path,l=e.x+o,h=e.y+s;if(t._path.setAttribute("transform",`rotate(${r},${l},${h})`),a){const e=new O(a).toAbs();let n=0,r=0,o=0,s=0;e.commands.forEach(t=>{const{x:e,y:i}=t;n=Math.min(e,n),r=Math.min(i,r),o=Math.max(e,o),s=Math.max(i,s)});const u=2*i/(o>s?o:s);return e.scale(u,u).translate(l-i,h-i),void this._setPath(t,e.encode())}if("arrow"===n){const e=`M${l-.85*i} ${h+.75*i} L${l} ${h} L${l+.85*i} ${h+.75*i} L${l} ${h-i} L${l-.85*i} ${h+.75*i}Z`;this._setPath(t,e)}if("diamond"===n){const e=`M${l-Math.sqrt(2)*i} ${h} L ${l} ${h-Math.sqrt(2)*i} L${l+Math.sqrt(2)*i} ${h} L${l} ${h+Math.sqrt(2)*i} L${l-Math.sqrt(2)*i} ${h}`;this._setPath(t,e)}if("square"===n){const e=`M${l-i} ${h-i} L ${l+i} ${h-i} L${l+i} ${h+i} L${l-i} ${h+i} L${l-i} ${h-i}`;this._setPath(t,e)}if("triangle"===n||"triangle-up"===n){const e=`M${l-1.3*i} ${h+.75*i} L${l} ${h-1.5*i} L${l+1.3*i} ${h+.75*i} Z`;this._setPath(t,e)}if("triangle-down"===n){const e=`M${l-1.3*i} ${h-.75*i} L${l} ${h+1.5*i} L${l+1.3*i} ${h-.75*i} Z`;this._setPath(t,e)}if("arrowhead"===n||"arrowhead-up"===n){const e=`M ${l+1.3*i} ${h+1.3*i} L ${l} ${h-1.3*i} L ${l-1.3*i} ${h+1.3*i} L ${l} ${h+.5*i} L ${l+1.3*i} ${h+1.3*i} Z`;this._setPath(t,e)}if("arrowhead-down"===n){const e=`M ${l-1.3*i} ${h-1.3*i} L ${l} ${h+1.3*i} L ${l+1.3*i} ${h-1.3*i} L ${l} ${h-.5*i} L ${l-1.3*i} ${h-1.3*i} Z`;this._setPath(t,e)}if("circle"===n){const e=`a${i},${i} 0 1,0 `,n=t._empty()?"M0 0":`M${l-i},${h}${e}${2*i},0 ${e}${2*-i},0 `;this._setPath(t,n)}if(n.startsWith("star")){const e=n.split(/[^0-9a-z]/gi,2),r=parseInt(e[1]);let o;o="star"===e[0]&&!isNaN(r)&&r>2?r:5;const s=.5*(1+Math.sqrt(5))+1,a=[];for(let t=0;t<o;t++)a.push(`${l+i/s*Math.sin(2*Math.PI/o*t)},${h+i/s*Math.cos(2*Math.PI/o*t)}`),a.push(`${l+i*Math.sin(1/o*Math.PI+2*Math.PI/o*t)},${h+i*Math.cos(1/o*Math.PI+2*Math.PI/o*t)}`);const u=`M${a.join("L")}Z`;this._setPath(t,u)}if("x"===n){const e=`M${l+(i/=2)},${h+i}L${l-i},${h-i}M${l-i},${h+i}L${l+i},${h-i}`;this._setPath(t,e)}if("cross"===n){const e=`M${l},${h+(i/=2)}L${l},${h-i}M${l+i},${h}L${l-i},${h}`;this._setPath(t,e)}},_fillPattern(t){const e=t._path,i=t.options,n=i.fillDetail;this._defs||(this._defs=r.SVG.create("defs"),this._container.appendChild(this._defs));const o=i.fill.substring(4,i.fill.length-1),s=o;let a;if(!Array.from(this._defs.children).some(t=>t.getAttribute("id")===s)){const t=new Image;t.src=o,(a=r.SVG.create("pattern")).setAttribute("id",s),a.setAttribute("patternUnits","userSpaceOnUse"),this._defs.appendChild(a);const e=r.SVG.create("image");e.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.appendChild(e),t.onload=function(){if(n){const{width:t=10,height:i=10,xoffset:r=0,yoffset:o=0,xscale:s=1,yscale:l=1}=n;a.setAttribute("x",r),a.setAttribute("y",o),e.setAttribute("x",r),e.setAttribute("y",o),a.setAttribute("width",t*s),a.setAttribute("height",i*l),e.style.transform=`scale(${s},${l})`,e.setAttribute("width",t),e.setAttribute("height",i)}else a.setAttribute("x","0"),a.setAttribute("y","0"),e.setAttribute("x","0"),e.setAttribute("y","0"),a.setAttribute("width",t.width),a.setAttribute("height",t.height),e.setAttribute("width",t.width),e.setAttribute("height",t.height)}}e.setAttribute("fill",`url(#${s})`)},_update(){A._update.call(this),this._map._rotate&&this.fire("update")}});const R=r.extend({},r.DivOverlay.prototype);r.DivOverlay.include({getEvents(){return r.extend(R.getEvents.call(this),{rotate:this._updatePosition})},_updatePosition(){if(!this._map)return;let t=this._map.latLngToLayerPoint(this._latlng),e=r.point(this.options.offset);const i=this._getAnchor();this._zoomAnimated?(this._map._rotate&&(t=this._map.rotatedPointToMapPanePoint(t)),r.DomUtil.setPosition(this._container,t.add(i))):e=e.add(t).add(i);const n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=`${n}px`,this._container.style.left=`${o}px`}});const k=r.extend({},r.Popup.prototype);r.Popup.include({_animateZoom(t){this._map._rotate||k._animateZoom.call(this,t);let e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);const i=this._getAnchor();e=this._map.rotatedPointToMapPanePoint(e),r.DomUtil.setPosition(this._container,e.add(i))},_adjustPan(){if(!this.options.autoPan||this._map._panAnim&&this._map._panAnim._inProgress)return;const t=this._map,e=parseInt(r.DomUtil.getStyle(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new r.Point(this._containerLeft,-i-this._containerBottom);o._add(r.DomUtil.getPosition(this._container));const s=o._add(this._map._getMapPanePos()),a=r.point(this.options.autoPanPadding),l=r.point(this.options.autoPanPaddingTopLeft||a),h=r.point(this.options.autoPanPaddingBottomRight||a),u=t.getSize();let c=0,p=0;s.x+n+h.x>u.x&&(c=s.x+n-u.x+h.x),s.x-c-l.x<0&&(c=s.x-l.x),s.y+i+h.y>u.y&&(p=s.y+i-u.y+h.y),s.y-p-l.y<0&&(p=s.y-l.y),(c||p)&&t.fire("autopanstart").panBy([c,p])}});const D=r.extend({},r.Tooltip.prototype);r.Tooltip.include({_updatePosition(){if(!this._map._rotate)return D._updatePosition.call(this);let t=this._map.latLngToLayerPoint(this._latlng);t=this._map.rotatedPointToMapPanePoint(t),this._setPosition(t)},_animateZoom(t){if(!this._map._rotate)return D._animateZoom.call(this,t);let e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);e=this._map.rotatedPointToMapPanePoint(e),this._setPosition(e)}});const z=1e-6,B=r.extend({},r.Map.prototype);r.Map.mergeOptions({rotate:!1,bearing:0}),r.Map.include({initialize(t,e){if(e.rotate&&(this._rotate=!0,this._bearing=0),e=r.Util.setOptions(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=r.Util.bind(this._onResize,this),this._initEvents(),this.options&&this.options.maxBounds){const t=this.options.zoomSnap;this.options.zoomSnap=z;const e=this.getBoundsZoom(this.options.maxBounds);this.options.zoomSnap=t,this.options.minZoom=e}e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(r.latLng(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=r.DomUtil.TRANSITION&&r.Browser.any3d&&!r.Browser.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),r.DomEvent.on(this._proxy,r.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)),this._addLayers(this.options.layers),this.options.rotate&&this.setBearing(this.options.bearing)},containerPointToLayerPoint(t){return this._rotate?r.point(t).subtract(this._getMapPanePos()).rotateFrom(-this._bearing,this._getRotatePanePos()).subtract(this._getRotatePanePos()):B.containerPointToLayerPoint.call(this,t)},getBounds(){if(!this._rotate)return B.getBounds.call(this);const t=this.getSize(),e=this.layerPointToLatLng(this.containerPointToLayerPoint([0,0])),i=this.layerPointToLatLng(this.containerPointToLayerPoint([t.x,0])),n=this.layerPointToLatLng(this.containerPointToLayerPoint([t.x,t.y])),o=this.layerPointToLatLng(this.containerPointToLayerPoint([0,t.y]));return new r.LatLngBounds([e,i,n,o])},_getBoundsCenterZoom(t,e){e=e||{},t=t.getBounds?t.getBounds():r.latLngBounds(t);const i=this.toPoint(e.paddingTopLeft||e.padding||[0,0]),n=this.toPoint(e.paddingBottomRight||e.padding||[0,0]);let o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};const s=n.subtract(i).divideBy(2),a=this.project(t.getNorthWest(),o),l=this.project(t.getSouthEast(),o);return{center:this.unproject(l.add(a).divideBy(2).add(s),o),zoom:o}},getGeoBoundsCoord(){const t=this.getPixelBounds(),e=this._zoom,i=this.options.crs.pointToGeoCoord(this.toPoint(t.getTopLeft()),e),n=this.options.crs.pointToGeoCoord(this.toPoint(t.getBottomRight()),e);return{xmin:i.x,ymin:n.y,xmax:n.x,ymax:i.y}},layerPointToGeo(t){const e=this.toPoint(t).add(this.getPixelOrigin()),i=this._zoom;return this.options.crs.pointToGeoCoord(this.toPoint(e),i)},layerPointToContainerPoint(t){return this._rotate?r.point(t).add(this._getRotatePanePos()).rotateFrom(this._bearing,this._getRotatePanePos()).add(this._getMapPanePos()):B.layerPointToContainerPoint.call(this,t)},setBearing(t){if(!r.Browser.any3d||!this._rotate)return;let e=this._getRotatePanePos();const i=this.getSize().divideBy(2),n=this._getMapPanePos();this._pivot=n.clone().multiplyBy(-1).add(i),e=e.rotateFrom(-this._bearing,this._pivot),this._bearing=t*r.DomUtil.DEG_TO_RAD,this._rotatePanePos=e.rotateFrom(this._bearing,this._pivot),r.DomUtil.setPositionBearing(this._rotatePane,e,this._bearing,this._pivot),this.fire("rotate")},getBearing(){return this._bearing*r.DomUtil.RAD_TO_DEG},_initPanes(){const t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),r.DomUtil.setPosition(this._mapPane,new r.Point(0,0)),this._rotate?(this._rotatePane=this.createPane("rotatePane",this._mapPane),this._norotatePane=this.createPane("norotatePane",this._mapPane),this.createPane("tilePane",this._rotatePane),this.createPane("overlayPane",this._rotatePane),this.createPane("shadowPane",this._norotatePane),this.createPane("markerPane",this._norotatePane),this.createPane("tooltipPane",this._norotatePane),this.createPane("popupPane",this._norotatePane)):(this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane")),this.options.markerZoomAnimation||(r.DomUtil.addClass(t.markerPane,"leaflet-zoom-hide"),r.DomUtil.addClass(t.shadowPane,"leaflet-zoom-hide"))},rotatedPointToMapPanePoint(t){return r.point(t).rotate(this._bearing)._add(this._getRotatePanePos())},mapPanePointToRotatedPoint(t){return r.point(t)._subtract(this._getRotatePanePos()).rotate(-this._bearing)},_getCenterOffset(t){let e=B._getCenterOffset.call(this,t);return this._rotate&&(e=e.rotate(this._bearing)),e},_getRotatePanePos(){return this._rotatePanePos||new r.Point(0,0)},_getNewPixelOrigin(t,e){const i=this.getSize()._divideBy(2);return this._rotate||B._getNewPixelOrigin.call(this,t,e),this.project(t,e).rotate(this._bearing)._subtract(i)._add(this._getMapPanePos())._add(this._getRotatePanePos()).rotate(-this._bearing)._round()},_handleGeolocationResponse(t){const e=t.coords.latitude,i=t.coords.longitude,n=t.coords.heading,o=new r.LatLng(e,i),s=o.toBounds(t.coords.accuracy),a=this._locateOptions;if(a.setView){const t=this.getBoundsZoom(s);this.setView(o,a.maxZoom?Math.min(t,a.maxZoom):t)}const l={latlng:o,bounds:s,timestamp:t.timestamp,heading:n};for(const e in t.coords)"number"==typeof t.coords[e]&&(l[e]=t.coords[e]);this.fire("locationfound",l)},toPoint:(t,e,i)=>t instanceof r.Point?t:Array.isArray(t)?new r.Point(t[0],t[1]):void 0===t||null===t?t:"object"==typeof t&&"x"in t&&"y"in t?new r.Point(t.x,t.y):new r.Point(t,e,i),panBy(t,e){if(t=this.toPoint(t).round(),e=e||{},t.x||t.y){if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new r.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){r.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");const i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this}}});var F=i(2);class V{static convertColorToRgb(t){return t instanceof n.Color?t.toCssRGBAString():n.Color.fromColor(t).toCssRGBAString()}static convertLngLatGeometry(t){return t&&t.spatialReference?t.spatialReference.isGeographic?t:n.Projection.project(t,new n.SpatialReference("EPSG:4326")):t}static convertClippingArea(t){if(!t)return t;let e=null;switch(t.type){case n.GeometryType.polygon:case n.GeometryType.multiPolygon:e=V.convertLngLatGeometry(t).toGeoJSON();break;case n.GeometryType.circle:e=V.convertLngLatGeometry(t).toPolygon().toGeoJSON();break;case n.GeometryType.extent:e=V.convertLngLatGeometry(t).toPolygon().toGeoJSON();break}return e}static convertClippAreaToPx(t,e){const i=[];for(let n=0;n<e.length;n++){const o=[];for(let i=0;i<e[n].length;i++){const s=t.project(r.latLng(e[n][i][1],e[n][i][0]),0);o.push([s.x,s.y])}i.push(o)}return i}static toTurfGeometry(t,e){let i=[];return"Polygon"===t.type?i.push(t.coordinates):i=t.coordinates,i.map(t=>{const i=V.convertClippAreaToPx(e,t);return F.polygon(i)})}static getClippingState(t,e){if(F.booleanContains(t,e))return{in:!0,geometry:null};if(F.booleanContains(e,t))return{intersect:!0,geometry:t};if(!F.booleanOverlap(t,e))return{out:!0,geometry:null};const i=F.intersect(t,e);return i?{intersect:!0,geometry:i}:{out:!0,geometry:null}}static convertLineDash(t,e){switch(t){case"dash":return e?[4,3]:[3,4];case"dash-dot":return e?[4,3,1,3]:[3,4,0,4];case"dot":return e?[1,3]:[0,4];case"long-dash":return e?[8,3]:[7,4];case"long-dash-dot":return e?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":return e?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":return e?[4,1]:[3,2];case"short-dash-dot":return e?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":return e?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":return e?[1,1]:[0,2];case"solid":case"none":default:return}}static calcLineMarkerDetail(t){(!t||Array.isArray(t)&&t.length<=1)&&n.Log.error("计算线样式首尾marker错误,传入几何数组不合法");const e=t[0],i=t[1],o=t[t.length-2],s=t[t.length-1],a=360-((180*Math.atan2(i[1]-e[1],i[0]-e[0])/Math.PI+180)%360-90),l=360-((180*Math.atan2(o[1]-s[1],o[0]-s[0])/Math.PI+180)%360-90),h=n.Projection.project(new n.Point({coordinates:e}),new n.SpatialReference("EPSG:4326")).coordinates,u=n.Projection.project(new n.Point({coordinates:s}),new n.SpatialReference("EPSG:4326")).coordinates;return{latlng1:r.latLng(h[1],h[0]),latlng2:r.latLng(u[1],u[0]),angle1:a,angle2:l}}static getTextWidth(t,e){const i=document.createElement("canvas").getContext("2d");return i.font=e,i.measureText(t).width}static getAreaCenter(t){let e;switch(t.type){case n.GeometryType.point:e=t;break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:case n.GeometryType.multiLineString:case n.GeometryType.multiPolygon:e=t.extent.center;break;case n.GeometryType.polygon:e=t.centroid;break;case n.GeometryType.extent:case n.GeometryType.circle:e=t.center;break;default:e=t.extent.center}const i=V.convertLngLatGeometry(e).coordinates;return r.latLng(i[1],i[0])}static setVisibleOpacity(t,e,i){t&&(t.layerOpacity=e,t.layerVisible=i,V.setGraphicVisibleOpacity(t,e,i))}static setGraphicVisibleOpacity(t,e,i){t.setStyle&&t.setStyle({opacity:i?e:0,fillOpacity:i?e:0}),t instanceof r.Marker&&t.setOpacity(i?e:0),t.eachLayer&&t.eachLayer(function(t){V.setGraphicVisibleOpacity(t,e,i)}),t._nonPointGroup&&V.setGraphicVisibleOpacity(t._nonPointGroup,e,i),t._featureGroup&&V.setGraphicVisibleOpacity(t._featureGroup,e,i)}static insertBefore(t,e){const i=t.parentNode;i&&e!==t&&i.insertBefore(t,e)}static getLeafletGroupLayers(t,e,i){if(i=i||(()=>!0),t instanceof r.LayerGroup)for(const n in t._layers){const r=t._layers[n];V.getLeafletGroupLayers(r,e,i)}else i(t)&&e.push(t)}static getInterceptorsUrl(t){const e=this._map.options.config;let i=r.InterceptorsUtils.serviceConfigRequestInterceptors(e,t),o=`${r.InterceptorsUtils.serviceConfigToken(e)}`;return!this.options||Object(n.isNull)(this.options.tokenKey)||Object(n.isNull)(this.options.tokenValue)||(o=""),!i||!o||t instanceof Object||(i.includes("?")?i+=`&${o}`:i+=`?${o}`),i}}var j=V;class G{}G.addIGSTileLayer=function(t){const{layer:e,innerView:i}=t;let n=G.initializeOptions(e);n.visible=t._getLayerViewVisible(e.visible);const{extendOptions:r={}}=e;n=Object.assign(n,r);const o=new yt(e.url,n).addTo(i);return o.id=e.id,o},G.initializeOptions=function(t){const e=nt(t),[i,r]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo);return{tileSize:t.tileSize,bounds:e,igsVersion:t._igsVersion,tokenKey:t.tokenKey,tokenValue:t.tokenValue,clippingArea:j.convertClippingArea(t.clippingArea),visible:t.visible,opacity:t.opacity,crsOptions:ot(t),minZoom:i,maxZoom:r}};var U=G;class H{}H.addIGSMapImageLayer=function(t){const{layer:e,innerView:i}=t,n=H.initializeOptions(e);n.visible=t._getLayerViewVisible(e.visible);const r=new bt(e._url,n).addTo(i);return r.id=e.id,r},H.initializeOptions=function(t){return _t(t)},H.updateIGSMapImageLayer=function(t){const{innerLayer:e,layer:i}=t,n=_t(i);n.visible=t._getLayerViewVisible(i.visible),r.Util.setOptions(e,n),e.refresh()};var q=H;class Z{}Z.addWMSLayer=function(t){const{layer:e,innerView:i}=t;let n=e.url;if(n.indexOf("igs/rest/services")>-1){const t=(n=`${n.replace("services","ogc/doc")}?`).split("igs/rest/ogc/doc/"),e=t[0];let i=t[1].split("/WMSServer")[0];n=`${e}igs/rest/ogc/doc/${i=i.replace("/",":")}/WMSServer?`}let r=Z.initializeOptions(e);r.visible=t._getLayerViewVisible(e.visible);const{extendOptions:o={}}=e;r=Object.assign(r,o);const s=new Lt(n,r).addTo(i);return s.id=e.id,s},Z.initializeOptions=function(t){const e=nt(t);return{layers:t.layers,format:t.imageFormat,version:t.version,visible:t.visible,opacity:t.opacity,noWrap:!0,tileSize:t.imageWidth,transparent:t.imageTransparency,bounds:e,clippingArea:j.convertClippingArea(t.clippingArea),isReverseBBOX:Object(n.isWMSReverse)(t.version,t.spatialReference),tokenKey:t.tokenKey,tokenValue:t.tokenValue}};var X=Z;class Y{}Y.addWMTSLayer=function(t){const{layer:e,innerView:i}=t;let r=e.url;switch(Object(n.getUrlType)(r)){case n.UrlServerType.igs_2:r=`${r.split("services")[0]}ogc/WMTSServer`}let o=Y.initializeOptions(e);o.visible=t._getLayerViewVisible(e.visible);const{extendOptions:s={}}=e;o=Object.assign(o,s);const a=new St(r,o).addTo(i);return a.id=e.id,a},Y.initializeOptions=function(t){const e=nt(t),{activeLayer:i}=t,r=t.getCurrentTileInfo(),[o,s]=n.TileInfoUtil.getLevelRangeByTileInfo(r);return{tilematrixSet:i.tileMatrixSetId,layer:i.identifier,tileSize:r.size[0],bounds:e,style:i.styleId,clippingArea:j.convertClippingArea(t.clippingArea),zoomOffset:0,visible:t.visible,opacity:t.opacity,crsOptions:ot(t),minZoom:o,maxZoom:s,tokenKey:t.tokenKey,tokenValue:t.tokenValue}};var W=Y;class ${}$.addArcGISMapImageLayer=function(t){const{layer:e,innerView:i}=t;let n=$.initializeOptions(e);n.visible=t._getLayerViewVisible(e.visible);const{extendOptions:r={}}=e;n=Object.assign(n,r);const o=new Ct(e.url,n).addTo(i);return o.id=e.id,o},$.initializeOptions=function(t){const e=nt(t);return{layers:t.layers,id:t.id,imageWidth:t.imageWidth,imageHeight:t.imageHeight,imageFormat:t.imageFormat,opacity:t.opacity,visible:t.visible,transparent:t.imageTransparency,bounds:e,tokenKey:t.tokenKey,tokenValue:t.tokenValue,tokenAttachType:t.tokenAttachType,spatialReference:t.spatialReference,httpMethod:t.httpMethod,renderMode:t.renderMode,mapServer:new n.ArcGISMapServer({url:t.url,tokenKey:t.tokenKey,tokenValue:t.tokenValue,enableGlobeFetch:!1,headers:t.headers})}};var K=$;class Q{}Q.addWebTileLayer=function(t){const{layer:e,innerView:i}=t,n=e.url;let r=Q.initializeOptions(e);r.visible=t._getLayerViewVisible(e.visible);const{extendOptions:o={}}=e;r=Object.assign(r,o);const s=new Pt(n,r).addTo(i);return s.id=e.id,s},Q.initializeOptions=function(t){const e=nt(t),[i,r]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo);return{tileSize:t.tileSize,bounds:e,visible:t.visible,opacity:t.opacity,tokenKey:t.tokenKey,tokenValue:t.tokenValue,clippingArea:j.convertClippingArea(t.clippingArea),crsOptions:ot(t),tms:"tms"===t.tileSliceType,subdomains:t.subDomains,minZoom:i,maxZoom:r}};var J=Q;var tt=class{static addVectorTileLayer(t){const{layer:e,innerView:i}=t;let r=this.initializeOptions(e);const{extendOptions:o={}}=e;r=Object.assign(r,o),t.innerLayer=new Mt(r).addTo(i),t.innerLayer.commonLayerId=e.id;const s=t.innerLayer.getMapboxMap();s.once("load",()=>{if(!(e instanceof n.IGSVectorTileLayer)){const i=t._getLayerViewVisible();this.setVisible(t.layer,s,i),this.setOpacity(t.layer,s,e.opacity)}})}static initializeOptions(t){let e,i;return t.style.layers.forEach(t=>{const{minzoom:n,maxzoom:r}=t;void 0===e&&(e=n),void 0===i&&(i=r),e=Math.min(n,e),i=Math.max(r,i)}),{style:JSON.parse(JSON.stringify(t.style)),noWrap:!0,clippingArea:j.convertClippingArea(t.clippingArea),tileSize:t.tileInfo.getTileSize(),crsOptions:ot(t),minZoom:e,maxZoom:i,tokenKey:t.tokenKey,tokenValue:t.tokenValue}}static setVisible(t,e,i){const{layers:n}=t.style,{style:r}=e;n.forEach(e=>{r.setLayoutProperty(e.id,"visibility",i?t._getBackupProperties(e.id,"visibility"):"none")}),e._update&&e._update(!0)}static setOpacity(t,e,i){const{layers:n}=t.style,{style:r}=e;n.forEach(e=>{const n=t._getBackupProperties(e.id,"opacities");n&&Object.keys(n).forEach(t=>{r.setPaintProperty(e.id,t,n[t]*i)})}),e._update&&e._update(!0)}static removeLayer(t){const{innerView:e,innerLayer:i}=t;e.removeLayer(i)}static setClippingArea(t,e){const{innerLayer:i}=t;i.setClippingArea(j.convertClippingArea(e))}static setPaintProperties(t,e,i){const{style:n}=t;Object.keys(i).forEach(t=>{n.setPaintProperty(e,t,i[t])}),t._update&&t._update(!0)}static setLayoutProperties(t,e,i){const{style:n}=t;Object.keys(i).forEach(t=>{n.setLayoutProperty(e,t,i[t])}),t._update&&t._update(!0)}};class et{}et.addArcGISTileLayer=function(t){const{layer:e,innerView:i}=t;let n=et.initializeOptions(e);n.visible=t._getLayerViewVisible(e.visible);const{extendOptions:r={}}=e;n=Object.assign(n,r);const o=new It(e.url,n).addTo(i);return o.id=e.id,o},et.initializeOptions=function(t){const e=nt(t);return{tileSize:t.tileSize,bounds:e,opacity:t.opacity,visible:t.visible,crsOptions:ot(t),tokenKey:t.tokenKey,tokenValue:t.tokenValue}};var it=et;function nt(t){let e=void 0;if("4326"===String(t.spatialReference.wkid)||"4214"===String(t.spatialReference.wkid)||"4490"===String(t.spatialReference.wkid)||"4610"===String(t.spatialReference.wkid)){const i=r.latLng(t.extent.ymin,t.extent.xmin),n=r.latLng(t.extent.ymax,t.extent.xmax);e=r.latLngBounds(i,n)}else if("3857"===String(t.spatialReference.wkid)||"900913"===String(t.spatialReference.wkid)){const i=n.Projection.projectMercatorToLonLat({x:t.extent.xmin,y:t.extent.ymin}),o=r.latLng(i.latitude,i.longitude),s=n.Projection.projectMercatorToLonLat({x:t.extent.xmax,y:t.extent.ymax}),a=r.latLng(s.latitude,s.longitude);e=r.latLngBounds(o,a)}else{const i=n.Projection.projectToGeographyPoints({points:[[t.extent.xmin,t.extent.ymin],[t.extent.xmax,t.extent.ymax]],wkid:t.spatialReference.wkid,proj4Defs:t.spatialReference.wkt}),o=r.latLng(i[0][1],i[0][0]),s=r.latLng(i[1][1],i[1][0]);e=r.latLngBounds(o,s)}return e}function rt(t){const e=t.getBounds(),i=e.getNorthWest(),n=e.getSouthEast(),o=e.getSouthWest(),s=e.getNorthEast(),a=t.latLngToLayerPoint(i),l=t.latLngToLayerPoint(n),h=t.latLngToLayerPoint(o),u=t.latLngToLayerPoint(s),c=r.bounds(a,l);c.extend(h),c.extend(u);const p=t.getSize(),f=t.containerPointToLayerPoint([0,0]),d=t.containerPointToLayerPoint([p.x,p.y]),g=r.bounds(f,d);return c.extend(g.getBottomLeft()),c.extend(g.getTopRight()),c}function ot(t){t&&t.spatialReference||n.Log.error("计算crsOptions错误");let e=t.tileInfo;t.type===n.LayerType.wmts&&(e=t.getCurrentTileInfo());const i=t.spatialReference,r=e.origin.coordinates,o=t.extent,s=e.lods.map(t=>t.clone());return{wkid:i.wkid,wkt:i.wkt,lods:s,origin:r,unit:i.isGeographic?"degree":void 0,extent:{xmin:o.xmin,ymin:o.ymin,xmax:o.xmax,ymax:o.ymax}}}function st(t,e){e=Object(n.defaultValue)(e,[t]);const i=Object(n.getValidLayers)(t,e),r=Object(n.getLayersExtent)(i,t.spatialReference),o=Object(n.getCrsOptions)(t,i,{fullExtent:r});return new l({wkid:o.spatialReference.wkid,wkt:o.spatialReference.wkt,lods:o.lods,origin:o.origin,extent:o.extent})}function at(t){switch(t.type){case n.LayerType.igsTile:return U.initializeOptions(t);case n.LayerType.igsMapImage:return q.initializeOptions(t);case n.LayerType.wms:return X.initializeOptions(t);case n.LayerType.wmts:return W.initializeOptions(t);case n.LayerType.arcgisMapImage:return K.initializeOptions(t);case n.LayerType.arcgisTile:return it.initializeOptions(t);case n.LayerType.webTileLayer:return J.initializeOptions(t);case n.LayerType.igsVectorTile:case n.LayerType.arcgisVectorTile:return tt.initializeOptions(t);default:n.Log.error(`暂不支持为${t.type}类型的图层构造实例化参数`)}}const lt=r.ImageOverlay.extend({options:{clippingArea:null,bboxBounds:null,pixBoundsSize:null,container:null},_initImage(){const t="IMG"===this._url.tagName,e=t?this._url:r.DomUtil.create("img"),i=this._map.project(this._bounds.getNorthWest()),n=this.options.pixBoundsSize,o=this._map.getZoomScale(this._map.getZoom(),0),s=document.createElement("canvas");s.width=n.x,s.height=n.y;const a=s.getContext("2d");this._image=s,r.DomUtil.addClass(s,"leaflet-image-layer"),this._zoomAnimated&&r.DomUtil.addClass(s,"leaflet-zoom-animated"),this.options.className&&r.DomUtil.addClass(s,this.options.className),s.onselectstart=r.Util.falseFn,s.onmousemove=r.Util.falseFn;let l=[];this.options.clippingArea&&(l=this._getTileGeometryAndState());e.onload=(()=>{s.complete=!0,setTimeout(()=>{const t=a.createPattern(e,"repeat");((t,e)=>{if(!Array.isArray(e)||0===e.length||e.some(t=>t.in))return!0;if(e.every(t=>t.out))return!1;const n=e.filter(t=>t.geometry).map(t=>t.geometry);return n.length>0?(t.beginPath(),n.forEach(e=>{const n=F.coordAll(e);let r=n[0][0]*o-i.x,s=n[0][1]*o-i.y;t.moveTo(r,s);for(let e=1;e<n.length;e++)r=n[e][0]*o-i.x,s=n[e][1]*o-i.y,t.lineTo(r,s)}),t.clip(),!0):void 0})(a,l)&&(a.beginPath(),a.rect(0,0,s.width,s.height),a.fillStyle=t,a.fill())},0),this.fire("load")}),e.onerror=(()=>{this._overlayOnError("error")}),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},getPane(){return this.options.container?this.options.container:r.ImageOverlay.prototype.getPane.call(this)},_toTurfGeometry(t){return j.toTurfGeometry(t,this._map)},_getClippingAreaPx(){return this._clippingAreaPx?this._clippingAreaPx:(this.options.clippingArea?this._clippingAreaPx=this._toTurfGeometry(this.options.clippingArea):this._clippingAreaPx=null,this._clippingAreaPx)},_getTileGeometryAndState(){if(!this.options.clippingArea)return null;const t=this._getClippingAreaPx(),e=this._map.getGeoBoundsCoord(),i=this._map.options.crs,n=i.scale(0),o=i.transformation._transform(r.point(e.xmin,e.ymin),n),s=i.transformation._transform(r.point(e.xmax,e.ymax),n),a=o.x,l=s.y,h=s.x,u=o.y,c=F.polygon([[[a,l],[h,l],[h,u],[a,u],[a,l]]]);return t.map(t=>j.getClippingState(t,c))},_animateZoom(t){if(!this._map._rotate||0===this._map._bearing)return r.ImageOverlay.prototype._animateZoom.call(this,t)},_reset(){const t=this._image,e=this._calcLayerPointBounds(),i=e.getSize(),n=i.divideBy(2);r.DomUtil.setPosition(t,e.getCenter().subtract(n)),t.style.width=`${i.x}px`,t.style.height=`${i.y}px`},_calcLayerPointBounds(){const t=this._map.getCenter(),e=this._map.getZoom(),i=this.options.bboxBounds,n=this._map.options.crs,o=n.unproject(i.getTopLeft()),s=n.unproject(i.getBottomRight());return new r.Bounds(this._map._latLngToNewLayerPoint(o,e,t),this._map._latLngToNewLayerPoint(s,e,t))}});r.ImageOverlay.clip=function(t,e,i){return new r.ImageOverlay.Clip(t,e,i)};var ht=lt;var ut=r.Layer.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:"",noWrap:!0,clippingArea:null,pane:"tilePane"},initialize(t,e){this.id=e.id,this.httpMethod=e.httpMethod,r.setOptions(this,e),r.stamp(this);const i=this.options.intervalTime||120;this.refresh=r.Util.throttle(this.refresh,i,this),this._currentImage=null,this._waitToUpdateImage=null,this.bboxBounds=null,this.pixBoundsSize=null,this.initBaseUrl(t,e)},onAdd(t){t.on("moveend",this.refresh,this),this._initContainer(),this._updateClippingArea(this.options.clippingArea),this.refresh()},_initContainer(){this._container||(this._container=r.DomUtil.create("div",`leaflet-layer ${this.options.className||""}`),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},onRemove(){this._waitToUpdateImage&&this._map.removeLayer(this._waitToUpdateImage),this._currentImage&&this._map.removeLayer(this._currentImage),r.DomUtil.remove(this._container),this._map.off("moveend",this.refresh,this)},refresh(){if(!this._map)return;const t=this._map.getZoom();if(t>(this._map.options.maxZoom||18)||t<(this._map.options.minZoom||0))return void(this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null));const e=this._baseUrl;e?this._requestImage(e):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null)},setOpacity(t){this.options.opacity=t,this._updateOpacity()},_updateOpacity(){this._container&&r.DomUtil.setOpacity(this._container,this.options.opacity)},setVisible(t){if((t=!!t)!==this.options.visible)if(this.options.visible=t,this._currentImage){this._currentImage.getElement().style.display=this.options.visible?"inline":"none"}else this.refresh()},setZIndex(t){this.options.zIndex=t,this._updateZIndex()},_updateZIndex(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_requestImage(t){const e=this,i=this._map;if(!i||!this.options.visible)return;const n=this._initAllRequestParams(),r=this._map.getBounds(),o=t=>{if(!i._mapPane)return;const n=e._currentImage;t._bounds&&t._bounds.equals(r)&&t._bounds.equals(i.getBounds())?(t.getElement().style.display=e.options.visible?"inline":"none",e._currentImage=t,n&&i.removeLayer(n)):i.removeLayer(t),e._waitToUpdateImage=null},s=t=>{i._mapPane&&i.removeLayer(t)};this.buildRequestImageSrc(t,n).then(t=>{if(!i._mapPane)return;let n=t;this.options&&"GET"===this.options.httpMethod&&(n=j.getInterceptorsUrl.call(this,n));const r=e._createImage(n,o,s);r.addTo(i),e._waitToUpdateImage=r})},_createImage(t,e,i){const n=this._map.getBounds(),r=new ht(t,n,{alt:this.options.alt,zIndex:this.options.zIndex,className:this.options.className,errorOverlayUrl:this.options.error,crossOrigin:this.options.crossOrigin,pane:this.options.pane||this.getPane(),interactive:this.options.interactive,clippingArea:this.options.clippingArea,bboxBounds:this.bboxBounds,pixBoundsSize:this.pixBoundsSize,container:this._container});return r.once("load",()=>{e(r)},self),r.once("error",()=>{i(r)},self),r},_initAllRequestParams(){const t=this._map,e=t.getZoom(),i=t.options.crs,n=rt(t).getSize().round(),o=n.y||512,s=n.x||512,a=t.project(t.getBounds().getNorthWest()),l=a.add(n),h=i.pointToGeoCoord(t.toPoint(a),e),u=i.pointToGeoCoord(t.toPoint(l),e),c=`${h.x},${u.y},${u.x},${h.y}`;this.bboxBounds=r.bounds(h,u),this.pixBoundsSize=n;const p={clientId:this.options.clientId,layers:this.options.layers,imageTransparent:this.options.imageTransparent,isAntialiasing:this.options.isAntialiasing,projectionSrs:this.options.crs};return this.buildRequestParamsObject(p,s,o,c),p},_toTurfGeometry(t){let e=[];return"Polygon"===t.type?e.push(t.coordinates):e=t.coordinates,e.map(t=>{const e=j.convertClippAreaToPx(this._map,t);return F.polygon(e)})},setClippingArea(t){return this.options.clippingArea=t,this._updateClippingArea(t),this.refresh(),this},_updateClippingArea(t){const e=this._map;this._clippingPolygons=t&&e?this._toTurfGeometry(t):null},initBaseUrl(t,e){this._baseUrl=t},buildRequestImageSrc:(t,e)=>new Promise(e=>{e(t)}),buildRequestParamsObject:(t,e,i,n)=>t});var ct=r.TileLayer.extend({options:{clippingArea:null,crsOptions:null},initialize(t,e){e=e||{},r.TileLayer.prototype.initialize.call(this,t,e),this._clippingAreaPx=null,this.httpMethod=Object(n.defaultValue)(e.httpMethod,n.FetchMethod.get)},createTile(t,e){const i=this.getTileUrl(t);return this._drawClippingTile(i,t,e)},onAdd(t){this._TileClippingGeometryCache={},r.TileLayer.prototype.onAdd.call(this,t)},setClippingArea(t){return this.options.clippingArea=t,this._clearClippingCache(),this._removeAllTiles(),this._resetView(),this},getClippingArea(){return this.options.clippingArea},_getTileGeometryAndState(t,e,i){if(!this.options.clippingArea)return null;const n=`${t},${e},${i}`;if(this._TileClippingGeometryCache[n])return this._TileClippingGeometryCache[n];const r=this._getClippingAreaPx(),o=this.options.tileSize,s=Math.pow(2,i-this.options.zoomOffset),a=t*o/s,l=e*o/s,h=(t+1)*o/s,u=(e+1)*o/s,c=F.polygon([[[a,l],[h,l],[h,u],[a,u],[a,l]]]),p=r.map(t=>j.getClippingState(t,c));return p.some(t=>t.geometry)&&(this._TileClippingGeometryCache[n]=p),p},_toTurfGeometry(t){return j.toTurfGeometry(t,this._map)},_getClippingAreaPx(){return this._clippingAreaPx?this._clippingAreaPx:(this.options.clippingArea?this._clippingAreaPx=this._toTurfGeometry(this.options.clippingArea):this._clippingAreaPx=null,this._clippingAreaPx)},_clearClippingCache(){this._clippingAreaPx=null,this._TileClippingGeometryCache={}},_drawClippingTile(t,e,i){const{x:n,y:r,z:o}=e,s=this._getTileGeometryAndState(n,r,o),a=document.createElement("img");if(!s||s.some(t=>t.in))return this._getTileImage(a,t,i);if(s.every(t=>t.out)){const t=document.createElement("canvas");return t.width=this.options.width,t.height=this.options.height,this._getTileImage(a,null,i)}const l=s.filter(t=>t.geometry).map(t=>t.geometry);if(l.length>0){this._getTileImage(a,t,i);const e=document.createElement("canvas");e.width=this.options.tileSize,e.height=this.options.tileSize;const s=e.getContext("2d"),h=this.options.tileSize,u=h*n,c=h*r,p=Math.pow(2,o-this.options.zoomOffset);return a.onload=function(){e.complete=!0,setTimeout(()=>{const t=s.createPattern(a,"repeat");let n,r;s.beginPath(),l.forEach(t=>{const e=F.coordAll(t);n=e[0][0]*p-u,r=e[0][1]*p-c,s.moveTo(n,r);for(let t=1;t<e.length;t++)n=e[t][0]*p-u,r=e[t][1]*p-c,s.lineTo(n,r)}),s.clip(),s.beginPath(),s.rect(0,0,e.width,e.height),s.fillStyle=t,s.fill(),i()},0)},this.options.crossOrigin&&(a.crossOrigin=""),e}},_getTileImage(t,e,i){if(!e)return t;r.DomEvent.on(t,"load",r.Util.bind(this._tileOnLoad,this,i,t)),r.DomEvent.on(t,"error",r.Util.bind(this._tileOnError,this,i,t)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(t.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(t.referrerPolicy=this.options.referrerPolicy),t.alt="";let o=e;if(!/data:image\/jpg;base64/.test(e)){o=j.getInterceptorsUrl.call(this,e);const i=this._map.options.config;t.onload=function(){r.InterceptorsUtils.serviceConfigResponseInterceptors(i,o,t)}}return this.httpMethod===n.FetchMethod.post?(t.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC",this._postImage(t,e)):t.src=o,t},_tileOnError(t,e,i){r.TileLayer.prototype._tileOnError.call(this,t,e,i),e instanceof Element&&(e.style.display="none")},_postImage(t,e){}});const{extend:pt,setOptions:ft,getParamString:dt}=r.Util;var gt=ct.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/png",transparent:!1,version:"1.1.1",isReverseBBOX:!1},options:{crs:null,uppercase:!1,visible:!0},initialize(t,e){e=e||{},this.options.lastOpacity=e.opacity,this._url=t;const i=pt({},this.defaultWmsParams);for(const t in e)t in this.options||(i[t]=e[t]);const n=(e=ft(this,e)).detectRetina&&r.Browser.retina?2:1,o=this.getTileSize();i.width=o.x*n,i.height=o.y*n,this.isReverseBBOX=e.isReverseBBOX,this.wmsParams=i},onAdd(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);const e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,ct.prototype.onAdd.call(this,t)},getTileUrl(t){const e=this._tileCoordsToNwSe(t),i=this._crs,n=r.bounds(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,a=(this.isReverseBBOX?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),l=ct.prototype.getTileUrl.call(this,t);return l+dt(this.wmsParams,l,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams(t,e){return pt(this.wmsParams,t),e||this.redraw(),this}});var yt=ct.extend({options:{noWrap:!0},initialize(t,e){this.igsVersion=e.igsVersion,this.tokenKey=e.tokenKey,this.tokenValue=e.tokenValue,this.zoomOffset=e.zoomOffset,"1.0"===this.igsVersion?this.url=`${t}`:this.url=`${t}/tileImage`,ct.prototype.initialize.apply(this,arguments),r.GridLayer.prototype.initialize(arguments[1]),r.setOptions(this,e),r.stamp(this)},onAdd(t){this._crs=this.options.crs||t.options.crs;const e=this._crs.projection.bounds,i=[e.min.x,e.max.y];this._origin=this.options.origin?this.options.origin:i,ct.prototype.onAdd.call(this,t)},getTileUrl(t){let e=void 0;"1.0"===this.igsVersion?(e=`${this.url}/{z}/{y}/{x}`,this.tokenKey&&this.tokenValue&&(e+=`?${this.tokenKey}=${this.tokenValue}`)):(e=`${this.url}/{z}/{y}/{x}?f=image`,this.tokenKey&&this.tokenValue&&(e+=`&${this.tokenKey}=${this.tokenValue}`));const i=this._getZoomForUrl();return e=e.replace("{x}",t.x.toString()).replace("{y}",t.y.toString()).replace("{z}",i)}});function mt(t){let e="?";return Object.keys(t).forEach(function(i){null!==t[i]&&void 0!==t[i]&&(e+=`${i}=${encodeURIComponent(t[i])}&`)}),e=e.substring(0,e.length-1)}function _t(t){const e=nt(t);let i={layers:t.layers,id:t.id,clientId:t.clientId,imageWidth:t.imageWidth,imageHeight:t.imageHeight,imageFormat:t.imageFormat,opacity:t.opacity,visible:t.visible,imageTransparent:t.imageTransparency,bounds:e,igsVersion:t._igsVersion,tokenKey:t.tokenKey,tokenValue:t.tokenValue,tokenAttachType:t.tokenAttachType,filters:t.getFilters(),httpMethod:t.httpMethod,clippingArea:j.convertClippingArea(t.clippingArea),mapServer:new n.MapServer({url:t.url,tokenKey:t.tokenKey,tokenValue:t.tokenValue,enableGlobeFetch:!1,headers:t.headers}),projectionSrs:Object(n.getProjectionSrs)(t.spatialReference),isAntialiasing:t.isAntialiasing,renderMode:t.renderMode};const r=Object(n.getIGSDynamicLayer)(t);r.length>0&&(i.dynamicLayers=r);const{extendOptions:o={}}=t;return i=Object.assign(i,o)}var vt=ct.extend({options:{noWrap:!0},initialize(t,e){this.id=e.id;const i=Object(n.formatBaseUrl)(t);this.httpMethod=e.httpMethod;const o=e.igsVersion;this.url="2.0"===o?encodeURI(`${i.baseUrl}/image`):encodeURI(`${i.baseUrl}`),e.tileSize=Math.max(e.imageWidth,e.imageHeight),r.setOptions(this,e),r.stamp(this),ct.prototype.initialize.apply(this,arguments),r.GridLayer.prototype.initialize(arguments[1])},onAdd(t){this._crs=t.options.crs,ct.prototype.onAdd.call(this,t),this._haveInnerLayer=!0},getTileUrl(t){const e=this._initAllRequestParams(t);if("POST"===this.httpMethod)return e;{const t=mt(e);return this.url+t}},_postImage(t,e){e.tokenAttachType=this.options.tokenAttachType,this.options.mapServer.exportImage(e).then(function(e){const i=new FileReader;i.onload=(e=>{t.src=e.target.result}),i.readAsDataURL(e),i.onerror=(()=>{})})},_initAllRequestParams(t){const e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i),s=e.unproject(n,t.z),a=e.unproject(o,t.z),l=new r.LatLngBounds(s,a),h=this._crs.project(l.getNorthWest()),u=this._crs.project(l.getSouthEast()),c={bbox:`${h.x},${u.y},${u.x},${h.y}`,clientId:this.options.clientId,layers:this.options.layers,imageTransparent:this.options.imageTransparent,isAntialiasing:this.options.isAntialiasing,projectionSrs:this.options.crs};return this.options.tokenKey&&this.options.tokenValue&&(c[this.options.tokenKey]=this.options.tokenValue),"2.0"===this.options.igsVersion?(c.size=`${this.options.imageWidth},${this.options.imageHeight}`,c.format=this.options.imageFormat,c.layerStyles=this.options.styles,c.layerFilters=JSON.stringify(this.options.filters),c.dynamicLayers=JSON.stringify(this.options.dynamicLayers),c.f="image",c.projectionSrs=this.options.projectionSrs):(c.w=this.options.imageWidth,c.h=this.options.imageHeight,c.style=this.options.styles,c.filters=JSON.stringify(this.options.filters),c.f="png"),c}});var xt=ut.extend({options:{imageFormat:null,clientId:null,imageTransparent:null,igsVersion:"2.0",tokenKey:"",tokenValue:"",filters:null,httpMethod:"GET",styles:null,layers:null,isAntialiasing:null,visible:!0,clippingArea:null,pane:"tilePane",mapServer:null},initBaseUrl(t,e){const i=Object(n.formatBaseUrl)(t);this.httpMethod=e.httpMethod;const r=e.igsVersion;this._baseUrl="2.0"===r?encodeURI(`${i.baseUrl}/image`):encodeURI(`${i.baseUrl}`)},buildRequestImageSrc(t,e){const i=this;return new Promise(n=>{if("POST"===this.options.httpMethod)e.tokenAttachType=this.options.tokenAttachType,this.options.mapServer.exportImage(e).then(function(t){const e=new FileReader;e.onload=(t=>{i._map?n(t.target.result):n("")}),e.readAsDataURL(t)});else{const i=mt(e);n(t+i)}})},buildRequestParamsObject(t,e,i,n){return t.bbox=n,this.options.tokenKey&&this.options.tokenValue&&(t[this.options.tokenKey]=this.options.tokenValue),"2.0"===this.options.igsVersion?(t.size=`${e},${i}`,t.format=this.options.imageFormat,t.layerStyles=this.options.styles,t.layerFilters=JSON.stringify(this.options.filters),t.dynamicLayers=JSON.stringify(this.options.dynamicLayers),t.f="image",t.projectionSrs=this.options.projectionSrs):(t.w=e,t.h=i,t.style=this.options.styles,t.filters=JSON.stringify(this.options.filters),t.f="png"),t}});var bt=class{constructor(t,e){let i;if((e=Object(n.defaultValue)(e,{})).renderMode=Object(n.defaultValue)(e.renderMode,"tile"),e.igsVersion=Object(n.defaultValue)(e.igsVersion,"2.0"),e.imageHeight=Object(n.defaultValue)(e.imageHeight,256),e.imageWidth=Object(n.defaultValue)(e.imageWidth,256),"tile"===e.renderMode){let n=t;"1.0"===e.igsVersion&&(n=n.replace("/mrcs/","/mrms/")),i=new vt(n,e)}else i=new xt(t,e);return i}};var wt=ut.extend({options:{imageFormat:null,imageTransparent:null,tokenKey:"",tokenValue:"",httpMethod:"GET",layers:null,visible:!0,clippingArea:null,pane:"tilePane",mapServer:null},initBaseUrl(t,e){this.httpMethod=e.httpMethod,this._baseUrl=t},buildRequestImageSrc(t,e){const i=this;return new Promise(n=>{if("POST"===this.options.httpMethod)e.tokenAttachType=this.options.tokenAttachType,this.options.mapServer.exportImage(e).then(function(t){const e=new FileReader;e.onload=(t=>{i._map?n(t.target.result):n("")}),e.readAsDataURL(t)});else{const i=mt(e);n(t+i)}})},buildRequestParamsObject(t,e,i,n){return t.bbox=n,this.options.tokenKey&&this.options.tokenValue&&(t[this.options.tokenKey]=this.options.tokenValue),t.size=`${e},${i}`,t.format=`${this.options.imageFormat}`,t.f="image",t.layers&&(t.layers=`${this.options.layers}`),void 0!==this.options.transparent&&null!==this.options.transparent&&(t.transparent=this.options.transparent),this.options.spatialReference&&(t.imageSR=`${this.options.spatialReference.wkid}`),Array.isArray(this.options.extensions)&&this.options.extensions.forEach(e=>{e.key&&e.value&&(t[e.key]=e.value)}),t}});var Et=ct.extend({options:{noWrap:!0},initialize(t,e){this.id=e.id,this.url=t,this._backUrl=t,e.tileSize=r.point(e.imageWidth,e.imageHeight),this.httpMethod=e.httpMethod,ct.prototype.initialize.apply(this,arguments),r.setOptions(this,e),r.stamp(this)},onAdd(t){this._crs=t.options.crs,this._initLayerUrl(),ct.prototype.onAdd.call(this,t)},getTileUrl(t){const e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i),s=e.unproject(n,t.z),a=e.unproject(o,t.z),l=new r.LatLngBounds(s,a),h=this._crs.project(l.getNorthWest()),u=this._crs.project(l.getSouthEast());if("POST"===this.httpMethod){const t=this._initAllRequestParams();return t.bbox=`${h.x},${u.y},${u.x},${h.y}`,t}{const t=`&bbox=${h.x},${u.y},${u.x},${h.y}`;return this._initLayerUrl(),this._layerUrl+encodeURI(t)}},_postImage(t,e){e.tokenAttachType=this.options.tokenAttachType,this.options.mapServer.exportImage(e).then(function(e){const i=new FileReader;i.onload=(e=>{t.src=e.target.result}),i.readAsDataURL(e),i.onerror=(()=>{})})},_initLayerUrl(){let t=`${this.url}?`;const e=this._initAllRequestParams();Object.keys(e).forEach(i=>{t+=`${i}=${encodeURIComponent(e[i])}&`}),t=t.substring(0,t.length-1),this._layerUrl=t},_initAllRequestParams(){const t=this.options||{},e={},i=t.imageHeight||256,n=t.imageWidth||256;return e.size=`${n},${i}`,e.format=`${t.imageFormat}`,e.f="image",t.layers&&(e.layers=`${t.layers}`),void 0!==t.transparent&&null!==t.transparent&&(e.transparent=t.transparent),t.spatialReference&&(e.imageSR=`${t.spatialReference.wkid}`),t.tokenKey&&t.tokenValue&&(e[`${t.tokenKey}`]=`${t.tokenValue}`),t.extensions&&t.extensions instanceof Array&&t.extensions.forEach(t=>{t.key&&t.value&&(e[t.key]=t.value)}),e}});var Ct=class{constructor(t,e){let i;return i="tile"===e.renderMode?new Et(`${t}/export`,e):new wt(`${t}/export`,e)}};var Lt=class{constructor(t,e){return new gt(t,e)}};var St=ct.extend({options:{version:"1.0.0",format:"image/png",tileSize:256,noWrap:!0},initialize(t,e){r.GridLayer.prototype.initialize.call(this,arguments[1]),this._url=encodeURI(t),this._url+="?service=WMTS&request=GetTile",this.options.origin=e.origin?e.origin:null,this.zoomOffset=e.zoomOffset,r.setOptions(this,e)},onAdd(t){this._crs=this.options.crs||t.options.crs;const e=this._crs.projection.bounds,i=[e.min.x,e.max.y];this._origin=this.options.origin?this.options.origin:i,ct.prototype.onAdd.call(this,t)},getTileUrl(t){const e=this._getZoomForUrl(),i=r.Util.template(this._url,{s:this._getSubdomain(t)}),n={version:this.options.version,style:this.options.style,tilematrixSet:this.options.tilematrixSet,format:this.options.format,layer:this.options.layer,tilematrix:e,tilerow:t.y,tilecol:t.x};return this.options.tokenKey&&this.options.tokenValue&&(n[this.options.tokenKey]=this.options.tokenValue),i+r.Util.getParamString(n,i)}});var Pt=ct.extend({options:{noWrap:!0},initialize(t,e){r.TileLayer.prototype.initialize.apply(this,arguments),r.GridLayer.prototype.initialize(arguments[1]),r.setOptions(this,e),r.stamp(this)},onAdd(t){r.TileLayer.prototype.onAdd.call(this,t)},getTileUrl(t){const e={r:r.Browser.retina?"@2x":"",s:this._getSubdomain(t),col:t.x,row:t.y,level:this._getZoomForUrl()};if(this._map&&!this.options.crs.infinite){const i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.row=i),e["-row"]=i}let i=r.Util.template(this._url,r.Util.extend(e,this.options));return this.options.tokenKey&&this.options.tokenValue&&(i+=`&${this.options.tokenKey}=${this.options.tokenValue}`),i}});var It=ct.extend({options:{noWrap:!0},initialize(t,e){this.tokenKey=e.tokenKey,this.tokenValue=e.tokenValue,this.url=encodeURI(`${t}/tile`),r.TileLayer.prototype.initialize.apply(this,arguments),r.GridLayer.prototype.initialize(arguments[1]),r.setOptions(this,e),r.stamp(this)},onAdd(t){this._crs=this.options.crs||t.options.crs;const e=this._crs.projection.bounds,i=[e.min.x,e.max.y];this._origin=this.options.origin?this.options.origin:i,r.TileLayer.prototype.onAdd.call(this,t)},getTileUrl(t){let e=`${this.url}/{z}/{y}/{x}`;return this.tokenKey&&this.tokenValue&&(e+=`?${this.tokenKey}=${this.tokenValue}`),e=e.replace("{x}",t.x.toString()).replace("{y}",t.y.toString()).replace("{z}",t.z.toString())}});var Mt=class{constructor(t){let e;return function(t,e){class i extends t.Projection{constructor(t,i){super();const n=(i||{}).def;if(!n)throw new Error("自定义参考系必须指定参数系信息def");if(this._def=n,!e)throw new Error("proj4对象不存在,自定义投影必须引入proj4对象");const r=this._isProj4Obj(t);this._proj=r?t:this._projFromCodeDef(t,n)}project(t){let e,i;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.lng,i=t.lat),this._proj.forward([e,i])}unproject(t){let e,i;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.x,i=t.y),this._proj.inverse([e,i])}_projFromCodeDef(t,i){if(i)e.defs(t,i);else if(void 0===e.defs[t]){const i=t.split(":");if(i.length>3&&(t=`${i[i.length-3]}:${i[i.length-1]}`),void 0===e.defs[t])throw`No projection definition for code ${t}`}return e(t)}_isProj4Obj(t){return void 0!==t.inverse&&void 0!==t.forward}}class n extends t.CRS{_parseParams(t){this._crsType="proj4",this.epsgCode=t[0],this.def=t[1];const e=t[2]||{};this._parseOptions(e)}_parseOptions(t){if(super._parseOptions(t),this._resolutions=t.resolutions,Array.isArray(this._resolutions)){const t={};this._resolutions.forEach((e,i)=>{t[i]=e}),this._resolutions=t}if(!this._resolutions)throw new Error("自定义坐标系时,未设置分辨率数组");if(!this.origin)throw new Error("自定义坐标系时,未设置原点");this.tileSize=t.tileSize||256}_setProjection(){this.projection=new i(this.getEpsgCode(),{origin:this.origin,def:this.def})}}t.Proj||(t.Proj={}),t.Proj.CRS=n,t.Proj.Projection=i}(e=i(4),n.proj4),function(t,e){t.mapboxgl&&t.MapboxGL||(t.MapboxGL=t.Layer.extend({options:{updateInterval:32,padding:0,interactive:!1,pane:"tilePane",clippingArea:null,zoomOffset:0,tileSize:256,zIndex:1,crsOptions:null},initialize(i){t.setOptions(this,i),i.accessToken&&(e.accessToken=i.accessToken),this._throttledUpdate=t.Util.throttle(this._update,this.options.updateInterval,this)},onAdd(e){this._container||this._initContainer();const i=this.getPaneName();e.getPane(i).appendChild(this._container),this._updateZIndex(),this._initGL(),this._offset=this._map.getBounds().getNorthWest(),e.options.zoomAnimation&&t.DomEvent.on(e._proxy,t.DomUtil.TRANSITION_END,this._transitionEnd,this),e._addZoomLimit(this)},onRemove(e){this._map._proxy&&this._map.options.zoomAnimation&&t.DomEvent.off(this._map._proxy,t.DomUtil.TRANSITION_END,this._transitionEnd,this);const i=this.getPaneName();e.getPane(i).removeChild(this._container)},setZIndex(t){this.options.zIndex=t,this._updateZIndex()},_updateZIndex(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},getEvents(){return{move:this._throttledUpdate,zoomanim:this._animateZoom,zoom:this._pinchZoom,zoomstart:this._zoomStart,zoomend:this._zoomEnd,resize:this._resize,rotate:this._rotate}},setClippingArea(t){this.options.clippingArea=t;const e=this.getMapboxMap(),i=this.options.style.sources;i&&Object.entries(i).forEach(i=>{const n=i[0],r=e.getSource(n);r&&"vector"===r.type&&r.setClippingArea&&r.setClippingArea(t)})},getClippingArea(){return this.options.clippingArea},getMapboxMap(){return this._glMap},getCanvas(){return this._glMap.getCanvas()},getSize(){return this._map.getSize().multiplyBy(1+2*this.options.padding)},getBounds(){const e=this.getSize().multiplyBy(.5),i=this._map.latLngToContainerPoint(this._clampCenter(this._map.getCenter()));return t.latLngBounds(this._map.containerPointToLatLng(i.subtract(e)),this._map.containerPointToLatLng(i.add(e)))},getContainer(){return this._container},getPaneName(){return this._map.getPane(this.options.pane)?this.options.pane:"tilePane"},_initContainer(){const e=this._container=t.DomUtil.create("div","leaflet-gl-layer"),i=this.getSize();e.style.width=`${i.x}px`,e.style.height=`${i.y}px`,e.style.position="absolute";const n=this._calcRotateOffset();t.DomUtil.setPosition(e,n)},_initGL(){let i;const n=this._map.options.crs,r=this._map.getCenter(),o=this.options.crsOptions;if(o){const t=o.extent,r={};o.lods.forEach(t=>{r[t.level]=t.resolution});const s=this.options.tileSize||256,a={resolutions:r,origin:o.origin,tileSize:s,bounds:[t.xmin,t.ymin,t.xmax,t.ymax],unit:o.unit};i=e.Proj&&e.Proj.CRS?new e.Proj.CRS(n.code,n.def,a):new e.CRS(n.code,a)}else i=n.code;const s=t.extend({},this.options,{container:this._container,center:[r.lng,r.lat],zoom:Math.max(0,this._map.getZoom()),attributionControl:!1,crs:i,minZoom:0,renderWorldCopies:!1});try{if(s.style){const t=s.style.sources;t&&Object.entries(t).forEach(t=>{"vector"===t[1].type&&(t[1].clippingArea=this.options.clippingArea)})}}catch(t){}this._glMap?(this._glMap.setCenter(s.center),this._glMap.setZoom(s.zoom)):this._glMap=new e.Map(s),this._glMap.transform.latRange=null,this._transformGL(this._glMap),this._glMap._canvas.canvas?this._glMap._actualCanvas=this._glMap._canvas.canvas:this._glMap._actualCanvas=this._glMap._canvas;const a=this._glMap._actualCanvas;t.DomUtil.addClass(a,"leaflet-image-layer"),t.DomUtil.addClass(a,"leaflet-zoom-animated"),this.options.interactive&&t.DomUtil.addClass(a,"leaflet-interactive"),this.options.className&&t.DomUtil.addClass(a,this.options.className)},_calcRotateOffset(){const t=this._map.getSize().multiplyBy(this.options.padding),e=this._map.getSize()._divideBy(2);return this._map._latLngToNewLayerPoint(this._map.getCenter(),this._map.getZoom(),this._map.getCenter()).subtract(e).subtract(t)},_update(t){if(!this._map)return;if(this._offset=this._map.getBounds().getNorthWest(),this._zooming)return;const e=this._glMap,i=this.getSize(),n=this._container;this._transformGL(e);const r=Math.round(i.x),o=Math.round(i.y);Math.round(e.transform.width)!==r||Math.round(e.transform.height)!==o?(n.style.width=`${r}px`,n.style.height=`${o}px`,e.transform.width=r,e.transform.height=o,null!==e._resize&&void 0!==e._resize?e._resize():e.resize()):null!==e._update&&void 0!==e._update?e._update():e.update()},_transformGL(i){const n=this._clampCenter(this._map.getCenter()),r=i.transform;r.resetZoomScale=!1;const o=this._getZoom();if(o<0)return;r.zoom=o,r.center=e.LngLat.convert([n.lng,n.lat]);const s=r.center,a=[0,0];if(Math.abs(s.lng-n.lng)>1e-7||Math.abs(s.lat-n.lat)>1e-7){const t=r.coordinatePoint(r.locationCoordinate(s)),e=r.coordinatePoint(r.locationCoordinate(n));a[0]=t.x-e.x,a[1]=t.y-e.y}const l=this._container,h=this._calcRotateOffset().add(a);t.DomUtil.setPosition(l,h)},_clampCenter(e){if(!e)return e;const i=Math.min(Math.max(e.lng,-180),180),n=Math.min(Math.max(e.lat,-90),90);return t.latLng(n,i)},_pinchZoom(t){this._glMap.jumpTo({zoom:Math.max(0,this._getZoom()),center:this._clampCenter(this._map.getCenter())})},_animateZoom(e){const i=this._map.getZoomScale(e.zoom),n=this._map.getSize().multiplyBy(this.options.padding*i),r=this.getSize()._divideBy(2),o=this._map.project(this._clampCenter(e.center),e.zoom)._subtract(r)._add(this._map._getMapPanePos().add(n))._round(),s=this._map.project(this._clampCenter(this._map.getBounds().getNorthWest()),e.zoom)._subtract(o),a=this._map.latLngToLayerPoint(this._offset)._add(this._map._getRotatePanePos());t.DomUtil.setTransform(this._glMap._actualCanvas,s.subtract(a),i)},_zoomStart(t){this._zooming=!0,this._container&&this._map._rotate&&0!==this._map._bearing&&(this._container.style.visibility="hidden")},_zoomEnd(){const e=this._map.getZoomScale(this._map.getZoom());t.DomUtil.setTransform(this._glMap._actualCanvas,null,e),this._zooming=!1,this._update(),this._container&&(this._container.style.visibility="visible")},_transitionEnd(e){t.Util.requestAnimFrame(function(){const e=this._map.getCenter(),i=this._map.latLngToContainerPoint(this._clampCenter(this._map.getBounds().getNorthWest()));t.DomUtil.setTransform(this._glMap._actualCanvas,i,1),this._glMap.once("moveend",t.Util.bind(function(){this._zoomEnd()},this)),this._glMap.jumpTo({center:this._clampCenter(e),zoom:Math.max(0,this._getZoom())})},this)},_resize(t){this._transitionEnd(t)},_getZoom(){const t=this._map.getSize()._divideBy(2),e=this._map._latLngToNewLayerPoint(this._map.getCenter(),this._map.getZoom(),this._map.getCenter()),i=e.subtract(t),n=e.add(t),r=this._map.layerPointToLatLng(i),o=this._map.layerPointToLatLng(n),s=[[Math.min(Math.max(o.lng,-180),180),Math.min(Math.max(r.lat,-90),90)],[Math.min(Math.max(r.lng,-180),180),Math.min(Math.max(o.lat,-90),90)]],a=this._map.getSize().multiplyBy(this.options.padding),l=this._glMap.cameraForBounds(s,{padding:{left:a.x,right:a.x,top:a.y,bottom:a.y}});return l?parseFloat(l.zoom.toFixed(10)):-1},_rotate(e){if(!this._map)return;const i=this._map.getSize(),n=this._map._bearing,r=t.point(i.x/2,i.y/2),o=t.point(0,0).rotateFrom(n,r),s=t.point(i.x,0).rotateFrom(n,r),a=t.point(i.x,i.y).rotateFrom(n,r),l=t.point(0,i.y).rotateFrom(n,r),h=t.bounds(o,l);h.extend(s),h.extend(a);const u=h.getSize(),c=(u.x-i.x)/i.x,p=(u.y-i.y)/i.y,f=Math.max(c,p)/2;this.options.padding=f,this._update()}}),t.mapboxGL=function(e){return new t.MapboxGL(e)})}(r,e),r.mapboxGL(t)}};var Tt=class{constructor(){return new r.FeatureGroup}};const Ot=window.mapv||{},Nt=Ot.baiduMapLayer?Ot.baiduMapLayer.__proto__:Function;var At=r.Layer.extend({initialize(t,e,i,n){this.map=t,this.dataset=e||{},this.mapvoption=i,n=n||{},this.render=this.render.bind(this),r.Util.setOptions(this,n),this._canvas=this._createCanvas(),r.stamp(this),this.innerMoveStartEvent=this.moveStartEvent.bind(this),this.innerMoveEndEvent=this.moveEndEvent.bind(this),this.innnerZoomstart=this.zoomStartEvent.bind(this),this.innerViewreset=this.viewresetEvent.bind(this),this.innerResize=this.resizeEvent.bind(this),this.innerRotate=this.rotateEvent.bind(this)},addData(t,e){this.mapvBaseLayer.addData(t,e)},updateData(t,e){this.mapvBaseLayer.updateData(t,e)},initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1},_createCanvas(){const t=document.createElement("canvas");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=this.options.zIndex||100;const e=this.map.getSize();t.width=e.x,t.height=e.y,t.style.width=`${e.x}px`,t.style.height=`${e.y}px`;const i=this.devicePixelRatio;return t.getContext("2d").scale(i,i),"2d"===this.mapvoption.context&&t.getContext("2d").scale(i,i),t},onAdd(t){const e=this.getPane("tilePane"),i=r.DomUtil.create("div","leaflet-layer",e);i.appendChild(this._canvas),this._container=i,this.mapvBaseLayer=new class extends Nt{constructor(t,e,i,n){super(t,e,i),Nt&&(this.map=t,this.dataSet=e,this.options=i,i=i||{},this.init(i),this.argCheck(i),this.initDevicePixelRatio(),this.canvasLayer=n,this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),this.bindEvent())}clickEvent(t){const e=this.map.containerPointToLayerPoint([0,0]),i=(this.devicePixelRatio,t.layerPoint);i.x,e.x,i.y,e.y}mousemoveEvent(t){if(!t)return;const e=this.map.containerPointToLayerPoint([0,0]),i=(this.devicePixelRatio,t.layerPoint);i.x,e.x,i.y,e.y}addAnimatorEvent(){}animatorMovestartEvent(){const t=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=t.stepsRange.start)}animatorMoveendEvent(){this.isEnabledTime()&&this.animator}bindEvent(){const t=this.map;this.options.methods&&(this.options.methods.click&&t.on("click",this.clickEvent),this.options.methods.mousemove&&t.on("mousemove",this.mousemoveEvent))}unbindEvent(){const t=this.map;this.options.methods&&(this.options.methods.click&&t.removeListener("click",this.clickEvent),this.options.methods.mousemove&&t.removeListener("mousemove",this.mousemoveEvent))}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}getContext(){return this.canvasLayer.getCanvas().getContext(this.context)}_canvasUpdate(t){if(!this.canvasLayer||this.canvasLayer.disposeFlag)return;const e=this,i=this.map,n=e.options.animation,o=this.getContext();if(e.isEnabledTime()){if(void 0===t)return void this.clear(o);"2d"===this.context&&(o.save(),o.globalCompositeOperation="destination-out",o.fillStyle="rgba(0, 0, 0, .1)",o.fillRect(0,0,o.canvas.width,o.canvas.height),o.restore())}else this.clear(o);if("2d"===this.context)for(const t in e.options)o[t]=e.options[t];else o.clear(o.COLOR_BUFFER_BIT);if(e.options.minZoom&&i.getZoom()<e.options.minZoom||e.options.maxZoom&&i.getZoom()>e.options.maxZoom)return;const s=i.getBounds().getNorthWest(),a=i.latLngToLayerPoint(s),l={transferCoordinate(t){const n=i.latLngToLayerPoint(new r.LatLng(t[1],t[0]));return"heatmap"===e.options.draw&&(n.x/=e.devicePixelRatio,n.y/=e.devicePixelRatio),[n.x-a.x,n.y-a.y]}};void 0!==t&&(l.filter=function(e){const i=n.trails||10;return t&&e.time>t-i&&e.time<t});const h=e.dataSet.get(l);this.processData(h),"m"===e.options.unit&&e.options.size,e.options._size=e.options.size;const u=i.latLngToLayerPoint(r.latLng(0,0)),c={x:u.x-a.x,y:u.y-a.y};this.drawContext(o,new Ot.DataSet(h),e.options,c),e.options.updateCallback&&e.options.updateCallback instanceof Function&&e.options.updateCallback(t)}init(t){const e=this;e.options=t,this.initDataRange(t),this.context=e.options.context||"2d",e.options.zIndex&&e.canvasLayer&&e.canvasLayer.setZIndex(e.options.zIndex),this.initAnimator()}updateData(t,e){let i=t;i&&i.get&&(i=i.get()),void 0!==i&&this.dataSet.set(i),super.update({options:e})}addData(t,e){let i=t;t&&t.get&&(i=t.get()),this.dataSet.add(i),this.update({options:e})}draw(){this.canvasLayer.draw()}clear(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)}}(t,this.dataset,this.mapvoption,this),this.bindEvent(),this.options.tileLoader&&this._initTileLoader(),this._reset(),this.fire("loaded")},bindEvent(){const t=this.map;t.on("movestart",this.innerMoveStartEvent),t.on("moveend",this.innerMoveEndEvent),t.on("zoomend",this.innerMoveEndEvent),t.on("zoomstart",this.innnerZoomstart),t.on("viewreset",this.innerViewreset),t.on("resize ",this.innerResize),t.on("rotate",this.innerRotate),this.mapvBaseLayer.bindEvent()},unbindEvent(){const t=this.map;t.off("movestart",this.innerMoveStartEvent),t.off("moveend",this.innerMoveEndEvent),t.on("zoomend",this.innerMoveEndEvent),t.off("zoomstart",this.innnerZoomstart),t.off("viewreset",this.innerViewreset),t.off("resize ",this.innerResize),t.off("rotate",this.innerRotate),this.removeAllData(),this.mapvBaseLayer.unbindEvent()},moveStartEvent(){this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()},moveEndEvent(){this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()},zoomStartEvent(){this._unvisiable()},viewresetEvent(){this._reset(),this._visiable()},resizeEvent(){this._reset(),this._visiable()},rotateEvent(){this._reset(),this._visiable()},_animateZoom(){this._animating||(this._animating=!0)},_endZoomAnim(){},getCanvas(){return this._canvas},getAttribution(){return this.options.attribution},draw(){return this._reset()},onRemove(){r.DomUtil.remove(this._container),this.unbindEvent(),this.disposeFlag=!0},setOpacity(t){this._canvas.style.opacity=t},setZIndex(t){this._canvas.style.zIndex=t},bringToFront(){return this},bringToBack(){return this},_reset(){this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render()},_visiable(){this.getCanvas().style.display="block"},_unvisiable(){this.getCanvas().style.display="none"},_render(){this.render()},fixPosition(){const t=this.map.getBounds().getNorthWest(),e=this.map.latLngToLayerPoint(t);t&&r.DomUtil.setPosition(this._canvas,{x:e.x,y:e.y})},resizeCanvas(){let t;t=this.map._rotate?rt(this.map).getSize():this.map.getSize();const e=this.getCanvas();e.width=t.x,e.height=t.y,e.style.width=`${t.x}px`,e.style.height=`${t.y}px`},redraw(t){this.resizeCanvas(),this.fixPosition(),this.render()},show(){this._visiable()},hide(){this._unvisiable()},destroy(){r.DomUtil.remove(this._container),this.unbindEvent(),this.disposeFlag=!0},update(t){void 0!==t&&this.mapvBaseLayer.updateData(t.data,t.options)},removeData(t){this.mapvBaseLayer&&this.mapvBaseLayer.removeData(t)},removeAllData(){},onResize(){},render(){this.mapvBaseLayer._canvasUpdate()}});const Rt=window.echarts;function kt(t,e){this._LeafletMap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e}kt.prototype.dimensions=["lng","lat"],kt.prototype.setMapOffset=function(t){this._mapOffset=t},kt.prototype.getBMap=function(){return this._LeafletMap},kt.prototype.dataToPoint=function(t){null===t[1]&&(t[1]=89.99);const e=new r.latLng(t[1],t[0]),i=this._LeafletMap.latLngToLayerPoint(e),n=this._mapOffset;return[i.x-n[0],i.y-n[1]]},kt.prototype.pointToData=function(t){const e=this._mapOffset,i=this._LeafletMap.layerPointToLatLng([t[0]+e[0],t[1]+e[1]]);return[i.lng,i.lat]},kt.prototype.getViewRect=function(){const t=this._api;return new Rt.graphic.BoundingRect(0,0,t.getWidth(),t.getHeight())},kt.prototype.getRoamTransform=function(){return Rt.matrix.create()},kt.prototype.prepareCustoms=function(){const t=Rt.util,e=this.getViewRect(),i=this;return{coordSys:{type:"leaflet",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:t.bind(this.dataToPoint,this),size:t.bind(function(e,n){return n=n||[0,0],t.map([0,1],function(t){const r=n[t],o=e[t]/2,s=[],a=[];return s[t]=r-o,a[t]=r+o,s[1-t]=n[1-t],a[1-t]=n[1-t],Math.abs(i.dataToPoint(s)[t]-i.dataToPoint(a)[t])},i)},this)}}},kt.dimensions=kt.prototype.dimensions,kt.create=function(t,e){let i;t.eachComponent("leaflet",function(t){const n=Rt.leafletMap;i||(i=new kt(n,e)),i.setMapOffset(t.__mapOffset||[0,0]),t.coordinateSystem=i}),t.eachSeries(function(t){if(!t.get("coordinateSystem")||"leaflet"===t.get("coordinateSystem")){if(!i){const t=Rt.leafletMap;i=new kt(t,e)}t.coordinateSystem=i,t.animation=!0===t.animation}})};var Dt=kt;const zt=window.echarts;var Bt=r.Layer.extend({map:null,chart:null,options:null,echartsInitOpts:null,canvas:null,initialize(t,e){this.map=t,this.options=e,this.echartsInitOpts=e.echartsInitOpts,this.layerId=e.layerId||"echartlayerdefaultid",this.layerClass=e.classId||"echartlayerdefaultclass",this.visible=!0,this.initDevicePixelRatio(),this.initOptions(this.options),this.initEcharts(),this._resizeCanvas()},initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1},initOptions(t){if(t){if(t.leaflet)return;this.options.leaflet={roam:!0}}},initEcharts(){zt.registerCoordinateSystem("leaflet",Dt),zt.extendComponentModel({type:"leaflet",getBMap(){return this.__leaflet},defaultOption:{roam:!1}}),zt.registerAction({type:"LeafletRoma",event:"LeafletRoma",update:"updateLayout"},function(){})},_visible(){this.visible=!0,this.canvas.style.visibility="visible"},_unvisible(){this.visible=!1,this.canvas.style.visibility="hidden"},onAdd(t){const e=this;this.map=t,this.canvas=this._createCanvas(),this.map.getPane("tilePane").appendChild(this.canvas),this.chart=zt.init(this.canvas,null,this.echartsInitOpts),zt.leafletMap=t;const i=this;t.on("resize",function(t){i.resize()}),t.on("zoomstart",function(){i._unvisible()}),t.on("rotate",()=>{i.resize()}),zt.extendComponentView({type:"leaflet",render(t,n,r){let o=!0;i._echartRenderApi||(i._echartRenderApi=r),i._mapModel||(i._mapModel=t);const s=zt.leafletMap,a=r.getZr().painter.getViewportRoot(),l=t.coordinateSystem,h=function(){if(o||!e.visible)return;const i=s.getBounds().getNorthWest(),n=s.latLngToLayerPoint(i),h=[parseInt(n.x,10)||0,parseInt(n.y,10)||0];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,l.setMapOffset(h),t.__mapOffset=h,r.dispatchAction({type:"LeafletRoma"})},u=function(){i._visible(),!o&&e.visible&&r.dispatchAction({type:"LeafletRoma"})};this._oldMoveHandler&&s.off("move",this._oldMoveHandler),this._oldZoomEndHandler&&s.off("zoomend",this._oldZoomEndHandler),s.on("move",h),s.on("zoomend",u),this._oldMoveHandler=h,this._oldZoomEndHandler=u,o=!1}}),this.chart.setOption(this.options)},onRemove(){this.chart.dispose()},_createCanvas(){const t=document.createElement("div");return t.id=this.layerId,t.style.top="0px",t.style.left="0px",t.height=`${this.map.getSize().y}px`,t.width=`${this.map.getSize().x}px`,t.style.height=`${this.map.getSize().y}px`,t.style.width=`${this.map.getSize().x}px`,t.style.zIndex=1e3,t.setAttribute("id",this.layerId),t.setAttribute("class",`leaflet-layer ${this.layerClass}`),this.canvas=t,t},_resizeCanvas(){window.onresize=this.resize.bind(this)},_calcRotateBounds(){return rt(this.map)},show(){this._visible()},hide(){this._unvisible()},resize(){const t=this,e=t._calcRotateBounds().getSize();if(t.canvas.style.width=`${e.x}px`,t.canvas.style.height=`${e.y}px`,t.canvas.width=e.x,t.canvas.height=e.y,t.chart.resize(),t._echartRenderApi&&t._mapModel&&t.map._rotate){const e=t._echartRenderApi,i=t._mapModel,n=e.getZr().painter.getViewportRoot(),r=i.coordinateSystem,o=t.map.getBounds().getNorthWest(),s=t.map.latLngToLayerPoint(o),a=[parseInt(s.x,10)||0,parseInt(s.y,10)||0];n.style.left=`${a[0]}px`,n.style.top=`${a[1]}px`,r.setMapOffset(a),i.__mapOffset=a,e.dispatchAction({type:"LeafletRoma"})}},update(t){this.chart.setOption(t)},remove(){return this.chart.clear(),this.canvas.parentElement&&this.canvas.parentElement.removeChild(this.canvas),this.map=void 0,this},setOpacity(t){this.canvas.style.opacity=t}});var Ft=class extends n.Evented{constructor(t){super();const e=Object(n.defaultValue)(t,{});if(this._id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._view=Object(n.defaultValue)(e.view,null),!this._view)throw new Error("视图不存在!");this._collection=new n.Collection}add(t){this._collection.add(t),t._addView()}remove(t){this._collection.remove(t),t._removeView(),t&&t.destroy&&t.destroy()}findControlById(t){return this._collection.filter(e=>e._id===t)}};class Vt{}Vt.getMouseEvent=function(t,e,i){const r=e._spatialReference;let o=void 0;return{mapPoint:o=r&&!r.isGeographic?n.Projection.project(new n.Point({coordinates:[t.latlng.lng,t.latlng.lat]}),r):new n.Point({coordinates:[t.latlng.lng,t.latlng.lat]}),x:t.containerPoint.x,y:t.containerPoint.y,button:t.originalEvent.button,buttons:t.originalEvent.buttons,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,type:i}},Vt.getKeyEvent=function(t,e,i){const n={key:t.originalEvent.key,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,type:i};return"key-down"===i&&(n.repeat=t.originalEvent.repeat),n},Vt.getViewChangeEvent=function(t,e,i){const n={event:t,target:e,type:i};return n.mapView=e,n.scale=e._scale,n.zoom=e._zoom,n.center=e.center,n.extent=e._extent,n},Vt.getDragEvent=function(t,e,i,n,r){return{x:t.originalEvent.layerX,y:t.originalEvent.layerY,button:void 0!==r?r:t.originalEvent.button,buttons:t.originalEvent.buttons,cancelable:t.originalEvent.cancelable,origin:i,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,action:n,type:"drag"}};var jt=Vt;var Gt=class extends n.LayerView{onAdd(){return this._layerViewVisible=this._getLayerViewVisible(this.layer.visble),tt.addVectorTileLayer(this),Promise.resolve(this)}onRemove(){return tt.removeLayer(this),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);const{innerLayer:e}=this;if(t.updateContent&&e&&e.getMapboxMap){const i=e.getMapboxMap();t.updateContent.forEach(t=>{t&&(i._loaded?this._onUpdate(t,i):i.once("load",()=>{this._onUpdate(t,i)}))})}return Promise.resolve(this)}_onUpdate(t,e){if(e[t.name])return void e[t.name].apply(e,t.params);const{params:i}=t;switch(t.name){case"setPaintProperties":tt.setPaintProperties(e,i[0],i[1]);break;case"setLayoutProperties":tt.setLayoutProperties(e,i[0],i[1]);break;case"setStyleLayer":case"deleteStyleLayer":e.setStyle(this.layer.style);break;case"opacity":tt.setOpacity(this.layer,e,i[0]);break;case"visible":{const t=this._getLayerViewVisible(i[0]);this._layerViewVisible!==t&&(tt.setVisible(this.layer,e,t),this._layerViewVisible=t);break}case"clippingArea":tt.setClippingArea(this,i[0])}}};var Ut=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=X.addWMSLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":this.innerLayer.redraw();break;case"sublayerVisible":this.innerLayer.setParams({layers:this.layer.layers});break;case"index":this.innerLayer.setZIndex(this.layer._realIndex);break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(j.convertClippingArea(t));break}}}return Promise.resolve(this)}};var Ht=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=W.addWMTSLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":this.innerLayer.redraw();break;case"index":this.innerLayer.setZIndex(this.layer._realIndex);break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(j.convertClippingArea(t));break}}}return Promise.resolve(this)}};var qt=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=U.addIGSTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":this.innerLayer.redraw();break;case"index":this.innerLayer.setZIndex(this.layer._realIndex);break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(j.convertClippingArea(t));break}}}return Promise.resolve(this)}};var Zt=class extends n.Evented{constructor(t){super(t),this.view=Object(n.defaultValue)(t.view,null),this.location=Object(n.defaultValue)(t.location,""),this.title=Object(n.defaultValue)(t.title,""),this.content=Object(n.defaultValue)(t.content,""),this.alignment=Object(n.defaultValue)(t.alignment,"bottom-center"),this.defaultButtons=Object(n.defaultValue)(t.defaultButtons,["toggle","close","zoom"]),this._popup=void 0,this._initPopup(),this._initDefaultClass()}_initPopup(){this._customPopup(),this.view._innerView.closePopupOnClick=!1}_customPopup(){r.CustomPopup=r.Popup.extend({_initLayout(){const t="leaflet-popup",e=r.DomUtil.create("div",`${t} ${this.options.className||""} leaflet-zoom-animated`);this._container=e,e.setAttribute("style","margin: 0;");const i=r.DomUtil.create("div",`zondy-popup__container ${t}-content-wrapper`,e);this._wrapper=i,this._contentNode=r.DomUtil.create("div",`${t}-content`,i),this._contentNode.setAttribute("style","margin:0"),r.DomEvent.disableClickPropagation(i).disableScrollPropagation(this._contentNode).on(i,"contextmenu",r.DomEvent.stopPropagation),this._tipContainer=r.DomUtil.create("div","",e),this._tipContainer.setAttribute("style","margin: auto;width: 40px;height: 20px;pointer-events: none;overflow: hidden;pointer-events: none;"),this._tip=r.DomUtil.create("div",`zondy-popup__tip ${t}-tip`,this._tipContainer)}})}_contentUI(t,e){const i=this;let n=void 0;const r=function(t){const e=document.createElement("div");return e.innerHTML=t,e.childNodes};(n=document.createElement("div")).setAttribute("id",`${this.id}-popup-default`);const o=document.createElement("div");o.setAttribute("class","zondy-popup__header"),o.setAttribute("style","display: flex;");const s=r('<div class="zondy-popup__toggle">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M5 13.793l7-7 7 7v1.414l-7-7-7 7z"></path></svg>\n </div>')[0],a=r('<div class="zondy-popup__close">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M3.98 11.303L7.281 8 3.98 4.697l.707-.707L7.99 7.293l.01-.01.01.01 3.304-3.303.707.707L8.718 8l3.303 3.303-.707.707L8.01 8.707l-.01.01-.01-.01-3.304 3.303z"></path></svg>\n </div>')[0];if(t){const e=r('<div class="zondy-popup__title" style="flex: 1;"></div>')[0];if(o.appendChild(e),"object"==typeof t?t instanceof Node?e.appendChild(t):t instanceof NodeList&&t.forEach(t=>{e.appendChild(t)}):e.innerHTML=t,this.defaultButtons.indexOf("toggle")>-1){o.appendChild(s);let t=!0;o.onclick=function(){t=!t,document.getElementById(`${i.id}-popup-default`).querySelector(".zondy-popup__content").style.display=t?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(o.appendChild(a),a.onclick=(()=>{this.close()}))}const l=document.createElement("div");if(l.setAttribute("class","zondy-popup__content"),e)if("object"==typeof e){if(e instanceof Node)l.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)l.appendChild(e[t]),t--}else l.innerHTML=e;const h=document.createElement("div");h.setAttribute("class","zondy-popup__footer");const u=r('<div class="zondy-popup__zoom" style="display: inline-block;width: 36px;height: 36px;line-height: 36px;text-align: center;">\n <svg class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M9 7H7v2H6V7H4V6h2V4h1v2h2zm6.805 7.861l-.943.942a.665.665 0 0 1-.943 0l-3.067-3.067a.667.667 0 0 1 0-.943l.129-.13-1.108-1.107A5.279 5.279 0 1 1 11.8 6.5a5.251 5.251 0 0 1-1.237 3.366l1.108 1.108.124-.124a.668.668 0 0 1 .943 0l3.067 3.068a.666.666 0 0 1 0 .943zM10.8 6.5a4.3 4.3 0 1 0-4.3 4.3 4.304 4.304 0 0 0 4.3-4.3zm4.062 7.89l-2.595-2.598-.473.473 2.597 2.595z"></path></svg>\n </div>')[0];return this.defaultButtons.indexOf("zoom")>-1&&(h.appendChild(u),u.onclick=function(){i.view.flyTo({zoom:i.view._zoom+1,center:i.location})}),h.childNodes.length>0&&h.setAttribute("class","zondy-popup__footer zondy-popup__footer-division"),n.appendChild(o),n.appendChild(l),n.appendChild(h),n}_initDefaultClass(){let t=!1;const e=document.head.getElementsByTagName("style");if(e)for(let i=0;i<e.length;i++)if(e[i].innerHTML.indexOf("styleDomString")>-1){t=!0;break}if(!t){const t=document.createElement("style");t.innerHTML="\n .zondy-popup__container{background-color: #fff;padding:0;border-radius: 10px;}\n .zondy-popup__tip{\n background-color: #fff;\n }\n .zondy-popup__header{\n padding: 8px;\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n }\n .zondy-popup__content{\n padding: 8px;\n }\n .zondy-popup__footer{\n }\n .zondy-popup__footer-division{\n border-top: 1px solid;\n }\n .zondy-popup__toggle,.zondy-popup__close{\n display: inline-block;width: 30px;text-align: center;\n }\n ",document.querySelector("head").append(t)}}open(t){this._popup?(this.close(),this._popup=void 0,this.openPopup(t)):this.openPopup(t)}openPopup(t){if(this.view=t.view?t.view:this.view,this.location=t.location?t.location:this.location,this.location.spatialReference.isGeographic?this._location=this.location:this._location=n.Projection.project(this.location,new n.SpatialReference({wkid:4326})),this.title=t.title?t.title:this.title,this.content=t.content?t.content:this.content,this.alignment=t.alignment?t.alignment:this.alignment,!this.view._innerView)return void n.Log.info("没有视图引擎!");const e=r.latLng(this._location.coordinates[1],this._location.coordinates[0]),i=this._contentUI(this.title,this.content);this._popup=new r.CustomPopup({className:"layerPopup",maxWidth:1900,minWidth:50,closeOnClick:!1,autoPan:!1}).setLatLng(e).setContent(i).openOn(this.view._innerView);const o=this._getOffset();this._popup=new r.CustomPopup({className:"layerPopup",maxWidth:1900,minWidth:50,closeOnClick:!1,offset:o,autoPan:!1}).setLatLng(e).setContent(i).openOn(this.view._innerView)}_getOffset(){let t=null;if(this._popup&&this._popup._container&&this.alignment){const e=this._popup._container.getBoundingClientRect(),i=this._getOffsetByAlignment(this.alignment,e.width,e.height);t=new r.Point(i.x,i.y)}return t}_getOffsetByAlignment(t,e,i){let n=0,r=0;switch(t){case"top-left":n=e/2,r=i;break;case"top-center":r=i;break;case"top-right":n=-e/2,r=i;break;case"bottom-left":n=e/2;break;case"auto":case"bottom-center":break;case"bottom-right":n=-e/2}return{x:n,y:r}}close(){this.view._innerView&&this.view._innerView.closePopup(this._popup)}destroy(){}},Xt=i(5),Yt=i(6);var Wt=function(t){t.Control.EasyPrint=t.Control.extend({options:{title:"Print map",position:"topleft",sizeModes:["Current"],filename:"map",exportOnly:!1,hidden:!1,tileWait:500,hideControlContainer:!0,hideClasses:[],customWindowTitle:window.document.title,spinnerBgCOlor:"#0DC5C1",customSpinnerClass:"epLoader",defaultSizeTitles:{Current:"Current Size",A4Landscape:"A4 Landscape",A4Portrait:"A4 Portrait"}},onAdd:function(){this.mapContainer=this._map.getContainer(),this.options.sizeModes=this.options.sizeModes.map(function(t){return"Current"===t?{name:this.options.defaultSizeTitles.Current,className:"CurrentSize"}:"A4Landscape"===t?{height:this._a4PageSize.height,width:this._a4PageSize.width,name:this.options.defaultSizeTitles.A4Landscape,className:"A4Landscape page"}:"A4Portrait"===t?{height:this._a4PageSize.width,width:this._a4PageSize.height,name:this.options.defaultSizeTitles.A4Portrait,className:"A4Portrait page"}:t},this);var e=t.DomUtil.create("div","leaflet-control-easyPrint leaflet-bar leaflet-control");if(!this.options.hidden){this._addCss(),t.DomEvent.addListener(e,"mouseover",this._togglePageSizeButtons,this),t.DomEvent.addListener(e,"mouseout",this._togglePageSizeButtons,this);var i="leaflet-control-easyPrint-button";this.options.exportOnly&&(i+="-export"),this.link=t.DomUtil.create("a",i,e),this.link.id="leafletEasyPrint",this.link.title=this.options.title,this.holder=t.DomUtil.create("ul","easyPrintHolder",e),this.options.sizeModes.forEach(function(e){var i=t.DomUtil.create("li","easyPrintSizeMode",this.holder);i.title=e.name,t.DomUtil.create("a",e.className,i),t.DomEvent.addListener(i,"click",this.printMap,this)},this),t.DomEvent.disableClickPropagation(e)}return e},printMap:async function(t,e){e&&(this.options.filename=e),this.options.format?("jpeg"==this.options.format.toLowerCase()?this.formatFun="toJpeg":"svg"==this.options.format.toLowerCase()?this.formatFun="toSvg":this.formatFun="toPng",this.format=this.options.format):(this.formatFun="toPng",this.format="png"),this.options.width=this.options.width?this.options.width:this.mapContainer.clientWidth,this.options.height=this.options.height?this.options.height:this.mapContainer.clientHeight,this.options.exportOnly||(this._page=window.open("","_blank","toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10, top=10, width=200, height=250, visible=none"),this._page.document.write(this._createSpinner(this.options.customWindowTitle,this.options.customSpinnerClass,this.options.spinnerBgCOlor))),this.originalState={mapWidth:this.mapContainer.style.width,widthWasAuto:!1,widthWasPercentage:!1,mapHeight:this.mapContainer.style.height,zoom:this._map.getZoom(),center:this._map.getCenter()},"auto"===this.originalState.mapWidth?(this.originalState.mapWidth=this._map.getSize().x+"px",this.originalState.widthWasAuto=!0):this.originalState.mapWidth.includes("%")&&(this.originalState.percentageWidth=this.originalState.mapWidth,this.originalState.widthWasPercentage=!0,this.originalState.mapWidth=this._map.getSize().x+"px"),this._map.fire("easyPrint-start",{event:t}),this.options.hidden||this._togglePageSizeButtons({type:null}),this.options.hideControlContainer&&this._toggleControls(),this.options.hideClasses&&this._toggleClasses(this.options.hideClasses);var i="string"!=typeof t?t.target.className:t;if("CurrentSize"===i)return await this._printOpertion(i);this.outerContainer=this._createOuterContainer(this.mapContainer),this.originalState.widthWasAuto&&(this.outerContainer.style.width=this.originalState.mapWidth),this._createImagePlaceholder(i)},_createImagePlaceholder:function(t){var e=this;Xt.toPng(this.mapContainer,{width:parseInt(this.originalState.mapWidth.replace("px")),height:parseInt(this.originalState.mapHeight.replace("px"))}).then(function(i){e.blankDiv=document.createElement("div");var n=e.blankDiv;e.outerContainer.parentElement.insertBefore(n,e.outerContainer),n.className="epHolder",n.style.backgroundImage='url("'+i+'")',n.style.position="absolute",n.style.zIndex=1011,n.style.display="initial",n.style.width=e.originalState.mapWidth,n.style.height=e.originalState.mapHeight,e._resizeAndPrintMap(t)}).catch(function(t){console.error("oops, something went wrong!",t)})},_resizeAndPrintMap:function(t){this.outerContainer.style.opacity=0;var e=this.options.sizeModes.filter(function(e){return e.className.indexOf(t)>-1});e=e[0],this.mapContainer.style.width=e.width+"px",this.mapContainer.style.height=e.height+"px",this.mapContainer.style.width>this.mapContainer.style.height?this.orientation="portrait":this.orientation="landscape",this._map.setView(this.originalState.center),this._map.setZoom(this.originalState.zoom),this._map.invalidateSize(),this.options.tileLayer?this._pausePrint(t):this._printOpertion(t)},_pausePrint:function(t){var e=this,i=setInterval(function(){e.options.tileLayer.isLoading()||(clearInterval(i),e._printOpertion(t))},e.options.tileWait)},_getValidDom:function(t){for(var e=t,i=e.getElementsByClassName("leaflet-tile"),n=0;n<i.length;n++){var r=i[n];!r.classList.contains("leaflet-tile-loaded")&&r.parentElement.classList.contains("leaflet-tile-container")&&(r.remove(),n--)}return t.parentNode.appendChild(e),e},_printOpertion:function(t){var e=this,i=this.mapContainer.style.width,n=this.options.isDownload;return(this.originalState.widthWasAuto&&"CurrentSize"===t||this.originalState.widthWasPercentage&&"CurrentSize"===t)&&(i=this.originalState.mapWidth),new Promise(t=>{Xt[this.formatFun](e._getValidDom(e.mapContainer),{width:parseInt(i),height:parseInt(e.mapContainer.style.height.replace("px"))}).then(function(i){var r=e._dataURItoBlob(i);e.options.exportOnly?n&&Yt.saveAs(r,e.options.filename+"."+e.format):e._sendToBrowserPrint(i,e.orientation),e._toggleControls(!0),e._toggleClasses(e.options.hideClasses,!0),e.outerContainer&&(e.originalState.widthWasAuto?e.mapContainer.style.width="auto":e.originalState.widthWasPercentage?e.mapContainer.style.width=e.originalState.percentageWidth:e.mapContainer.style.width=e.originalState.mapWidth,e.mapContainer.style.height=e.originalState.mapHeight,e._removeOuterContainer(e.mapContainer,e.outerContainer,e.blankDiv),e._map.invalidateSize(),e._map.setView(e.originalState.center),e._map.setZoom(e.originalState.zoom)),e._map.fire("easyPrint-finished"),t({dataUrl:i})}).catch(function(t){console.error("Print operation failed",t)})})},_sendToBrowserPrint:function(t,e){this._page.resizeTo(600,800);var i=this._createNewWindow(t,e,this);this._page.document.body.innerHTML="",this._page.document.write(i),this._page.document.close()},_createSpinner:function(t,e,i){return"<html><head><title>"+t+"</title></head><body><style>\n body{\n background: "+i+";\n }\n .epLoader,\n .epLoader:before,\n .epLoader:after {\n border-radius: 50%;\n }\n .epLoader {\n color: #ffffff;\n font-size: 11px;\n text-indent: -99999em;\n margin: 55px auto;\n position: relative;\n width: 10em;\n height: 10em;\n box-shadow: inset 0 0 0 1em;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n }\n .epLoader:before,\n .epLoader:after {\n position: absolute;\n content: '';\n }\n .epLoader:before {\n width: 5.2em;\n height: 10.2em;\n background: #0dc5c1;\n border-radius: 10.2em 0 0 10.2em;\n top: -0.1em;\n left: -0.1em;\n -webkit-transform-origin: 5.2em 5.1em;\n transform-origin: 5.2em 5.1em;\n -webkit-animation: load2 2s infinite ease 1.5s;\n animation: load2 2s infinite ease 1.5s;\n }\n .epLoader:after {\n width: 5.2em;\n height: 10.2em;\n background: #0dc5c1;\n border-radius: 0 10.2em 10.2em 0;\n top: -0.1em;\n left: 5.1em;\n -webkit-transform-origin: 0px 5.1em;\n transform-origin: 0px 5.1em;\n -webkit-animation: load2 2s infinite ease;\n animation: load2 2s infinite ease;\n }\n @-webkit-keyframes load2 {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n @keyframes load2 {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n </style>\n <div class=\""+e+'">Loading...</div></body></html>'},_createNewWindow:function(t,e,i){return"<html><head>\n <style>@media print {\n img { max-width: 98%!important; max-height: 98%!important; }\n @page { size: "+e+";}}\n </style>\n <script>function step1(){\n setTimeout('step2()', 10);}\n function step2(){window.print();window.close()}\n <\/script></head><body onload='step1()'>\n <img src=\""+t+'" style="display:block; margin:auto;"></body></html>'},_createOuterContainer:function(t){var e=document.createElement("div");return t.parentNode.insertBefore(e,t),t.parentNode.removeChild(t),e.appendChild(t),e.style.width=t.style.width,e.style.height=t.style.height,e.style.display="inline-block",e.style.overflow="hidden",e},_removeOuterContainer:function(t,e,i){e.parentNode&&(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(i),e.parentNode.removeChild(e))},_addCss:function(){var t=document.createElement("style");t.type="text/css",t.innerHTML=".leaflet-control-easyPrint-button { \n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMiA1MTI7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8cGF0aCBkPSJNMTI4LDMyaDI1NnY2NEgxMjhWMzJ6IE00ODAsMTI4SDMyYy0xNy42LDAtMzIsMTQuNC0zMiwzMnYxNjBjMCwxNy42LDE0LjM5OCwzMiwzMiwzMmg5NnYxMjhoMjU2VjM1Mmg5NiAgIGMxNy42LDAsMzItMTQuNCwzMi0zMlYxNjBDNTEyLDE0Mi40LDQ5Ny42LDEyOCw0ODAsMTI4eiBNMzUyLDQ0OEgxNjBWMjg4aDE5MlY0NDh6IE00ODcuMTk5LDE3NmMwLDEyLjgxMy0xMC4zODcsMjMuMi0yMy4xOTcsMjMuMiAgIGMtMTIuODEyLDAtMjMuMjAxLTEwLjM4Ny0yMy4yMDEtMjMuMnMxMC4zODktMjMuMiwyMy4xOTktMjMuMkM0NzYuODE0LDE1Mi44LDQ4Ny4xOTksMTYzLjE4Nyw0ODcuMTk5LDE3NnoiIGZpbGw9IiMwMDAwMDAiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);\n background-size: 16px 16px; \n cursor: pointer; \n }\n .leaflet-control-easyPrint-button-export { \n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDQzMy41IDQzMy41IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0MzMuNSA0MzMuNTsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxnIGlkPSJmaWxlLWRvd25sb2FkIj4KCQk8cGF0aCBkPSJNMzk1LjI1LDE1M2gtMTAyVjBoLTE1M3YxNTNoLTEwMmwxNzguNSwxNzguNUwzOTUuMjUsMTUzeiBNMzguMjUsMzgyLjV2NTFoMzU3di01MUgzOC4yNXoiIGZpbGw9IiMwMDAwMDAiLz4KCTwvZz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);\n background-size: 16px 16px; \n cursor: pointer; \n }\n .easyPrintHolder a {\n background-size: 16px 16px;\n cursor: pointer;\n }\n .easyPrintHolder .CurrentSize{\n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTZweCIgdmVyc2lvbj0iMS4xIiBoZWlnaHQ9IjE2cHgiIHZpZXdCb3g9IjAgMCA2NCA2NCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNjQgNjQiPgogIDxnPgogICAgPGcgZmlsbD0iIzFEMUQxQiI+CiAgICAgIDxwYXRoIGQ9Ik0yNS4yNTUsMzUuOTA1TDQuMDE2LDU3LjE0NVY0Ni41OWMwLTEuMTA4LTAuODk3LTIuMDA4LTIuMDA4LTIuMDA4QzAuODk4LDQ0LjU4MiwwLDQ1LjQ4MSwwLDQ2LjU5djE1LjQwMiAgICBjMCwwLjI2MSwwLjA1MywwLjUyMSwwLjE1NSwwLjc2N2MwLjIwMywwLjQ5MiwwLjU5NCwwLjg4MiwxLjA4NiwxLjA4N0MxLjQ4Niw2My45NDcsMS43NDcsNjQsMi4wMDgsNjRoMTUuNDAzICAgIGMxLjEwOSwwLDIuMDA4LTAuODk4LDIuMDA4LTIuMDA4cy0wLjg5OC0yLjAwOC0yLjAwOC0yLjAwOEg2Ljg1NWwyMS4yMzgtMjEuMjRjMC43ODQtMC43ODQsMC43ODQtMi4wNTUsMC0yLjgzOSAgICBTMjYuMDM5LDM1LjEyMSwyNS4yNTUsMzUuOTA1eiIgZmlsbD0iIzAwMDAwMCIvPgogICAgICA8cGF0aCBkPSJtNjMuODQ1LDEuMjQxYy0wLjIwMy0wLjQ5MS0wLjU5NC0wLjg4Mi0xLjA4Ni0xLjA4Ny0wLjI0NS0wLjEwMS0wLjUwNi0wLjE1NC0wLjc2Ny0wLjE1NGgtMTUuNDAzYy0xLjEwOSwwLTIuMDA4LDAuODk4LTIuMDA4LDIuMDA4czAuODk4LDIuMDA4IDIuMDA4LDIuMDA4aDEwLjU1NmwtMjEuMjM4LDIxLjI0Yy0wLjc4NCwwLjc4NC0wLjc4NCwyLjA1NSAwLDIuODM5IDAuMzkyLDAuMzkyIDAuOTA2LDAuNTg5IDEuNDIsMC41ODlzMS4wMjctMC4xOTcgMS40MTktMC41ODlsMjEuMjM4LTIxLjI0djEwLjU1NWMwLDEuMTA4IDAuODk3LDIuMDA4IDIuMDA4LDIuMDA4IDEuMTA5LDAgMi4wMDgtMC44OTkgMi4wMDgtMi4wMDh2LTE1LjQwMmMwLTAuMjYxLTAuMDUzLTAuNTIyLTAuMTU1LTAuNzY3eiIgZmlsbD0iIzAwMDAwMCIvPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==)\n }\n .easyPrintHolder .page {\n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTguMS4xLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDQ0NC44MzMgNDQ0LjgzMyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDQ0LjgzMyA0NDQuODMzOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4Ij4KPGc+Cgk8Zz4KCQk8cGF0aCBkPSJNNTUuMjUsNDQ0LjgzM2gzMzQuMzMzYzkuMzUsMCwxNy03LjY1LDE3LTE3VjEzOS4xMTdjMC00LjgxNy0xLjk4My05LjM1LTUuMzgzLTEyLjQ2N0wyNjkuNzMzLDQuNTMzICAgIEMyNjYuNjE3LDEuNywyNjIuMzY3LDAsMjU4LjExNywwSDU1LjI1Yy05LjM1LDAtMTcsNy42NS0xNywxN3Y0MTAuODMzQzM4LjI1LDQzNy4xODMsNDUuOSw0NDQuODMzLDU1LjI1LDQ0NC44MzN6ICAgICBNMzcyLjU4MywxNDYuNDgzdjAuODVIMjU2LjQxN3YtMTA4LjhMMzcyLjU4MywxNDYuNDgzeiBNNzIuMjUsMzRoMTUwLjE2N3YxMzAuMzMzYzAsOS4zNSw3LjY1LDE3LDE3LDE3aDEzMy4xNjd2MjI5LjVINzIuMjVWMzR6ICAgICIgZmlsbD0iIzAwMDAwMCIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=);\n }\n .easyPrintHolder .A4Landscape { \n transform: rotate(-90deg);\n }\n \n .leaflet-control-easyPrint-button{\n display: inline-block;\n }\n .easyPrintHolder{\n margin-top:-31px;\n margin-bottom: -5px;\n margin-left: 30px;\n padding-left: 0px;\n display: none;\n }\n \n .easyPrintSizeMode {\n display: inline-block;\n }\n .easyPrintHolder .easyPrintSizeMode a {\n border-radius: 0px;\n }\n \n .easyPrintHolder .easyPrintSizeMode:last-child a{\n border-top-right-radius: 2px;\n border-bottom-right-radius: 2px;\n margin-left: -1px;\n }\n \n .easyPrintPortrait:hover, .easyPrintLandscape:hover{\n background-color: #757570;\n cursor: pointer;\n }",document.body.appendChild(t)},_dataURItoBlob:function(t){for(var e=atob(t.split(",")[1]),i=t.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(e.length),r=new DataView(n),o=0;o<e.length;o++)r.setUint8(o,e.charCodeAt(o));return new Blob([n],{type:i})},_togglePageSizeButtons:function(t){var e=this.holder.style,i=this.link.style;"mouseover"===t.type?(e.display="block",i.borderTopRightRadius="0",i.borderBottomRightRadius="0"):(e.display="none",i.borderTopRightRadius="2px",i.borderBottomRightRadius="2px")},_toggleControls:function(t){var e=document.getElementsByClassName("leaflet-control-container")[0];if(t)return e.style.display="block";e.style.display="none"},_toggleClasses:function(t,e){t.forEach(function(t){var i=document.getElementsByClassName(t)[0];if(e)return i.style.display="block";i.style.display="none"})},_a4PageSize:{height:715,width:1045}}),t.EasyPrint=function(e){return new t.Control.EasyPrint(e)}};var $t=class{constructor(t){t=Object(n.defaultValue)(t,{}),this.view=Object(n.defaultValue)(t.view,null),this.format=Object(n.defaultValue)(t.format,n.PictureFormat.png),this.filename=Object(n.defaultValue)(t.filename,"screenshotFile"),this.width=Object(n.defaultValue)(t.width,void 0),this.height=Object(n.defaultValue)(t.height,void 0),this.x=Object(n.defaultValue)(t.x,0),this.y=Object(n.defaultValue)(t.y,0),this.isDownload=Object(n.defaultValue)(t.isDownload,!0),this._print=void 0,this._initEasyPrint()}_initEasyPrint(){Wt(r)}_addView(){const t=this.view._innerView;if(t){const e={format:this.format,sizeModes:["Current","A4Landscape","A4Portrait"],filename:"新地图",exportOnly:!0,hidden:!0,hideControlContainer:!0};return this._print=r.EasyPrint(e).addTo(t),new Promise(t=>{this._print.printMap("CurrentSize",this.filename).then(e=>{this._cutImage(e.dataUrl).then(e=>{t({dataUrl:e.dataUrl})})})})}}_cutImage(t){const e=this,i=document.createElement("canvas");i.width=this.width,i.height=this.height;const r=i.getContext("2d"),o=function(t,e){const i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click()};return new Promise(s=>{if(this.width&&this.height){const a=new Image;a.src=t,a.onload=function(){r.drawImage(a,e.x,e.y,e.width,e.height,0,0,e.width,e.height);let t=null;e.format===n.PictureFormat.png?t=i.toDataURL():e.format===n.PictureFormat.jpeg?t=i.toDataURL("image/jpeg"):"svg"===e.format&&(t=i.toDataURL()),e.isDownload&&o(t,e.filename),s({dataUrl:t})}}else e.isDownload&&o(t,this.filename),s({dataUrl:t})})}_removeView(){super._removeView();const t=this.view._innerView;t&&this._print&&(t.removeControl(this._print),this._print=null)}};var Kt=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=q.addIGSMapImageLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"sublayerVisible":case"refresh":this._refresh();break;case"index":this.innerLayer.setZIndex(this.layer._realIndex);break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(j.convertClippingArea(t));break}}}return Promise.resolve(this)}_refresh(){const{innerLayer:t}=this;q.updateIGSMapImageLayer(this),t.refresh()}};class Qt extends n.BaseGraphicsLayerView{onAdd(t){const e=this.layer,i=this.innerView,n=e.graphics||[],o=this;o.innerLayer=r.featureGroup().addTo(i),o.innerLayer.commonLayerId=e.id;const s=o._getLayerViewVisible();return j.setVisibleOpacity(o.innerLayer,e._opacity,s),n.forEach(t=>{o._addFeature(o.innerLayer,t)}),Promise.resolve(this)}onRemove(t){return this.innerView.removeLayer(this.innerLayer),this.innerLayer=null,Promise.resolve(this)}onUpdate(t){const e=this.layer,i=this.innerLayer;return t.updateContent&&i&&t.updateContent.forEach(t=>{if(t&&"property"===t.operationType)switch(t.name){case"opacity":j.setVisibleOpacity(this.innerLayer,e._opacity,e._visible);break;case"visible":{const i=t.params&&t.params.length>0?t.params[0]:void 0,n=this._getLayerViewVisible(i);j.setVisibleOpacity(this.innerLayer,e._opacity,n);break}}if(t&&"method"===t.operationType)switch(t.name){case"add":{const e=t.params;this._addFeature(i,e[0]),this._updateGraphicsInOrder();break}case"remove":{const e=t.params;this._removeFeature(i,e[0]);break}case"addMany":{let e=t.params[0];e instanceof n.FeatureSet&&(e=e.features),e.forEach(t=>{this._addFeature(i,t)}),this._updateGraphicsInOrder();break}case"removeMany":t.params[0].forEach(t=>{this._removeFeature(i,t)});break;case"removeAll":i.clearLayers()}}),Promise.resolve(this)}_addFeature(t,e){e.geometry&&!e.geometry.spatialReference&&(e.geometry.spatialReference=this.layer.spatialReference),this.render.drawFeature(t,[e])}_removeFeature(t,e){this.render.clearFeature(t,[e])}_updateGraphicsInOrder(){const t=this.view.allLayerViews.toArray(),e=t.findIndex(t=>t.id===this.id);if(e>-1){const i=t.slice(e+1).find(t=>t instanceof Qt);i&&i!==this&&this._insertBeforeLayerView(i)}}_insertBeforeLayerView(t){const e=[];j.getLeafletGroupLayers(this.innerLayer,e,t=>t instanceof r.Path);const i=[];if(j.getLeafletGroupLayers(t.innerLayer,i,t=>t instanceof r.Path),0===i.length||0===e.length)return;const n=i[0];e.forEach(t=>{j.insertBefore(t._path,n._path)})}}var Jt=Qt;class te{}te.addEchartsLayer=function(t){const{layer:e,innerView:i}=t,{extendOptions:n={}}=e,r=Object.assign(e.echartsOptions,n),o=new Bt(i,r).addTo(i);return o.id=e.id,o},te.removeLayer=function(t){t.remove()};var ee=te;var ie=class extends n.LayerView{onAdd(t){const e=this.layer;return this.innerLayer=ee.addEchartsLayer(this),this.innerLayer.commonLayerId=e.commonLayerId,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide(),Promise.resolve(this)}onRemove(t){return ee.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0;this._getLayerViewVisible(t)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};class ne{}ne.addMapVLayer=function(t){const{layer:e,innerView:i}=t,{extendOptions:n={}}=e,r=Object.assign(e.mapVOptions,n);return new At(i,e.data,r).addTo(i).id=e.id,At},ne.removeLayer=function(t){t.remove()};var re=ne;var oe=class extends n.LayerView{onAdd(t){const e=this.layer;return this.innerLayer=re.addMapVLayer(this),this.innerLayer.commonLayerId=e.id,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide(),Promise.resolve(this)}onRemove(t){return re.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0;this._getLayerViewVisible(t)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};const se=r.Icon.extend({options:{iconUrl:null,iconRetinaUrl:null,shadowUrl:null,iconSize:[0,0],iconAnchor:[0,0],popupAnchor:[0,0],shadowSize:[0,0],className:"",prefix:"",glyph:"text",glyphColor:"white",lineHeight:1,horizontalAlignment:"center",verticalAlignment:"middle",font:{family:"微软雅黑",size:9,style:"normal",weight:"normal"},haloSize:0,haloColor:"#000000",angle:0,rotated:!1,backgroundColor:void 0,borderLineColor:"#ff0000",borderLineSize:0,lineWidth:192,kerning:!1,calcWidth:1},createIcon(){const t=document.createElement("div"),e=this.options;return e.glyph&&(this._textGlyph=this._createGlyph(),t.appendChild(this._textGlyph)),this._setIconStyles(t,e.className),t},_createGlyph(){let t,e;const i=this.options;i.prefix?t="fab"===i.prefix||"fal"===i.prefix||"far"===i.prefix||"fas"===i.prefix?`fa-${i.glyph}`:i.glyph.slice(0,i.prefix.length+1)===`${i.prefix}-`?i.glyph:`${i.prefix}-${i.glyph}`:(t="",e=i.glyph);const n=r.DomUtil.create("div");n.style.width="100%",n.style.height="100%",n.style.boxSizing="content-box",i.backgroundColor&&(n.style.backgroundColor=i.backgroundColor),i.borderLineColor&&i.borderLineSize&&(n.style.border=`${i.borderLineSize}px solid ${i.borderLineColor}`),i.rotated&&n.style.setProperty("transform",`rotate(${i.angle}deg)`);const o=r.DomUtil.create("span",`${i.prefix} ${t}`),s=0!==i.haloSize?r.DomUtil.create("span",`${i.prefix} ${t}`):void 0;return[s,o].forEach(t=>{if(t){const{size:n,weight:r,style:o,family:s,decoration:a}=i.font;t.style.fontSize=`${n}px`,t.style.fontWeight=r,t.style.fontStyle=o,t.style.fontFamily=s,t.style.color=i.glyphColor,t.style.lineHeight=i.lineHeight,t.style.textAlign=i.horizontalAlignment,t.style.verticalAlign=i.verticalAlignment,t.style.pointerEvents="none",t.style.display="inline-block",t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.textDecoration=a,i.kerning&&(t.style.transformOrigin="left",t.style.transform=`scale(${i.iconSize[0]/i.calcWidth},1)`),e&&(t.innerHTML=e)}}),s&&(s.style.setProperty("-webkit-text-stroke",`${i.haloSize}px ${i.haloColor}`),s.style.color="transparent",n.appendChild(s)),n.appendChild(o),n},_setIconStyles(t,e){if("shadow"===e)return r.Icon.prototype._setIconStyles.call(this,t,e);const i=this.options,n=r.point(i.iconSize);let o=r.point(i.iconAnchor);!o&&n&&(o=n.divideBy(2,!0)),t.className=`leaflet-marker-icon leaflet-glyph-icon ${e}`;const s=this._getIconUrl("icon");s&&(t.style.backgroundImage=`url('${s}')`),i.bgPos&&(t.style.backgroundPosition=`${-i.bgPos.x}px ${-i.bgPos.y}px`),i.bgSize&&(t.style.backgroundSize=`${i.bgSize.x}px ${i.bgSize.y}px`),o&&(t.style.marginLeft=`${-o.x}px`,t.style.marginTop=`${-o.y}px`),n&&(t.style.width=`${n.x}px`,t.style.height=`${n.y}px`)}});se.prototype.options.iconUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAUlSURBVFjDrZdLiBxVFIb/e289uqt6kkx6zIiIoKgLRReKuMhCcaOIAUEIiCCE4CIPggZ8kBjooPgM0TiYEUUjqBGchZqAQlyYRTA+kJiJQiJGMjN5zYzT3dP1rrr3HBeTjDGTSfc8Dvyruud89Z9z6kIJdBj31763MivsJXKuZYF6dak5++2mh7NOcsXVHq6sHbhOK/24kOJJMO4AE1vKygwZhxlKSHGKiD+RSu09vOXB43OCrHz96y6T2lsh+OmKXzFdlbLne2UopSAupBhjECcZgjDMgiiSxPhcK/nCr1sfOtcWcm/tq9uEsL4rl0vdK67pKVu2jUwTMk0wBBAzpBCQAnAtiZIlwWQwPlHPglZQAFj1Y23VwVkh92zbd59U+Kanp+p2L12mooKQ5AbcpuclS6LiKoRhxOfHzhXMcs3PtVV7Z0DufXH/LSzpSG9vr1/p6kIz0dDUrvx/IYXAsrJCkWc4e/Z0Zpgf+KX26A/TkNtrXziesY9Xq8tvWNZdVfVYg7hzwKVv3O3ZiKMWj46OTrq5fdOh1x5pSADwjdzo2nbv0u6qqkca2jCIMGcZAuqRhu8vEX7ZK2V2WgMAcXdtvyeKbPS662+osCohzMycHVweniNREoShoZO5KYobpciSh23bFq7rIUgNiLFghRkBlg2v7GlpiccsCHrcryzxUk3zmsNskeYGvt/lxVH4hMWEu9xSWaQFYQ7L1B6iGZ5bBoy+zWKiHiltFHpqeIsVhWaosg1iqlgg4wAAEYEXsV3EmNppJmExMFYUxfVSuIs6E0sI5FkBBhLJzH9laQxLSjBj0WQJgSJPweDTkknvS4JGbCuxKOt7UY4lEQfNnAu9TzLxN2nUdAQTLAEw8YIlAVgAkmDCSBL75eCutSeY+GTUqqNkqUVxUbIl4qgJo4vWzecrhyQAMJldYf1MXLLl1EIsYBZgoGwpRI2zMTPtGBhYbSQAlJF9lieRzNMIriVBzPOWawvoIkYaNC0u9IcAIAHgp75NLQl8ENbPZJ6jgAU48RyFqHEuZyE+Pda/vjENAQBD5s209Y+kPJlyM4+r3lUS0AWSyVEhpHnjYu1pyO+7N4ywwPvhxHDiuwo8j1b5rkQwMZIziYHBXetPzIAAgIV8exZOSMoieI6aU5vKtgR0jqw1JtiYbZfW/R/kSN+mcWbxdtwYjn1XTd9B7cQAfNdCWB/OhBR7jvWv/3tWCAAoO3ktjyZZJ0HHbsq2AooERVQXzPKly2vOgPz29jNNBr+e1IcSz5YAM4hmFzPDtyWS+lDK4N2DfU+dbgsBAFHyd+oszE3agt/GjWcrUBEjj5sQBb96pXpXhAzueDJi4u1p41TsuQpCiFln4bkKeXMoJeadg++tG+sYAgBBXOo3RRrruAnfkWDmGfIdCeQhiiQgQbxjtlqzQk59vCZlNluL5lDiORLyMjcA4DsKeXM4AfDKxa97ThAAqPaMfaR1Nq6jOiqOAhOm5TsKJg1QZGGRedY7V6tzVcjBWk1D0JZ8cigt2RJSimkXnqOgW8MxQLUTb6wN5g0BgGPV0c9BekTH41xx5YXrQ8FkTRgdpxU7ea9djbYQ1GokmJ43wUhWtgRcS04tQjAcw9CWw29tThYOAXD03XVfMps/TTTOy30blDZgiqxFK6p7OsnvCDJ1UD9LyUjORoPDkUQyPfdHbXW+qJCjfRsOwOAoNY4z6Xz01rHq3k5zO4ZMHTabYSIhJD87MLB64f8Ys8WdG/tfBljMJedfwY+s/2P4Pv8AAAAASUVORK5CYII=";var ae=se;function le(t,e){if(!t)return e;e.stroke=!0,e.color=n.Color.fromColor(t.color).toCssRGBAString(),e.weight=Object(n.defaultValue)(t.width,3),e.lineJoin=Object(n.defaultValue)(t.join,"round"),e.lineCap=Object(n.defaultValue)(t.cap,"round");let i=j.convertLineDash(t.style,"butt"===t.cap);i&&Array.isArray(i)&&(i=i.map(e=>t.width*e)),e.dashArray=i,e.marker=t.marker,e.noClip=!0}function he(t,e){if(!t)return e;"solid"!==t.style?e.fill=`url(${Object(n.createSimpleFillSymbolCanvas)(t,{lineWidth:1}).toDataURL()})`:e.fill=!0,e.fillColor=n.Color.fromColor(t.color).toCssRGBAString();const i={};le(t.outline,i);for(const t in i)e[t]=i[t]}var ue=class{static convertSymboltoLeafletStyle(t){const e={};if(!t)return e;switch(t.type){case n.SymbolType.simpleMarker:!function(t,e){Object(n.defined)(t.size)&&(e.radius=Object(n.defaultValue)(parseFloat(t.size)/2,10)),e.xoffset=t.xoffset,e.yoffset=t.yoffset,e.rotation=t.angle,e.shape=t.style,e.path=t.path,e.fill=!0,e.fillColor=n.Color.fromColor(t.color).toCssRGBAString();const i={};le(t.outline,i);for(const t in i)e[t]=i[t]}(t,e);break;case n.SymbolType.pictureMarker:!function(t,e){const i={},o=[10,10];Object(n.defined)(t.width)&&(o[0]=parseFloat(t.width)),Object(n.defined)(t.height)&&(o[1]=parseFloat(t.height)),i.iconSize=o,Object(n.defined)(t.url)&&(i.iconUrl=t.url);const s=[o[0]/2,o[1]/2];Object(n.defined)(t.xoffset)&&(s[0]=t.xoffset+s[0]),Object(n.defined)(t.yoffset)&&(s[1]=t.yoffset+s[1]),i.iconAnchor=s;const a=r.icon(i);e.icon=a,e.rotationAngle=t.angle}(t,e);break;case n.SymbolType.simpleLine:le(t,e);break;case n.SymbolType.simpleFill:he(t,e);break;case n.SymbolType.pictureFill:!function(t,e){if(!t)return e;const{width:i,height:n,xscale:r,yscale:o,xoffset:s,yoffset:a,url:l}=t;e.fill=`url(${l})`,e.fillDetail={width:i,height:n,xscale:r,yscale:o,xoffset:s,yoffset:a};const h={};le(t.outline,h);for(const t in h)e[t]=h[t]}(t,e);break;case n.SymbolType.text:!function(t,e){const i=j.getTextWidth(t.text,`${t.font.weight} ${t.font.size}px ${t.font.family}`);let r=i<t.lineWidth?i:t.lineWidth,o=Math.ceil(i/r);t.kerning&&(r=t.lineWidth,o=1);const s=t.font.size*t.lineHeight*o;let a=0,l=0;switch(t.horizontalAlignment){case"left":a=0;break;case"right":a=r;break;case"center":a=r/2;break;default:a=0}switch(t.verticalAlignment){case"baseline":l=s/2;break;case"top":l=0;break;case"middle":l=s/2;break;case"bottom":l=s;break;default:l=0}const h=[t.xoffset+a,t.yoffset+l],u={glyph:t.text,iconUrl:null,iconSize:[r,s],font:t.font,lineHeight:t.lineHeight,iconAnchor:h,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,glyphColor:n.Color.fromColor(t.color).toCssRGBAString(),haloSize:t.haloSize,haloColor:n.Color.fromColor(t.haloColor).toCssRGBAString(),angle:t.angle,rotated:t.rotated,backgroundColor:t.backgroundColor?n.Color.fromColor(t.backgroundColor).toCssRGBAString():void 0,borderLineColor:t.borderLineColor?n.Color.fromColor(t.borderLineColor).toCssRGBAString():void 0,borderLineSize:t.borderLineSize,lineWidth:t.lineWidth,kerning:t.kerning,calcWidth:i},c=new ae(u);e.icon=c}(t,e);break;default:he(t,e)}return e}};const ce=r.Marker.extend({options:{textIcon:null},onAdd(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this._initTextIcon(),this.update()},onRemove(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeTextIcon(),this._removeShadow()},setTextIcon(t){return this.options.textIcon=t,this._map&&(this._initTextIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},_initTextIcon(){if(!this.options.textIcon)return;const t=this.options,e=`leaflet-zoom-${this._zoomAnimated?"animated":"hide"}`,i=t.textIcon.createIcon(this._textIcon);let n=!1;i!==this._textIcon&&(this._textIcon&&this._removeTextIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),r.DomUtil.addClass(i,e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._textIcon=i,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._textIcon),this._initTextIconInteraction()},_removeTextIcon(){this._textIcon&&(r.DomUtil.remove(this._textIcon),this.removeInteractiveTarget(this._textIcon),this._textIcon=null)},_setPos(t){this._icon&&r.DomUtil.setPosition(this._icon,t),this._textIcon&&r.DomUtil.setPosition(this._textIcon,t),this._shadow&&r.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t),this._textIcon&&(this._textIcon.style.zIndex=this._zIndex+t)},_initTextIconInteraction(){if(this.options.interactive&&this._textIcon&&(r.DomUtil.addClass(this._textIcon,"leaflet-interactive"),this.addInteractiveTarget(this._textIcon),r.MarkerDrag)){let t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new r.MarkerDrag(this),t&&this.dragging.enable()}},_updateOpacity(){const t=this.options.opacity;this._icon&&r.DomUtil.setOpacity(this._icon,t),this._textIcon&&r.DomUtil.setOpacity(this._textIcon,t),this._shadow&&r.DomUtil.setOpacity(this._shadow,t)}});function pe(t,e,i,n,r){!function t(e,i,n,r,o){for(;r>n;){if(r-n>600){const s=r-n+1,a=i-n+1,l=Math.log(s),h=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*h*(s-h)/s)*(a-s/2<0?-1:1),c=Math.max(n,Math.floor(i-a*h/s+u)),p=Math.min(r,Math.floor(i+(s-a)*h/s+u));t(e,i,c,p,o)}const s=e[i];let a=n,l=r;for(fe(e,n,i),o(e[r],s)>0&&fe(e,n,r);a<l;){for(fe(e,a,l),a++,l--;o(e[a],s)<0;)a++;for(;o(e[l],s)>0;)l--}0===o(e[n],s)?fe(e,n,l):fe(e,++l,r),l<=i&&(n=l+1),i<=l&&(r=l-1)}}(t,e,i||0,n||t.length-1,r||de)}function fe(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function de(t,e){return t<e?-1:t>e?1:0}function ge(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function ye(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function me(t,e){_e(t,0,t.children.length,e,t)}function _e(t,e,i,n,r){r||(r=Ie(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=e;o<i;o++){const e=t.children[o];ve(r,t.leaf?n(e):e)}return r}function ve(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function xe(t,e){return t.minX-e.minX}function be(t,e){return t.minY-e.minY}function we(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Ee(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Ce(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function Le(t,e){const i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-i)*Math.max(0,o-n)}function Se(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Pe(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Ie(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Me(t,e,i,n,r){const o=[e,i];for(;o.length;){if((i=o.pop())-(e=o.pop())<=n)continue;const s=e+Math.ceil((i-e)/n/2)*n;pe(t,s,e,i,r),o.push(e,s,s,i)}}r.MarkerWithText=ce,ge.prototype.all=function(){return this._all(this.data,[])},ge.prototype.search=function(t){let e=this.data;const i=[];if(!Pe(t,e))return i;const n=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?n(s):s;Pe(t,a)&&(e.leaf?i.push(s):Se(t,a)?this._all(s,i):r.push(s))}e=r.pop()}return i},ge.prototype.collides=function(t){let e=this.data;if(!Pe(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const r=e.children[n],o=e.leaf?this.toBBox(r):r;if(Pe(t,o)){if(e.leaf||Se(t,o))return!0;i.push(r)}}e=i.pop()}return!1},ge.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this},ge.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},ge.prototype.clear=function(){return this.data=Ie([]),this},ge.prototype.remove=function(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),r=[],o=[];let s,a,l;for(;i||r.length;){if(i||(i=r.pop(),a=r[r.length-1],s=o.pop(),l=!0),i.leaf){const n=ye(t,i.children,e);if(-1!==n)return i.children.splice(n,1),r.push(i),this._condense(r),this}l||i.leaf||!Se(i,n)?a?(s++,i=a.children[s],l=!1):i=null:(r.push(i),o.push(s),s=0,a=i,i=i.children[0])}return this},ge.prototype.toBBox=function(t){return t},ge.prototype.compareMinX=function(t,e){return t.minX-e.minX},ge.prototype.compareMinY=function(t,e){return t.minY-e.minY},ge.prototype.toJSON=function(){return this.data},ge.prototype.fromJSON=function(t){return this.data=t,this},ge.prototype._all=function(t,e){const i=[];for(;t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},ge.prototype._build=function(t,e,i,n){const r=i-e+1;let o,s=this._maxEntries;if(r<=s)return me(o=Ie(t.slice(e,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,n-1))),(o=Ie([])).leaf=!1,o.height=n;const a=Math.ceil(r/s),l=a*Math.ceil(Math.sqrt(s));Me(t,e,i,l,this.compareMinX);for(let r=e;r<=i;r+=l){const e=Math.min(r+l-1,i);Me(t,r,e,a,this.compareMinY);for(let i=r;i<=e;i+=a){const r=Math.min(i+a-1,e);o.children.push(this._build(t,i,r,n-1))}}return me(o,this.toBBox),o},ge.prototype._chooseSubtree=function(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){let i=1/0,n=1/0,r=void 0;for(let o=0;o<e.children.length;o++){const s=e.children[o],a=we(s),l=Ce(t,s)-a;l<n?(n=l,i=a<i?a:i,r=s):l===n&&a<i&&(i=a,r=s)}e=r||e.children[0]}return e},ge.prototype._insert=function(t,e,i){const n=i?t:this.toBBox(t),r=[],o=this._chooseSubtree(n,this.data,e,r);for(o.children.push(t),ve(o,n);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},ge.prototype._split=function(t,e){const i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const o=this._chooseSplitIndex(i,r,n),s=Ie(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,me(i,this.toBBox),me(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)},ge.prototype._splitRoot=function(t,e){this.data=Ie([t,e]),this.data.height=t.height+1,this.data.leaf=!1,me(this.data,this.toBBox)},ge.prototype._chooseSplitIndex=function(t,e,i){let n,r=1/0,o=1/0;for(let s=e;s<=i-e;s++){const e=_e(t,0,s,this.toBBox),a=_e(t,s,i,this.toBBox),l=Le(e,a),h=we(e)+we(a);l<r?(r=l,n=s,o=h<o?h:o):l===r&&h<o&&(o=h,n=s)}return n||i-e},ge.prototype._chooseSplitAxis=function(t,e,i){const n=t.leaf?this.compareMinX:xe,r=t.leaf?this.compareMinY:be;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)},ge.prototype._allDistMargin=function(t,e,i,n){t.children.sort(n);const r=this.toBBox,o=_e(t,0,e,r),s=_e(t,i-e,i,r);let a=Ee(o)+Ee(s);for(let n=e;n<i-e;n++){const e=t.children[n];ve(o,t.leaf?r(e):e),a+=Ee(o)}for(let n=i-e-1;n>=e;n--){const e=t.children[n];ve(s,t.leaf?r(e):e),a+=Ee(s)}return a},ge.prototype._adjustParentBBoxes=function(t,e,i){for(let n=i;n>=0;n--)ve(e[n],t)},ge.prototype._condense=function(t){for(let e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():me(t[e],this.toBBox)};const Te=r.MarkerClusterGroup=r.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:r.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{},maxClusterNum:0,deconflictionStrategy:"none"},initialize(t){r.Util.setOptions(this,t),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=r.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=r.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd},this._rbush=new ge;const e=r.DomUtil.TRANSITION&&this.options.animate;r.extend(this,e?this._withAnimation:this._noAnimation),this._markerCluster=e?r.MarkerCluster:r.MarkerClusterNonAnimated},addLayer(t){if(t instanceof r.LayerGroup)return this.addLayers([t]);if(!t.getLatLng)return this._nonPointGroup.addLayer(t),this.fire("layeradd",{layer:t}),this;if(!this._map)return this._needsClustering.push(t),this.fire("layeradd",{layer:t}),this;if(this.hasLayer(t))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(t,this._maxZoom),this.fire("layeradd",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();let e=t;const i=this._zoom;if(t.__parent)for(;e.__parent._zoom>=i;)e=e.__parent;return this._currentShownBounds.contains(e.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(t,e):this._animationAddLayerNonAnimated(t,e)),this},removeLayer(t){return t instanceof r.LayerGroup?this.removeLayers([t]):t.getLatLng?this._map?t.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(t)),this._removeLayer(t,!0),this.fire("layerremove",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),t.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(t)&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,t)&&this.hasLayer(t)&&this._needsRemoving.push({layer:t,latlng:t._latlng}),this.fire("layerremove",{layer:t}),this):(this._nonPointGroup.removeLayer(t),this.fire("layerremove",{layer:t}),this)},addLayers(t,e){if(!r.Util.isArray(t))return this.addLayer(t);const i=this._featureGroup,n=this._nonPointGroup,o=this.options.chunkedLoading,s=this.options.chunkInterval,a=this.options.chunkProgress;let l,h=t.length,u=0,c=!0;if(this._map){const f=(new Date).getTime();var p=r.bind(function(){const d=(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();u<h;u++){if(o&&u%200==0){if((new Date).getTime()-d>s)break}if((l=t[u])instanceof r.LayerGroup)c&&(t=t.slice(),c=!1),this._extractNonGroupLayers(l,t),h=t.length;else if(l.getLatLng){if(!this.hasLayer(l)&&(this._addLayer(l,this._maxZoom),e||this.fire("layeradd",{layer:l}),l.__parent&&2===l.__parent.getChildCount())){const t=l.__parent.getAllChildMarkers(),e=t[0]===l?t[1]:t[0];i.removeLayer(e)}}else n.addLayer(l),e||this.fire("layeradd",{layer:l})}a&&a(u,h,(new Date).getTime()-f),u===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds,this._rbush,this.options.deconflictionStrategy)):setTimeout(p,this.options.chunkDelay)},this);p()}else{const e=this._needsClustering;for(;u<h;u++)(l=t[u])instanceof r.LayerGroup?(c&&(t=t.slice(),c=!1),this._extractNonGroupLayers(l,t),h=t.length):l.getLatLng?this.hasLayer(l)||e.push(l):n.addLayer(l)}return this},removeLayers(t){let e,i,n=t.length;const o=this._featureGroup,s=this._nonPointGroup;let a=!0;if(!this._map){for(e=0;e<n;e++)(i=t[e])instanceof r.LayerGroup?(a&&(t=t.slice(),a=!1),this._extractNonGroupLayers(i,t),n=t.length):(this._arraySplice(this._needsClustering,i),s.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();const o=t.slice();let s=n;for(e=0;e<s;e++)(i=o[e])instanceof r.LayerGroup?(this._extractNonGroupLayers(i,o),s=o.length):this._unspiderfyLayer(i)}for(e=0;e<n;e++)(i=t[e])instanceof r.LayerGroup?(a&&(t=t.slice(),a=!1),this._extractNonGroupLayers(i,t),n=t.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),o.hasLayer(i)&&(o.removeLayer(i),i.clusterShow&&i.clusterShow())):(s.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(t){t.off(this._childMarkerEventHandlers,this),delete t.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds(){const t=new r.LatLngBounds;this._topClusterLevel&&t.extend(this._topClusterLevel._bounds);for(let e=this._needsClustering.length-1;e>=0;e--)t.extend(this._needsClustering[e].getLatLng());return t.extend(this._nonPointGroup.getBounds()),t},eachLayer(t,e){const i=this._needsClustering.slice(),n=this._needsRemoving;let r,o,s;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(i),o=i.length-1;o>=0;o--){for(r=!0,s=n.length-1;s>=0;s--)if(n[s].layer===i[o]){r=!1;break}r&&t.call(e,i[o])}this._nonPointGroup.eachLayer(t,e)},getLayers(){const t=[];return this.eachLayer(function(e){t.push(e)}),t},getLayer(t){let e=null;return t=parseInt(t,10),this.eachLayer(function(i){r.stamp(i)===t&&(e=i)}),e},hasLayer(t){if(!t)return!1;let e,i=this._needsClustering;for(e=i.length-1;e>=0;e--)if(i[e]===t)return!0;for(e=(i=this._needsRemoving).length-1;e>=0;e--)if(i[e].layer===t)return!1;return!(!t.__parent||t.__parent._group!==this)||this._nonPointGroup.hasLayer(t)},zoomToShowLayer(t,e){const i=this._map;"function"!=typeof e&&(e=function(){});var n=function(){!i.hasLayer(t)&&!i.hasLayer(t.__parent)||this._inZoomAnimation||(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(t)?e():t.__parent._icon&&(this.once("spiderfied",e,this),t.__parent.spiderfy()))};t._icon&&this._map.getBounds().contains(t.getLatLng())?e():t.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",n,this),this._map.panTo(t.getLatLng())):(this._map.on("moveend",n,this),this.on("animationend",n,this),t.__parent.zoomToBounds())},onAdd(t){let e,i,n;for(this._map=t,this._featureGroup.addTo(t),this._nonPointGroup.addTo(t),this._gridClusters||this._generateInitialClusters(),this._maxLat=t.options.crs.projection.MAX_LATITUDE,e=0,i=this._needsRemoving.length;e<i;e++)(n=this._needsRemoving[e]).newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(e=0,i=this._needsRemoving.length;e<i;e++)n=this._needsRemoving[e],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0),this.forceAnimation()},onRemove(t){t.off("zoomend",this._zoomEnd,this),t.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent(t){let e=t;for(;e&&!e._icon;)e=e.__parent;return e||null},_arraySplice(t,e){for(let i=t.length-1;i>=0;i--)if(t[i]===e)return t.splice(i,1),!0},_removeFromGridUnclustered(t,e){const i=this._map,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());for(;e>=r&&n[e].removeObject(t,i.project(t.getLatLng(),e));e--);},_childMarkerDragStart(t){t.target.__dragStart=t.target._latlng},_childMarkerMoved(t){if(!this._ignoreMove&&!t.target.__dragStart){const e=t.target._popup&&t.target._popup.isOpen();this._moveChild(t.target,t.oldLatLng,t.latlng),e&&t.target.openPopup()}},_moveChild(t,e,i){t._latlng=e,this.removeLayer(t),t._latlng=i,this.addLayer(t)},_childMarkerDragEnd(t){const e=t.target.__dragStart;delete t.target.__dragStart,e&&this._moveChild(t.target,e,t.target._latlng)},_removeLayer(t,e,i){const n=this._gridClusters,r=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());e&&this._removeFromGridUnclustered(t,this._maxZoom);let l=t.__parent;const h=l._markers;let u;for(this._arraySplice(h,t);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)e&&l._childCount<=1?(u=l._markers[0]===t?l._markers[1]:l._markers[0],n[l._zoom].removeObject(l,s.project(l._cLatLng,l._zoom)),r[l._zoom].addObject(u,s.project(u.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(u),u.__parent=l.__parent,l._icon&&(o.removeLayer(l),i||o.addLayer(u))):l._iconNeedsUpdate=!0,l=l.__parent;delete t.__parent},_isOrIsParent(t,e){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},fire(t,e,i){if(e&&e.layer instanceof r.MarkerCluster){if(e.originalEvent&&this._isOrIsParent(e.layer._icon,e.originalEvent.relatedTarget))return;t=`cluster${t}`}r.FeatureGroup.prototype.fire.call(this,t,e,i)},listens(t,e){return r.FeatureGroup.prototype.listens.call(this,t,e)||r.FeatureGroup.prototype.listens.call(this,`cluster${t}`,e)},_defaultIconCreateFunction(t){const e=t.getChildCount();let i=" marker-cluster-";return i+=e<10?"small":e<100?"medium":"large",new r.DivIcon({html:`<div><span>${e} <span aria-label="markers"></span>`+"</span></div>",className:`marker-cluster${i}`,iconSize:new r.Point(40,40)})},_bindEvents(){const t=this._map,e=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom;(e||n||r)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),t.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy(t){const e=t.layer;let i=e;if(!("clusterkeypress"===t.type&&t.originalEvent&&13!==t.originalEvent.keyCode||t.originalEvent.defaultPrevented)){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===e._childCount&&this.options.spiderfyOnMaxZoom?e.spiderfy():this.options.zoomToBoundsOnClick&&e.zoomToBounds(),this.options.spiderfyOnEveryZoom&&e.spiderfy(),t.originalEvent&&13===t.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage(t){const e=this._map;this._inZoomAnimation||(this._shownPolygon&&e.removeLayer(this._shownPolygon),t.layer.getChildCount()>2&&t.layer!==this._spiderfied&&(this._shownPolygon=new r.Polygon(t.layer.getConvexHull(),this.options.polygonOptions),e.addLayer(this._shownPolygon)))},_hideCoverage(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents(){const t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,r=this._map;(t||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),e&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),r.off("zoomend",this._hideCoverage,this))},_zoomEnd(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd(){if(this._inZoomAnimation)return;const t=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),t),this._currentShownBounds=t},_generateInitialClusters(){let t=Math.ceil(this._map.getMaxZoom());const e=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius;let n=i;if("function"!=typeof i&&(n=function(){return i}),null!==this.options.disableClusteringAtZoom&&(t=this.options.disableClusteringAtZoom-1),this._maxZoom=t,this._gridClusters={},this._gridUnclustered={},!isFinite(t))throw"Map has no maxZoom specified";if(!isFinite(e))throw"Map has no minZoom specified";for(let i=t;i>=e;i--)this._gridClusters[i]=new r.DistanceGrid(n(i)),this._gridUnclustered[i]=new r.DistanceGrid(n(i));this._topClusterLevel=new this._markerCluster(this,e-1)},_addLayer(t,e){const i=this._gridClusters,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());let o,s;this.options.singleMarkerMode&&this._overrideMarkerIcon(t),t.on(this._childMarkerEventHandlers,this);const a=this.options.maxClusterNum;for(;e>=r;e--){o=this._map.project(t.getLatLng(),e);const r=i[e].getNearObjectArr(o);if(r&&Array.isArray(r)&&r.length>0)for(let e=0;e<r.length;e++){const i=r[e].obj,n=i.getChildCount(),o=i.getAllChildMarkers();if(n>=a-1||o&&Array.isArray(o)&&o.length>0&&o[0].options&&t.options&&t.options.groupName===o[0].options.groupName)return i._addChild(t),void(t.__parent=i)}const u=n[e].getNearObjectArr(o);if(u&&Array.isArray(u)){let n=[],r=[];var l;const o=u.length;if(u.length>0)if(o>=a-1)u.forEach(t=>{n.push(t.obj),r.push(t.obj)}),r.push(t),l=r[0].__parent;else{for(let e=0;e<u.length;e++){const{obj:i,dist:o}=u[e];if(i.options&&t.options&&t.options.groupName===i.options.groupName){r=[i,t],n=[i];break}}r.length>0&&(l=r[0].__parent)}if(r.length>0&&l){n.forEach(t=>{t.__parent&&this._removeLayer(t,!1)});var h=new this._markerCluster(this,e);r.forEach(t=>{h._addChild(t),t.__parent=h}),i[e].addObject(h,this._map.project(h._cLatLng,e));let t=h;for(s=e-1;s>l._zoom;s--)t=new this._markerCluster(this,s,t),i[s].addObject(t,this._map.project(h._cLatLng,s));return l._addChild(t),void n.forEach(t=>{this._removeFromGridUnclustered(t,e)})}}n[e].addObject(t,o)}this._topClusterLevel._addChild(t),t.__parent=this._topClusterLevel},_refreshClustersIcons(){this._featureGroup.eachLayer(function(t){t instanceof r.MarkerCluster&&t._iconNeedsUpdate&&t._updateIcon()})},_enqueue(t){this._queue.push(t),this._queueTimeout||(this._queueTimeout=setTimeout(r.bind(this._processQueue,this),300))},_processQueue(){for(let t=0;t<this._queue.length;t++)this._queue[t].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters(){const t=Math.round(this._map._zoom);this._processQueue(),this._zoom<t&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,t)):this._zoom>t?(this._animationStart(),this._animationZoomOut(this._zoom,t)):this._moveEnd()},_getExpandedVisibleBounds(){return this.options.removeOutsideVisibleBounds?r.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat(t){const e=this._maxLat;return void 0!==e&&(t.getNorth()>=e&&(t._northEast.lat=1/0),t.getSouth()<=-e&&(t._southWest.lat=-1/0)),t},_animationAddLayerNonAnimated(t,e){if(e===t)this._featureGroup.addLayer(t);else if(2===e._childCount){e._addToMap();const t=e.getAllChildMarkers();this._featureGroup.removeLayer(t[0]),this._featureGroup.removeLayer(t[1])}else e._updateIcon()},_extractNonGroupLayers(t,e){const i=t.getLayers();let n,o=0;for(e=e||[];o<i.length;o++)(n=i[o])instanceof r.LayerGroup?this._extractNonGroupLayers(n,e):e.push(n);return e},_overrideMarkerIcon(t){return t.getChildCount=function(){return 1},t.getAllChildMarkers=function(){return[t]},t.options.icon=this.options.iconCreateFunction(t)},_animationCreateMarkerIcon(t){!t||t.isRefreshIcon||this.options.singleMarkerMode||(this._overrideMarkerIcon(t),t.isRefreshIcon=!0)}});r.MarkerClusterGroup.include({_mapBoundsInfinite:new r.LatLngBounds(new r.LatLng(-1/0,-1/0),new r.LatLng(1/0,1/0))}),r.MarkerClusterGroup.include({_noAnimation:{_animationStart(){},_animationZoomIn(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer(t,e){this._animationAddLayerNonAnimated(t,e)}},_withAnimation:{_animationStart(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn(t,e){const i=this._getExpandedVisibleBounds(),n=this._featureGroup,o=Math.floor(this._map.getMinZoom());let s;this._ignoreMove=!0,this._rbush.clear();const a=this;this._topClusterLevel._recursively(i,t,o,function(r){let o=r._latlng;const a=r._markers;let l;for(i.contains(o)||(o=null),r._isSingleParent()&&t+1===e?(n.removeLayer(r),r._recursivelyAddChildrenToMap(null,e,i)):(r.clusterHide(),r._recursivelyAddChildrenToMap(o,e,i)),s=a.length-1;s>=0;s--)l=a[s],i.contains(l._latlng)||n.removeLayer(l)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(i,e),n.eachLayer(function(t){t instanceof r.MarkerCluster||!t._icon||t.clusterShow()}),this._topClusterLevel._recursively(i,t,e,function(t){a._ignoreMove=!0,t._recursivelyRestoreChildPositions(e,a._rbush,a.options.deconflictionStrategy),a._ignoreMove=!1}),this._topClusterLevel._recursively(i,Math.floor(this._map.getMinZoom()),e-1,function(t){a._ignoreMove=!0,t._recursivelyRestoreChildMarkerPositions(e,i,a._rbush,a.options.deconflictionStrategy),a._ignoreMove=!1}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(i,t,o,function(t){n.removeLayer(t),t.clusterShow()}),this._animationEnd()})},_animationZoomOut(t,e){this._rbush.clear(),this._animationZoomOutSingle(this._topClusterLevel,t-1,e),this._ignoreMove=!0,this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds(),this._rbush,this.options.deconflictionStrategy),this._ignoreMove=!1,this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t,this._getExpandedVisibleBounds())},_animationAddLayer(t,e){const i=this,n=this._featureGroup;n.addLayer(t),e!==t&&(e._childCount>2?(e._updateIcon(),this._forceLayout(),this._animationStart(),t._setPos(this._map.latLngToLayerPoint(e.getLatLng())),t.clusterHide(),this._enqueue(function(){n.removeLayer(t),t.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(e,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle(t,e,i){const n=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());t._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,e+1,i);const o=this;this._forceLayout(),t._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===t._childCount){const e=t._markers[0];this._ignoreMove=!0,e.setLatLng(e.getLatLng()),this._ignoreMove=!1,e.clusterShow&&e.clusterShow()}else t._recursively(n,i,r,function(t){t._recursivelyRemoveChildrenFromMap(n,r,e+1)});o._animationEnd()})},_animationEnd(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout(){r.Util.falseFn(document.body.offsetWidth)},forceAnimation(){const t=this._map.getZoom();this._animationStart(),this._animationZoomIn(t-1,t)}}),r.markerClusterGroup=function(t){return new r.MarkerClusterGroup(t)};var Oe=r.MarkerCluster=r.MarkerWithText.extend({options:r.Icon.prototype.options,initialize(t,e,i,n){r.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new r.LatLng(0,0),{icon:this,pane:t.options.clusterPane}),this._group=t,this._zoom=e,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new r.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers(t,e){t=t||[];for(let i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(t,e);for(let i=this._markers.length-1;i>=0;i--)e&&this._markers[i].__dragStart||t.push(this._markers[i]);return t},getChildCount(){return this._childCount},zoomToBounds(t){let e=this._childClusters.slice();const i=this._group._map,n=i.getBoundsZoom(this._bounds);let r=this._zoom+1;const o=i.getZoom();let s;for(;e.length>0&&n>r;){r++;let t=[];for(s=0;s<e.length;s++)t=t.concat(e[s]._childClusters);e=t}n>r?this._group._map.setView(this._latlng,r):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,t)},getBounds(){const t=new r.LatLngBounds;return t.extend(this._bounds),t},_updateIcon(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow(){return this._iconObj.createShadow()},_addChild(t,e){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(t),t instanceof r.MarkerCluster?(e||(this._childClusters.push(t),t.__parent=this),this._childCount+=t._childCount):(e||this._markers.push(t),this._childCount++),this.__parent&&this.__parent._addChild(t,!0)},_setClusterCenter(t){this._cLatLng||(this._cLatLng=t._cLatLng||t._latlng)},_resetBounds(){const t=this._bounds;t._southWest&&(t._southWest.lat=1/0,t._southWest.lng=1/0),t._northEast&&(t._northEast.lat=-1/0,t._northEast.lng=-1/0)},_recalculateBounds(){const t=this._markers,e=this._childClusters;let i=0,n=0;const o=this._childCount;let s,a,l,h;if(0!==o){for(this._resetBounds(),s=0;s<t.length;s++)l=t[s]._latlng,this._bounds.extend(l),i+=l.lat,n+=l.lng;for(s=0;s<e.length;s++)(a=e[s])._boundsNeedUpdate&&a._recalculateBounds(),this._bounds.extend(a._bounds),l=a._wLatLng,h=a._childCount,i+=l.lat*h,n+=l.lng*h;this._latlng=this._wLatLng=new r.LatLng(i/o,n/o),this._boundsNeedUpdate=!1}},_addToMap(t){t&&(this._backupLatlng=this._latlng,this.setLatLng(t)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn(t,e,i){this._recursively(t,this._group._map.getMinZoom(),i-1,function(t){const i=t._markers;let n,r;for(n=i.length-1;n>=0;n--)(r=i[n])._icon&&(r._setPos(e),r.clusterHide())},function(t){const i=t._childClusters;let n,r;for(n=i.length-1;n>=0;n--)(r=i[n])._icon&&(r._setPos(e),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap(t,e,i,n){this._recursively(t,n,e,function(r){r._recursivelyAnimateChildrenIn(t,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(t,e,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible(t,e){this._recursively(t,this._group._map.getMinZoom(),e,null,function(t){t.clusterShow()})},_recursivelyAddChildrenToMap(t,e,i,n,r){const o=this;this._recursively(i,this._group._map.getMinZoom()-1,e,function(s){if(e!==s._zoom)for(let a=s._markers.length-1;a>=0;a--){const l=s._markers[a];i.contains(l._latlng)&&(t&&(l._backupLatlng=l.getLatLng(),l.setLatLng(t),l.clusterHide&&l.clusterHide()),s._group._animationCreateMarkerIcon(l),s._group._featureGroup.addLayer(l),"static"===r&&o._adjustClusterOrMarkerStatus(l,n,e))}},function(i){i._addToMap(t),"static"===r&&o._adjustClusterOrMarkerStatus(i,n,e)})},_getAdjustPoint(t,e,i){const n=2*i,o=r.point(e.x-t.x,e.y-t.y),s=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return t.add(o._divideBy(s)._multiplyBy(n))},_calcAdjustPoint(t,e,i,n){const o=n*Math.SQRT2;let s,a,l=i,h=n;a=t.search(l);do{let t,i,u,c;a.forEach(e=>{t=Math.min(void 0===t?e.minX:t,e.minX),i=Math.min(void 0===i?e.minY:i,e.minY),u=Math.max(void 0===u?e.maxX:u,e.maxX),c=Math.max(void 0===c?e.maxY:c,e.maxY)});const p=r.point((u+t)/2,(i+c)/2);if(s=this._getAdjustPoint(p,e,h),h>o)return null;h+=1,l={minX:s.x-n,minY:s.y-n,maxX:s.x+n,maxY:s.y+n,point:s}}while(t.collides(l));return s},_adjustClusterOrMarkerStatus(t,e,i){if(t&&e&&e){let n,r;i=i||this._zoom,t instanceof Oe?(n=t._group._map,r=t._iconObj):(n=t._map,r=t.options.icon);const o=n.latLngToLayerPoint(t.getLatLng(),i);if(!r)return;if(isNaN(o.x)||isNaN(o.y))return;const s=r.options.iconSize,a=Math.max(s.x,s.y)/2;let l={minX:o.x-a,minY:o.y-a,maxX:o.x+a,maxY:o.y+a,point:o,obj:t};if(e.collides(l)){e.search(l);const r=this._calcAdjustPoint(e,o,l,a);if(!r||isNaN(r.x)||isNaN(r.y))return void t.setOpacity(0);const s=n.layerPointToLatLng(r,i);t.setLatLng(s),l={minX:r.x-a,minY:r.y-a,maxX:r.x+a,maxY:r.y+a,point:r,obj:t}}e.insert(l)}},_recursivelyRestoreChildMarkerPositions(t,e,i,n){for(let r=this._markers.length-1;r>=0;r--){const o=this._markers[r];o._backupLatlng&&(o.setLatLng(o._backupLatlng),delete o._backupLatlng),o&&o._map&&e&&e.contains(o._latlng)&&"static"===n&&this._adjustClusterOrMarkerStatus(o,i,t)}},_recursivelyRestoreChildPositions(t,e,i){const n=this._childClusters.slice().sort((t,e)=>t._childCount-e._childCount);if(t-1===this._zoom)for(let r=n.length-1;r>=0;r--)n[r]._restorePosition(),"static"===i&&this._adjustClusterOrMarkerStatus(n[r],e,t);else for(let e=this._childClusters.length-1;e>=0;e--)this._childClusters[e]._recursivelyRestoreChildPositions(t)},_restorePosition(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap(t,e,i,n){let r,o;this._recursively(t,e-1,i-1,function(t){for(o=t._markers.length-1;o>=0;o--)r=t._markers[o],n&&n.contains(r._latlng)||(t._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(t){for(o=t._childClusters.length-1;o>=0;o--)r=t._childClusters[o],n&&n.contains(r._latlng)||(t._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively(t,e,i,n,r){const o=this._childClusters,s=this._zoom;let a,l;if(e<=s&&(r&&s===i&&r(this),n&&n(this)),o.sort((t,e)=>t._childCount-e._childCount),s<e||s<i)for(a=o.length-1;a>=0;a--)(l=o[a])._boundsNeedUpdate&&l._recalculateBounds(),t.intersects(l._bounds)&&l._recursively(t,e,i,n,r)},_isSingleParent(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});function Ne(t,e,i,n){return t.evaluate({$feature:e,$cluster_count:i,$is_same_group:n})}function Ae(t,e){for(let i=0;i<t.length;i++){const n=t[i];if(void 0!==n.value){if(n.value===e)return n}else if("undefined"!==n.minValue&&void 0!==n.maxValue&&(e=parseFloat(e),n.minValue<=e&&n.maxValue>e&&!isNaN(e)))return n}return null}function Re(t,e,i,n,r,o){const s=Ae(o,Ne(e,i,n,r));if(s){const e=t.findIndex(t=>t.object===s);if(e>-1)return t[e].groupName;{const e={groupName:String(t.length),object:s};return t.push(e),e.groupName}}return t[0].groupName}r.Marker.include({clusterHide(){const t=this.options.opacity;return this.setOpacity(0),this.options.opacity=t,this},clusterShow(){return this.setOpacity(this.options.opacity)}}),r.DistanceGrid=function(t){this._cellSize=t,this._sqCellSize=t*t,this._grid={},this._objectPoint={}},r.DistanceGrid.prototype={addObject(t,e){const i=this._getCoord(e.x),n=this._getCoord(e.y),o=this._grid,s=o[n]=o[n]||{},a=s[i]=s[i]||[],l=r.Util.stamp(t);this._objectPoint[l]=e,a.push(t)},updateObject(t,e){this.removeObject(t,e),this.addObject(t,e)},removeObject(t,e){const i=this._getCoord(e.x),n=this._getCoord(e.y),o=this._grid,s=o[n]=o[n]||{},a=s[i]=s[i]||[];let l,h;for(delete this._objectPoint[r.Util.stamp(t)],l=0,h=a.length;l<h;l++)if(a[l]===t)return a.splice(l,1),1===h&&delete s[i],!0},eachObject(t,e){let i,n,r,o,s,a,l;const h=this._grid;for(i in h)for(n in s=h[i])for(r=0,o=(a=s[n]).length;r<o;r++)(l=t.call(e,a[r]))&&(r--,o--)},getNearObject(t){const e=this._getCoord(t.x),i=this._getCoord(t.y);let n,o,s,a,l,h,u,c;const p=this._objectPoint;let f=this._sqCellSize,d=null;for(n=i-1;n<=i+1;n++)if(a=this._grid[n])for(o=e-1;o<=e+1;o++)if(l=a[o])for(s=0,h=l.length;s<h;s++)u=l[s],((c=this._sqDist(p[r.Util.stamp(u)],t))<f||c<=f&&null===d)&&(f=c,d=u);return d},getNearObjectArr(t,e){const i=this._getCoord(t.x),n=this._getCoord(t.y);let o,s,a,l,h,u,c,p;const f=this._objectPoint;let d=e||this._sqCellSize;const g=[];for(o=n-1;o<=n+1;o++)if(l=this._grid[o])for(s=i-1;s<=i+1;s++)if(h=l[s])for(a=0,u=h.length;a<u;a++)c=h[a],(p=this._sqDist(f[r.Util.stamp(c)],t))<=d&&(d=p,g.push({obj:c,dist:p,point:f[r.Util.stamp(c)]}));return g.sort((t,e)=>t.dist-e.dist),g},_getCoord(t){const e=Math.floor(t/this._cellSize);return isFinite(e)?e:t},_sqDist(t,e){const i=e.x-t.x,n=e.y-t.y;return i*i+n*n}},r.QuickHull={getDistant(t,e){const i=e[1].lat-e[0].lat;return(e[0].lng-e[1].lng)*(t.lat-e[0].lat)+i*(t.lng-e[0].lng)},findMostDistantPointFromBaseLine(t,e){let i=0,n=null;const r=[];let o,s,a;for(o=e.length-1;o>=0;o--)s=e[o],(a=this.getDistant(s,t))>0&&(r.push(s),a>i&&(i=a,n=s));return{maxPoint:n,newPoints:r}},buildConvexHull(t,e){let i=[];const n=this.findMostDistantPointFromBaseLine(t,e);return n.maxPoint?i=(i=i.concat(this.buildConvexHull([t[0],n.maxPoint],n.newPoints))).concat(this.buildConvexHull([n.maxPoint,t[1]],n.newPoints)):[t[0]]},getConvexHull(t){let e,i=!1,n=!1,r=!1,o=!1,s=null,a=null,l=null,h=null,u=null,c=null;for(e=t.length-1;e>=0;e--){const u=t[e];(!1===i||u.lat>i)&&(s=u,i=u.lat),(!1===n||u.lat<n)&&(a=u,n=u.lat),(!1===r||u.lng>r)&&(l=u,r=u.lng),(!1===o||u.lng<o)&&(h=u,o=u.lng)}return n!==i?(c=a,u=s):(c=h,u=l),[].concat(this.buildConvexHull([c,u],t),this.buildConvexHull([u,c],t))}},r.MarkerCluster.include({getConvexHull(){const t=this.getAllChildMarkers(),e=[];let i,n;for(n=t.length-1;n>=0;n--)i=t[n].getLatLng(),e.push(i);return r.QuickHull.getConvexHull(e)}}),r.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy(){if(this._group._spiderfied===this||this._group._inZoomAnimation)return;const t=this.getAllChildMarkers(null,!0),e=this._group._map.latLngToLayerPoint(this._latlng);let i;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?i=this._group.options.spiderfyShapePositions(t.length,e):t.length>=this._circleSpiralSwitchover?i=this._generatePointsSpiral(t.length,e):(e.y+=10,i=this._generatePointsCircle(t.length,e)),this._animationSpiderfy(t,i)},unspiderfy(t){this._group._inZoomAnimation||(this._animationUnspiderfy(t),this._group._spiderfied=null)},_generatePointsCircle(t,e){let i=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+t)/this._2PI;const n=this._2PI/t,o=[];let s,a;for(i=Math.max(i,35),o.length=t,s=0;s<t;s++)a=this._circleStartAngle+s*n,o[s]=new r.Point(e.x+i*Math.cos(a),e.y+i*Math.sin(a))._round();return o},_generatePointsSpiral(t,e){const i=this._group.options.spiderfyDistanceMultiplier;let n=i*this._spiralLengthStart;const o=i*this._spiralFootSeparation,s=i*this._spiralLengthFactor*this._2PI;let a=0;const l=[];let h;for(l.length=t,h=t;h>=0;h--)h<t&&(l[h]=new r.Point(e.x+n*Math.cos(a),e.y+n*Math.sin(a))._round()),n+=s/(a+=o/n+5e-4*h);return l},_noanimationUnspiderfy(){const t=this._group,e=t._map,i=t._featureGroup,n=this.getAllChildMarkers(null,!0);let r,o;for(t._ignoreMove=!0,this.setOpacity(1),o=n.length-1;o>=0;o--)r=n[o],i.removeLayer(r),r._preSpiderfyLatlng&&(r.setLatLng(r._preSpiderfyLatlng),delete r._preSpiderfyLatlng),r.setZIndexOffset&&r.setZIndexOffset(0),r._spiderLeg&&(e.removeLayer(r._spiderLeg),delete r._spiderLeg);t.fire("unspiderfied",{cluster:this,markers:n}),t._ignoreMove=!1,t._spiderfied=null}}),r.MarkerClusterNonAnimated=r.MarkerCluster.extend({_animationSpiderfy(t,e){const i=this._group,n=i._map,o=i._featureGroup,s=this._group.options.spiderLegPolylineOptions;let a,l,h,u;for(i._ignoreMove=!0,a=0;a<t.length;a++)u=n.layerPointToLatLng(e[a]),l=t[a],h=new r.Polyline([this._latlng,u],s),n.addLayer(h),l._spiderLeg=h,l._preSpiderfyLatlng=l._latlng,l.setLatLng(u),l.setZIndexOffset&&l.setZIndexOffset(1e6),o.addLayer(l);this.setOpacity(.3),i._ignoreMove=!1,i.fire("spiderfied",{cluster:this,markers:t})},_animationUnspiderfy(){this._noanimationUnspiderfy()}}),r.MarkerCluster.include({_animationSpiderfy(t,e){const i=this,n=this._group,o=n._map,s=n._featureGroup,a=this._latlng,l=o.latLngToLayerPoint(a),h=r.Path.SVG,u=r.extend({},this._group.options.spiderLegPolylineOptions);let c,p,f,d,g,y,m=u.opacity;for(void 0===m&&(m=r.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),h?(u.opacity=0,u.className=`${u.className||""} leaflet-cluster-spider-leg`):u.opacity=m,n._ignoreMove=!0,c=0;c<t.length;c++)p=t[c],n._animationCreateMarkerIcon(p),y=o.layerPointToLatLng(e[c]),f=new r.Polyline([a,y],u),o.addLayer(f),p._spiderLeg=f,h&&(g=(d=f._path).getTotalLength()+.1,d.style.strokeDasharray=g,d.style.strokeDashoffset=g),p.setZIndexOffset&&p.setZIndexOffset(1e6),p.clusterHide&&p.clusterHide(),s.addLayer(p),p._setPos&&p._setPos(l);for(n._forceLayout(),n._animationStart(),c=t.length-1;c>=0;c--)y=o.layerPointToLatLng(e[c]),(p=t[c])._preSpiderfyLatlng=p._latlng,p.setLatLng(y),p.clusterShow&&p.clusterShow(),h&&((d=(f=p._spiderLeg)._path).style.strokeDashoffset=0,f.setStyle({opacity:m}));this.setOpacity(.3),n._ignoreMove=!1,setTimeout(function(){n._animationEnd(),n.fire("spiderfied",{cluster:i,markers:t})},200)},_animationUnspiderfy(t){const e=this,i=this._group,n=i._map,o=i._featureGroup,s=t?n._latLngToNewLayerPoint(this._latlng,t.zoom,t.center):n.latLngToLayerPoint(this._latlng),a=this.getAllChildMarkers(null,!0),l=r.Path.SVG;let h,u,c,p,f,d;for(i._ignoreMove=!0,i._animationStart(),this.setOpacity(1),u=a.length-1;u>=0;u--)(h=a[u])._preSpiderfyLatlng&&(h.closePopup(),h.setLatLng(h._preSpiderfyLatlng),delete h._preSpiderfyLatlng,d=!0,h._setPos&&(h._setPos(s),d=!1),h.clusterHide&&(h.clusterHide(),d=!1),d&&o.removeLayer(h),l&&(f=(p=(c=h._spiderLeg)._path).getTotalLength()+.1,p.style.strokeDashoffset=f,c.setStyle({opacity:0})));i._ignoreMove=!1,setTimeout(function(){let t=0;for(u=a.length-1;u>=0;u--)(h=a[u])._spiderLeg&&t++;for(u=a.length-1;u>=0;u--)(h=a[u])._spiderLeg&&(h.clusterShow&&h.clusterShow(),h.setZIndexOffset&&h.setZIndexOffset(0),t>1&&o.removeLayer(h),n.removeLayer(h._spiderLeg),delete h._spiderLeg);i._animationEnd(),i.fire("unspiderfied",{cluster:e,markers:a})},200)}}),r.MarkerClusterGroup.include({_spiderfied:null,unspiderfy(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),r.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim(t){r.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(t))},_unspiderfyWrapper(){this._unspiderfy()},_unspiderfy(t){this._spiderfied&&this._spiderfied.unspiderfy(t)},_noanimationUnspiderfy(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer(t){t._spiderLeg&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),this._map.removeLayer(t._spiderLeg),delete t._spiderLeg)}}),r.MarkerClusterGroup.include({refreshClusters(t){return t?t instanceof r.MarkerClusterGroup?t=t._topClusterLevel.getAllChildMarkers():t instanceof r.LayerGroup?t=t._layers:t instanceof r.MarkerCluster?t=t.getAllChildMarkers():t instanceof r.Marker&&(t=[t]):t=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(t),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(t),this},_flagParentsIconsNeedUpdate(t){let e,i;for(e in t)for(i=t[e].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers(t){let e,i;for(e in t)i=t[e],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),r.Marker.include({refreshIconOptions(t,e){const i=this.options.icon;return r.setOptions(i,t),this.setIcon(i),e&&this.__parent&&this.__parent._group.refreshClusters(this),this}});class ke{static createClusterLayer(t,e,i){ke.isAddClusterCss||(Object(n.inputCss)("\n .leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {\n -webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;\n -moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;\n -o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;\n transition: transform 0.3s ease-out, opacity 0.3s ease-in;\n }\n .leaflet-cluster-spider-leg {\n /* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */\n -webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;\n -moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;\n -o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;\n transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;\n }\n "),ke.isAddClusterCss=!0);const o={},s=t.renderer,{defaultSymbol:a,defaultLabelSymbol:l,defaultLabelExpressionInfo:h,radius:u,clusterBoundSymbol:c,maxScale:p,isExpandOnClick:f,isHoverShowBound:d,valueExpression:g,minHybridClusterCount:y,deconflictionStrategy:m}=s,_=s.clusterInfos||[];let v=20;if(e){const t=p/96*.0254,i=e.unproject(r.point(0,0),0),n=e.unproject(r.point(0,1),0);let o=e.distance(i,n),s=0;for(;s<=20&&o>t;)s+=1,o/=2;v=Math.max(s-1,0)}o.disableClusteringAtZoom=v,o.singleMarkerMode=!1,o.maxClusterRadius=u,o.polygonOptions=ue.convertSymboltoLeafletStyle(c),o.zoomToBoundsOnClick=f,o.showCoverageOnHover=d,o.deconflictionStrategy=m,o.maxClusterNum=y;const x=n.ExpressionParser.createValueExpressionParser(),b=x.parse(g);let w;const E={};h&&h.expression&&(w=x.parse(h.expression));for(let t=0;t<_.length;t++){const e=_[t];e&&e.labelExpressionInfo&&e.labelExpressionInfo.expression&&(E[e.labelExpressionInfo.expression]=x.parse(e.labelExpressionInfo.expression))}o.iconCreateFunction=(t=>{const e=t.getChildCount();let i,o=!0;if(1===e)i=t;else{const e=t.getAllChildMarkers(),n={};for(let t=0;t<e.length;t++){const i=e[t];n[i.options.groupName]?n[i.options.groupName].count+=1:n[i.options.groupName]={count:1,marker:i}}let r;for(const t in n)(void 0===r||r&&n[t].count>r.count)&&(r=n[t]);i=r.marker,o=!(Object.keys(n).length>1)}const s=Ne(b,i.attributes,e,o),h=Ae(_,s);let u=a,c=l,p=w;if(h&&(u=h.symbol,c=h.labelSymbol,h.labelExpressionInfo&&h.labelExpressionInfo.expression&&E[h.labelExpressionInfo.expression]&&(p=E[h.labelExpressionInfo.expression])),t instanceof r.Marker)if(c&&p){const i=function(t,e){return t.evaluate({$cluster_count:e})}(p,e),n=c.clone();n.text=i;const r=ue.convertSymboltoLeafletStyle(n);t.setTextIcon(r.icon)}else t._removeTextIcon();return function(t){const e=document.createElement("div"),i=document.createElement("div");let o=[10,10],s=0,a="none";if(n.SymbolType.pictureMarker===t.type)Object(n.defined)(t.width)&&(e.style.width=`${parseFloat(t.width)}px`,o[0]=parseFloat(t.width)),Object(n.defined)(t.height)&&(e.style.height=`${parseFloat(t.height)}px`,o[1]=parseFloat(t.height)),Object(n.defined)(t.xoffset)&&(e.style.marginLeft=t.xoffset),Object(n.defined)(t.yoffset)&&(e.style.marginTop=t.yoffset),Object(n.defined)(t.angle)&&(e.style.transform=`rotate(${t.angle}deg)`),Object(n.defined)(t.url)&&(e.style.backgroundImage=`url(${t.url})`,e.style.backgroundSize="100% 100%");else{const{size:i=20,outline:r=null,style:l="circle",path:h="",angle:u=0,xoffset:c=0,yoffset:p=0,color:f}=t;if(Object(n.defined)(r)){const{width:t,color:n}=r;"circle"===l&&(e.style.borderRadius=`${i}px`,e.style.backgroundClip="padding-box"),s=t,a=j.convertColorToRgb(n)}Object(n.defined)(f)&&(e.style.backgroundColor=j.convertColorToRgb(f),e.style.backgroundSize="100% 100%"),Object(n.defined)(i)&&(o=[i,i],e.style.width=`${i}px`,e.style.height=`${i}px`),Object(n.defined)(c)&&(e.style.marginLeft=`${c}px`),Object(n.defined)(p)&&(e.style.marginTop=`${p}px`),Object(n.defined)(u)&&(e.style.transform=`rotate(${u}deg)`)}const l=o[0]+2*s,h=o[1]+2*s;return i.style=`border:none;background-color:${a};border-radius:${"circle"===t.style?`${l}px`:"none"};padding:${s}px;`,i.appendChild(e),new r.DivIcon({html:i,iconSize:new r.Point(l,h),className:""})}(u)});const C=new Te(o);i=i||[];const L=[{groupName:"0",object:null}];for(let t=0;t<i.length;t++){const e=i[t],n=new ce(j.getAreaCenter(e.geometry)),r=e.attributes,o=Re(L,b,r,0,!0,_);n.options.groupName=o,C.addLayer(n),n.attributes=r}return C}}var De=ke;var ze=class extends n.BaseFeatureLayerView{onAdd(t){return this._addInnerLayer()}_processData(){return new Promise(t=>{})}onRemove(t){return super.onRemove(t),this.innerView.removeLayer(this.innerLayer),this.innerLayer=null,Promise.resolve(this)}onUpdate(t){const e=this.layer,i=this.innerLayer;return t.updateContent&&i&&t.updateContent.forEach(t=>{if(t&&"property"===t.operationType)switch(t.name){case"opacity":j.setVisibleOpacity(this.innerLayer,e._opacity,e._visible);break;case"visible":{const i=t.params&&t.params.length>0?t.params[0]:void 0,n=this._getLayerViewVisible(i);j.setVisibleOpacity(this.innerLayer,e._opacity,n);break}}if(t&&"method"===t.operationType)switch(t.name){case"refresh":this.innerView.removeLayer(this.innerLayer),this._addInnerLayer()}}),Promise.resolve(this)}_addInnerLayer(){return this._processData().then(t=>{const e=this.layer,i=this,n=this.innerView,r=e.renderer;i._initInnerLayer(e,n,t,r);const o=i._getLayerViewVisible();return j.setVisibleOpacity(i.innerLayer,e._opacity,o),i.innerLayer.addTo(n),new Promise(t=>{t(i)})})}_initInnerLayer(t,e,i,o){let s;o=o||{};let a=!1;if(this._isCommonRenderer(o))a=!0,s=r.featureGroup();else switch(o.type){case n.RendererType.cluster:s=De.createClusterLayer(t,e,i.features);break;default:n.Log.error("无法解析renderer信息")}return j.setVisibleOpacity(s,t._opacity,t._visible),s.commonLayerId=t.id,s._realIndex=t._realIndex,this.innerLayer=s,a&&this._initFeatures(i.features,o),s}_rendererChangeAction(t){const{sourceEventData:e={}}=t;if("renderer"===e.key){const t=e.oldValue,i=e.value;if(!this._isCommonRenderer(t)||!this._isCommonRenderer(i))return this.innerView.removeLayer(this.innerLayer),void this._addInnerLayer()}const i=this.layer.renderer;this._isCommonRenderer(i)?super._rendererChangeAction(t):De.updateCluster(this.innerLayer,this.layer,this.view)}_isCommonRenderer(t){return t&&[n.RendererType.classBreak,n.RendererType.simple,n.RendererType.uniqueValue,n.RendererType.random,n.RendererType.rank].some(e=>e===t.type)}};var Be=class extends ze{_processData(){const t=this.layer;return Promise.resolve(t._source)}};class Fe{}Fe.addIGSVectorLayer=function(t,e,i){const o=new(r.TileLayer.extend({options:{gdbps:null,filters:null,style:null,f:null,keepCache:!0,guid:null,attribution:"Zondy Map vector Data",proj:null,noWrap:!0},initialize(t){t=t||{},this.url=t.url||"",this.layer=t.layer,r.setOptions(this,t),r.stamp(this)},onAdd(t){this._crs=t.options.crs,this._initLayerUrl(),r.TileLayer.prototype.onAdd.call(this,t)},getTileUrl(t){const e=this._tileCoordsToBounds(t),i=this._crs.project(e.getNorthWest()),n=this._crs.project(e.getSouthEast());let r=`&bbox=${i.x},${n.y},${n.x},${i.y}`;return this.options.keepCache||(r+=`&temp=${Math.random()}`),this._layerUrl+encodeURI(r)},_initLayerUrl(){let t=`${this.url}?`;t+=encodeURI(this._initAllRequestParams().join("&")),this._layerUrl=t},_initAllRequestParams(){const t=this.options||{},e=[];if("1.0"===this.layer._igsVersion){const i=t.f||"png";e.push(`f=${i}`),t.gdbps&&e.push(`gdbps=${t.gdbps}`);let o=this.options.tileSize;o instanceof r.Point||(o=r.point(o,o)),e.push(`w=${o.x}`),e.push(`h=${o.y}`),t.filters&&e.push(`filters=${t.filters}`),t.style&&e.push(`style=${JSON.stringify(t.style)}`),t.proj&&e.push(`proj=${t.proj}`);const s=t.guid||Object(n.getGUID)();e.push(`guid=${s}`),void 0!==t.isAntialiasing&&null!==t.isAntialiasing&&e.push(`isAntialiasing=${t.isAntialiasing}`),t.tokenKey&&t.tokenValue&&e.push(`${t.tokenKey}=${t.tokenValue}`)}else{const i=t.f||"image";e.push(`f=${i}`),t.gdbps&&e.push(`urls=${t.gdbps}`);let o=this.options.tileSize;o instanceof r.Point||(o=r.point(o,o)),e.push(`size=${o.x},${o.y}`),t.projectionSrs&&e.push(`projectionSrs=${t.projectionSrs}`);const s=t.clientId||Object(n.getGUID)();e.push(`clientId=${s}`),void 0!==t.isAntialiasing&&null!==t.isAntialiasing&&e.push(`isAntialiasing=${t.isAntialiasing}`),t.tokenKey&&t.tokenValue&&e.push(`${t.tokenKey}=${t.tokenValue}`)}return e},redraw(){if(this._map){this._removeAllTiles();const t=Object(n.getGUID)();this.options.guid=t,this._initLayerUrl(),this._update()}return this}}))({url:t,gdbps:[e.gdbp],tokenKey:e.tokenKey,tokenValue:e.tokenValue,filters:e.definitionExpression?`0:${e.definitionExpression}`:"",layer:e}).addTo(i);return o.id=e.id,o};var Ve=Fe;var je=class extends ze{_processData(){const t=this.layer,e=t._createQueryOption();return e.resultRecordCount=1e5,t.queryFeatures(e).then(t=>t)}onAdd(t){const e=this,i=this.layer,r=this.innerView;if("server"===i.renderMode){const t=i.url;if("1.0"===i._igsVersion){const o=Object(n.getBaseUrl)(t);e.innerLayer=Ve.addIGSVectorLayer(`${o}/igs/rest/mrms/layers`,i,r)}else{const o=Object(n.getBaseUrl)(t);e.innerLayer=Ve.addIGSVectorLayer(`${o}/igs/rest/mrms/layers`,i,r)}const o=e._getLayerViewVisible();return j.setVisibleOpacity(e.innerLayer,i._opacity,o),Promise.resolve(e)}return super.onAdd(t)}onRemove(t){const e=this;return this.layer.gdbp?(this.innerView.removeLayer(this.innerLayer),Promise.resolve(e)):super.onRemove(t)}};var Ge=class extends n.GroupLayerView{};var Ue=class extends ze{_processData(){return this.layer.queryFeatures().then(t=>t)}};var He=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=K.addArcGISMapImageLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"index":this.innerLayer.setZIndex(this.layer._realIndex)}}return Promise.resolve(this)}};var qe=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=it.addArcGISTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"index":this.innerLayer.setZIndex(this.layer._realIndex)}}return Promise.resolve(this)}};var Ze=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=J.addWebTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"visible":const t=i.params&&i.params.length>0?i.params[0]:void 0,e=this._getLayerViewVisible(t);this.innerLayer.setVisible(e);break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":this.innerLayer.redraw();break;case"index":this.innerLayer.setZIndex(this.layer._realIndex);break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(j.convertClippingArea(t));break}}}return Promise.resolve(this)}};function Xe(t){return t.length>2?new r.LatLng(t[1],t[0],t[2]):new r.LatLng(t[1],t[0])}function Ye(t,e,i){const n=[];for(let r,o=0,s=t.length;o<s;o++)r=e?Ye(t[o],e-1,i):(i||Xe)(t[o]),n.push(r);return n}function We(t,e){return t.isGeographic?e:(e.spatialReference=t,n.Projection.project(e,new n.SpatialReference("EPSG:4326")))}var $e=class{static toLeafletCoords(t,e){let i=[];const r=Object(n.defaultValue)(e,{}),o=Object(n.defaultValue)(r.additional,void 0);let s=Object(n.defaultValue)(n.SpatialReference.fromJSON(r.spatialReference),new n.SpatialReference("EPSG:4326"));switch(t.spatialReference&&(s=t.spatialReference),t.type){case n.GeometryType.point:{let e=t.clone();const n=(e=We(s,e)).coordinates;i.push(Xe(n));break}case n.GeometryType.multiPoint:{let e=t.clone();i=Ye((e=We(s,e)).coordinates,0,Xe);break}case n.GeometryType.lineString:{let e=t.clone();i=Ye((e=We(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,0,Xe);break}case n.GeometryType.multiLineString:case n.GeometryType.polygon:{let e=t.clone();i=Ye((e=We(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,1,Xe);break}case n.GeometryType.multiPolygon:{let e=t.clone();i=Ye((e=We(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,2,Xe);break}case n.GeometryType.extent:{let e=t.clone();const n=(e=We(s,e)).xmin,r=e.xmax,o=e.ymin,a=e.ymax;i.push([o,n]),i.push([a,r]);break}case n.GeometryType.circle:{let e=t.clone();const n=(e=We(s,e)).center;i.push([n[1],n[0]]);break}}return i}};var Ke=r.CircleMarker.extend({options:{fill:!0,shape:"circle",radius:10,rotation:0,xoffset:0,yoffset:0,path:""},setStyle(t){const e=t&&t.radius||this.options.radius||this._radius;r.Path.prototype.setStyle.call(this,t),this.setRadius(e)},setPath(t){return this.options.path=t,this.redraw()},getPath(){return this.options.path},setXoffset(t){return this.options.xoffset=t,this.redraw()},getXoffset(){return this.options.xoffset},setYoffset(t){return this.options.yoffset=t,this.redraw()},getYoffset(){return this.options.yoffset},setRadius(t){return this.options.radius=t,this.redraw()},getRadius(){return this.options.radius},setRotation(t){return this.options.rotation=t,this.redraw()},getRotation(){return this.options.rotation},_updatePath(){this._renderer._updateShape(this)},toGeoJSON(){return r.GeoJSON.getFeature(this,{type:"Point",coordinates:r.GeoJSON.latLngToCoords(this.getLatLng())})}});const Qe=$e.toLeafletCoords,Je=ue.convertSymboltoLeafletStyle;function ti(t,e,i){let o;switch(t){case n.SymbolType.simpleMarker:o=new Ke(e,i);break;case n.SymbolType.pictureMarker:o=r.marker(e,i);break;case n.SymbolType.line:o=r.polyline(e,i);break;case n.SymbolType.text:o=r.marker(e,i);break;case n.SymbolType.fill:case n.SymbolType.pictureFill:o=r.polygon(e,i);break;default:n.Log.error("符号类型错误,不合法的符号类型")}return o}function ei(t,e,i){const r=[];if(t){const{color:o,style:s,placement:a}=t,l=j.calcLineMarkerDetail(i),{angle1:h,angle2:u,latlng1:c,latlng2:p}=l,f=Je(new n.SimpleMarkerSymbol({angle:h,color:o,outline:{color:o,width:e},style:s,size:Math.max(15,4*e)})),d=ti(n.SymbolType.simpleMarker,c,f),g=ti(n.SymbolType.simpleMarker,p,Je(new n.SimpleMarkerSymbol({angle:u,color:o,outline:{color:o,width:e},style:s,size:Math.max(15,4*e)})));"begin"===a?r.push(d):"end"===a?r.push(g):(r.push(d),r.push(g))}return r}function ii(t,e){e.__marker__group&&e.removeLayer(e.__marker__group);const i=t.symbol.width,n=ei(t.symbol.marker,i,t.geometry.coordinates),o=new r.FeatureGroup(n);e.__marker__group=o,e.addLayer(o)}function ni(t,e){e.__marker__group&&e.removeLayer(e.__marker__group);const i=t.symbol.width,n=t.symbol.marker;let o=[];t.geometry.coordinates.forEach(t=>{const e=ei(n,i,t);o=o.concat(e)});const s=new r.FeatureGroup(o);e.__marker__group=s,e.addLayer(s)}function ri(t,e,i){let r;return r=n.SymbolType.simpleMarker===t||n.SymbolType.text===t||n.SymbolType.pictureMarker===t?j.getAreaCenter(e):Qe(e,{additional:i.additional})}function oi(t){const e=Je(t.symbol),i=t.symbol.type;return ti(i,ri(i,t.geometry.toPolygon(),t),e)}function si(t){let e=null;if(!(t instanceof n.Feature))return e;if(!t.geometry)return n.Log.error("几何不存在"),e;switch(t.geometry.type){case n.GeometryType.point:e=function(t){const e=Qe(t.geometry),i=Je(t.symbol);return ti(t.symbol.type,e[0],i)}(t);break;case n.GeometryType.lineString:e=function(t){const e=Qe(t.geometry,{additional:t.additional}),i=Je(t.symbol),n=t.symbol.type,o=new r.FeatureGroup,s=ti(n,e,i);return o.__line__graphic=s,o.addLayer(s),t.symbol.marker&&ii(t,o),o}(t);break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:e=function(t){const e=Je(t.symbol),i=t.symbol.type;return ti(i,ri(i,t.geometry,t),e)}(t);break;case n.GeometryType.extent:case n.GeometryType.circle:e=oi(t);break;case n.GeometryType.multiPoint:e=function(t){const e=Qe(t.geometry),i=Je(t.symbol),n=t.symbol.type,o=[];return e.forEach(t=>{const e=ti(n,t,i);o.push(e)}),new r.FeatureGroup(o)}(t);break;case n.GeometryType.multiLineString:e=function(t){const e=Qe(t.geometry,{additional:t.additional}),i=Je(t.symbol),n=t.symbol.type,o=new r.FeatureGroup,s=ti(n,e,i);return o.__line__graphic=s,o.addLayer(s),t.symbol.marker&&ni(t,o),o}(t)}return e}const ai=ue.convertSymboltoLeafletStyle;var li=class extends n.FeatureRender{drawFeature(t,e){if(t){const{layerVisible:i,layerOpacity:n}=t;e.forEach(e=>{if(e.visible){const r=si(e);r.commonFeatureId=e.id,r.commonLayerId=t.commonLayerId,j.setGraphicVisibleOpacity(r,n,i),t.addLayer(r)}})}}updateFeature(t,e,i){t&&(super.updateFeature(t,e,i),e.forEach((e,n)=>{const r=i[n];r&&e&&this._update(t,r.symbolUpdated,r.geometryUpdated,e)}))}_update(t,e,i,r){const o=r.geometry,s=r.symbol,a=!!i,l=!!e;let h=!1;const u=this._getGraphicByFeatureId(t,r.id);if(r.visible)if(u){if(e){const{key:t,oldValue:i,value:n}=e;i&&n&&i.type!==n.type&&(h=!0),"type"===t&&(h=!0)}if(!h)switch(o.type){case n.GeometryType.point:if(l){const t=ai(r.symbol)||{};u.setStyle(t)}if(a){const t=$e.toLeafletCoords(o);u.setLatLng(t[0])}break;case n.GeometryType.multiPoint:if(l){const t=ai(r.symbol);u.eachLayer(e=>{e.setStyle(t)})}if(a){const t=$e.toLeafletCoords(o),e=Object.keys(u._layers).map(t=>u._layers[t])||[],i=t.length;let n=e.length;if(n!==i)if(n>i){for(;n!==i;)u.removeLayer(e[n-1]),n-=1;let r=0;u.eachLayer(e=>{e.setLatLng(t[r]),r+=1})}else{const i=r.symbol.type,o=ai(r.symbol);t.forEach((t,r)=>{if(r<n)e[r].setLatLng(t);else{const e=ti(i,t,o);u.addLayer(e)}})}else{let e=0;u.eachLayer(i=>{i.setLatLng(t[e]),e+=1})}}break;case n.GeometryType.lineString:if(l){const t=ai(r.symbol);u.__line__graphic&&u.__line__graphic.setStyle(t)}if(a){const t=$e.toLeafletCoords(o);u.__line__graphic&&u.__line__graphic.setLatLngs(t)}s.marker&&ii(r,u);break;case n.GeometryType.multiLineString:if(l){const t=ai(r.symbol);u.__line__graphic&&u.__line__graphic.setStyle(t)}if(a){const t=$e.toLeafletCoords(o);u.__line__graphic&&u.__line__graphic.setLatLngs(t)}s.marker&&ni(r,u);break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:if(l){const t=ai(r.symbol);u.setStyle(t)}if(a){const t=ri(s.type,o,r);u.setLatLngs?u.setLatLngs(t):u.setLatLng&&u.setLatLng(t)}break;case n.GeometryType.extent:case n.GeometryType.circle:if(l){const t=ai(r.symbol);u.setStyle(t)}if(a){const t=ri(s.type,o.toPolygon(),r);u.setLatLngs?u.setLatLngs(t):u.setLatLng&&u.setLatLng(t)}}h&&this._redrawFeature(t,r)}else this.drawFeature(t,[r]);else this.clearFeature(t,[r])}clearFeature(t,e){t&&(super.clearFeature(t,e),e.forEach(e=>{const i=this._getGraphicByFeatureId(t,e.id);i&&t.removeLayer(i)}))}clear(t){t&&(super.clear(t),t.clearLayers())}_getGraphicByFeatureId(t,e){let i=null;return t&&e&&t.eachLayer(t=>{if(t.commonFeatureId===e)return i=t}),i}_redrawFeature(t,e){this.clearFeature(t,[e]),this.drawFeature(t,[e])}};function hi(t,e){console.log(e);let i=null;switch(e.type){case n.LayerType.igsVectorTile:case n.LayerType.arcgisVectorTile:i=new Gt({view:t,layer:e});break;case n.LayerType.wmts:i=new Ht({view:t,layer:e});break;case n.LayerType.igsMapImage:i=new Kt({view:t,layer:e});break;case n.LayerType.igsTile:i=new qt({view:t,layer:e});break;case n.LayerType.wms:i=new Ut({view:t,layer:e});break;case n.LayerType.echarts:i=new ie({view:t,layer:e});break;case n.LayerType.mapv:i=new oe({view:t,layer:e});break;case n.LayerType.graphics:i=new Jt({view:t,layer:e,render:new li});break;case n.LayerType.geojson:i=new Be({view:t,layer:e,render:new li});break;case n.LayerType.igsFeature:i=new je({view:t,layer:e,render:new li});break;case n.LayerType.group:i=new Ge({view:t,layer:e});break;case n.LayerType.wfs:i=new Ue({view:t,layer:e,render:new li});break;case n.LayerType.arcgisMapImage:i=new He({view:t,layer:e});break;case n.LayerType.arcgisTile:i=new qe({view:t,layer:e});break;case n.LayerType.webTileLayer:i=new Ze({view:t,layer:e})}return i}class ui extends n.MapView{constructor(t){if(super(t),t=Object(n.defaultValue)(t,{}),this._options=t,this._center=Object(n.defaultValue)(t.center,void 0),this._center&&Array.isArray(this._center)&&this._center.length>1&&(this._center=new n.Point({coordinates:[this._center[0],this._center[1]]})),this.crs=void 0,this._extent=Object(n.defaultValue)(t.extent,void 0),this.animation=Object(n.defaultValue)(t.animation,!0),this.width=void 0,this.height=void 0,this._zoom=Object(n.defaultValue)(t.zoom,0),this._resolution=0,this._scale=Object(n.defaultValue)(t.scale,void 0),this.maxScale=Object(n.defaultValue)(t.maxScale,void 0),this.minScale=Object(n.defaultValue)(t.minScale,void 0),this.popup=Object(n.defaultValue)(t.popup,void 0),this.preferCanvas=Object(n.defaultValue)(t.preferCanvas,!1),this._spatialReference=void 0,this._referenceLayer=void 0,this.spatialReferenceLocked=Object(n.defaultValue)(t.spatialReferenceLocked,!1),this._rotation=Object(n.defaultValue)(t.rotation,0),this.stationary=!0,this.engineType="leaflet",this._zoomSnap=Object(n.defaultValue)(t.zoomSnap,1),this._zoomDelta=Object(n.defaultValue)(t.zoomDelta,1),this._isCustomCrs=!1,this._map._initLeafletView=!0,this._screenshot=null,t.fullExtent){let e=n.Extent.fromJSON(t.fullExtent.toJSON());e.spatialReference.isGeographic||(e=n.Projection.project(e,new n.SpatialReference({wkid:4326}))),this._initFullExtent=e}this._fullExtent=this._initFullExtent,this._mapExtent=null}flyTo(t,e={animate:!0}){t=Object(n.defaultValue)(t,{});const i=Object(n.defaultValue)(t.zoom,1),r=this._getFlyToCenter(t),o=this._getFlyToExtent(t);if(this._innerView){if(this._zoomSnap>z&&(this._innerView.options.zoomSnap=z),this._zoomDelta>z&&(this._innerView.options.zoomDelta=z),r){let t=r.coordinates[1],o=r.coordinates[0];if(this._fullExtent&&((t>this._fullExtent.ymax||t<this._fullExtent.ymin)&&(t=(this._fullExtent.ymax+this._fullExtent.ymin)/2),(o>this._fullExtent.xmax||o<this._fullExtent.xmin)&&(o=(this._fullExtent.xmax+this._fullExtent.xmin)/2)),isFinite(t)&&isFinite(o)){let s=!1;const a=this._innerView.getCenter();if(i===this._zoom&&t===a.lat&&o===a.lng&&(s=!0),!s){let s;this._innerView&&this._innerView.options&&this._innerView.options.maxBounds&&(s=this._innerView._limitCenter({lat:t,lng:o},i,this._innerView.options.maxBounds)),s&&s.lat!==t&&s.lng!==o?n.Log.warning(`中心点${r}、层级${i}的视图,范围超过最大视图范围!`):this._innerView.setView([t,o],i,e)}}}else if(o){let t=o.xmin,i=o.xmax,n=o.ymin,r=o.ymax;this._fullExtent&&(t<this._fullExtent.xmin&&(t=this._fullExtent.xmin),i>this._fullExtent.xmax&&(i=this._fullExtent.xmax),n<this._fullExtent.ymin&&(n=this._fullExtent.ymin),r>this._fullExtent.ymax&&(r=this._fullExtent.ymax)),isFinite(t)&&isFinite(i)&&isFinite(n)&&isFinite(r)&&this._setViewExtent(o,e)}this._zoomSnap!==this._innerView.options.zoomSnap&&(this._innerView.options.zoomSnap=this._zoomSnap),this._zoomDelta!==this._innerView.options.zoomDelta&&(this._innerView.options.zoomDelta=this._zoomDelta)}}goTo(t={},e={}){let i,r,o=new Promise(t=>{t()});if(this._innerView){let s;if(Object(n.isNull)(t.center)&&Object(n.isNull)(t.zoom)&&Object(n.isNull)(t.scale)||(i=Object(n.isNull)(t.center)?this._center:this._getFlyToCenter({center:t.center}),r=!Object(n.isNull)(t.scale)&&t.scale>0?this._getZoomByScale(t.scale):!Object(n.isNull)(t.zoom)&&t.zoom>0?t.zoom:this._zoom),!Object(n.isNull)(t.target)){const e=this._getTargetExtent(t.target);e.xmin!==e.xmax&&e.ymin!==e.ymax?s=e:i=this._getFlyToCenter({center:new n.Point({coordinates:[e.xmin,e.ymin]})})}const a={animate:!0,duration:200};if(Object(n.isNull)(e)||(Object(n.isNull)(e.animate)||(a.animate=e.animate),Object(n.isNull)(e.duration)||(a.duration=e.duration)),this._zoomSnap>z&&(this._innerView.options.zoomSnap=z),this._zoomDelta>z&&(this._innerView.options.zoomDelta=z),i){let t=i.coordinates[1],e=i.coordinates[0];if(this._fullExtent&&((t>this._fullExtent.ymax||t<this._fullExtent.ymin)&&(t=(this._fullExtent.ymax+this._fullExtent.ymin)/2),(e>this._fullExtent.xmax||e<this._fullExtent.xmin)&&(e=(this._fullExtent.xmax+this._fullExtent.xmin)/2)),isFinite(t)&&isFinite(e)){let s=!1;const l=this._innerView.getCenter();if(r===this._zoom&&t===l.lat&&e===l.lng&&(s=!0),s)return o;let h;this._innerView&&this._innerView.options&&this._innerView.options.maxBounds&&(h=this._innerView._limitCenter({lat:t,lng:e},r,this._innerView.options.maxBounds)),h&&h.lat!==t&&h.lat!==e?n.Log.warning(`中心点${i}、层级${r}的视图,范围超过最大视图范围!`):o=new Promise(i=>{this._innerView.setView([t,e],r,a),this._innerView.once("moveend",()=>{i()})})}}else if(s){let t=s.xmin,e=s.xmax,i=s.ymin,n=s.ymax;this._fullExtent&&(t<this._fullExtent.xmin&&(t=this._fullExtent.xmin),e>this._fullExtent.xmax&&(e=this._fullExtent.xmax),i<this._fullExtent.ymin&&(i=this._fullExtent.ymin),n>this._fullExtent.ymax&&(n=this._fullExtent.ymax)),isFinite(t)&&isFinite(e)&&isFinite(i)&&isFinite(n)&&(o=this._setViewExtent(s,a))}this._zoomSnap!==this._innerView.options.zoomSnap&&(this._innerView.options.zoomSnap=this._zoomSnap),this._zoomDelta!==this._innerView.options.zoomDelta&&(this._innerView.options.zoomDelta=this._zoomDelta)}return o}_getFlyToExtent(t){let e=t.extent;if(!e)return;const i=n.Projection.project(new n.Point({coordinates:[e.xmin,e.ymax],spatialReference:e.spatialReference}),new n.SpatialReference("EPSG:4326")),r=n.Projection.project(new n.Point({coordinates:[e.xmax,e.ymin],spatialReference:e.spatialReference}),new n.SpatialReference("EPSG:4326"));return e=new n.Extent({xmin:i.coordinates[0],ymin:r.coordinates[1],xmax:r.coordinates[0],ymax:i.coordinates[1]})}_setViewExtent(t,e){t.spatialReference&&!t.spatialReference.isGeographic&&(t=n.Projection.project(t,new n.SpatialReference("EPSG:4326")));const i=t.xmin,o=t.ymin,s=t.xmax,a=t.ymax,l=this.getExtent();let h=!1;if(l.ymin===o&&l.xmin===i&&l.ymax===a&&l.xmax===s)h=!0;else{const i=this._innerView.getCenter(),n=this._innerView._getBoundsCenterZoom(r.latLngBounds(r.latLng(t.ymin,t.xmin),r.latLng(t.ymax,t.xmax)));if(n.zoom===this._zoom&&n.center.lat===i.lat&&n.center.lng===i.lng&&(h=!0),!h)return new Promise(t=>{this._innerView.setView([n.center.lat,n.center.lng],n.zoom,e),this._innerView.once("moveend",()=>{t()})})}return new Promise(t=>{t()})}_getLatLngFromExtent(t){const e=new n.SpatialReference("EPSG:4326"),i=n.Projection.project(t,e);return{northEastLatlng:new r.latLng(i.ymax,i.xmax),southWestLatlng:new r.latLng(i.ymin,i.xmin)}}_getLatLngFromPoint(t){const e=new n.SpatialReference("EPSG:4326"),i=n.Projection.project(t,e);return new r.latLng(i.coordinates[1],i.coordinates[0])}_initViewEvent(){super._initViewEvent();const t=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null,dragMouseUp:!1},t.fire(n.ViewEventType.loaded,{}),this._innerView.on("click",e=>{t._dragParams.dragMouseUp?t._dragParams.dragMouseUp=!1:(t._clickStore=setTimeout(function(){t._clickStore&&t.fire(n.ViewEventType.click,jt.getMouseEvent(e,t))},300),t.fire(n.ViewEventType.immediateClick,jt.getMouseEvent(e,t)))}),this._innerView.on("contextmenu",e=>{t._clickStore=setTimeout(function(){t._clickStore&&t.fire(n.ViewEventType.click,jt.getMouseEvent(e,t))},300),t.fire(n.ViewEventType.immediateClick,jt.getMouseEvent(e,t))}),this._innerView.on("dblclick",e=>{t._clickStore&&(clearTimeout(this._clickStore),t._clickStore=null),t.fire(n.ViewEventType.doubleClick,jt.getMouseEvent(e,t))}),this._innerView.on("mousedown",e=>{t.fire(n.ViewEventType.pointerDown,jt.getMouseEvent(e,t)),this._dragParams.isDrag||(this._dragParams.origin={x:e.originalEvent.layerX,y:e.originalEvent.layerY},this._dragParams.button=e.originalEvent.button,this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)}),this._innerView.on("mouseup",e=>{t.fire(n.ViewEventType.pointerUp,jt.getMouseEvent(e,t)),t._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",this._innerView.dragging._enabled||(t._dragParams.dragMouseUp=!0),t.fire(n.ViewEventType.drag,jt.getDragEvent(e,t,t._dragParams.origin,this._dragParams.action))),t._dragParams.isDrag=!1,t._dragParams.origin=null,t._dragParams.action="",t._dragParams.button=null}),this._innerView.on("mousemove",e=>{t.fire(n.ViewEventType.pointerMove,jt.getMouseEvent(e,t)),t._dragParams.isDrag?(t.fire(n.ViewEventType.drag,jt.getDragEvent(e,t,t._dragParams.origin,t._dragParams.action,t._dragParams.button)),t._dragParams.action="update"):"mouse-down"===this._dragParams.action&&(this._dragParams.action="start",t._dragParams.isDrag=!0)}),this._innerView.on("keydown",e=>{t.fire(n.ViewEventType.keyDown,jt.getKeyEvent(e,t,n.ViewEventType.keyDown))}),this._innerView.on("keyup",e=>{t.fire(n.ViewEventType.keyUp,jt.getKeyEvent(e,t,n.ViewEventType.keyUp))}),this._innerView.on("movestart",()=>{t.stationary=!1}),this._innerView.on("zoom",e=>{t.fire(n.ViewEventType.zoom,{zoom:e.target._zoom,event:e})}),this._innerView.on("zoomend",e=>{t._zoomEndHandler(),t.fire(n.ViewEventType.viewChange,jt.getViewChangeEvent(e,t))}),this._innerView.on("moveend",e=>{t._moveEndHandler(),t.fire(n.ViewEventType.viewChange,jt.getViewChangeEvent(e,t)),t.stationary=!0}),this._innerView.on("resize",e=>{t.fire(n.ViewEventType.resize,{oldWidth:e.oldSize.x,oldHeight:e.oldSize.y,width:e.newSize.x,height:e.newSize.y}),t._initSize()}),this.fire(n.ViewEventType.viewCreated,this._innerView)}_mapActionControl(t,e){this._innerView&&("drag-pan"===t?e?this._innerView.dragging.enable():this._innerView.dragging.disable():"double-click-zoom"===t&&(e?this._innerView.doubleClickZoom.enable():this._innerView.doubleClickZoom.disable()))}_initView(t,e){t&&!this._center&&this.fullExtent&&(this._center=this._fullExtent.center);const i=this._getMaxBounds();let o={preferCanvas:this.preferCanvas,attributionControl:Object(n.defaultValue)(e.attributionControl,!1),zoomControl:Object(n.defaultValue)(e.zoomControl,!0),doubleClickZoom:Object(n.defaultValue)(e.doubleClickZoom,!0),dragging:Object(n.defaultValue)(e.dragging,!0),zoomSnap:this._zoomSnap,zoomDelta:this._zoomDelta,trackResize:Object(n.defaultValue)(e.trackResize,!0),keyboard:Object(n.defaultValue)(e.keyboard,!0),keyboardPanDelta:Object(n.defaultValue)(e.keyboardPanDelta,80),scrollWheelZoom:Object(n.defaultValue)(e.scrollWheelZoom,!0),wheelDebounceTime:Object(n.defaultValue)(e.wheelDebounceTime,40),wheelPxPerZoomLevel:Object(n.defaultValue)(e.wheelDebounceTime,60),tapHold:Object(n.defaultValue)(e.tapHold,!0),tapTolerance:Object(n.defaultValue)(e.tapTolerance,15),touchZoom:Object(n.defaultValue)(e.touchZoom,!0),bounceAtZoomLimits:Object(n.defaultValue)(e.bounceAtZoomLimits,!0),crs:this.crs,center:this._center&&this._center.coordinates?[this._center.coordinates[1],this._center.coordinates[0]]:[0,0],maxBounds:i,zoom:this._zoom,zoomAnimation:this.animation,config:n.Config,rotate:!0,bearing:this._rotation};if(o=Object.assign(o,this.extendOptions),this._innerView=r.map(this._viewId,o),this.ui=new Ft({view:this}),this._initViewEvent(),this._extent){let t=this._extent;this._extent.spatialReference.isGeographic||(t=n.Projection.project(this._extent.clone(),new n.SpatialReference({wkid:4326}))),(t.xmax>this._fullExtent.xmax||t.ymax>this._fullExtent.ymax||t.xmin<this._fullExtent.xmin||t.ymin<this._fullExtent.ymin)&&(t=this._fullExtent),this.flyTo({extent:t},{animate:!1})}return!this._extent&&this._scale&&this._center&&t&&this._initScale(),this._initSize(),this._initScaleLimit(),this._initPopup(),this._initCursor(),this._innerView.whenReady(()=>{this.getZoom(),this.getCenter(),this.getExtent(),this.getScale()}),new Promise(t=>{t(self)})}_reCreateView(t){return this._innerView&&(this._innerView._animatingZoom=!1,this._innerView.remove()),this._initView(t,this._options)}_resetExtent(){this._extent&&(this._extent=void 0,this._zoom=Math.max(this.minZoom,0))}_createCrsObject(t){if(t.spatialReference&&t.lods&&t.origin&&t.extent)return new l({wkid:t.spatialReference.wkid,wkt:t.spatialReference.wkt,lods:t.lods,origin:t.origin,extent:t.extent})}_processEvent(t){super._processEvent(t),t.type===n.MapEventType.layerRemove&&(this._map._isRemoveMany||this._map._isRemoveAll||!this._map._canResetView||this._setSpatialReference()),t.type===n.MapEventType.layerRemoveMany&&this._map._canResetView&&t.layers&&this._setSpatialReference()}_initSize(){const t=this._innerView.getSize();this.width=t.x,this.height=t.y}destroy(){this._innerView.remove()}getCenter(){const t=this._innerView.getCenter();let e=new n.Point({coordinates:[t.lng,t.lat]});this._center=e;const i=this._spatialReference;return i.isGeographic||(e=n.Projection.project(e,i)),e}setCenter(t){this._innerView&&(Array.isArray(t)&&t.length>1?(this._center=new n.Point({coordinates:[t[0],t[1]],spatialReference:this._spatialReference}),this.flyTo({zoom:this._zoom,center:this._center})):t instanceof n.Point&&(this._center=t,this.flyTo({zoom:this._zoom,center:this._center})))}getZoom(){return this._zoom=this._innerView.getZoom(),this._zoom}setZoom(t){if(!this._innerView)return;const e=Math.max(this.minZoom,t);this.flyTo({zoom:e,center:this._center})}getMinZoom(){return this._innerView.getMinZoom()}getSize(){return this._innerView.getSize()}getMaxZoom(){return this._innerView.getMaxZoom()}getPixelExtent(){return this._innerView.getPixelBounds()}getPixelCenter(){return this._innerView.getPixelOrigin()}getPixelWorldExtent(){return this._innerView.getPixelWorldBounds()}toJSON(){const t=super.toJSON();return t.extent=Object(n.toJSON)(this._extent,n.Extent),t.animation=this.animation,t.width=this.width,t.height=this.height,t.preferCanvas=this.preferCanvas,t.spatialReferenceLocked=this.spatialReferenceLocked,t}clone(){return Object(n.cloneObject)(this)}static fromJSON(t){return new ui(t)}toMap(t){const e=this._innerView.containerPointToLatLng(t);let i=new n.Point({coordinates:[e.lng,e.lat]});const r=this._spatialReference;return r.isGeographic?i.spatialReference=r:i=n.Projection.project(i,r),i}toScreen(t){let e=n.Geometry.fromJSON(t);return e.spatialReference.isGeographic||(e=n.Projection.project(e,new n.SpatialReference({wkid:4326}))),this._innerView.latLngToContainerPoint([e.coordinates[1],e.coordinates[0]])}takeScreenshot(t){t.view=this;let e=null;return this._screenshot?e=this._screenshot._addView():(this._screenshot=new $t(t),e=this._screenshot._addView()),e}getExtent(){if(!this._innerView)return;const t=this._innerView.getGeoBoundsCoord(),e=new n.Extent({xmin:t.xmin,ymin:t.ymin,xmax:t.xmax,ymax:t.ymax,spatialReference:this._spatialReference});return this._extent=e,e}getZoomByExtent(t){let e=0;if(this._innerView){let i=n.Extent.fromJSON(t.toJSON());i.spatialReference.isGeographic||(i=n.Projection.project(i,new n.SpatialReference("EPSG:4326")));const o=r.latLng(i.ymin,i.xmin),s=r.latLng(i.ymax,i.xmax),a=r.latLngBounds(o,s);e=this._innerView.getBoundsZoom(a)}return e}setExtent(t){this._innerView&&(this._extent=t,this.flyTo({extent:t}))}_zoomEndHandler(){this.getExtent(),this.getZoom(),this.getCenter(),this.getScale(),this.getResolution(),this._showLayerByScale()}_moveEndHandler(){this.getCenter(),this.getExtent()}_initScaleLimit(){if(void 0!==this._options.minScale)if(this.minScale>0){const t=this._getZoomByScale(this.minScale);void 0!==t&&(this.minZoom=t,this._innerView.setMinZoom(this.minZoom))}else this.minZoom=void 0,this.minScale=0,this._innerView.setMinZoom(this.minZoom);else{const t=this._innerView.getMinZoom();isFinite(t)?(this.minZoom=t,this.minScale=this._getScaleByZoom(this.minZoom)):(this.minZoom=void 0,this.minScale=void 0)}if(void 0!==this._options.maxScale)if(this.maxScale>0){const t=this._getZoomByScale(this.maxScale);void 0!==t&&(this.maxZoom=t,this._innerView.setMaxZoom(this.maxZoom))}else this.maxScale<=0&&(this.maxZoom=void 0,this.maxScale=0,this._innerView.setMaxZoom(this.maxZoom));else{let t=this._innerView.getMaxZoom();const e=((this.crs||{}).options||{}).lods;e&&Array.isArray(e)&&t>=e.length-1&&(t=e.length-1,this._innerView.setMaxZoom(t)),isFinite(t)?(this.maxZoom=t,this.maxScale=this._getScaleByZoom(this.maxZoom)):(this.maxZoom=void 0,this.maxScale=void 0)}!this._scale||this._scale<=0?this._scale=this.minScale:this._scale>this.minScale?this._scale=this.minScale:this._scale<this.maxScale&&(this._scale=this.maxScale)}_limitZoomByExtent(t){this._innerView.getBoundsZoom(t);this._innerView.options.minZoom=this.minZoom}_getMaxBounds(){return function(t){if(t){const e=r.latLng(t.ymin,t.xmin),i=r.latLng(t.ymax,t.xmax);return r.latLngBounds(e,i)}return null}(this._fullExtent)}_initPopup(){this.popup=new Zt({view:this})}hitTest(t){let e=[];return e=this.preferCanvas?this._hitTestCanvas(t):this._hitTestSVG(t)}_hitTestSVG(t){const e=this,i=[],r=this._innerView._container.getBoundingClientRect();document.elementsFromPoint(r.x+t.x,r.y+t.y).forEach(t=>{t&&t._leaflet_id&&t.classList.contains("leaflet-interactive")&&t._leaflet_id&&i.push(e._innerView._targets[t._leaflet_id])});const o=[];return i.forEach(e=>{const i=this._getInnerLayerId(e);if(Object(n.isNull)(i.commonLayerId))return;const r=this.getLayer(i.commonLayerId);let s=null;if(r.type===n.LayerType.igsFeature||r.type===n.LayerType.geojson){s=this._getLayerView(r)._featureSetCache.filter(t=>{if(t.id===i.commonFeatureId)return t})}else r.type===n.LayerType.graphics&&(s=r.graphics.filter(t=>{if(t.id===i.commonFeatureId)return t}));const a={graphic:s&&s.items.length>0?s.items[0]:null,layer:r,mapPoint:this.toMap(t),type:"graphic"};o.push(a)}),o}_hitTestCanvas(t){const e=[],i=this._innerView._renderer,r={clientX:t.x,clientY:t.y},o=i._map.mouseEventToContainerPoint(r);for(let t=i._dragFirst;t;t=t.next){const n=t.layer;n.options.interactive&&n._containsPoint(o)&&("click"!==r.type&&"preclick"!==r.type||!i._map._draggableMoved(n))&&n.feature&&e.push(n)}const s=[];return e.forEach(e=>{const i=this._getInnerLayerId(e);if(Object(n.isNull)(i.commonLayerId))return;const r=this.getLayer(i.commonLayerId);let o=null;if(r.type===n.LayerType.igsFeature||r.type===n.LayerType.geojson){o=this.getLayerView(r)._featureSetCache.filter(t=>{if(t.id===i.commonFeatureId)return t})}else r.type===n.LayerType.graphics&&(o=r.graphics.filter(t=>{if(t.id===i.commonFeatureId)return t}));const a={graphic:o.items.length>0?o.items[0]:null,layer:r,mapPoint:this.toMap(t),type:"graphic"};s.push(a)}),s}_getInnerLayerId(t){let e;const i=function(t){let e,n;for(const r in t){if(void 0!==t[r].commonLayerId){e=t[r].commonLayerId,n=t[r].commonFeatureId;break}e=i(t[r]._eventParents)}return{commonLayerId:e,commonFeatureId:n}};return e=void 0===t.commonLayerId?i(t._eventParents):{commonLayerId:t.commonLayerId,commonFeatureId:t.commonFeatureId}}_initScale(){this._scale&&this._scale>0&&this.minScale>0&&this.maxScale>0&&this._scale<this.minScale&&this._scale>this.maxScale&&this.setScale()}_getZoomByScale(t){let e=void 0;if(this.crs&&this.crs.options&&this.crs.options.lods){let i=-1;for(let n=0;n<this.crs.options.lods.length;n++){const r=this.crs.options.lods[n],o=this.crs.options.lods[n-1];if(r.scale<=0)break;if(i<0&&(i=n),n===i){if(r.scale>0&&t>=r.scale){e=r.level;break}}else{if(t>=r.scale&&t<=o.scale&&o.scale!==r.scale){e=r.level-(t-r.scale)/(o.scale-r.scale);break}if(n===this.crs.options.lods.length-1&&r.scale>0&&t<=r.scale){e=r.level;break}}}}return e}_getScaleExtent(t){return this._getScaleDefaultExtent(t)}_getScaleDefaultExtent(t){const e=this.getSize(),i=e.x/96*.0254*t,r=e.y/96*.0254*t,o=Math.sqrt(i*i+r*r),s=180/Math.PI*Math.atan2(i,r),a=this._center.coordinates,l=(t,e,i)=>{t=n.T.point(t);return n.T.destination(t,e,i,{units:"kilometers"}).geometry.coordinates},h=l(a,o/2e3,-s),u=l(a,o/2e3,180-s);return new n.Extent({xmin:h[0],xmax:u[0],ymin:u[1],ymax:h[1]})}getScale(){const t=this._getScaleByZoom(this._zoom);return this._scale=t,t}_getScaleByZoom(t){let e;if(this.crs&&this.crs.options&&this.crs.options.lods&&!Object(n.isNull)(t))if(t%1==0){e=this.crs.options.lods[t].scale}else{const i=Math.floor(t),n=Math.ceil(t),r=this.crs.options.lods[i],o=this.crs.options.lods[n];e=void 0===r&&void 0===o?0:void 0===r?o.scale:void 0===o?r.scale:r.scale-(r.scale-o.scale)*(t-i)}return e}_getScaleByExtent(t){const e=this.getSize(),i=e.x/96*.0254,r=e.y/96*.0254,o=Math.sqrt(i*i+r*r),s=this._getLatLngFromExtent(t),a=n.T.point([s.southWestLatlng.lng,s.southWestLatlng.lat]),l=n.T.point([s.northEastLatlng.lng,s.northEastLatlng.lat]),h=1e3*n.T.distance(a,l,{units:"kilometers"})/o;return this._scale=h,h}_isEqualBounds(t,e){return t.equals(e)}setScale(t){if(!this._innerView)return;const e=this._getZoomByScale(t);e&&this.flyTo({center:this._center,zoom:e})}getExtentScale(t){const e=this.getSize(),i=e.x/96*.0254,r=e.y/96*.0254,o=Math.sqrt(i*i+r*r),s=n.T.point([t.xmin,t.ymax]),a=n.T.point([t.xmax,t.ymin]),l=1e3*n.T.distance(s,a,{units:"kilometers"})/o;return this._scale=l,l}getResolutionByScale(t){return this._resolution=.0254/96*t,this._resolution}getResolution(){const t=this.getSize(),e=Math.sqrt(t.x*t.x+t.y*t.y),i=this._innerView.getBounds(),r=n.T.point([i._southWest.lng,i._southWest.lat]),o=n.T.point([i._northEast.lng,i._northEast.lat]),s=n.T.distance(r,o,{units:"kilometers"});return this._resolution=1e3*s/e,this._resolution}_moveLayerView(t,e){if(this._isLayerViewSupportReorder(t)){const e=this.allLayerViews.toArray();for(let t=0;t<e.length;t++){const i=e[t];this._isLayerViewSupportReorder(i)&&i.innerLayer&&i.innerLayer.setZIndex&&i.innerLayer.setZIndex(t)}t instanceof Jt&&t._updateGraphicsInOrder()}}_createLayerViewObj(t){let e=null;return t&&t.autoAddTo2D&&(e=hi(this,t)),e}_isEqualCrs(t,e){let i=!1;if(!t||!e)return i;let r=void 0;t.code.split(":").length>1&&(r=t.code.split(":")[1]);const o=new n.SpatialReference({wkid:r,wkt:t.def});let s=void 0;e.code.split(":").length>1&&(s=e.code.split(":")[1]);const a=new n.SpatialReference({wkid:s,wkt:e.def});return o.equals(a)&&e.options&&t.options&&Object(n.compareObject)(e.options.lods,t.options.lods)&&Object(n.compareObject)(e.options.origin,t.options.origin)&&Object(n.compareObject)(e.options.bounds,t.options.bounds)&&(i=!0),i}}ui.fromJSON=function(t){return t=Object(n.defaultValue)(t,{}),new ui(t)},Object.defineProperties(ui.prototype,{scale:{get(){return this._scale},set(t){this.setScale(t)}},zoom:{get(){return this._zoom},set(t){this.setZoom(t)}},extent:{get(){return this._extent},set(t){this.setExtent(t)}},center:{get(){let t=this._center;if(this.crs){const e=this._spatialReference;e.isGeographic||(t=n.Projection.project(this._center,e))}return t},set(t){this.setCenter(t)}},spatialReference:{get(){return this._spatialReference},set(){}},rotation:{get(){return this._rotation},set(t){this._rotation=t,this._innerView&&this._innerView.setBearing(t)}}}),n.Zondy.MapViewLeaflet=ui;var ci=ui;var pi=class extends n.Evented{constructor(t){super();const e=Object(n.defaultValue)(t,{});if(this._id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._container=this._createContainer(e.container),this._visible=Object(n.defaultValue)(e.visible,!0),this._view=Object(n.defaultValue)(e.view,null),!this._view)throw new Error("视图不存在!")}_addView(){}_removeView(){}destroy(){}_createContainer(t){let e=t;return"string"==typeof e&&(e=document.getElementById(e)),t instanceof HTMLElement?e:e=document.createElement("div")}};var fi=class extends pi{constructor(t){super(t),t=Object(n.defaultValue)(t,{}),this.drawConfig=Object(n.defaultValue)(t.drawConfig,{polygon:{allowIntersection:!1,showArea:!0},circlemarker:!1}),this._complete=Object(n.defaultValue)(t.complete,function(){}),this._drawHandler=null,this._drawTool=null,this._initHandler(),this._initStyles()}_initHandler(){const t=this._view.getInnerView();this._processEvent=this._processEvent.bind(this),t&&t.on(L.Draw.Event.CREATED,this._processEvent)}_initStyles(){this.styles={circle:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},marker:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},polygon:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},polyline:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},rectangle:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0}}}_removeHandler(){const t=this._view.getInnerView();t&&t.off(L.Draw.Event.CREATED,this._processEvent)}_processEvent(t){if(t&&t.layer){let e,i;const r=t.layer.toGeoJSON();switch(e=r.geometry.type){case"LineString":i=new n.Feature({geometry:new n.LineString({coordinates:r.geometry.coordinates})});break;case"Polygon":i=new n.Feature({geometry:new n.Polygon({coordinates:r.geometry.coordinates})});break;case"Point":let o;o=t.layer._mRadius?new n.Circle({center:[r.geometry.coordinates[0],r.geometry.coordinates[1]],radius:t.layer._mRadius}):t.layer._radius?new n.Circle({center:[r.geometry.coordinates[0],r.geometry.coordinates[1]],radius:t.layer._radius}):new n.Point({coordinates:r.geometry.coordinates}),i=new n.Feature({geometry:o})}this._complete(e,i)}}_addView(){super._addView();const t=this._view.getInnerView();if(t&&this._visible){const e=L.featureGroup().addTo(t);this._drawTool=new L.Control.Draw({edit:{featureGroup:e,poly:{allowIntersection:!1}},draw:this.drawConfig}),t.addControl(this._drawTool)}}_removeView(){super._removeView();const t=this._view.getInnerView();t&&this._visible&&(this._removeHandler(),this._drawTool&&(t.removeControl(this._drawTool),this._print=null))}start(t,e){const i=this._view.getInnerView();if(i)switch(this._drawHandler&&this._drawHandler.disable(),t){case"lineString":this._drawHandler=new L.Draw.Polyline(i,{...this.styles.polyline,...e}),this._drawHandler.enable();break;case"polygon":this._drawHandler=new L.Draw.Polygon(i,{...this.styles.polygon,...e}),this._drawHandler.enable();break;case"rectangle":this._drawHandler=new L.Draw.Rectangle(i,{...this.styles.rectangle,...e}),this._drawHandler.enable();break;case"marker":this._drawHandler=new L.Draw.Marker(i,{...this.styles.marker,...e}),this._drawHandler.enable();break;case"circle":this._drawHandler=new L.Draw.Circle(i,{...this.styles.circle,...e}),this._drawHandler.enable()}}end(){this._drawHandler&&(this._drawHandler.disable(),this._drawHandler=null)}destory(){}};var di=class extends n.SketchEditor{constructor(t){super(t)}start(t,e){super.start(t,e)}startCustomDrawTool(t){super.startCustomDrawTool(t)}stop(){super.stop()}remove(){super.remove()}update(t,e){super.updateFeature(t,e)}addVertex(t,e){super.addVertex(t,e)}updateVertex(t,e){super.updateVertex(t,e)}removeVertex(t){super.removeVertex(t)}getSketchDataType(){super.getSketchDataType()}setSketchStyle(t){super.setSketchStyle(t)}getSketchStyle(){return super.getSketchStyle()}getGeometry(){return super.getGeometry()}union(t){return super.union(t)}split(t,e){return super.split(t,e)}drawPolylineToPolygon(t){super.drawPolylineToPolygon(t)}undo(){return super.undo()}redo(){return super.redo()}canUndo(){return super.canUndo()}canRedo(){return super.canRedo()}_hitTestSketchEvent(t=this._sketchInnerLayer){const e=this;e.testNum=0;const i=this.view.getInnerLayer(t);i&&i.on("layeradd",t=>{const i=t.layer;if(!i||!i.commonFeatureId||!e._drawTool)return;let n=e._drawTool._getDrawToolByFeatureId(i.commonFeatureId);if(!n){if(!e._drawTool.sketchStage.entityGraphic||"drawn"!==e._drawTool.state)return;{const t=e.view.getLayer(i.commonLayerId).graphics.filter(t=>{if(t.id===i.commonFeatureId)return t}),r=t&&t.items.length>0?t.items[0]:null;this._addFeatureToSketchEditor(r),n=e._drawTool._getDrawToolByFeatureId(i.commonFeatureId)}}n===e._drawTool&&"drawn"!==n.state||e._bindHit(n,i)})}_bindHit(t,e,i=this._sketchInnerLayer){const r=this,o=t.sketchStage.entityGraphic,s=t.editOption._hitTestMode;if(!e){const t=this.view.getInnerLayer(i);if(t)for(const i in t._layers){const n=t._layers[i];if(n.commonFeatureId===o.id){e=n;break}}if(!e)return}const a=function(e){if(!r._editable)return;if(void 0!==r._drawTool&&null!==r._drawTool&&3===r._drawTool._editMode)return;let i;if(i=new n.SpatialReference(r.view._spatialReference).isGeographic?new n.Point({coordinates:[e.latlng.lng,e.latlng.lat]}):n.Projection.project(new n.Point({coordinates:[e.latlng.lng,e.latlng.lat]}),new n.SpatialReference(r.view._spatialReference)),e.mapPoint=i,t._parent?r._drawTool._id!==t._parent._id&&r._drawTool._clearEditGraphics(r._editMode):r._drawTool?r._drawTool._id!==t._id&&(r._drawTool._clearEditGraphics(r._editMode),r._drawTool._stopAll(),r._drawTool=t,r._undoRedoManager.reset(),r._drawTools=[r._drawTool]):(r._drawTool=t,r._undoRedoManager.reset(),r._drawTools=[r._drawTool]),r.fire("selected",{isSelected:!0,selectedDrawTool:r._drawTool,selectedGeometry:r._drawTool.sketchStage.entityGraphic.geometry},r),!t._parent&&0===t._editMode){const e=new n.SketchEditorEvent({type:n.SketchEditorEventType.update,target:r,toolEventInfo:null,state:n.SketchEditorState.start,feature:r._drawTool.sketchStage.entityGraphic,geometry:r._drawTool.sketchStage.entityGraphic.geometry});t.fire(n.SketchEditorEventType.update,e)}t.hitTestFeature(o,e)};0===s?e.on("click",t=>{a(t)}):e.on("mousedown",t=>{a(t)})}_getCenterCoordinate(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}},gi=function(t,e,i){if(t=t||{},e)for(var n in e){var r=!1;if(i&&i.length)for(var o=0,s=i.length;o<s;o++)if(n===i[o]){r=!0;break}if(!0!==r){var a=e[n];void 0!==a&&"CLASS_NAME"!==n&&"function"!=typeof a&&(t[n]=a)}}return t},yi=function(t,e){if(t=t||{},e){for(var i in e){var n=e[i];void 0!==n&&(t[i]=n)}!("function"==typeof window.Event&&e instanceof window.Event)&&e.hasOwnProperty&&e.hasOwnProperty("toString")&&(t.toString=e.toString)}return t},mi=function(...t){class e{constructor(e){for(var i=0;i<t.length;i++)r(this,new t[i](e))}}for(var i=0;i<t.length;i++){var n=t[i];r(e,n),r(e.prototype,n.prototype),r(e.prototype,new n)}return e;function r(t,e){var i=Object.getOwnPropertyNames(e);Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(e)));for(var n=0;n<i.length;n++){var r=i[n];if("constructor"!==r&&"prototype"!==r&&"name"!==r&&"length"!==r){let i=Object.getOwnPropertyDescriptor(e,r);window.ActiveXObject?Object.defineProperty(t,r,i||{}):Object.defineProperty(t,r,i)}}}},_i=function(t,e){if(null==t)return-1;if("function"==typeof t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},vi=function(){for(var t="",e=1;e<=32;e++){t+=Math.floor(16*Math.random()).toString(16),8!=e&&12!=e&&16!=e&&20!=e||(t+="-")}return t},xi=function(t,e,i){for(var n in e)mergeItem(t,e,n,i);return t},bi=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Date)return(e=new Date).setTime(t.getTime()),e;if(t instanceof Array)return e=t.slice(0);if(t instanceof Object){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[i]=bi(t[i]));return e}throw new Error("Unable to copy obj! Its type isn't supported.")};class wi{constructor(){this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=!0,this.hoverable=!0,this.style=null,this.highlightStyle={},this.CLASS_NAME="Zondy.Feature.ShapeParameters"}destroy(){this.refOriginalPosition=null,this.refDataID=null,this.isHoverByRefDataID=null,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=null,this.hoverable=null,this.style=null,this.highlightStyle=null}}class Ei extends wi{constructor(t,e){super(t,e),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=6,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Point"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class Ci extends wi{constructor(t){super(t),this.pointList=t,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Line"}destroy(){this.pointList=null,super.destroy()}}class Li extends wi{constructor(t){super(t),this.pointList=t,this.holePolygonPointLists=null,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Polygon"}destroy(){this.pointList=null,this.holePolygonPointLists=null,super.destroy()}}class Si extends wi{constructor(t,e,i,n){super(t,e,i,n),this.x=isNaN(t)?0:t,this.y=isNaN(t)?0:e,this.width=isNaN(i)?0:i,this.height=isNaN(n)?0:n,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Rectangle"}destroy(){this.x=null,this.y=null,this.width=null,this.height=null,super.destroy()}}class Pi extends wi{constructor(t,e,i,n,r,o,s){super(t,e,i,n,r,o,s),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=isNaN(i)?0:i,this.startAngle=isNaN(n)?0:n,this.endAngle=isNaN(r)?0:r,this.r0=isNaN(o)?0:o,this.clockWise=s,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Sector"}destroy(){this.x=null,this.y=null,this.r=null,this.startAngle=null,this.endAngle=null,this.r0=null,this.clockWise=null,super.destroy()}}class Ii extends wi{constructor(t,e,i){super(t,e,i),this.x=t,this.y=e,this.text=i,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Label"}destroy(){this.x=null,this.y=null,this.text=null,super.destroy()}}class Mi extends wi{constructor(t,e,i,n,r,o,s,a,l){super(t,e,i,n,r,o,s,a,l),this.x=t,this.y=e,this.image=i,this.width=n,this.height=r,this.sx=o,this.sy=s,this.sWidth=a,this.sHeight=l,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Image"}destroy(){this.x=null,this.y=null,this.image=null,this.width=null,this.height=null,this.sx=null,this.sy=null,this.sWidth=null,this.sHeight=null,super.destroy()}}class Ti extends wi{constructor(t,e,i){super(t,e,i),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=isNaN(i)?0:i,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Circle"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class Oi{constructor(){this._handlers={},this.CLASS_NAME="Zondy.LevelRenderer.Eventful"}destroy(){this._handlers=null}one(t,e,i){var n=this._handlers;return e&&t?(n[t]||(n[t]=[]),n[t].push({h:e,one:!0,ctx:i||this}),this):this}bind(t,e,i){var n=this._handlers;return e&&t?(n[t]||(n[t]=[]),n[t].push({h:e,one:!1,ctx:i||this}),this):this}unbind(t,e){var i=this._handlers;if(!t)return this._handlers={},this;if(e){if(i[t]){for(var n=[],r=0,o=i[t].length;r<o;r++)i[t][r].h!==e&&n.push(i[t][r]);i[t]=n}i[t]&&0===i[t].length&&delete i[t]}else delete i[t];return this}dispatch(t){if(this._handlers[t]){var e=arguments,i=e.length;i>3&&(e=Array.prototype.slice.call(e,1));for(var n=this._handlers[t],r=n.length,o=0;o<r;){switch(i){case 1:n[o].h.call(n[o].ctx);break;case 2:n[o].h.call(n[o].ctx,e[1]);break;case 3:n[o].h.call(n[o].ctx,e[1],e[2]);break;default:n[o].h.apply(n[o].ctx,e)}n[o].one?(n.splice(o,1),r--):o++}}return this}dispatchWithContext(t){if(this._handlers[t]){var e=arguments,i=e.length;i>4&&(e=Array.prototype.slice.call(e,1,e.length-1));for(var n=e[e.length-1],r=this._handlers[t],o=r.length,s=0;s<o;){switch(i){case 1:r[s].h.call(n);break;case 2:r[s].h.call(n,e[1]);break;case 3:r[s].h.call(n,e[1],e[2]);break;default:r[s].h.apply(n,e)}r[s].one?(r.splice(s,1),o--):s++}}return this}}class Ni{constructor(){this.BUILTIN_OBJECT={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},this._ctx=null,this._canvas=null,this._pixelCtx=null,this._width=null,this._height=null,this._offsetX=0,this._offsetY=0,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Util"}clone(t){var e=this.BUILTIN_OBJECT;if("object"==typeof t&&null!==t){var i=t;if(t instanceof Array){i=[];for(var n=0,r=t.length;n<r;n++)i[n]=this.clone(t[n])}else if(!e[Object.prototype.toString.call(t)])for(var o in i={},t)t.hasOwnProperty(o)&&(i[o]=this.clone(t[o]));return i}return t}mergeItem(t,e,i,n){var r=this.BUILTIN_OBJECT;e.hasOwnProperty(i)&&("object"!=typeof t[i]||r[Object.prototype.toString.call(t[i])]?!n&&i in t||(t[i]=e[i]):this.merge(t[i],e[i],n))}merge(t,e,i){for(var n in e)this.mergeItem(t,e,n,i);return t}getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}getPixelContext(){return this._pixelCtx||(this._canvas=document.createElement("canvas"),this._width=this._canvas.width,this._height=this._canvas.height,this._pixelCtx=this._canvas.getContext("2d")),this._pixelCtx}adjustCanvasSize(t,e){var i,n=this._canvas,r=this._pixelCtx,o=this._width,s=this._height,a=this._offsetX,l=this._offsetY;t+a>o&&(o=t+a+100,n.width=o,i=!0),e+l>s&&(s=e+l+100,n.height=s,i=!0),t<-a&&(o+=a=100*Math.ceil(-t/100),n.width=o,i=!0),e<-l&&(s+=l=100*Math.ceil(-e/100),n.height=s,i=!0),i&&r.translate(a,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1}inherits(t,e){var i=t.prototype;function n(){}for(var r in n.prototype=e.prototype,t.prototype=new n,i)t.prototype[r]=i[r];t.constructor=t}}class Ai{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Vector"}create(t,e){var i=new(0,this.ArrayCtor)(2);return i[0]=t||0,i[1]=e||0,i}copy(t,e){return t[0]=e[0],t[1]=e[1],t}set(t,e,i){return t[0]=e,t[1]=i,t}add(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}scaleAndAdd(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t}sub(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}len(t){return Math.sqrt(this.lenSquare(t))}lenSquare(t){return t[0]*t[0]+t[1]*t[1]}mul(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t}div(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t}dot(t,e){return t[0]*e[0]+t[1]*e[1]}scale(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}normalize(t,e){var i=this.len(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t}distance(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}distanceSquare(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}negate(t,e){return t[0]=-e[0],t[1]=-e[1],t}lerp(t,e,i,n){return t[0]=e[0]+n*(i[0]-e[0]),t[1]=e[1]+n*(i[1]-e[1]),t}applyTransform(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t}min(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}max(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}length(t){return this.len(t)}lengthSquare(t){return this.lenSquare(t)}dist(t,e){return this.distance(t,e)}distSquare(t,e){return this.distanceSquare(t,e)}}class Ri{constructor(){this.vector=new Ai,this.EPSILON=1e-4,this.THREE_SQRT=Math.sqrt(3),this.ONE_THIRD=1/3,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Curve"}isAroundZero(t){return t>-this.EPSILON&&t<this.EPSILON}isNotAroundZero(t){return t>this.EPSILON||t<-this.EPSILON}cubicAt(t,e,i,n,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*n+3*o*i)}cubicDerivativeAt(t,e,i,n,r){var o=1-r;return 3*(((e-t)*o+2*(i-e)*r)*o+(n-i)*r*r)}cubicRootAt(t,e,i,n,r,o){var s=n+3*(e-i)-t,a=3*(i-2*e+t),l=3*(e-t),h=t-r,u=a*a-3*s*l,c=a*l-9*s*h,p=l*l-3*a*h,f=0;if(this.isAroundZero(u)&&this.isAroundZero(c))if(this.isAroundZero(a))o[0]=0;else{let t=-l/a;t>=0&&t<=1&&(o[f++]=t)}else{var d=c*c-4*u*p;if(this.isAroundZero(d)){var g=c/u;let t=-a/s+g,e=-g/2;t>=0&&t<=1&&(o[f++]=t),e>=0&&e<=1&&(o[f++]=e)}else if(d>0){let t=Math.sqrt(d),e=u*a+1.5*s*(-c+t),i=u*a+1.5*s*(-c-t),n=(-a-((e=e<0?-Math.pow(-e,this.ONE_THIRD):Math.pow(e,this.ONE_THIRD))+(i=i<0?-Math.pow(-i,this.ONE_THIRD):Math.pow(i,this.ONE_THIRD))))/(3*s);n>=0&&n<=1&&(o[f++]=n)}else{var y=(2*u*a-3*s*c)/(2*Math.sqrt(u*u*u)),m=Math.acos(y)/3,_=Math.sqrt(u),v=Math.cos(m);let t=(-a-2*_*v)/(3*s),e=(-a+_*(v+this.THREE_SQRT*Math.sin(m)))/(3*s),i=(-a+_*(v-this.THREE_SQRT*Math.sin(m)))/(3*s);t>=0&&t<=1&&(o[f++]=t),e>=0&&e<=1&&(o[f++]=e),i>=0&&i<=1&&(o[f++]=i)}}return f}cubicExtrema(t,e,i,n,r){var o=6*i-12*e+6*t,s=9*e+3*n-3*t-9*i,a=3*e-3*t,l=0;if(this.isAroundZero(s)){if(this.isNotAroundZero(o)){let t=-a/o;t>=0&&t<=1&&(r[l++]=t)}}else{var h=o*o-4*s*a;if(this.isAroundZero(h))r[0]=-o/(2*s);else if(h>0){let t=Math.sqrt(h),e=(-o+t)/(2*s),i=(-o-t)/(2*s);e>=0&&e<=1&&(r[l++]=e),i>=0&&i<=1&&(r[l++]=i)}}return l}cubicSubdivide(t,e,i,n,r,o){var s=(e-t)*r+t,a=(i-e)*r+e,l=(n-i)*r+i,h=(a-s)*r+s,u=(l-a)*r+a,c=(u-h)*r+h;o[0]=t,o[1]=s,o[2]=h,o[3]=c,o[4]=c,o[5]=u,o[6]=l,o[7]=n}cubicProjectPoint(t,e,i,n,r,o,s,a,l,h,u){var c,p=this.vector.create(),f=this.vector.create(),d=this.vector.create(),g=.005,y=1/0;p[0]=l,p[1]=h;for(let l=0;l<1;l+=.05){f[0]=this.cubicAt(t,i,r,s,l),f[1]=this.cubicAt(e,n,o,a,l);let h=this.vector.distSquare(p,f);h<y&&(c=l,y=h)}y=1/0;for(let l=0;l<32&&!(g<this.EPSILON);l++){let l=c-g,h=c+g;f[0]=this.cubicAt(t,i,r,s,l),f[1]=this.cubicAt(e,n,o,a,l);let u=this.vector.distSquare(f,p);if(l>=0&&u<y)c=l,y=u;else{d[0]=this.cubicAt(t,i,r,s,h),d[1]=this.cubicAt(e,n,o,a,h);let l=this.vector.distSquare(d,p);h<=1&&l<y?(c=h,y=l):g*=.5}}return u&&(u[0]=this.cubicAt(t,i,r,s,c),u[1]=this.cubicAt(e,n,o,a,c)),Math.sqrt(y)}quadraticAt(t,e,i,n){var r=1-n;return r*(r*t+2*n*e)+n*n*i}quadraticDerivativeAt(t,e,i,n){return 2*((1-n)*(e-t)+n*(i-e))}quadraticRootAt(t,e,i,n,r){var o=t-2*e+i,s=2*(e-t),a=t-n,l=0;if(this.isAroundZero(o)){if(this.isNotAroundZero(s)){var h=-a/s;h>=0&&h<=1&&(r[l++]=h)}}else{var u=s*s-4*o*a;if(this.isAroundZero(u)){let t=-s/(2*o);t>=0&&t<=1&&(r[l++]=t)}else if(u>0){let t=Math.sqrt(u),e=(-s+t)/(2*o),i=(-s-t)/(2*o);e>=0&&e<=1&&(r[l++]=e),i>=0&&i<=1&&(r[l++]=i)}}return l}quadraticExtremum(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n}quadraticProjectPoint(t,e,i,n,r,o,s,a,l){var h,u=this.vector.create(),c=this.vector.create(),p=this.vector.create(),f=.005,d=1/0;u[0]=s,u[1]=a;for(let s=0;s<1;s+=.05){c[0]=this.quadraticAt(t,i,r,s),c[1]=this.quadraticAt(e,n,o,s);let a=this.vector.distSquare(u,c);a<d&&(h=s,d=a)}d=1/0;for(let s=0;s<32&&!(f<this.EPSILON);s++){let s=h-f,a=h+f;c[0]=this.quadraticAt(t,i,r,s),c[1]=this.quadraticAt(e,n,o,s);let l=this.vector.distSquare(c,u);if(s>=0&&l<d)h=s,d=l;else{p[0]=this.quadraticAt(t,i,r,a),p[1]=this.quadraticAt(e,n,o,a);let s=this.vector.distSquare(p,u);a<=1&&s<d?(h=a,d=s):f*=.5}}return l&&(l[0]=this.quadraticAt(t,i,r,h),l[1]=this.quadraticAt(e,n,o,h)),Math.sqrt(d)}}class ki{constructor(){this.util=new Ni,this._ctx=null,this.palette=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],this._palette=this.palette,this.highlightColor="rgba(0,0,255,1)",this._highlightColor=this.highlightColor,this.colorRegExp=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,this._nameColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"},this.CLASS_NAME="Zondy.LevelRenderer.Tool.Color"}customPalette(t){this.palette=t}resetPalette(){this.palette=this._palette}getColor(t,e){return t|=0,(e=e||this.palette)[t%e.length]}customHighlight(t){this.highlightColor=t}resetHighlight(){this.highlightColor=this._highlightColor}getHighlightColor(){return this.highlightColor}getRadialGradient(t,e,i,n,r,o,s){var a=this.util;this._ctx||(this._ctx=a.getContext());for(var l=this._ctx.createRadialGradient(t,e,i,n,r,o),h=0,u=s.length;h<u;h++)l.addColorStop(s[h][0],s[h][1]);return l.__nonRecursion=!0,l}getLinearGradient(t,e,i,n,r){var o=this.util;this._ctx||(this._ctx=o.getContext());for(var s=this._ctx.createLinearGradient(t,e,i,n),a=0,l=r.length;a<l;a++)s.addColorStop(r[a][0],r[a][1]);return s.__nonRecursion=!0,s}getStepColors(t,e,i){t=this.toRGBA(t),e=this.toRGBA(e),t=this.getData(t);for(var n=[],r=((e=this.getData(e))[0]-t[0])/i,o=(e[1]-t[1])/i,s=(e[2]-t[2])/i,a=(e[3]-t[3])/i,l=0,h=t[0],u=t[1],c=t[2],p=t[3];l<i;l++)n[l]=this.toColor([this.adjust(Math.floor(h),[0,255]),this.adjust(Math.floor(u),[0,255]),this.adjust(Math.floor(c),[0,255]),p.toFixed(4)-0],"rgba"),h+=r,u+=o,c+=s,p+=a;return h=e[0],u=e[1],c=e[2],p=e[3],n[l]=this.toColor([h,u,c,p],"rgba"),n}getGradientColors(t,e){var i=[],n=t.length;if(void 0===e&&(e=20),1===n)i=this.getStepColors(t[0],t[0],e);else if(n>1)for(var r=0,o=n-1;r<o;r++){var s=this.getStepColors(t[r],t[r+1],e);r<o-1&&s.pop(),i=i.concat(s)}return i}toColor(t,e){if(e=e||"rgb",t&&(3===t.length||4===t.length)){if(t=this.map(t,function(t){return t>1?Math.ceil(t):t}),e.indexOf("hex")>-1)return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1);if(e.indexOf("hs")>-1){var i=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=i[0],t[2]=i[1]}return e.indexOf("a")>-1?(3===t.length&&t.push(1),t[3]=this.adjust(t[3],[0,1]),e+"("+t.slice(0,4).join(",")+")"):e+"("+t.slice(0,3).join(",")+")"}}toArray(t){(t=this.trim(t)).indexOf("rgba")<0&&(t=this.toRGBA(t));var e=[],i=0;return t.replace(/[\d.]+/g,function(t){i<3?t|=0:t=+t,e[i++]=t}),e}convert(t,e){if(!this.isCalculableColor(t))return t;var i=this.getData(t),n=i[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?i=this._HSV_2_RGB(i):t.indexOf("hsl")>-1&&(i=this._HSL_2_RGB(i)),e.indexOf("hsb")>-1||e.indexOf("hsv")>-1?i=this._RGB_2_HSB(i):e.indexOf("hsl")>-1&&(i=this._RGB_2_HSL(i)),i[3]=n,this.toColor(i,e)}toRGBA(t){return this.convert(t,"rgba")}toRGB(t){return this.convert(t,"rgb")}toHex(t){return this.convert(t,"hex")}toHSVA(t){return this.convert(t,"hsva")}toHSV(t){return this.convert(t,"hsv")}toHSBA(t){return this.convert(t,"hsba")}toHSB(t){return this.convert(t,"hsb")}toHSLA(t){return this.convert(t,"hsla")}toHSL(t){return this.convert(t,"hsl")}toName(t){for(var e in this._nameColors)if(this.toHex(this._nameColors[e])===this.toHex(t))return e;return null}trim(t){return String(t).replace(/\s+/g,"")}normalize(t){if(this._nameColors[t]&&(t=this._nameColors[t]),t=(t=this.trim(t)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(t)){var e=(3840&(t=parseInt(t.slice(1),16)))<<8,i=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(i<<4)+i+(n<<4)+n).toString(16).slice(1)}return t}lift(t,e){if(!this.isCalculableColor(t))return t;var i=e>0?1:-1;void 0===e&&(e=0),e=Math.abs(e)>1?1:Math.abs(e),t=this.toRGB(t);for(var n=this.getData(t),r=0;r<3;r++)n[r]=1===i?n[r]*(1-e)|0:(255-n[r])*e+n[r]|0;return"rgb("+n.join(",")+")"}reverse(t){if(!this.isCalculableColor(t))return t;var e=this.getData(this.toRGBA(t));return e=this.map(e,function(t){return 255-t}),this.toColor(e,"rgb")}mix(t,e,i){if(!this.isCalculableColor(t)||!this.isCalculableColor(e))return t;void 0===i&&(i=.5);for(var n=2*(i=1-this.adjust(i,[0,1]))-1,r=this.getData(this.toRGBA(t)),o=this.getData(this.toRGBA(e)),s=r[3]-o[3],a=((n*s==-1?n:(n+s)/(1+n*s))+1)/2,l=1-a,h=[],u=0;u<3;u++)h[u]=r[u]*a+o[u]*l;var c=r[3]*i+o[3]*(1-i);return c=Math.max(0,Math.min(1,c)),1===r[3]&&1===o[3]?this.toColor(h,"rgb"):(h[3]=c,this.toColor(h,"rgba"))}random(){return"#"+Math.random().toString(16).slice(2,8)}getData(t){var e,i,n=(t=this.normalize(t)).match(this.colorRegExp);if(null===n)throw new Error("The color format error");var r,o=[];if(n[2])r=[(e=n[2].replace("#","").split(""))[0]+e[1],e[2]+e[3],e[4]+e[5]],o=this.map(r,function(t){return ki.prototype.adjust.call(this,parseInt(t,16),[0,255])});else if(n[4]){var s=n[4].split(",");i=s[3],r=s.slice(0,3),o=this.map(r,function(t){return t=Math.floor(t.indexOf("%")>0?2.55*parseInt(t,0):t),ki.prototype.adjust.call(this,t,[0,255])}),void 0!==i&&o.push(this.adjust(parseFloat(i),[0,1]))}else if(n[5]||n[6]){var a=(n[5]||n[6]).split(","),l=parseInt(a[0],0)/360,h=a[1],u=a[2];i=a[3],(o=this.map([h,u],function(t){return ki.prototype.adjust.call(this,parseFloat(t)/100,[0,1])})).unshift(l),void 0!==i&&o.push(this.adjust(parseFloat(i),[0,1]))}return o}alpha(t,e){if(!this.isCalculableColor(t))return t;null===e&&(e=1);var i=this.getData(this.toRGBA(t));return i[3]=this.adjust(Number(e).toFixed(4),[0,1]),this.toColor(i,"rgba")}map(t,e){if("function"!=typeof e)throw new TypeError;for(var i=t?t.length:0,n=0;n<i;n++)t[n]=e(t[n]);return t}adjust(t,e){return t<=e[0]?t=e[0]:t>=e[1]&&(t=e[1]),t}isCalculableColor(t){return t instanceof Array||"string"==typeof t}_HSV_2_RGB(t){var e,i,n,r=t[0],o=t[1],s=t[2];if(0===o)e=255*s,i=255*s,n=255*s;else{var a=6*r;6===a&&(a=0);var l=0|a,h=s*(1-o),u=s*(1-o*(a-l)),c=s*(1-o*(1-(a-l))),p=0,f=0,d=0;0===l?(p=s,f=c,d=h):1===l?(p=u,f=s,d=h):2===l?(p=h,f=s,d=c):3===l?(p=h,f=u,d=s):4===l?(p=c,f=h,d=s):(p=s,f=h,d=u),e=255*p,i=255*f,n=255*d}return[e,i,n]}_HSL_2_RGB(t){var e,i,n,r=t[0],o=t[1],s=t[2];if(0===o)e=255*s,i=255*s,n=255*s;else{var a,l=2*s-(a=s<.5?s*(1+o):s+o-o*s);e=255*this._HUE_2_RGB(l,a,r+1/3),i=255*this._HUE_2_RGB(l,a,r),n=255*this._HUE_2_RGB(l,a,r-1/3)}return[e,i,n]}_HUE_2_RGB(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?t+6*(e-t)*i:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}_RGB_2_HSB(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(n,r,o),a=Math.max(n,r,o),l=a-s,h=a;if(0===l)e=0,i=0;else{i=l/a;var u=((a-n)/6+l/2)/l,c=((a-r)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?e=p-c:r===a?e=1/3+u-p:o===a&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,i*=100,h*=100]}_RGB_2_HSL(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(n,r,o),a=Math.max(n,r,o),l=a-s,h=(a+s)/2;if(0===l)e=0,i=0;else{i=h<.5?l/(a+s):l/(2-a-s);var u=((a-n)/6+l/2)/l,c=((a-r)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?e=p-c:r===a?e=1/3+u-p:o===a&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,i*=100,h*=100]}}class Di{static SUtil_smoothBezier(t,e,i,n,r){r&&2===r||(r=[0,0]);var o,s,a=r,l=[],h=[],u=[],c=[],p=!!n;if(p){o=[1/0,1/0],s=[-1/0,-1/0];let e=t.length;for(let i=0;i<e;i++)Di.Util_vector.min(o,o,[t[i][0]+a[0],t[i][1]+a[1]]),Di.Util_vector.max(s,s,[t[i][0]+a[0],t[i][1]+a[1]]);Di.Util_vector.min(o,o,n[0]),Di.Util_vector.max(s,s,n[1])}let f=t.length;for(let n=0;n<f;n++){let r,d,g=[t[n][0]+a[0],t[n][1]+a[1]];if(i)r=[t[n?n-1:f-1][0]+a[0],t[n?n-1:f-1][1]+a[1]],d=[t[(n+1)%f][0]+a[0],t[(n+1)%f][1]+a[1]];else{if(0===n||n===f-1){l.push([t[n][0]+a[0],t[n][1]+a[1]]);continue}r=[t[n-1][0]+a[0],t[n-1][1]+a[1]],d=[t[n+1][0]+a[0],t[n+1][1]+a[1]]}Di.Util_vector.sub(h,d,r),Di.Util_vector.scale(h,h,e);let y=Di.Util_vector.distance(g,r),m=Di.Util_vector.distance(g,d),_=y+m;0!==_&&(y/=_,m/=_),Di.Util_vector.scale(u,h,-y),Di.Util_vector.scale(c,h,m);let v=Di.Util_vector.add([],g,u),x=Di.Util_vector.add([],g,c);p&&(Di.Util_vector.max(v,v,o),Di.Util_vector.min(v,v,s),Di.Util_vector.max(x,x,o),Di.Util_vector.min(x,x,s)),l.push(v),l.push(x)}return i&&l.push(l.shift()),l}static SUtil_smoothSpline(t,e,i,n){n&&2===n||(n=[0,0]);var r=n,o=t.length,s=[],a=0;for(let e=1;e<o;e++)a+=Di.Util_vector.distance([t[e-1][0]+r[0],t[e-1][1]+r[1]],[t[e][0]+r[0],t[e][1]+r[1]]);var l=a/5;l=l<o?o:l;for(let i=0;i<l;i++){let n,a,u,c=i/(l-1)*(e?o:o-1),p=Math.floor(c),f=c-p,d=[t[p%o][0]+r[0],t[p%o][1]+r[1]];e?(n=[t[(p-1+o)%o][0]+r[0],t[(p-1+o)%o][1]+r[1]],a=[t[(p+1)%o][0]+r[0],t[(p+1)%o][1]+r[1]],u=[t[(p+2)%o][0]+r[0],t[(p+2)%o][1]+r[1]]):(n=[t[0===p?p:p-1][0]+r[0],t[0===p?p:p-1][1]+r[1]],a=[t[p>o-2?o-1:p+1][0]+r[0],t[p>o-2?o-1:p+1][1]+r[1]],u=[t[p>o-3?o-1:p+2][0]+r[0],t[p>o-3?o-1:p+2][1]+r[1]]);let g=f*f,y=f*g;s.push([h(n[0],d[0],a[0],u[0],f,g,y),h(n[1],d[1],a[1],u[1],f,g,y)])}return s;function h(t,e,i,n,r,o,s){var a=.5*(i-t),l=.5*(n-e);return(2*(e-i)+a+l)*s+(-3*(e-i)-2*a-l)*o+a*r+e}}static SUtil_dashedLineTo(t,e,i,n,r,o,s){var a=[5,5];if(o="number"!=typeof o?5:o,t.setLineDash)return a[0]=o,a[1]=o,s&&s instanceof Array?t.setLineDash(s):t.setLineDash(a),t.moveTo(e,i),void t.lineTo(n,r);var l=n-e,h=r-i,u=Math.floor(Math.sqrt(l*l+h*h)/o);l/=u,h/=u;for(var c=!0,p=0;p<u;++p)c?t.moveTo(e,i):t.lineTo(e,i),c=!c,e+=l,i+=h;t.lineTo(n,r)}}Di.Util_area=new class{constructor(){this.util=new Ni,this.curve=new Ri,this._ctx=null,this._textWidthCache={},this._textHeightCache={},this._textWidthCacheCounter=0,this._textHeightCacheCounter=0,this.TEXT_CACHE_MAX=5e3,this.PI2=2*Math.PI,this.roots=[-1,-1,-1],this.extrema=[-1,-1],this.CLASS_NAME="Zondy.LevelRenderer.Tool.Area"}normalizeRadian(t){return(t%=this.PI2)<0&&(t+=this.PI2),t}isInside(t,e,i,n){if(!e||!t)return!1;var r=t.type;this._ctx=this._ctx||this.util.getContext();var o=this._mathMethod(t,e,i,n);if(void 0!==o)return o;if(t.buildPath&&this._ctx.isPointInPath)return this._buildPathMethod(t,this._ctx,e,i,n);switch(r){case"ellipse":case"smicellipse":return!0;case"trochoid":var s="out"===e.location?e.r1+e.r2+e.d:e.r1-e.r2+e.d;return this.isInsideCircle(e,i,n,s);case"rose":return this.isInsideCircle(e,i,n,e.maxr);default:return!1}}_mathMethod(t,e,i,n){switch(t.type){case"bezier-curve":return void 0===e.cpX2?this.isInsideQuadraticStroke(e.xStart,e.yStart,e.cpX1,e.cpY1,e.xEnd,e.yEnd,e.lineWidth,i,n):this.isInsideCubicStroke(e.xStart,e.yStart,e.cpX1,e.cpY1,e.cpX2,e.cpY2,e.xEnd,e.yEnd,e.lineWidth,i,n);case"line":return this.isInsideLine(e.xStart,e.yStart,e.xEnd,e.yEnd,e.lineWidth,i,n);case"broken-line":return this.isInsideBrokenLine(e.pointList,e.lineWidth,i,n);case"smicbroken-line":{let r=i,o=n;return t.refOriginalPosition&&(r=i-t.refOriginalPosition[0],o=n-t.refOriginalPosition[1]),this.isInsideBrokenLine(e.pointList,e.lineWidth,r,o)}case"ring":return this.isInsideRing(e.x,e.y,e.r0,e.r,i,n);case"smicring":{let r=e.x,o=e.y;return t.refOriginalPosition&&(r=e.x+t.refOriginalPosition[0],o=e.y+t.refOriginalPosition[1]),this.isInsideRing(r,o,e.r0,e.r,i,n)}case"circle":return this.isInsideCircle(e.x,e.y,e.r,i,n);case"smicpoint":{let r=i,o=n;return t.refOriginalPosition&&(r=i-t.refOriginalPosition[0],o=n-t.refOriginalPosition[1]),this.isInsideCircle(e.x,e.y,e.r,r,o)}case"sector":{let t=e.startAngle*Math.PI/180,r=e.endAngle*Math.PI/180;return e.clockWise||(t=-t,r=-r),this.isInsideSector(e.x,e.y,e.r0,e.r,t,r,!e.clockWise,i,n)}case"smicsector":{let r=e.startAngle*Math.PI/180,o=e.endAngle*Math.PI/180;e.clockWise||(r=-r,o=-o);let s=e.x,a=e.y;return t.refOriginalPosition&&(s=e.x+t.refOriginalPosition[0],a=e.y+t.refOriginalPosition[1]),this.isInsideSector(s,a,e.r0,e.r,r,o,!e.clockWise,i,n)}case"path":return this.isInsidePath(e.pathArray,Math.max(e.lineWidth,5),e.brushType,i,n);case"polygon":case"star":case"smicstar":case"isogon":case"smicisogon":return this.isInsidePolygon(e.pointList,i,n);case"smicpolygon":{let u=i,c=n;if(t.refOriginalPosition&&(u=i-t.refOriginalPosition[0],c=n-t.refOriginalPosition[1]),t.holePolygonPointLists&&t.holePolygonPointLists.length>0){for(var r=this.isInsidePolygon(e.pointList,u,c),o=t.holePolygonPointLists,s=!1,a=0,l=o.length;a<l;a++){var h=o[a];!0===this.isInsidePolygon(h,u,c)&&(s=!0)}return!0===r&&!1===s}return this.isInsidePolygon(e.pointList,u,c)}case"text":var u=e.__rect||t.getRect(e);return this.isInsideRect(u.x,u.y,u.width,u.height,i,n);case"smictext":var c=t.getTextBackground(e);return this.isInsidePolygon(c,i,n);case"rectangle":case"image":return this.isInsideRect(e.x,e.y,e.width,e.height,i,n);case"smicimage":{let r=e.x,o=e.y;return t.refOriginalPosition&&(r=e.x+t.refOriginalPosition[0],o=e.y+t.refOriginalPosition[1]),this.isInsideRect(r,o,e.width,e.height,i,n)}}}_buildPathMethod(t,e,i,n,r){return e.beginPath(),t.buildPath(e,i),e.closePath(),e.isPointInPath(n,r)}isOutside(t,e,i,n){return!this.isInside(t,e,i,n)}isInsideLine(t,e,i,n,r,o,s){if(0===r)return!1;var a=Math.max(r,5),l=0;if(s>e+a&&s>n+a||s<e-a&&s<n-a||o>t+a&&o>i+a||o<t-a&&o<i-a)return!1;if(t===i)return Math.abs(o-t)<=a/2;var h=(l=(e-n)/(t-i))*o-s+(t*n-i*e)/(t-i);return h*h/(l*l+1)<=a/2*a/2}isInsideCubicStroke(t,e,i,n,r,o,s,a,l,h,u){if(0===l)return!1;var c=Math.max(l,5);return!(u>e+c&&u>n+c&&u>o+c&&u>a+c||u<e-c&&u<n-c&&u<o-c&&u<a-c||h>t+c&&h>i+c&&h>r+c&&h>s+c||h<t-c&&h<i-c&&h<r-c&&h<s-c)&&this.curve.cubicProjectPoint(t,e,i,n,r,o,s,a,h,u,null)<=c/2}isInsideQuadraticStroke(t,e,i,n,r,o,s,a,l){if(0===s)return!1;var h=Math.max(s,5);return!(l>e+h&&l>n+h&&l>o+h||l<e-h&&l<n-h&&l<o-h||a>t+h&&a>i+h&&a>r+h||a<t-h&&a<i-h&&a<r-h)&&this.curve.quadraticProjectPoint(t,e,i,n,r,o,a,l,null)<=h/2}isInsideArcStroke(t,e,i,n,r,o,s,a,l){var h=this.PI2;if(0===s)return!1;var u=Math.max(s,5);a-=t,l-=e;var c=Math.sqrt(a*a+l*l);if(c-u>i||c+u<i)return!1;if(Math.abs(n-r)>=h)return!0;if(o){var p=n;n=this.normalizeRadian(r),r=this.normalizeRadian(p)}else n=this.normalizeRadian(n),r=this.normalizeRadian(r);n>r&&(r+=h);var f=Math.atan2(l,a);return f<0&&(f+=h),f>=n&&f<=r||f+h>=n&&f+h<=r}isInsideBrokenLine(t,e,i,n){for(var r=Math.max(e,10),o=0,s=t.length-1;o<s;o++){var a=t[o][0],l=t[o][1],h=t[o+1][0],u=t[o+1][1];if(this.isInsideLine(a,l,h,u,r,i,n))return!0}return!1}isInsideRing(t,e,i,n,r,o){var s=(r-t)*(r-t)+(o-e)*(o-e);return s<n*n&&s>i*i}isInsideRect(t,e,i,n,r,o){return r>=t&&r<=t+i&&o>=e&&o<=e+n}isInsideCircle(t,e,i,n,r){return(n-t)*(n-t)+(r-e)*(r-e)<i*i}isInsideSector(t,e,i,n,r,o,s,a,l){return this.isInsideArcStroke(t,e,(i+n)/2,r,o,s,n-i,a,l)}isInsidePolygon(t,e,i){for(var n=t.length,r=0,o=0,s=n-1;o<n;o++){var a=t[s][0],l=t[s][1],h=t[o][0],u=t[o][1];r+=this.windingLine(a,l,h,u,e,i),s=o}return 0!==r}windingLine(t,e,i,n,r,o){return o>e&&o>n||o<e&&o<n?0:n==e?0:(o-e)/(n-e)*(i-t)+t>r?n<e?1:-1:0}swapExtrema(){var t=this.extrema[0];this.extrema[0]=this.extrema[1],this.extrema[1]=t}windingCubic(t,e,i,n,r,o,s,a,l,h){var u=this.curve,c=this.roots,p=this.extrema;if(h>e&&h>n&&h>o&&h>a||h<e&&h<n&&h<o&&h<a)return 0;var f=u.cubicRootAt(e,n,o,a,h,c);if(0===f)return 0;for(var d,g,y=0,m=-1,_=0;_<f;_++){var v=c[_];u.cubicAt(t,i,r,s,v)<l||(m<0&&(m=u.cubicExtrema(e,n,o,a,p),p[1]<p[0]&&m>1&&this.swapExtrema(),d=u.cubicAt(e,n,o,a,p[0]),m>1&&(g=u.cubicAt(e,n,o,a,p[1]))),2===m?v<p[0]?y+=d<e?1:-1:v<p[1]?y+=g<d?1:-1:y+=a<g?1:-1:v<p[0]?y+=d<e?1:-1:y+=a<d?1:-1)}return y}windingQuadratic(t,e,i,n,r,o,s,a){var l=this.curve,h=this.roots;if(a>e&&a>n&&a>o||a<e&&a<n&&a<o)return 0;var u=l.quadraticRootAt(e,n,o,a,h);if(0===u)return 0;var c=l.quadraticExtremum(e,n,o);if(c>=0&&c<=1){var p=0,f=l.quadraticAt(e,n,o,c);for(let n=0;n<u;n++)l.quadraticAt(t,i,r,h[n])>s||(h[n]<c?p+=f<e?1:-1:p+=o<f?1:-1);return p}return l.quadraticAt(t,i,r,h[0])>s?0:o<e?1:-1}windingArc(t,e,i,n,r,o,s,a){var l=this.roots,h=this.PI2;if((a-=e)>i||a<-i)return 0;let u=Math.sqrt(i*i-a*a);if(l[0]=-u,l[1]=u,Math.abs(n-r)>=h){n=0,r=h;var c=o?1:-1;return s>=l[0]+t&&s<=l[1]+t?c:0}if(o){let t=n;n=this.normalizeRadian(r),r=this.normalizeRadian(t)}else n=this.normalizeRadian(n),r=this.normalizeRadian(r);n>r&&(r+=h);var p=0;for(let e=0;e<2;e++){var f=l[e];if(f+t>s){let t=Math.atan2(a,f),e=o?1:-1;t<0&&(t=h+t),(t>=n&&t<=r||t+h>=n&&t+h<=r)&&(t>Math.PI/2&&t<1.5*Math.PI&&(e=-e),p+=e)}}return p}isInsidePath(t,e,i,n,r){for(var o=0,s=0,a=0,l=0,h=0,u=!0,c=!0,p="stroke"===(i=i||"fill")||"both"===i,f="fill"===i||"both"===i,d=0;d<t.length;d++){var g=t[d],y=g.points;if(u||"M"===g.command){if(d>0&&(f&&(o+=this.windingLine(s,a,l,h,n,r)),0!==o))return!0;l=y[y.length-2],h=y[y.length-1],u=!1,c&&"A"!==g.command&&(c=!1,s=l,a=h)}switch(g.command){case"M":s=y[0],a=y[1];break;case"L":if(p&&this.isInsideLine(s,a,y[0],y[1],e,n,r))return!0;f&&(o+=this.windingLine(s,a,y[0],y[1],n,r)),s=y[0],a=y[1];break;case"C":if(p&&this.isInsideCubicStroke(s,a,y[0],y[1],y[2],y[3],y[4],y[5],e,n,r))return!0;f&&(o+=this.windingCubic(s,a,y[0],y[1],y[2],y[3],y[4],y[5],n,r)),s=y[4],a=y[5];break;case"Q":if(p&&this.isInsideQuadraticStroke(s,a,y[0],y[1],y[2],y[3],e,n,r))return!0;f&&(o+=this.windingQuadratic(s,a,y[0],y[1],y[2],y[3],n,r)),s=y[2],a=y[3];break;case"A":var m=y[0],_=y[1],v=y[2],x=y[3],b=y[4],w=y[5],E=Math.cos(b)*v+m,C=Math.sin(b)*x+_;c?(c=!1,l=E,h=C):o+=this.windingLine(s,a,E,C);var L=(n-m)*x/v+m;if(p&&this.isInsideArcStroke(m,_,x,b,b+w,1-y[7],e,L,r))return!0;f&&(o+=this.windingArc(m,_,x,b,b+w,1-y[7],L,r)),s=Math.cos(b+w)*v+m,a=Math.sin(b+w)*x+_;break;case"z":if(p&&this.isInsideLine(s,a,l,h,e,n,r))return!0;u=!0}}return f&&(o+=this.windingLine(s,a,l,h,n,r)),0!==o}getTextWidth(t,e){var i=t+":"+e;if(this._textWidthCache[i])return this._textWidthCache[i];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e);for(var n=0,r=0,o=(t=(t+"").split("\n")).length;r<o;r++)n=Math.max(this._ctx.measureText(t[r]).width,n);return this._ctx.restore(),this._textWidthCache[i]=n,++this._textWidthCacheCounter>this.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),n}getTextHeight(t,e){var i=t+":"+e;if(this._textHeightCache[i])return this._textHeightCache[i];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e),t=(t+"").split("\n");var n=(this._ctx.measureText("ZH").width+2)*t.length;return this._ctx.restore(),this._textHeightCache[i]=n,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),n}},Di.Util_color=new ki,Di.Util_computeBoundingBox=new class{constructor(){3===arguments.length&&this.computeBoundingBox(arguments),this.CLASS_NAME="Zondy.LevelRenderer.Tool.ComputeBoundingBox"}computeBoundingBox(t,e,i){if(0!==t.length){for(var n=t[0][0],r=t[0][0],o=t[0][1],s=t[0][1],a=1;a<t.length;a++){var l=t[a];l[0]<n&&(n=l[0]),l[0]>r&&(r=l[0]),l[1]<o&&(o=l[1]),l[1]>s&&(s=l[1])}e[0]=n,e[1]=o,i[0]=r,i[1]=s}}cubeBezier(t,e,i,n,r,o){var s=new Ri,a=[];s.cubicExtrema(t[0],e[0],i[0],n[0],a);for(let r=0;r<a.length;r++)a[r]=s.cubicAt(t[0],e[0],i[0],n[0],a[r]);var l=[];s.cubicExtrema(t[1],e[1],i[1],n[1],l);for(let r=0;r<l.length;r++)l[r]=s.cubicAt(t[1],e[1],i[1],n[1],l[r]);a.push(t[0],n[0]),l.push(t[1],n[1]);var h=Math.min.apply(null,a),u=Math.max.apply(null,a),c=Math.min.apply(null,l),p=Math.max.apply(null,l);r[0]=h,r[1]=c,o[0]=u,o[1]=p}quadraticBezier(t,e,i,n,r){var o=new Ri,s=o.quadraticExtremum(t[0],e[0],i[0]),a=o.quadraticExtremum(t[1],e[1],i[1]),l=1-(s=Math.max(Math.min(s,1),0)),h=1-(a=Math.max(Math.min(a,1),0)),u=l*l*t[0]+2*l*s*e[0]+s*s*i[0],c=l*l*t[1]+2*l*s*e[1]+s*s*i[1],p=h*h*t[0]+2*h*a*e[0]+a*a*i[0],f=h*h*t[1]+2*h*a*e[1]+a*a*i[1];n[0]=Math.min(t[0],i[0],u,p),n[1]=Math.min(t[1],i[1],c,f),r[0]=Math.max(t[0],i[0],u,p),r[1]=Math.max(t[1],i[1],c,f)}arc(t,e,i,n,r,o,s,a){var l=new Ai,h=l.create(),u=l.create(),c=l.create();if(h[0]=Math.cos(n)*i+t,h[1]=Math.sin(n)*i+e,u[0]=Math.cos(r)*i+t,u[1]=Math.sin(r)*i+e,l.min(s,h,u),l.max(a,h,u),(n%=2*Math.PI)<0&&(n+=2*Math.PI),(r%=2*Math.PI)<0&&(r+=2*Math.PI),n>r&&!o?r+=2*Math.PI:n<r&&o&&(n+=2*Math.PI),o){var p=r;r=n,n=p}for(var f=0;f<r;f+=Math.PI/2)f>n&&(c[0]=Math.cos(f)*i+t,c[1]=Math.sin(f)*i+e,l.min(s,c,s),l.max(a,c,a))}},Di.Util_curve=new Ri,Di.Util_env=new class{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Tool.Env";var t=this;return function(e){var i=t.os={},n=t.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),o=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),a=e.match(/(iPod)(.*OS\s([\d_]+))?/),l=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),h=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),u=h&&e.match(/TouchPad/),c=e.match(/Kindle\/([\d.]+)/),p=e.match(/Silk\/([\d._]+)/),f=e.match(/(BlackBerry).*Version\/([\d.]+)/),d=e.match(/(BB10).*Version\/([\d.]+)/),g=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),y=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),_=e.match(/Firefox\/([\d.]+)/),v=e.match(/MSIE ([\d.]+)/),x=r&&e.match(/Mobile\//)&&!m,b=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m;return(n.webkit=!!r)&&(n.version=r[1]),o&&(i.android=!0,i.version=o[2]),l&&!a&&(i.ios=i.iphone=!0,i.version=l[2].replace(/_/g,".")),s&&(i.ios=i.ipad=!0,i.version=s[2].replace(/_/g,".")),a&&(i.ios=i.ipod=!0,i.version=a[3]?a[3].replace(/_/g,"."):null),h&&(i.webos=!0,i.version=h[2]),u&&(i.touchpad=!0),f&&(i.blackberry=!0,i.version=f[2]),d&&(i.bb10=!0,i.version=d[2]),g&&(i.rimtabletos=!0,i.version=g[2]),y&&(n.playbook=!0),c&&(i.kindle=!0,i.version=c[1]),p&&(n.silk=!0,n.version=p[1]),!p&&i.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),_&&(n.firefox=!0,n.version=_[1]),v&&(n.ie=!0,n.version=v[1]),x&&(e.match(/Safari/)||i.ios)&&(n.safari=!0),b&&(n.webview=!0),v&&(n.ie=!0,n.version=v[1]),i.tablet=!!(s||y||o&&!e.match(/Mobile/)||_&&e.match(/Tablet/)||v&&!e.match(/Phone/)&&e.match(/Touch/)),i.phone=!(i.tablet||i.ipod||!(o||l||h||f||d||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||_&&e.match(/Mobile/)||v&&e.match(/Touch/))),{browser:n,os:i,canvasSupported:!!document.createElement("canvas").getContext}}(navigator.userAgent)}destory(){return!0}},Di.Util_event=new class{constructor(){this.stop="function"==typeof window.addEventListener?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0},this.CLASS_NAME="Zondy.LevelRenderer.Tool.Event"}getX(t){return void 0!==t.zrenderX&&t.zrenderX||void 0!==t.offsetX&&t.offsetX||void 0!==t.layerX&&t.layerX||void 0!==t.clientX&&t.clientX}getY(t){return void 0!==t.zrenderY&&t.zrenderY||void 0!==t.offsetY&&t.offsetY||void 0!==t.layerY&&t.layerY||void 0!==t.clientY&&t.clientY}getDelta(t){return void 0!==t.zrenderDelta&&t.zrenderDelta||void 0!==t.wheelDelta&&t.wheelDelta||void 0!==t.detail&&-t.detail}},Di.Util_http=new class{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Tool.Http"}get(t,e,i){if("object"==typeof t){var n=t;t=n.url,e=n.onsuccess,i=n.onerror}var r=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");r.open("GET",t,!0),r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300||304===r.status?e&&e(r.responseText):i&&i(),r.onreadystatechange=new Function,r=null)},r.send(null)}},Di.Util_math=new class{constructor(){this._radians=window.Math.PI/180,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Math"}sin(t,e){return window.Math.sin(e?t*this._radians:t)}cos(t,e){return window.Math.cos(e?t*this._radians:t)}degreeToRadian(t){return t*this._radians}radianToDegree(t){return t/this._radians}},Di.Util_matrix=new class{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Matrix"}create(){var t=new(0,this.ArrayCtor)(6);return this.identity(t),t}identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}copy(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}mul(t,e,i){return t[0]=e[0]*i[0]+e[2]*i[1],t[1]=e[1]*i[0]+e[3]*i[1],t[2]=e[0]*i[2]+e[2]*i[3],t[3]=e[1]*i[2]+e[3]*i[3],t[4]=e[0]*i[4]+e[2]*i[5]+e[4],t[5]=e[1]*i[4]+e[3]*i[5]+e[5],t}translate(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+i[0],t[5]=e[5]+i[1],t}rotate(t,e,i){var n=e[0],r=e[2],o=e[4],s=e[1],a=e[3],l=e[5],h=Math.sin(i),u=Math.cos(i);return t[0]=n*u+s*h,t[1]=-n*h+s*u,t[2]=r*u+a*h,t[3]=-r*h+u*a,t[4]=u*o+h*l,t[5]=u*l-h*o,t}scale(t,e,i){var n=i[0],r=i[1];return t[0]=e[0]*n,t[1]=e[1]*r,t[2]=e[2]*n,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*r,t}invert(t,e){var i=e[0],n=e[2],r=e[4],o=e[1],s=e[3],a=e[5],l=i*s-o*n;return l?(l=1/l,t[0]=s*l,t[1]=-o*l,t[2]=-n*l,t[3]=i*l,t[4]=(n*a-s*r)*l,t[5]=(o*r-i*a)*l,t):null}mulVector(t,e,i){var n=e[0],r=e[2],o=e[4],s=e[1],a=e[3],l=e[5];return t[0]=i[0]*n+i[1]*r+o,t[1]=i[0]*s+i[1]*a+l,t}},Di.Util=new Ni,Di.Util_vector=new Ai;class zi{constructor(){this.position=[0,0],this.rotation=[0,0,0],this.scale=[1,1,0,0],this.needLocalTransform=!1,this.needTransform=!1,this.CLASS_NAME="Zondy.LevelRenderer.Transformable",this.lookAt=function(){var t=Di.Util_vector.create();return function(e){this.transform||(this.transform=Di.Util_matrix.create());var i=this.transform;function n(t){return t>-5e-5&&t<5e-5}Di.Util_vector.sub(t,e,this.position),n(t[0])&&n(t[1])||(Di.Util_vector.normalize(t,t),i[2]=t[0]*this.scale[1],i[3]=t[1]*this.scale[1],i[0]=t[1]*this.scale[0],i[1]=-t[0]*this.scale[0],i[4]=this.position[0],i[5]=this.position[1],this.decomposeTransform())}}()}destroy(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}updateNeedTransform(){function t(t){return t>5e-5||t<-5e-5}this.needLocalTransform=t(this.rotation[0])||t(this.position[0])||t(this.position[1])||t(this.scale[0]-1)||t(this.scale[1]-1)}updateTransform(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,this.needTransform){var t=[0,0],e=this.transform||Di.Util_matrix.create();if(Di.Util_matrix.identity(e),this.needLocalTransform){if(i(this.scale[0])||i(this.scale[1])){t[0]=-this.scale[2]||0,t[1]=-this.scale[3]||0;let n=i(t[0])||i(t[1]);n&&Di.Util_matrix.translate(e,e,t),Di.Util_matrix.scale(e,e,this.scale),n&&(t[0]=-t[0],t[1]=-t[1],Di.Util_matrix.translate(e,e,t))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){t[0]=-this.rotation[1]||0,t[1]=-this.rotation[2]||0;let n=i(t[0])||i(t[1]);n&&Di.Util_matrix.translate(e,e,t),Di.Util_matrix.rotate(e,e,this.rotation[0]),n&&(t[0]=-t[0],t[1]=-t[1],Di.Util_matrix.translate(e,e,t))}}else 0!==this.rotation&&Di.Util_matrix.rotate(e,e,this.rotation);(i(this.position[0])||i(this.position[1]))&&Di.Util_matrix.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?Di.Util_matrix.mul(this.transform,this.parent.transform,this.transform):Di.Util_matrix.copy(this.transform,this.parent.transform))}function i(t){return t>5e-5||t<-5e-5}}setTransform(t){if(this.needTransform){var e=this.transform;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}}decomposeTransform(){if(this.transform){var t=this.transform,e=t[0]*t[0]+t[1]*t[1],i=this.position,n=this.scale,r=this.rotation;s(e-1)&&(e=Math.sqrt(e));var o=t[2]*t[2]+t[3]*t[3];s(o-1)&&(o=Math.sqrt(o)),i[0]=t[4],i[1]=t[5],n[0]=e,n[1]=o,n[2]=n[3]=0,r[0]=Math.atan2(-t[1]/o,t[0]/e),r[1]=r[2]=0}function s(t){return t>5e-5||t<-5e-5}}}class Bi extends(mi(Oi,zi)){constructor(t){super(t),t=t||{},this.id=null,this.style={},this.highlightStyle=null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],this.invisible=!1,this.ignore=!1,this.zlevel=0,this.draggable=!1,this.clickable=!1,this.hoverable=!0,this.z=0,this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,yi(this,t),this.id=this.id||vi(),this.CLASS_NAME="Zondy.LevelRenderer.Shape",this.getTansform=function(){var t=[];return function(e,i){var n=[e,i];return this.needTransform&&this.transform&&(Di.Util_matrix.invert(t,this.transform),Di.Util_matrix.mulVector(n,t,[e,i,1]),e===n[0]&&i===n[1]&&this.updateNeedTransform()),n}}()}destroy(){this.id=null,this.style=null,this.highlightStyle=null,this.parent=null,this.__dirty=null,this.__clipShapes=null,this.invisible=null,this.ignore=null,this.zlevel=null,this.draggable=null,this.clickable=null,this.hoverable=null,this.z=null,this.refOriginalPosition=null,this.refDataID=null,this.refDataHoverGroup=null,this.isHoverByRefDataID=null,this.dataInfo=null,super.destroy()}brush(t,e){var i=this.beforeBrush(t,e);switch(t.beginPath(),this.buildPath(t,i),i.brushType){case"both":this.setCtxGlobalAlpha(t,"fill",i),t.fill(),i.lineWidth>0&&(this.setCtxGlobalAlpha(t,"stroke",i),t.stroke()),this.setCtxGlobalAlpha(t,"reset",i);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",i),i.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",i);break;default:this.setCtxGlobalAlpha(t,"fill",i),t.fill(),this.setCtxGlobalAlpha(t,"reset",i)}this.drawText(t,i,this.style),this.afterBrush(t)}beforeBrush(t,e){var i=this.style;return this.brushTypeOnly&&(i.brushType=this.brushTypeOnly),e&&(i=this.getHighlightStyle(i,this.highlightStyle||{},this.brushTypeOnly)),"stroke"===this.brushTypeOnly&&(i.strokeColor=i.strokeColor||i.color),t.save(),this.doClip(t),this.setContext(t,i),this.setTransform(t),i}afterBrush(t){t.restore()}setContext(t,e){for(var i=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],n=0,r=i.length;n<r;n++){var o=e[i[n][0]],s=i[n][1];void 0!==o&&(t[s]=o)}}doClip(t){var e=Di.Util_matrix.create();if(this.__clipShapes)for(var i=0;i<this.__clipShapes.length;i++){var n=this.__clipShapes[i];if(n.needTransform){let i=n.transform;Di.Util_matrix.invert(e,i),t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}if(t.beginPath(),n.buildPath(t,n.style),t.clip(),n.needTransform){let i=e;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}}}getHighlightStyle(t,e,i){var n={};for(let e in t)n[e]=t[e];var r=Di.Util_color.getHighlightColor();"stroke"!==t.brushType?(n.strokeColor=r,n.lineWidth=t.lineWidth||1,n.brushType="both"):"stroke"!==i?(n.strokeColor=r,n.lineWidth=t.lineWidth||1):n.strokeColor=e.strokeColor||Di.Util_color.mix(t.strokeColor,Di.Util_color.toRGB(r));for(let t in e)void 0!==e[t]&&(n[t]=e[t]);return n}getHighlightZoom(){return"text"!==this.type?6:2}drift(t,e){this.position[0]+=t,this.position[1]+=e}buildPath(t,e){}getRect(t){}isCover(t,e){var i=this.getTansform(t,e);t=i[0],e=i[1];var n=this.style.__rect;return n||(n=this.style.__rect=this.getRect(this.style)),t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height&&Di.Util_area.isInside(this,this.style,t,e)}drawText(t,e,i){if(void 0!==e.text&&!1!==e.text){var n=e.textColor||e.color||e.strokeColor;t.fillStyle=n;var r,o,s,a,l=10,h=e.textPosition||this.textPosition||"top",u=[];switch(u=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],h){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(i||e).__rect||this.getRect(i||e);switch(h){case"inside":s=c.x+c.width/2,a=c.y+c.height/2,r="center",o="middle","stroke"!==e.brushType&&n===e.color&&(t.fillStyle="#fff");break;case"left":s=c.x-l,a=c.y+c.height/2,r="end",o="middle";break;case"right":s=c.x+c.width+l,a=c.y+c.height/2,r="start",o="middle";break;case"top":s=c.x+c.width/2,a=c.y-l,r="center",o="bottom";break;case"bottom":s=c.x+c.width/2,a=c.y+c.height+l,r="center",o="top"}}break;case"start":case"end":var p=0,f=0,d=0,g=0;if(void 0!==e.pointList){var y=e.pointList;if(y.length<2)return;var m=y.length;switch(h){case"start":p=y[0][0]+u[0],f=y[1][0]+u[0],d=y[0][1]+u[1],g=y[1][1]+u[1];break;case"end":p=y[m-2][0]+u[0],f=y[m-1][0]+u[0],d=y[m-2][1]+u[1],g=y[m-1][1]+u[1]}}else p=e.xStart+u[0]||0,f=e.xEnd+u[0]||0,d=e.yStart+u[1]||0,g=e.yEnd+u[1]||0;switch(h){case"start":r=p<f?"end":"start",o=d<g?"bottom":"top",s=p,a=d;break;case"end":r=p<f?"start":"end",o=d<g?"top":"bottom",s=f,a=g}l-=4,p&&f&&p!==f?s-="end"===r?l:-l:r="center",d!==g?a-="bottom"===o?l:-l:o="middle";break;case"specific":s=e.textX||0,a=e.textY||0,r="start",o="middle"}e.labelXOffset&&!isNaN(e.labelXOffset)&&(s+=e.labelXOffset),e.labelYOffset&&!isNaN(e.labelYOffset)&&(a+=e.labelYOffset),null!=s&&null!=a&&Bi._fillText(t,e.text,s,a,e.textFont,e.textAlign||r,e.textBaseline||o)}}modSelf(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)}isSilent(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)}setCtxGlobalAlpha(t,e,i){t.globalAlpha="fill"===e?void 0===i.fillOpacity?void 0===i.opacity?1:i.opacity:i.fillOpacity:"stroke"===e?void 0===i.strokeOpacity?void 0===i.opacity?1:i.opacity:i.strokeOpacity:void 0===i.opacity?1:i.opacity}static _fillText(t,e,i,n,r,o,s){r&&(t.font=r),t.textAlign=o,t.textBaseline=s;var a=Bi._getTextRect(e,i,n,r,o,s);e=(e+"").split("\n");var l=Di.Util_area.getTextHeight("ZH",r);switch(s){case"top":n=a.y;break;case"bottom":n=a.y+l;break;default:n=a.y+l/2}for(var h=0,u=e.length;h<u;h++)t.fillText(e[h],i,n),n+=l}static _getTextRect(t,e,i,n,r,o){var s=Di.Util_area.getTextWidth(t,n),a=Di.Util_area.getTextHeight("ZH",n);switch(t=(t+"").split("\n"),r){case"end":case"right":e-=s;break;case"center":e-=s/2}switch(o){case"top":break;case"bottom":i-=a*t.length;break;default:i-=a*t.length/2}return{x:e,y:i,width:s,height:a*t.length}}}class Fi extends Bi{constructor(t){super(t),this.type="smicpoint",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicPoint"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;t.arc(e.x+i[0],e.y+i[1],e.r,0,2*Math.PI,!0)}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition;return t.__rect?t.__rect:(e="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(t.x+i[0]-t.r-e/2),y:Math.round(t.y+i[1]-t.r-e/2),width:2*t.r+e,height:2*t.r+e},t.__rect)}}class Vi extends Bi{constructor(t){super(t),this.type="smictext",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.SmicText"}destroy(){this.type=null,super.destroy()}brush(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=this.style;if(e&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),void 0!==n.text&&!1!==n.text){t.save(),this.doClip(t),this.setContext(t,n),this.setTransform(t),n.textFont&&(t.font=n.textFont),t.textAlign=n.textAlign||"start",t.textBaseline=n.textBaseline||"middle";var r,o=(n.text+"").split("\n"),s=Di.Util_area.getTextHeight("ZH",n.textFont),a=this.getRectNoRotation(n),l=n.x+i[0];r="top"===n.textBaseline?a.y:"bottom"===n.textBaseline?a.y+s:a.y+s/2;for(var h=n.x+i[0],u=n.y+i[1],c=0,p=o.length;c<p;c++){switch(n.labelRect&&(t.fillRect(a.x-2,a.y,a.width+4,a.height),t.fillStyle=n.strokeColor,t.strokeRect(a.x-2,a.y,a.width+4,a.height),t.fillStyle=n.textColor),n.brushType){case"stroke":this.setCtxGlobalAlpha(t,"stroke",n),n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?t.strokeText(o[c],0,s*c,n.maxWidth):t.strokeText(o[c],0,s*c):"bottom"===n.textBaseline?n.maxWidth?t.strokeText(o[c],0,s*(c+1)-a.height,n.maxWidth):t.strokeText(o[c],0,s*(c+1)-a.height):n.maxWidth?t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth):t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2),t.restore()):n.maxWidth?t.strokeText(o[c],l,r,n.maxWidth):t.strokeText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n);break;case"both":n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*c,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*c,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*c),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*c),this.setCtxGlobalAlpha(t,"reset",n)):"bottom"===n.textBaseline?n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height),this.setCtxGlobalAlpha(t,"reset",n)):n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height/2-s/2),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2),this.setCtxGlobalAlpha(t,"reset",n)),t.restore()):n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],l,r,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],l,r,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n));break;default:this.setCtxGlobalAlpha(t,"fill",n),n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?t.fillText(o[c],0,s*c,n.maxWidth):t.fillText(o[c],0,s*c):"bottom"===n.textBaseline?n.maxWidth?t.fillText(o[c],0,s*(c+1)-a.height,n.maxWidth):t.fillText(o[c],0,s*(c+1)-a.height):n.maxWidth?t.fillText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth):t.fillText(o[c],0,s*(c+1)-a.height/2-s/2),t.restore()):n.maxWidth?t.fillText(o[c],l,r,n.maxWidth):t.fillText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n)}r+=s}t.restore()}}getRect(t){if(t.__rect)return t.__rect;for(var e,i,n,r,o=this.getTextBackground(t,!0),s=0,a=o.length;s<a;s++){var l=o[s];0===s?(e=l[0],n=l[0],i=l[1],r=l[1]):(l[0]<e&&(e=l[0]),l[0]>n&&(n=l[0]),l[1]<i&&(i=l[1]),l[1]>r&&(r=l[1]))}return t.__rect={x:e,y:i,width:n-e,height:r-i},t.__rect}getRectNoRotation(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition,n=Di.Util_area.getTextHeight("ZH",t.textFont),r=Di.Util_area.getTextWidth(t.text,t.textFont),o=Di.Util_area.getTextHeight(t.text,t.textFont),s=t.x+i[0];"end"===t.textAlign||"right"===t.textAlign?s-=r:"center"===t.textAlign&&(s-=r/2),e="top"===t.textBaseline?t.y+i[1]:"bottom"===t.textBaseline?t.y+i[1]-o:t.y+i[1]-o/2;var a,l=!1;if(t.maxWidth){var h=parseInt(t.maxWidth);h<r&&(a=r,l=!0,r=h),s=t.x+i[0],"end"===t.textAlign||"right"===t.textAlign?s-=r:"center"===t.textAlign&&(s-=r/2)}t.textFont&&(t.textFont.toLowerCase().indexOf("italic")>-1&&(r+=a&&!0===l?n/3*(r/a):n/3));return{x:s,y:e,width:r,height:o}}getTextBackground(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;if((!e||!1===e)&&t.__textBackground)return t.__textBackground;var n=this.getRectNoRotation(t),r=t.x+i[0],o=t.y+i[1],s=[];if(t.textRotation&&0!==t.textRotation){let e=t.textRotation,i=this.getRotatedLocation(n.x,n.y,r,o,e),a=this.getRotatedLocation(n.x+n.width,n.y,r,o,e),l=this.getRotatedLocation(n.x+n.width,n.y+n.height,r,o,e),h=this.getRotatedLocation(n.x,n.y+n.height,r,o,e);s.push(i),s.push(a),s.push(l),s.push(h)}else{let t=[n.x,n.y],e=[n.x+n.width,n.y],i=[n.x+n.width,n.y+n.height],r=[n.x,n.y+n.height];s.push(t),s.push(e),s.push(i),s.push(r)}return t.__textBackground=s,t.__textBackground}getRotatedLocation(t,e,i,n,r){var o,s,a=new Array;return e=-e,n=-n,r=-r,o=(t-i)*Math.cos(r/180*Math.PI)-(e-n)*Math.sin(r/180*Math.PI)+i,s=(t-i)*Math.sin(r/180*Math.PI)+(e-n)*Math.cos(r/180*Math.PI)+n,a[0]=o,a[1]=-s,a}}class ji extends Bi{constructor(t){super(t),this.type="smiccircle",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.SmicCircle"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.x+i[0],r=e.y+i[1];return t.moveTo(n+e.r,r),t.arc(n,r,e.r,0,2*Math.PI,!0),!0}getRect(t){if(t.__rect)return t.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition,n=t.x+i[0],r=t.y+i[1],o=t.r;return e="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(n-o-e/2),y:Math.round(r-o-e/2),width:2*o+e,height:2*o+e},t.__rect}}class Gi extends Bi{constructor(t){super(t),this.type="smicpolygon",this.holePolygonPointLists=null,this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicPolygon"}destroy(){this.type=null,this.holePolygonPointLists=null,super.destroy()}brush(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.style;e&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),t.save(),this.setContext(t,i),this.setTransform(t);var n=!1;"fill"!==i.brushType&&"both"!==i.brushType&&void 0!==i.brushType||(t.beginPath(),"dashed"===i.lineType||"dotted"===i.lineType||"dot"===i.lineType||"dash"===i.lineType||"dashot"===i.lineType||"longdash"===i.lineType||"longdashdot"===i.lineType?this.buildPath(t,{lineType:"solid",lineWidth:i.lineWidth,pointList:i.pointList}):(this.buildPath(t,i),n=!0),t.closePath(),this.setCtxGlobalAlpha(t,"fill",i),t.fill(),this.setCtxGlobalAlpha(t,"reset",i)),i.lineWidth>0&&("stroke"===i.brushType||"both"===i.brushType)&&(n||(t.beginPath(),this.buildPath(t,i)),this.setCtxGlobalAlpha(t,"stroke",i),t.stroke(),this.setCtxGlobalAlpha(t,"reset",i)),this.drawText(t,i,this.style);var r=bi(i);if(r.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var o=this.holePolygonPointLists,s=o.length,a=0;a<s;a++){var l=o[a];r.pointList=l,t.globalCompositeOperation="destination-out",n=!1,"fill"!==r.brushType&&"both"!==r.brushType&&void 0!==r.brushType||(t.beginPath(),"dashed"===r.lineType||"dotted"===r.lineType||"dot"===r.lineType||"dash"===r.lineType||"dashot"===r.lineType||"longdash"===r.lineType||"longdashdot"===r.lineType?this.buildPath(t,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}):(this.buildPath(t,r),n=!0),t.closePath(),this.setCtxGlobalAlpha(t,"fill",r),t.fill(),this.setCtxGlobalAlpha(t,"reset",r)),r.lineWidth>0&&("stroke"===r.brushType||"both"===r.brushType)?(n||(t.beginPath(),this.buildPath(t,r)),t.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(t,"stroke",r),t.stroke(),this.setCtxGlobalAlpha(t,"reset",r)):t.globalCompositeOperation="source-over"}t.restore()}buildPath(t,e){e.showShadow&&(t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY),this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.pointList;if(!(n.length<2))if(e.smooth&&"spline"!==e.smooth){var r,o,s,a=Di.SUtil_smoothBezier(n,e.smooth,!0,e.smoothConstraint,i);t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(var l=n.length,h=0;h<l;h++)r=a[2*h],o=a[2*h+1],s=[n[(h+1)%l][0]+i[0],n[(h+1)%l][1]+i[1]],t.bezierCurveTo(r[0],r[1],o[0],o[1],s[0],s[1])}else if("spline"===e.smooth&&(n=Di.SUtil_smoothSpline(n,!0,null,i)),e.lineType&&"solid"!==e.lineType){if("dashed"===e.lineType||"dotted"===e.lineType||"dot"===e.lineType||"dash"===e.lineType||"longdash"===e.lineType){let r=e._dashLength||(e.lineWidth||1)*("dashed"===e.lineType?5:1);e._dashLength=r;let o=e.lineWidth||1,s=o,a=o;"dashed"===e.lineType&&(s*=5,a*=5,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"dotted"===e.lineType&&e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o),"dot"===e.lineType&&(a*=4,e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o)),"dash"===e.lineType&&(s*=4,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"longdash"===e.lineType&&(s*=8,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)Di.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a]);Di.SUtil_dashedLineTo(t,n[n.length-1][0]+i[0],n[n.length-1][1]+i[1],n[0][0]+i[0],n[0][1]+i[1],o,[s,a])}else if("dashot"===e.lineType||"longdashdot"===e.lineType){let r=e._dashLength||(e.lineWidth||1)*("dashed"===e.lineType?5:1);e._dashLength=r;let o=e.lineWidth||1,s=o,a=o,l=o,h=o;"dashot"===e.lineType&&(s*=4,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),"longdashdot"===e.lineType&&(s*=8,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)Di.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a,l,h]);Di.SUtil_dashedLineTo(t,n[n.length-1][0]+i[0],n[n.length-1][1]+i[1],n[0][0]+i[0],n[0][1]+i[1],o,[s,a,l,h])}}else{t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)t.lineTo(n[e][0]+i[0],n[e][1]+i[1]);t.lineTo(n[0][0]+i[0],n[0][1]+i[1])}}getRect(t,e){var i;if(e?i=e:(this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),i=this.refOriginalPosition),t.__rect)return t.__rect;for(var n,r=Number.MAX_VALUE,o=Number.MIN_VALUE,s=Number.MAX_VALUE,a=Number.MIN_VALUE,l=t.pointList,h=0,u=l.length;h<u;h++)l[h][0]+i[0]<r&&(r=l[h][0]+i[0]),l[h][0]+i[0]>o&&(o=l[h][0]+i[0]),l[h][1]+i[1]<s&&(s=l[h][1]+i[1]),l[h][1]+i[1]>a&&(a=l[h][1]+i[1]);return n="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(r-n/2),y:Math.round(s-n/2),width:o-r+n,height:a-s+n},t.__rect}}class Ui extends Bi{constructor(t){super(t),this.brushTypeOnly="stroke",this.textPosition="end",this.type="smicbroken-line",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicBrokenLine"}destroy(){this.brushTypeOnly=null,this.textPosition=null,this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.pointList;if(!(n.length<2)){var r=Math.min(e.pointList.length,Math.round(e.pointListLength||e.pointList.length));if(e.smooth&&"spline"!==e.smooth){var o,s,a,l=Di.SUtil_smoothBezier(n,e.smooth,!1,e.smoothConstraint,i);t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=0;e<r-1;e++)o=l[2*e],s=l[2*e+1],a=[n[e+1][0]+i[0],n[e+1][1]+i[1]],t.bezierCurveTo(o[0],o[1],s[0],s[1],a[0],a[1])}else if("spline"===e.smooth&&(r=(n=Di.SUtil_smoothSpline(n,null,null,i)).length),e.lineType&&"solid"!==e.lineType){if("dashed"===e.lineType||"dotted"===e.lineType||"dot"===e.lineType||"dash"===e.lineType||"longdash"===e.lineType){let o=e.lineWidth||1,s=o,a=o;"dashed"===e.lineType&&(s*=5,a*=5,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"dotted"===e.lineType&&e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o),"dot"===e.lineType&&(a*=4,e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o)),"dash"===e.lineType&&(s*=4,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"longdash"===e.lineType&&(s*=8,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(var h=1;h<r;h++)Di.SUtil_dashedLineTo(t,n[h-1][0]+i[0],n[h-1][1]+i[1],n[h][0]+i[0],n[h][1]+i[1],o,[s,a])}else if("dashot"===e.lineType||"longdashdot"===e.lineType){let o=e.lineWidth||1,s=o,a=o,l=o,h=o;"dashot"===e.lineType&&(s*=4,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),"longdashdot"===e.lineType&&(s*=8,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),o=(e.lineWidth||1)*("dashed"===e.lineType?5:1),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<r;e++)Di.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a,l,h])}}else{t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<r;e++)t.lineTo(n[e][0]+i[0],n[e][1]+i[1])}}}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition;return Gi.prototype.getRect.apply(this,[t,e])}brush(t,e){var i=this.beforeBrush(t,e);switch(t.beginPath(),this.buildPath(t,i),i.brushType){case"both":this.setCtxGlobalAlpha(t,"fill",i),i.lineWidth>0&&(this.setCtxGlobalAlpha(t,"stroke",i),t.stroke()),this.setCtxGlobalAlpha(t,"reset",i);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",i),i.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",i);break;default:this.setCtxGlobalAlpha(t,"fill",i),this.setCtxGlobalAlpha(t,"reset",i)}this.drawText(t,i,this.style),this.afterBrush(t)}}class Hi extends Bi{constructor(t){super(t),this.type="smicimage",this._imageCache={},this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicImage"}destroy(){this.type=null,this._imageCache=null,super.destroy()}brush(t,e,i){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var n=this.refOriginalPosition,r=this.style||{};e&&(r=this.getHighlightStyle(r,this.highlightStyle||{}));var o=r.image,s=this;if("string"==typeof o){var a=o;this._imageCache[a]?o=this._imageCache[a]:((o=new Image).onload=function(){o.onload=null,clearTimeout(Hi._refreshTimeout),Hi._needsRefresh.push(s),Hi._refreshTimeout=setTimeout(function(){i&&i(Hi._needsRefresh),Hi._needsRefresh=[]},10)},o.src=a,this._imageCache[a]=o)}if(o){if("IMG"===o.nodeName.toUpperCase())if(window.ActiveXObject){if("complete"!==o.readyState)return}else if(!o.complete)return;var l=r.width||o.width,h=r.height||o.height,u=r.x+n[0],c=r.y+n[1];if(!o.width||!o.height)return;if(t.save(),this.doClip(t),this.setContext(t,r),this.setTransform(t),r.sWidth&&r.sHeight){let e=r.sx+n[0]||0,i=r.sy+n[1]||0;t.drawImage(o,e,i,r.sWidth,r.sHeight,u,c,l,h)}else if(r.sx&&r.sy){let e=r.sx+n[0],i=r.sy+n[1];var p=l-e,f=h-i;t.drawImage(o,e,i,p,f,u,c,l,h)}else t.drawImage(o,u,c,l,h);r.width||(r.width=l),r.height||(r.height=h),this.style.width||(this.style.width=l),this.style.height||(this.style.height=h),this.drawText(t,r,this.style),t.restore()}}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition;return{x:t.x+e[0],y:t.y+e[1],width:t.width,height:t.height}}clearCache(){this._imageCache={}}}Hi._needsRefresh=[],Hi._refreshTimeout=null;class qi extends Bi{constructor(t){super(t),this.type="smicrectangle",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicRectangle"}destroy(){this.type=null,super.destroy()}_buildRadiusPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i,n,r,o,s,a=this.refOriginalPosition,l=e.x+a[0],h=e.y+a[1],u=e.width,c=e.height,p=e.radius;"number"==typeof p?i=n=r=o=p:p instanceof Array?1===p.length?i=n=r=o=p[0]:2===p.length?(i=r=p[0],n=o=p[1]):3===p.length?(i=p[0],n=o=p[1],r=p[2]):(i=p[0],n=p[1],r=p[2],o=p[3]):i=n=r=o=0,i+n>u&&(i*=u/(s=i+n),n*=u/s),r+o>u&&(r*=u/(s=r+o),o*=u/s),n+r>c&&(n*=c/(s=n+r),r*=c/s),i+o>c&&(i*=c/(s=i+o),o*=c/s),t.moveTo(l+i,h),t.lineTo(l+u-n,h),0!==n&&t.quadraticCurveTo(l+u,h,l+u,h+n),t.lineTo(l+u,h+c-r),0!==r&&t.quadraticCurveTo(l+u,h+c,l+u-r,h+c),t.lineTo(l+o,h+c),0!==o&&t.quadraticCurveTo(l,h+c,l,h+c-o),t.lineTo(l,h+i),0!==i&&t.quadraticCurveTo(l,h,l+i,h)}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;e.radius?this._buildRadiusPath(t,e):(t.moveTo(e.x+i[0],e.y+i[1]),t.lineTo(e.x+i[0]+e.width,e.y+i[1]),t.lineTo(e.x+i[0]+e.width,e.y+i[1]+e.height),t.lineTo(e.x+i[0],e.y+i[1]+e.height),t.lineTo(e.x+i[0],e.y+i[1])),t.closePath()}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition;return t.__rect?t.__rect:(e="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(t.x+i[0]-e/2),y:Math.round(t.y+i[1]-e/2),width:t.width+e,height:t.height+e},t.__rect)}}class Zi extends Bi{constructor(t){super(t),this.type="smicsector",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicSector"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.x+i[0],r=e.y+i[1],o=e.r0||0,s=e.r,a=e.startAngle,l=e.endAngle,h=e.clockWise||!1;a=Di.Util_math.degreeToRadian(a),l=Di.Util_math.degreeToRadian(l),h||(a=-a,l=-l);var u=Di.Util_math.cos(a),c=Di.Util_math.sin(a);t.moveTo(u*o+n,c*o+r),t.lineTo(u*s+n,c*s+r),t.arc(n,r,s,a,l,!h),t.lineTo(Di.Util_math.cos(l)*o+n,Di.Util_math.sin(l)*o+r),0!==o&&t.arc(n,r,o,l,a,h),t.closePath()}getRect(t){if(t.__rect)return t.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition,i=Di.Util_vector.create(),n=Di.Util_vector.create(),r=Di.Util_vector.create(),o=Di.Util_vector.create(),s=t.x+e[0],a=t.y+e[1],l=t.r0||0,h=t.r,u=Di.Util_math.degreeToRadian(t.startAngle),c=Di.Util_math.degreeToRadian(t.endAngle),p=t.clockWise;return p||(u=-u,c=-c),l>1?Di.Util_computeBoundingBox.arc(s,a,l,u,c,!p,i,r):(i[0]=r[0]=s,i[1]=r[1]=a),Di.Util_computeBoundingBox.arc(s,a,h,u,c,!p,n,o),Di.Util_vector.min(i,i,n),Di.Util_vector.max(r,r,o),t.__rect={x:i[0],y:i[1],width:r[0]-i[0],height:r[1]-i[1]},t.__rect}}class Xi{constructor(t){this.shapeParameters=t,this.CLASS_NAME="Zondy.Feature.ShapeFactory"}destroy(){this.shapeParameters=null}createShape(t){if(t&&(this.shapeParameters=t),!this.shapeParameters)return null;var e=this.shapeParameters;if(e instanceof Ei){let t=new Object;t.x=e.x,t.y=e.y,t.r=e.r,t=gi(t,e.style,["x","y"]);let i=new Fi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","style","highlightStyle"]),i}if(e instanceof Ci){if(!e.pointList)return null;let t=new Object;t.pointList=e.pointList,t=gi(t,e.style,["pointList"]);let i=new Ui;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["pointList","style","highlightStyle"]),i}if(e instanceof Li){if(!e.pointList)return null;let t=new Object;t.pointList=e.pointList,t=gi(t,e.style,["pointList"]);let i=new Gi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["pointList","style","highlightStyle"]),i}if(e instanceof Si){if(!e.x&&!e.y&!e.width&!e.height)return null;let t=new Object;t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t=gi(t,e.style,["x","y","width","height"]);let i=new qi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","width","height","style","highlightStyle"]),i}if(e instanceof Pi){let t=new Object;t.x=e.x,t.y=e.y,t.r=e.r,t.startAngle=e.startAngle,t.endAngle=e.endAngle,e.r0&&(t.r0=e.r0),e.clockWise&&(t.clockWise=e.clockWise),t=gi(t,e.style,["x","y","r","startAngle","endAngle","r0","endAngle"]);let i=new Zi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","r","startAngle","endAngle","r0","endAngle","style","highlightStyle"]),i}if(e instanceof Ii){let t=new Object;t.x=e.x,t.y=e.y,t.text=e.text,t=gi(t,e.style,["x","y","text"]);let i=new Vi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","text","style","highlightStyle"]),i}if(e instanceof Mi){let t=new Object;t.x=e.x,t.y=e.y,e.image&&(t.image=e.image),e.width&&(t.width=e.width),e.height&&(t.height=e.height),e.sx&&(t.sx=e.sx),e.sy&&(t.sy=e.sy),e.sWidth&&(t.sWidth=e.sWidth),e.sHeight&&(t.sHeight=e.sHeight),t=gi(t,e.style,["x","y","image","width","height","sx","sy","sWidth","sHeight"]);let i=new Hi;return i.style=Xi.transformStyle(t),i.highlightStyle=Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","image","width","height","style","highlightStyle"]),i}if(e instanceof Ti){let t=new Object;t.x=e.x,t.r=e.r,t.y=e.y,t=gi(t,e.style,["x","y","r"]);let i=new ji;return i.style=new Xi.transformStyle(t),i.highlightStyle=new Xi.transformStyle(e.highlightStyle),gi(i,e,["x","y","r","style","highlightStyle","lineWidth","text","textPosition"]),i}return null}static transformStyle(t){var e={},i=["normal","normal","normal","12","arial,sans-serif"],n=[!0,!1];for(var r in t)switch(r){case"fill":n[0]=t[r];break;case"fillColor":e.color=t[r];break;case"stroke":n[1]=t[r];break;case"strokeWidth":e.lineWidth=t[r];break;case"strokeLinecap":e.lineCap=t[r];break;case"strokeLineJoin":e.lineJoin=t[r];break;case"strokeDashstyle":e.lineType=t[r];break;case"pointRadius":e.r=t[r];break;case"label":e.text=t[r];break;case"labelRect":e.labelRect=t[r];break;case"fontColor":e.textColor=t[r];break;case"fontStyle":i[0]=t[r];break;case"fontVariant":i[1]=t[r];break;case"fontWeight":i[2]=t[r];break;case"fontSize":var o="";t[r]&&t[r].toString().indexOf("px")<0&&(o="px"),i[3]=t[r]+o;break;case"fontFamily":i[4]=t[r];break;case"fontOpacity":e.opacity=t[r];break;case"labelPosition":e.textPosition=t[r];break;case"labelAlign":e.textAlign=t[r];break;case"labelBaseline":e.textBaseline=t[r];break;case"labelRotation":e.textRotation=t[r];break;default:e[r]=t[r]}return e.textFont=i.join(" "),!0===n[0]&&!1===n[1]?e.brushType="fill":!1===n[0]&&!0===n[1]?e.brushType="stroke":!0===n[0]&&!0===n[1]?e.brushType="both":e.brushType="fill",null==e.lineWidth&&(e.lineWidth=1),e}static Background(t,e,i){var n=i||{},r=new Si(e[0],e[3],Math.abs(e[2]-e[0]),Math.abs(e[3]-e[1]));return r.style={fillColor:"#f3f3f3"},n.backgroundStyle&&gi(r.style,n.backgroundStyle),n.backgroundRadius&&(r.style.radius=n.backgroundRadius),r.clickable=!1,r.hoverable=!1,t.createShape(r)}static GraphAxis(t,e,i,n){var r=e,o=i||{},s=[],a=[],l=!!o.useXReferenceLine&&o.useXReferenceLine,h=o.axisYTick&&!isNaN(o.axisYTick)?o.axisYTick:0,u=[],c=[];if(0===h){if(c.push([r[0],r[3]-5]),c.push([r[0],r[1]]),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){let t=parseInt(o.axis3DParameter),e=[r[0]-t,r[1]+t];o.axisUseArrow?(u.push([e[0]+1.5,e[1]-7.5]),u.push([e[0]-1,e[1]+1]),u.push([e[0]+7.5,e[1]-1.5]),c.push([e[0],e[1]])):c.push([e[0],e[1]]),c.push([r[0],r[1]])}c.push([r[2]+5,r[1]])}else{var p=Math.abs(r[1]-r[3])/h,f=r[3];c.push([r[0],f-5]);for(var d=0;d<h;d++){if(c.push([r[0],f]),c.push([r[0]-5,f]),c.push([r[0],f]),l){var g=new Ci([[r[0],f],[r[2],f]]);g.style={strokeColor:"#cfcfcf",strokeLinecap:"butt",strokeLineJoin:"round",strokeWidth:1},g.clickable=!1,g.hoverable=!1,o.xReferenceLineStyle&&gi(g.style,o.xReferenceLineStyle),s.push(t.createShape(g))}f+=p}if(c.push([r[0],r[1]]),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){let t=parseInt(o.axis3DParameter),e=[r[0]-t,r[1]+t];o.axisUseArrow?(u.push([e[0]+1.5,e[1]-7.5]),u.push([e[0]-1,e[1]+1]),u.push([e[0]+7.5,e[1]-1.5]),c.push([e[0],e[1]])):c.push([e[0],e[1]]),c.push([r[0],r[1]])}c.push([r[2]+5,r[1]])}if(o.axisUseArrow){var y=[[r[2]+5,r[1]+4],[r[2]+13,r[1]],[r[2]+5,r[1]-4]],m=[[r[0]-4,r[3]-5],[r[0],r[3]-13],[r[0]+4,r[3]-5]],_=new Li(y);_.style={fillColor:"#008acd"},gi(_.style,o.axisStyle),a.push(t.createShape(_));var v=new Li(m);if(v.style={fillColor:"#008acd"},gi(v.style,o.axisStyle),a.push(t.createShape(v)),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){var x=new Li(u);x.style={fillColor:"#008acd"},gi(x.style,o.axisStyle),a.push(t.createShape(x))}}var b=new Ci(c);b.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},o.axisStyle&&gi(b.style,o.axisStyle),b.clickable=!1,b.hoverable=!1;var w=[t.createShape(b)],E=[];if(o.axisYLabels&&o.axisYLabels.length&&o.axisYLabels.length>0){var C=o.axisYLabels;let e=C.length;var L=[0,0];if(o.axisYLabelsOffset&&o.axisYLabelsOffset.length&&(L=o.axisYLabelsOffset),1===e){let e=new Ii(r[0]-5+L[0],r[3]+L[1],C[0]);e.style={labelAlign:"right"},o.axisYLabelsStyle&&gi(e.style,o.axisYLabelsStyle),e.clickable=!1,e.hoverable=!1,E.push(t.createShape(e))}else for(var S=r[3],P=Math.abs(r[1]-r[3])/(e-1),I=0;I<e;I++){let e=new Ii(r[0]-5+L[0],S+L[1],C[I]);e.style={labelAlign:"right"},o.axisYLabelsStyle&&gi(e.style,o.axisYLabelsStyle),e.clickable=!1,e.hoverable=!1,E.push(t.createShape(e)),S+=P}}var M=[];if(o.axisXLabels&&o.axisXLabels.length&&o.axisXLabels.length>0){let e=o.axisXLabels,i=e.length,s=[0,0];if(o.axisXLabelsOffset&&o.axisXLabelsOffset.length&&(s=o.axisXLabelsOffset),n&&n.xPositions&&n.xPositions.length&&n.xPositions.length===i){let a=n.xPositions;for(let n=0;n<i;n++){let i=new Ii(a[n]+s[0],r[1]+s[1],e[n]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&gi(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i))}}else if(1===i){let i=new Ii(r[0]-5+s[0],r[1]+s[0],e[0]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&gi(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i))}else{let n=r[0],a=Math.abs(r[2]-r[0])/(i-1);for(let l=0;l<i;l++){let i=new Ii(n+s[0],r[1]+s[1],e[l]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&gi(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i)),n+=a}}}return s.concat(w).concat(E).concat(M).concat(a)}static ShapeStyleTool(t,e,i,n,r,o){var s=t||{};if(e&&gi(s,e),i&&i.length&&void 0!==r&&!isNaN(r)&&r>=0&&i[r]&&gi(s,i[r]),n&&n.length&&void 0!==o)for(var a=n,l=a.length,h=parseFloat(o),u=0;u<l;u++)if(a[u].start<=h&&h<a[u].end){gi(s,a[u].style);break}return s}}class Yi{constructor(t,e){t&&e&&e.map&&e.renderer&&(this.id=vi(),this.lonlat=null,this.location=[],this.data=t,this.shapes=[],this.layer=e,this.CLASS_NAME="Zondy.Feature.Theme")}destroy(){this.data=null,this.id=null,this.lonlat=null,this.location=null,this.shapes=null,this.layer=null}}class Wi extends Yi{constructor(t,e,i,n,r,o){if(super(t,e,i,n,r,o),this.shapeFactory=new Xi,this.shapeParameters=null,this.RelativeCoordinate=!1,this.setting=null,this.origonPoint=null,this.chartBox=null,this.chartBounds=null,this.width=null,this.height=null,this.XOffset=0,this.YOffset=0,this.DVBParameter=null,this.dataViewBox=null,this.DVBCodomain=null,this.DVBCenterPoint=null,this.DVBUnitValue=null,this.DVBOrigonPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.origonPointOffset=null,this.fields=i||[],this.dataValues=null,r)this.lonlat=r;else if(o&&o.calGravity){let t;const e=this.data.geometry;switch(e.type){case"Point":t=e.clone();break;case"MultiPoint":case"LineString":case"MultiLineString":case"MultiPolygon":t=e.extent.center;break;case"Polygon":t=e.centroid;break;case"Extent":case"Circle":t=e.center;break;default:t=e.extent.center}const i=t.coordinates;this.lonlat=[i[0],i[1]]}else{const t=feature.geometry.extent.center.coordinates;this.lonlat=[t[0],t[1]]}n&&n.width&&n.height&&n.codomain&&(this.setting=n),this.CLASS_NAME="Zondy.Feature.Theme.Graph"}destroy(){this.shapeFactory=null,this.shapeParameters=null,this.width=null,this.height=null,this.origonPoint=null,this.chartBox=null,this.dataViewBox=null,this.chartBounds=null,this.DVBParameter=null,this.DVBOrigonPoint=null,this.DVBCenterPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.DVBCodomain=null,this.DVBUnitValue=null,this.origonPointOffset=null,this.XOffset=null,this.YOffset=null,this.fields=null,this.dataValues=null,this.setting=null,super.destroy()}initBaseParameter(){if(!this.setting)return!1;var t=this.setting;if(!(t.width&&t.height&&t.codomain))return!1;var e=void 0===t.decimalNumber||isNaN(t.decimalNumber)?-1:t.decimalNumber,i=Yi.getDataValues(this.data,this.fields,e);this.dataValues=i||[],this.width=parseFloat(t.width),this.height=parseFloat(t.height),this.DVBCodomain=t.codomain,this.XOffset=t.XOffset?t.XOffset:0,this.YOffset=t.YOffset?t.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=t.dataViewBoxParameter?t.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var n=this.width,r=this.height,o=this.location;this.origonPoint=[o[0]-n/2,o[1]-r/2];var s=this.origonPoint;this.chartBox=[s[0],s[1]+r,s[0]+n,s[1]];var a=this.chartBox,l=this.DVBParameter;this.dataViewBox=[a[0]+l[0],a[1]-l[1],a[2]-l[2],a[3]+l[3]];var h=this.dataViewBox;return!(h[0]>=h[2]||h[1]<=h[3])&&(this.DVBOrigonPoint=[h[0],h[3]],this.DVBWidth=Math.abs(h[2]-h[0]),this.DVBHeight=Math.abs(h[1]-h[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-s[0],this.DVBOrigonPoint[1]-s[1]],!0)}resetLocation(t){t&&(this.lonlat=t);var e=this.getLocalXY(this.lonlat);e[0]+=this.XOffset,e[1]+=this.YOffset,this.location=e;var i=this.width,n=this.height,r=this.location;return this.chartBounds=[r[0]-i/2,r[1]-n/2,r[0]+i/2,r[1]+n/2],this.chartBounds.xmin=r[0]-i/2,this.chartBounds.ymin=r[1]-n/2,this.chartBounds.xmax=r[0]+i/2,this.chartBounds.ymax=r[1]+n/2,this.resetLinearGradient(),r}resetLinearGradient(){}shapesConvertToRelativeCoordinate(){for(var t=this.shapes,e=this.location,i=0,n=t.length;i<n;i++){t[i].refOriginalPosition=e;var r=t[i].style;for(var o in r)switch(o){case"pointList":for(var s=r[o],a=0,l=s.length;a<l;a++)s[a][0]-=e[0],s[a][1]-=e[1];break;case"x":r[o]-=e[0];break;case"y":r[o]-=e[1]}}this.RelativeCoordinate=!0}assembleShapes(){}getLocalXY(t){return this.layer.getLocalXY(t)}getCenterOfGravityPoint(t){var e=[],i=0,n=0,r=0;if(t.ftype===Zondy.Enum.FeatureType.Reg)for(var o=t.fGeom.RegGeom,s=0;s<o.length;s++){var a=o[s];if(null!=a&&null!=a.Rings)for(var l=a.Rings,h=0;h<l.length;h++){var u=l[h];if(null!=u&&null!=u.Arcs)for(var c=u.Arcs,p=0;p<c.length;p++){var f=c[p];if(null!=f&&null!=f.Dots)for(var d=f.Dots,g=0;g<d.length;g++)e.push(d[g])}}}for(h=1;h<=e.length;h++){var y=e[h%e.length].x,m=e[h%e.length].y,_=e[h-1].x,v=e[h-1].y,x=(y*v-m*_)/2;i+=x,n+=x*(y+_)/3,r+=x*(m+v)/3}return[n/=i,r/=i]}}Yi.getDataValues=function(t,e,i){if(!t.attributes)return!1;for(var n=[],r=t.attributes,o=0;o<e.length;o++)for(var s in r)if(s===e[o]&&null!==r[s]&&void 0!==r[s])try{!isNaN(i)&&i>=0?n.push(parseFloat(r[s].toString()).toFixed(i)):n.push(parseFloat(r[s].toString()))}catch(t){throw new Error("not a number")}return n.length===e.length&&n};class $i extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.setting=null,n&&n.codomain&&(this.setting=n,this.DVBCodomain=this.setting.codomain),this.CLASS_NAME="Zondy.Theme.RankSymbol"}destroy(){this.setting=null,super.destroy()}initBaseParameter(){if(!this.setting)return!1;var t=this.setting;t.XOffset&&(this.XOffset=t.XOffset),t.YOffset&&(this.YOffset=t.YOffset),this.XOffset=t.XOffset?t.XOffset:0,this.YOffset=t.YOffset?t.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=t.dataViewBoxParameter?t.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var e=this.width,i=this.height,n=this.location;this.origonPoint=[n[0]-e/2,n[1]-i/2];var r=this.origonPoint;this.chartBox=[r[0],r[1]+i,r[0]+e,r[1]];var o=this.chartBox,s=this.DVBParameter;this.dataViewBox=[o[0]+s[0],o[1]-s[1],o[2]-s[2],o[3]+s[3]];var a=this.dataViewBox;return!(a[0]>=a[2]||a[1]<=a[3])&&(this.DVBOrigonPoint=[a[0],a[3]],this.DVBWidth=Math.abs(a[2]-a[0]),this.DVBHeight=Math.abs(a[1]-a[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-r[0],this.DVBOrigonPoint[1]-r[1]],!0)}}class Ki extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Point"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,15,15,15]:t.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var e=this.dataViewBox,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.DVBUnitValue,r=this.dataValues,o=this.calculateXShapeInfo();if(o){var s,a,l=o.xPositions;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,t)),this.shapes=this.shapes.concat(Xi.GraphAxis(this.shapeFactory,e,t,o));for(var h=0,u=r.length;h<u;h++){if(r[h]<i[0]||r[h]>i[1])return null;s=l[h],a=e[1]-(r[h]-i[0])/n;var c=new Ei(s,a);c.style=Xi.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,h,r[h]),c.highlightStyle=Xi.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(c.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(c.clickable=t.pointClickAble),c.refDataID=this.data.id,c.dataInfo={field:this.fields[h],value:r[h]},this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=this.DVBWidth,s=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2===i.xShapeBlank.length){var a=o-((t=i.xShapeBlank)[0]+t[1]);if(a<=n)return null;s=a/(n-1)}else t=[s=o/(n+1),s,s];for(var l=0,h=0;h<n;h++)0===h?l=t[0]:l+=s,r.push(e[0]+l);return{xPositions:r,width:0}}}class Qi extends Yi{constructor(t,e,i,n,r){if(super(t,e),t.fGeom){this.dataBounds=t.bound,this.nodesClipPixel=2,this.isHoverAble=!0,this.isMultiHover=!0,this.isClickAble=!0,this.highlightStyle=null,this.shapeOptions={},this.style=i||{},this.CLASS_NAME="Zondy.Theme.ThemeVector",this.style=i||{},n&&gi(this,n,["shapeOptions","dataBounds"]),r&&gi(this.shapeOptions,r);t.fGeom;switch(this.lonlat=[(this.dataBounds.xmin+this.dataBounds.xmax)/2,(this.dataBounds.ymin+this.dataBounds.ymax)/2],this.location=this.getLocalXY(this.lonlat),t.ftype){case 0:break;case 1:this.pointsToTF(t.fGeom.PntGeom);break;case 2:this.linesToTF(t.fGeom.LinGeom);break;case 3:this.regsToTF(t.fGeom.RegGeom)}}}destroy(){this.style=null,this.dataBounds=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.highlightStyle=null,this.shapeOptions=null,super.destroy()}pointsToTF(t){if(!(null==t||t.length<=0)){t.components;for(var e=[],i=[],n=this.location,r=[],o=this.nodesClipPixel,s=0;s<t.length;s++){var a=t[s];if(i=[],e=this.getLocalXY([a.Dot.x,a.Dot.y]),i[0]=e[0]-n[0],i[1]=e[1]-n[1],r.length>0){var l=r[r.length-1];if(Math.abs(l[0]-i[0])<=o&&Math.abs(l[1]-i[1])<=o)continue}r.push(i);var h=new Object;h.r=6,(h=gi(h,this.style)).x=i[0],h.y=i[1];var u=new Fi({style:h,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(u.highlightStyle=this.highlightStyle),u.refOriginalPosition=n,u.refDataID=this.data.id,u.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&gi(u,this.shapeOptions),this.shapes.push(u)}}}linesToTF(t){if(!(null==t||t.length<=0))for(var e=0;e<t.length;e++)this.lineToTF(t[e])}lineToTF(t){var e=[];if(null!=t.Line&&null!=t.Line.Arcs&&t.Line.Arcs.length>0)for(var i=t.Line.Arcs,n=0;n<i.length;n++)for(var r=i[n].Dots,o=0;o<r.length;o++)e.push([r[o].x,r[o].y]);if(!(e.length<=0)){var s=[],a=[],l=this.location,h=[],u=this.nodesClipPixel;for(n=0;n<e.length;n++){var c=e[n];if(a=[],s=this.getLocalXY(c),a[0]=s[0]-l[0],a[1]=s[1]-l[1],h.length>0){var p=h[h.length-1];if(Math.abs(p[0]-a[0])<=u&&Math.abs(p[1]-a[1])<=u)continue}h.push(a)}if(h.length<2)return null;var f=new Object;(f=gi(f,this.style,["pointList"])).pointList=h;var d=new Ui({style:f,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(d.highlightStyle=this.highlightStyle),d.refOriginalPosition=this.location,d.refDataID=this.data.id,d.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&gi(d,this.shapeOptions),this.shapes.push(d)}}regsToTF(t){if(!(null==t||t.length<=0))for(var e=0;e<t.length;e++)this.regToTF(t[e])}regToTF(t){var e=t.Rings;if(!(null==e||e.length<=0)){for(var i=[],n=[],r=this.location,o=[],s=[],a=[],l=this.nodesClipPixel,h=0;h<e.length;h++){if(0===h){if(o=[],null!=e[h]&&null!=e[h].Arcs&&e[h].Arcs.length>0)for(var u=e[h].Arcs,c=0;c<u.length;c++)for(var p=u[c].Dots,f=0;f<p.length;f++){if(n=[],i=this.getLocalXY([p[f].x,p[f].y]),n[0]=i[0]-r[0],n[1]=i[1]-r[1],o.length>0){var d=o[o.length-1];if(Math.abs(d[0]-n[0])<=l&&Math.abs(d[1]-n[1])<=l)continue}o.push(n)}}else if(s=[],null!=e[h]&&null!=e[h].Arcs&&e[h].Arcs.length>0)for(u=e[h].Arcs,c=0;c<u.length;c++)for(p=u[c].Dots,f=0;f<p.length;f++){if(n=[],i=this.getLocalXY([p[f].x,p[f].y]),n[0]=i[0]-r[0],n[1]=i[1]-r[1],s.length>0){var g=s[s.length-1];if(Math.abs(g[0]-n[0])<=l&&Math.abs(g[1]-n[1])<=l)continue}s.push(n)}s.length<2||a.push(s)}if(!(o.length<2)){var y={};(y=gi(y,this.style,["pointList"])).pointList=o;var m=new Gi({style:y,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(m.highlightStyle=this.highlightStyle),m.refOriginalPosition=this.location,m.refDataID=this.data.id,m.isHoverByRefDataID=this.isMultiHover,a.length>0&&(m.holePolygonPointLists=a),this.shapeOptions&&gi(m,this.shapeOptions),this.shapes.push(m)}}}updateAndAddShapes(){var t=this.getLocalXY(this.lonlat);this.location=t;for(var e=this.layer.renderer,i=0,n=this.shapes.length;i<n;i++){var r=this.shapes[i];r.refOriginalPosition=t,e.addShape(r)}}getShapesCount(){return this.shapes.length}getLocalXY(t){return this.layer.getLocalXY(t)}}class Ji extends(mi(Oi,zi)){constructor(t){super(t),t=t||{},this.id=null,this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,this.ignore=!1,yi(this,t),this.id=this.id||vi(),this.CLASS_NAME="Zondy.LevelRenderer.Group"}destroy(){this.id=null,this.type=null,this.clipShape=null,this._children=null,this._storage=null,this.__dirty=null,this.ignore=null,super.destroy()}children(){return this._children.slice()}childAt(t){return this._children[t]}addChild(t){t!==this&&t.parent!==this&&(t.parent&&t.parent.removeChild(t),this._children.push(t),t.parent=this,this._storage&&this._storage!==t._storage&&(this._storage.addToMap(t),t instanceof Ji&&t.addChildrenToStorage(this._storage)))}removeChild(t){var e=_i(this._children,t);this._children.splice(e,1),t.parent=null,this._storage&&(this._storage.delFromMap(t.id),t instanceof Ji&&t.delChildrenFromStorage(this._storage))}eachChild(t,e){for(var i=!!e,n=0;n<this._children.length;n++){var r=this._children[n];i?t.call(e,r):t(r)}}traverse(t,e){for(var i=!!e,n=0;n<this._children.length;n++){var r=this._children[n];i?t.call(e,r):t(r),"group"===r.type&&r.traverse(t,e)}}addChildrenToStorage(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.addToMap(i),"group"===i.type&&i.addChildrenToStorage(t)}}delChildrenFromStorage(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.delFromMap(i.id),"group"===i.type&&i.delChildrenFromStorage(t)}}modSelf(){this.__dirty=!0}}class tn{constructor(){this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],this._shapeListOffset=0,this.CLASS_NAME="Zondy.LevelRenderer.Storage"}destroy(){this.dispose(),this._shapeList=null,this._shapeListOffset=null}iterShape(t,e){if(!e){e={hover:!1,normal:"down",update:!1}}if(e.hover)for(var i=0,n=this._hoverElements.length;i<n;i++){var r=this._hoverElements[i];if(r.updateTransform(),t(r))return this}switch(e.update&&this.updateShapeList(),e.normal){case"down":{let e=this._shapeList.length;for(;e--;)if(t(this._shapeList[e]))return this;break}default:for(let e=0,i=this._shapeList.length;e<i;e++)if(t(this._shapeList[e]))return this}return this}getHoverShapes(t){var e=[],i=this._hoverElements.length;for(let t=0;t<i;t++){e.push(this._hoverElements[t]);var n=this._hoverElements[t].hoverConnect;if(n)for(var r,o=0,s=(n=n instanceof Array?n:[n]).length;o<s;o++)(r=n[o].id?n[o]:this.get(n[o]))&&e.push(r)}if(e.sort(tn.shapeCompareFunc),t)for(let t=0,i=e.length;t<i;t++)e[t].updateTransform();return e}getShapeList(t){return t&&this.updateShapeList(),this._shapeList}updateShapeList(){this._shapeListOffset=0;var t=this._roots.length;for(let e=0;e<t;e++){let t=this._roots[e];this._updateAndAddShape(t)}this._shapeList.length=this._shapeListOffset;var e=this._shapeList.length;for(let t=0;t<e;t++)this._shapeList[t].__renderidx=t;this._shapeList.sort(tn.shapeCompareFunc)}_updateAndAddShape(t,e){if(!t.ignore)if(t.updateTransform(),"group"===t.type){t.clipShape&&(t.clipShape.parent=t,t.clipShape.updateTransform(),e?(e=e.slice()).push(t.clipShape):e=[t.clipShape]);for(var i=0;i<t._children.length;i++){var n=t._children[i];n.__dirty=t.__dirty||n.__dirty,this._updateAndAddShape(n,e)}t.__dirty=!1}else t.__clipShapes=e,this._shapeList[this._shapeListOffset++]=t}mod(t,e){var i=this._elements[t];if(i&&(i.modSelf(),e))if(e.parent||e._storage||e.__startClip){var n={};for(var r in e)"parent"!==r&&"_storage"!==r&&"__startClip"!==r&&e.hasOwnProperty(r)&&(n[r]=e[r]);xi(i,n,!0)}else xi(i,e,!0);return this}drift(t,e,i){var n=this._elements[t];return n&&(n.needTransform=!0,"horizontal"===n.draggable?i=0:"vertical"===n.draggable&&(e=0),(!n.ondrift||n.ondrift&&!n.ondrift(e,i))&&n.drift(e,i)),this}addHover(t){return t.updateNeedTransform(),this._hoverElements.push(t),this}delHover(){return this._hoverElements=[],this}hasHoverShape(){return this._hoverElements.length>0}addRoot(t){t instanceof Ji&&t.addChildrenToStorage(this),this.addToMap(t),this._roots.push(t)}delRoot(t){if(void 0===t){for(var e=0;e<this._roots.length;e++){var i=this._roots[e];i instanceof Ji&&i.delChildrenFromStorage(this)}return this._elements={},this._hoverElements=[],void(this._roots=[])}if(t instanceof Array){var n=t.length;for(let e=0;e<n;e++)this.delRoot(t[e])}else{var r;r="string"==typeof t?this._elements[t]:t;var o=_i(this._roots,r);o>=0&&(this.delFromMap(r.id),this._roots.splice(o,1),r instanceof Ji&&r.delChildrenFromStorage(this))}}addToMap(t){return t instanceof Ji&&(t._storage=this),t.modSelf(),this._elements[t.id]=t,this}get(t){return this._elements[t]}delFromMap(t){var e=this._elements[t];return e&&(delete this._elements[t],e instanceof Ji&&(e._storage=null)),this}dispose(){this._elements=null,this._roots=null,this._hoverElements=null}static shapeCompareFunc(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.__renderidx-e.__renderidx:t.z-e.z:t.zlevel-e.zlevel}}class en{}en.EVENT={RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300},en.catchBrushException=!1,en.debugMode=0;class nn{constructor(t,e){this.root=t,this.storage=e,this._domRoot=null,this._layers={},this._zlevelList=[],this._layerConfig={},this._bgDom=null,this.shapeToImage=null,nn.devicePixelRatio=Math.max(window.devicePixelRatio||1,1),this.CLASS_NAME="Zondy.LevelRenderer.Painter",this.root.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var i=document.createElement("div");this._domRoot=i,i.style.position="relative",i.style.overflow="hidden",i.style.width=this._width+"px",i.style.height=this._height+"px",this.root.appendChild(i),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=nn.createDom(vi(),"div",this),i.appendChild(this._bgDom),this._bgDom.onselectstart=o,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none",this._bgDom.style["-webkit-touch-callout"]="none";var n=new rn(vi(),this);this._layers.hover=n,i.appendChild(n.dom),n.initContext(),n.dom.onselectstart=o,n.dom.style["-webkit-user-select"]="none",n.dom.style["user-select"]="none",n.dom.style["-webkit-touch-callout"]="none";var r=this;function o(){return!1}this.updatePainter=function(t,e){r.refreshShapes(t,e)}}destroy(){this.dispose(),this._zlevelList=null,this._layerConfig=null,this._bgDom=null,this.shapeToImage=null}render(t){return this.refresh(t,!0),this}refresh(t,e){var i=this.storage.getShapeList(!0);return this._paintList(i,e),"function"==typeof t&&t(),this}_paintList(t,e){var i,n,r;for(var o in void 0===e&&(e=!1),this._updateLayerStatus(t),this._layers)"hover"!==o&&(this._layers[o].unusedCount++,this._layers[o].updateTransform());for(var s=[],a=0,l=t.length;a<l;a++){var h=t[a];if(n!==h.zlevel&&(i&&i.needTransform&&r.restore(),r=(i=this.getLayer(h.zlevel)).ctx,n=h.zlevel,i.unusedCount=0,(i.dirty||e)&&i.clear(),i.needTransform&&(r.save(),i.setTransform(r))),r&&h.__startClip){var u=h.__startClip;if(r.save(),u.needTransform){let t=u.transform;Di.Util_matrix.invert(s,t),r.transform(t[0],t[1],t[2],t[3],t[4],t[5])}if(r.beginPath(),u.buildPath(r,u.style),r.clip(),u.needTransform){let t=s;r.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}if((i&&i.dirty||e)&&!h.invisible&&(!h.onbrush||h.onbrush&&!h.onbrush(r,!1)))if(en.catchBrushException)try{h.brush(r,!1,this.updatePainter)}catch(t){}else h.brush(r,!1,this.updatePainter);r&&h.__stopClip&&r.restore(),h.__dirty=!1}r&&i&&i.needTransform&&r.restore();for(let t in this._layers)if("hover"!==t){var c=this._layers[t];c.dirty=!1,1===c.unusedCount&&c.clear()}}getLayer(t){var e=this._layers[t];if(!e){var i=this._zlevelList.length,n=null,r=-1;if(i>0&&t>this._zlevelList[0]){for(r=0;r<i-1&&!(this._zlevelList[r]<t&&this._zlevelList[r+1]>t);r++);n=this._layers[this._zlevelList[r]]}this._zlevelList.splice(r+1,0,t),e=new rn(vi(),this);var o=n?n.dom:this._bgDom;o.nextSibling?o.parentNode.insertBefore(e.dom,o.nextSibling):o.parentNode.appendChild(e.dom),e.initContext(),this._layers[t]=e,this._layerConfig[t]&&(new Ni).merge(e,this._layerConfig[t],!0),e.updateTransform()}return e}getLayers(){return this._layers}_updateLayerStatus(t){var e=this._layers,i={};for(let t in e)"hover"!==t&&(i[t]=e[t].elCount,e[t].elCount=0);for(let i=0;i<t.length;i++){var n=t[i],r=e[n.zlevel];if(r){if(r.elCount++,r.dirty)continue;r.dirty=n.__dirty}}for(let t in e)"hover"!==t&&i[t]!==e[t].elCount&&(e[t].dirty=!0)}refreshShapes(t,e){for(var i=0,n=t.length;i<n;i++){var r=t[i];this.storage.mod(r.id)}return this.refresh(e),this}clear(){for(var t in this._layers)"hover"!==t&&this._layers[t].clear();return this}modLayer(t,e){if(e){this._layerConfig[t]?(new Ni).merge(this._layerConfig[t],e,!0):this._layerConfig[t]=e;var i=this._layers[t];i&&(new Ni).merge(i,this._layerConfig[t],!0)}}delLayer(t){var e=this._layers[t];e&&(this.modLayer(t,{position:e.position,rotation:e.rotation,scale:e.scale}),e.dom.parentNode.removeChild(e.dom),delete this._layers[t],this._zlevelList.splice((new Ni).indexOf(this._zlevelList,t),1))}refreshHover(){this.clearHover();for(var t=this.storage.getHoverShapes(!0),e=0,i=t.length;e<i;e++)this._brushHover(t[e]);return this.storage.delHover(),this}clearHover(){var t=this._layers.hover;return t&&t.clear(),this}resize(){var t=this._domRoot;t.style.display="none";var e=this._getWidth(),i=this._getHeight();if(t.style.display="",this._width!==e||i!==this._height){for(var n in this._width=e,this._height=i,t.style.width=e+"px",t.style.height=i+"px",this._layers)this._layers[n].resize(e,i);this.refresh(null,!0)}return this}clearLayer(t){var e=this._layers[t];e&&e.clear()}dispose(){this.root.innerHTML="",this.root=null,this.storage=null,this._domRoot=null,this._layers=null}getDomHover(){return this._layers.hover.dom}toDataURL(t,e,i){var n=nn.createDom(vi(),"canvas",this);this._bgDom.appendChild(n);var r=n.getContext("2d");1!==nn.devicePixelRatio&&r.scale(nn.devicePixelRatio,nn.devicePixelRatio),r.fillStyle=e||"#fff",r.rect(0,0,this._width*nn.devicePixelRatio,this._height*nn.devicePixelRatio),r.fill();var o=this;this.storage.iterShape(function(t){if(!t.invisible&&(!t.onbrush||t.onbrush&&!t.onbrush(r,!1)))if(en.catchBrushException)try{t.brush(r,!1,o.updatePainter)}catch(t){}else t.brush(r,!1,o.updatePainter)},{normal:"up",update:!0});var s=n.toDataURL(t,i);return r=null,this._bgDom.removeChild(n),s}getWidth(){return this._width}getHeight(){return this._height}_getWidth(){var t=this.root,e=t.currentStyle||document.defaultView.getComputedStyle(t);return((t.clientWidth||parseInt(e.width,10))-parseInt(e.paddingLeft,10)-parseInt(e.paddingRight,10)).toFixed(0)-0}_getHeight(){var t=this.root,e=t.currentStyle||document.defaultView.getComputedStyle(t);return((t.clientHeight||parseInt(e.height,10))-parseInt(e.paddingTop,10)-parseInt(e.paddingBottom,10)).toFixed(0)-0}_brushHover(t){var e=this._layers.hover.ctx;if(!t.onbrush||t.onbrush&&!t.onbrush(e,!0)){var i=this.getLayer(t.zlevel);if(i.needTransform&&(e.save(),i.setTransform(e)),en.catchBrushException)try{t.brush(e,!0,this.updatePainter)}catch(t){}else t.brush(e,!0,this.updatePainter);i.needTransform&&e.restore()}}_shapeToImage(t,e,i,n,r){var o=document.createElement("canvas"),s=o.getContext("2d"),a=r||window.devicePixelRatio||1;o.style.width=i+"px",o.style.height=n+"px",o.setAttribute("width",i*a),o.setAttribute("height",n*a),s.clearRect(0,0,i*a,n*a);var l={position:e.position,rotation:e.rotation,scale:e.scale};e.position=[0,0,0],e.rotation=0,e.scale=[1,1],e&&e.brush(s,!1);var h=new Hi({id:t,style:{x:0,y:0,image:o}});return null!=l.position&&(h.position=e.position=l.position),null!=l.rotation&&(h.rotation=e.rotation=l.rotation),null!=l.scale&&(h.scale=e.scale=l.scale),h}_createShapeToImageProcessor(){var t=this;return function(e,i,n,r){return t._shapeToImage(e,i,n,r,nn.devicePixelRatio)}}updateHoverLayer(t){if(!(t instanceof Array))return this;this.clearHover(),this.storage.delHover();for(var e=0;e<t.length;e++)this.storage.addHover(t[e]),this._brushHover(t[e])}static createDom(t,e,i){var n=document.createElement(e),r=i._width,o=i._height;return n.style.position="absolute",n.style.left=0,n.style.top=0,n.style.width=r+"px",n.style.height=o+"px",n.setAttribute("width",r*nn.devicePixelRatio),n.setAttribute("height",o*nn.devicePixelRatio),n.setAttribute("id",t),n}}class rn extends zi{constructor(t,e){super(t,e),this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=e,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=1/0,this.minZoom=0,this.ctx=null,this.dom=nn.createDom(vi(),"canvas",e),this.dom.onselectstart=function(){return!1},this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none",this.CLASS_NAME="Zondy.LevelRenderer.Painter.Layer"}destroy(){this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=null,this.unusedCount=null,this.config=null,this.dirty=null,this.elCount=null,this.clearColor=null,this.motionBlur=null,this.lastFrameAlpha=null,this.zoomable=null,this.panable=null,this.maxZoom=null,this.minZoom=null,this.ctx=null,zi.destroy.apply(this,arguments)}initContext(){this.ctx=this.dom.getContext("2d"),1!==nn.devicePixelRatio&&this.ctx.scale(nn.devicePixelRatio,nn.devicePixelRatio)}createBackBuffer(){this.domBack=nn.createDom(vi(),"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d"),1!==nn.devicePixelRatio&&this.ctxBack.scale(nn.devicePixelRatio,nn.devicePixelRatio)}resize(t,e){this.dom.style.width=t+"px",this.dom.style.height=e+"px",this.dom.setAttribute("width",t*nn.devicePixelRatio),this.dom.setAttribute("height",e*nn.devicePixelRatio),1!==nn.devicePixelRatio&&this.ctx.scale(nn.devicePixelRatio,nn.devicePixelRatio),this.domBack&&(this.domBack.setAttribute("width",t*nn.devicePixelRatio),this.domBack.setAttribute("height",e*nn.devicePixelRatio),1!==nn.devicePixelRatio&&this.ctxBack.scale(nn.devicePixelRatio,nn.devicePixelRatio))}clear(){var t=this.dom,e=this.ctx,i=t.width,n=t.height,r=this.clearColor,o=this.motionBlur,s=this.lastFrameAlpha;if(o&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(t,0,0,i/nn.devicePixelRatio,n/nn.devicePixelRatio)),r?(e.save(),e.fillStyle=this.config.clearColor,e.fillRect(0,0,i/nn.devicePixelRatio,n/nn.devicePixelRatio),e.restore()):e.clearRect(0,0,i/nn.devicePixelRatio,n/nn.devicePixelRatio),o){var a=this.domBack;e.save(),e.globalAlpha=s,e.drawImage(a,0,0,i/nn.devicePixelRatio,n/nn.devicePixelRatio),e.restore()}}}class on extends Oi{constructor(t,e,i){super(t,e,i),this.root=t,this.storage=e,this.painter=i,this._lastX=0,this._lastY=0,this._mouseX=0,this._mouseY=0,this._findHover=null,this._domHover=null,this._findHover=function(t,e){return function(i,n,r){return t.call(e,i,n,r)}}(function(t,e,i){var n=this;if(n._draggingTarget&&n._draggingTarget.id===t.id||t.isSilent())return!1;var r=n._event;if(t.isCover(e,i)){if(t.hoverable)if(t.isHoverByRefDataID&&!0===t.isHoverByRefDataID){if(t.refDataID){var o=t.refDataID,s=null;t.refDataHoverGroup&&(s=t.refDataHoverGroup);for(var a=n.storage._shapeList,l=0,h=a.length;l<h;l++){var u=a[l];u.refDataID&&o===u.refDataID&&(s?u.refDataHoverGroup&&s===u.refDataHoverGroup&&n.storage.addHover(u):n.storage.addHover(u))}}}else n.storage.addHover(t);for(var c=t.parent;c;){if(c.clipShape&&!c.clipShape.isCover(n._mouseX,n._mouseY))return!1;c=c.parent}return n._lastHover!==t&&(n._processOutShape(r),n._processDragLeave(r),n._lastHover=t,n._processDragEnter(r)),n._processOverShape(r),n._processDragOver(r),n._hasfound=1,!0}return!1},this),this._domHover=i.getDomHover(),this.CLASS_NAME="Zondy.LevelRenderer.Handler";var n={resize:function(t){t=t||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(en.EVENT.RESIZE,t)},click:function(t){t=this._zrenderEventFixed(t);var e=this._lastHover;(e&&e.clickable||!e)&&this._clickThreshold<10&&this._dispatchAgency(e,en.EVENT.CLICK,t),this._mousemoveHandler(t)},dblclick:function(t){t=t||window.event,t=this._zrenderEventFixed(t);var e=this._lastHover;(e&&e.clickable||!e)&&this._clickThreshold<5&&this._dispatchAgency(e,en.EVENT.DBLCLICK,t),this._mousemoveHandler(t)},mousewheel:function(t){var e=((t=this._zrenderEventFixed(t)).wheelDelta||-t.detail)>0?1.1:1/1.1,i=this.painter.getLayers(),n=!1;for(var r in i)if("hover"!==r){var o=i[r],s=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var a=o.__zoom;a*=e,e=(a=Math.max(Math.min(o.maxZoom,a),o.minZoom))/o.__zoom,o.__zoom=a,s[0]-=(this._mouseX-s[0])*(e-1),s[1]-=(this._mouseY-s[1])*(e-1),o.scale[0]*=e,o.scale[1]*=e,o.dirty=!0,n=!0}}n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,en.EVENT.MOUSEWHEEL,t),this._mousemoveHandler(t)},mousemove:function(t){this._clickThreshold++,t=this._zrenderEventFixed(t),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=Di.Util_event.getX(t),this._mouseY=Di.Util_event.getY(t);var e=this._mouseX-this._lastX,i=this._mouseY-this._lastY;this._processDragStart(t),this._hasfound=0,this._event=t,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!==this._draggingTarget)&&(this._processOutShape(t),this._processDragLeave(t)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var n="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,e,i),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var r=this.painter.getLayers(),o=!1;for(var s in r)if("hover"!==s){var a=r[s];a.panable&&(n="move",a.position[0]+=e,a.position[1]+=i,o=!0,a.dirty=!0)}o&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?n="move":this._hasfound&&this._lastHover.clickable&&(n="pointer"),this.root.style.cursor=n,this._dispatchAgency(this._lastHover,en.EVENT.MOUSEMOVE,t),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(t){var e=(t=this._zrenderEventFixed(t)).toElement||t.relatedTarget;if(e!==this.root)for(;e&&9!==e.nodeType;){if(e===this.root)return void this._mousemoveHandler(t);e=e.parentNode}t.zrenderX=this._lastX,t.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(t),this._processDrop(t),this._processDragEnd(t),this.painter.refreshHover(),this.dispatch(en.EVENT.GLOBALOUT,t)},mousedown:function(t){if(this._clickThreshold=0,2===this._lastDownButton)return this._lastDownButton=t.button,void(this._mouseDownTarget=null);this._lastMouseDownMoment=new Date,t=this._zrenderEventFixed(t),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,en.EVENT.MOUSEDOWN,t),this._lastDownButton=t.button},mouseup:function(t){t=this._zrenderEventFixed(t),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,en.EVENT.MOUSEUP,t),this._processDrop(t),this._processDragEnd(t)},touchstart:function(t){t=this._zrenderEventFixed(t,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(t),this._mousedownHandler(t)},touchmove:function(t){t=this._zrenderEventFixed(t,!0),this._mousemoveHandler(t),this._isDragging&&Di.Util_event.stop(t)},touchend:function(t){t=this._zrenderEventFixed(t,!0),this._mouseupHandler(t);var e=new Date;e-this._lastTouchMoment<en.EVENT.touchClickDelay&&(this._mobildFindFixed(t),this._clickHandler(t),e-this._lastClickMoment<en.EVENT.touchClickDelay/2&&(this._dblclickHandler(t),this._lastHover&&this._lastHover.clickable&&Di.Util_event.stop(t)),this._lastClickMoment=e),this.painter.clearHover()}};function r(t,e){return function(i){return t.call(e,i)}}!function(t){var e=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],i=e.length;for(;i--;){var o=e[i];t["_"+o+"Handler"]=r(n[o],t)}}(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),Di.Util_env.os.tablet||Di.Util_env.os.phone?(t.addEventListener("touchstart",this._touchstartHandler),t.addEventListener("touchmove",this._touchmoveHandler),t.addEventListener("touchend",this._touchendHandler)):(t.addEventListener("click",this._clickHandler),t.addEventListener("dblclick",this._dblclickHandler),t.addEventListener("mousewheel",this._mousewheelHandler),t.addEventListener("mousemove",this._mousemoveHandler),t.addEventListener("mousedown",this._mousedownHandler),t.addEventListener("mouseup",this._mouseupHandler)),t.addEventListener("DOMMouseScroll",this._mousewheelHandler),t.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),t.attachEvent("onclick",this._clickHandler),t.ondblclick=this._dblclickHandler,t.attachEvent("onmousewheel",this._mousewheelHandler),t.attachEvent("onmousemove",this._mousemoveHandler),t.attachEvent("onmouseout",this._mouseoutHandler),t.attachEvent("onmousedown",this._mousedownHandler),t.attachEvent("onmouseup",this._mouseupHandler))}destroy(){this.dispose(),this._lastX=null,this._lastY=null,this._mouseX=null,this._mouseY=null,this._findHover=null,Oi.prototype.destroy.apply(this,arguments)}on(t,e){return this.bind(t,e),this}un(t,e){return this.unbind(t,e),this}trigger(t,e){var i=en.EVENT;switch(t){case i.RESIZE:case i.CLICK:case i.DBLCLICK:case i.MOUSEWHEEL:case i.MOUSEMOVE:case i.MOUSEDOWN:case i.MOUSEUP:case i.MOUSEOUT:this["_"+t+"Handler"](e)}}dispose(){var t=this.root;window.removeEventListener?(window.removeEventListener("resize",this._resizeHandler),Di.Util_env.os.tablet||Di.Util_env.os.phone?(t.removeEventListener("touchstart",this._touchstartHandler),t.removeEventListener("touchmove",this._touchmoveHandler),t.removeEventListener("touchend",this._touchendHandler)):(t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblclickHandler),t.removeEventListener("mousewheel",this._mousewheelHandler),t.removeEventListener("mousemove",this._mousemoveHandler),t.removeEventListener("mousedown",this._mousedownHandler),t.removeEventListener("mouseup",this._mouseupHandler)),t.removeEventListener("DOMMouseScroll",this._mousewheelHandler),t.removeEventListener("mouseout",this._mouseoutHandler)):(window.detachEvent("onresize",this._resizeHandler),t.detachEvent("onclick",this._clickHandler),t.detachEvent("dblclick",this._dblclickHandler),t.detachEvent("onmousewheel",this._mousewheelHandler),t.detachEvent("onmousemove",this._mousemoveHandler),t.detachEvent("onmouseout",this._mouseoutHandler),t.detachEvent("onmousedown",this._mousedownHandler),t.detachEvent("onmouseup",this._mouseupHandler)),this.root=null,this._domHover=null,this.storage=null,this.painter=null,this.un()}_processDragStart(t){var e=this._lastHover;if(this._isMouseDown&&e&&e.draggable&&!this._draggingTarget&&this._mouseDownTarget===e){if(e.dragEnableTime&&new Date-this._lastMouseDownMoment<e.dragEnableTime)return;var i=e;this._draggingTarget=i,this._isDragging=1,i.invisible=!0,this.storage.mod(i.id),this._dispatchAgency(i,en.EVENT.DRAGSTART,t),this.painter.refresh()}}_processDragEnter(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,en.EVENT.DRAGENTER,t,this._draggingTarget)}_processDragOver(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,en.EVENT.DRAGOVER,t,this._draggingTarget)}_processDragLeave(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,en.EVENT.DRAGLEAVE,t,this._draggingTarget)}_processDrop(t){this._draggingTarget&&(this._draggingTarget.invisible=!1,this.storage.mod(this._draggingTarget.id),this.painter.refresh(),this._dispatchAgency(this._lastHover,en.EVENT.DROP,t,this._draggingTarget))}_processDragEnd(t){this._draggingTarget&&(this._dispatchAgency(this._draggingTarget,en.EVENT.DRAGEND,t),this._lastHover=null),this._isDragging=0,this._draggingTarget=null}_processOverShape(t){this._dispatchAgency(this._lastHover,en.EVENT.MOUSEOVER,t)}_processOutShape(t){this._dispatchAgency(this._lastHover,en.EVENT.MOUSEOUT,t)}_dispatchAgency(t,e,i,n){var r="on"+e,o={type:e,event:i,target:t,cancelBubble:!1},s=t;for(n&&(o.dragged=n);s&&(s[r]&&(o.cancelBubble=s[r](o)),s.dispatch(e,o),s=s.parent,!o.cancelBubble););t?o.cancelBubble||this.dispatch(e,o):n||this.dispatch(e,{type:e,event:i})}_iterateAndFindHover(){for(var t,e=Di.Util_matrix.create(),i=this.storage.getShapeList(),n=[0,0],r=i.length-1;r>=0;r--){var o=i[r];if(void 0!==o.zlevel&&(t=this.painter.getLayer(o.zlevel,t),n[0]=this._mouseX,n[1]=this._mouseY,t.needTransform&&(Di.Util_matrix.invert(e,t.transform),Di.Util_vector.applyTransform(n,n,e))),this._findHover(o,n[0],n[1]))break}}_mobildFindFixed(t){var e=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=t.zrenderX,this._mouseY=t.zrenderY,this._event=t,this._iterateAndFindHover();for(var i=0;!this._lastHover&&i<e.length;i++){var n=e[i];n.x&&(this._mouseX+=n.x),n.y&&(this._mouseX+=n.y),this._iterateAndFindHover()}this._lastHover&&(t.zrenderX=this._mouseX,t.zrenderY=this._mouseY)}_zrenderEventFixed(t,e){if(t.zrenderFixed)return t;if(e){var i="touchend"!==t.type?t.targetTouches[0]:t.changedTouches[0];if(i){var n=this.root.getBoundingClientRect();t.zrenderX=i.clientX-n.left,t.zrenderY=i.clientY-n.top}}else{var r=(t=t||window.event).toElement||t.relatedTarget||t.srcElement||t.target;r&&r!==this._domHover&&(t.zrenderX=(void 0!==t.offsetX?t.offsetX:t.layerX)+r.offsetLeft,t.zrenderY=(void 0!==t.offsetY?t.offsetY:t.layerY)+r.offsetTop)}return t.zrenderFixed=1,t}getLastHoverOne(){return this._lastHover?this._lastHover:null}}class sn{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Animation.Easing"}destroy(){}Linear(t){return t}QuadraticIn(t){return t*t}QuadraticOut(t){return t*(2-t)}QuadraticInOut(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}CubicIn(t){return t*t*t}CubicOut(t){return--t*t*t+1}CubicInOut(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}QuarticIn(t){return t*t*t*t}QuarticOut(t){return 1- --t*t*t*t}QuarticInOut(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}QuinticIn(t){return t*t*t*t*t}QuinticOut(t){return--t*t*t*t*t+1}QuinticInOut(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}SinusoidalIn(t){return 1-Math.cos(t*Math.PI/2)}SinusoidalOut(t){return Math.sin(t*Math.PI/2)}SinusoidalInOut(t){return.5*(1-Math.cos(Math.PI*t))}ExponentialIn(t){return 0===t?0:Math.pow(1024,t-1)}ExponentialOut(t){return 1===t?1:1-Math.pow(2,-10*t)}ExponentialInOut(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}CircularIn(t){return 1-Math.sqrt(1-t*t)}CircularOut(t){return Math.sqrt(1- --t*t)}CircularInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}ElasticIn(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))}ElasticOut(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)}ElasticInOut(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)}BackIn(t){var e=1.70158;return t*t*((e+1)*t-e)}BackOut(t){var e=1.70158;return--t*t*((e+1)*t+e)+1}BackInOut(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}BounceIn(t){return 1-this.BounceOut(1-t)}BounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}BounceInOut(t){return t<.5?.5*this.BounceIn(2*t):.5*this.BounceOut(2*t-1)+.5}}class an{constructor(t){this._targetPool=t.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=t.life||1e3,this._delay=t.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+1e3*this._life,this.loop=void 0!==t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this.CLASS_NAME="Zondy.LevelRenderer.Animation.Clip"}destroy(){}step(t){var e=new sn,i=(t-this._startTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n="string"==typeof this.easing?e[this.easing]:this.easing,r="function"==typeof n?n(i):i;return this.fire("frame",r),1===i?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}}restart(){var t=((new Date).getTime()-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap}fire(t,e){for(var i=0,n=this._targetPool.length;i<n;i++)this["on"+t]&&this["on"+t](this._targetPool[i],e)}}class ln extends Oi{constructor(t){super(t),t=t||{},this.stage={},this.onframe=function(){},this._clips=[],this._running=!1,this._time=0,yi(this,t),this.CLASS_NAME="Zondy.LevelRenderer.Animation"}add(t){this._clips.push(t)}remove(t){var e=(new Ni).indexOf(this._clips,t);e>=0&&this._clips.splice(e,1)}_update(){var t=(new Date).getTime(),e=t-this._time,i=this._clips,n=i.length,r=[],o=[];for(let e=0;e<n;e++){var s=i[e],a=s.step(t);a&&(r.push(a),o.push(s))}this.stage.update&&this.stage.update();for(let t=0;t<n;)i[t]._needsRemove?(i[t]=i[n-1],i.pop(),n--):t++;n=r.length;for(let t=0;t<n;t++)o[t].fire(r[t]);this._time=t,this.onframe(e),this.dispatch("frame",e)}start(){var t=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){setTimeout(t,16)},e=this;this._running=!0,this._time=(new Date).getTime(),t(function i(){e._running&&(e._update(),t(i))})}stop(){this._running=!1}clear(){this._clips=[]}animate(t,e){var i=new hn(t,(e=e||{}).loop,e.getter,e.setter);return i.animation=this,i}static _interpolateNumber(t,e,i){return(e-t)*i+t}static _interpolateArray(t,e,i,n,r){var o=t.length;if(1===r)for(let r=0;r<o;r++)n[r]=ln._interpolateNumber(t[r],e[r],i);else{var s=t[0].length;for(let r=0;r<o;r++)for(let o=0;o<s;o++)n[r][o]=ln._interpolateNumber(t[r][o],e[r][o],i)}}static _isArrayLike(t){switch(typeof t){case"undefined":case"string":return!1}return void 0!==t.length}static _catmullRomInterpolateArray(t,e,i,n,r,o,s,a,l){var h=t.length;if(1===l)for(let l=0;l<h;l++)a[l]=ln._catmullRomInterpolate(t[l],e[l],i[l],n[l],r,o,s);else{var u=t[0].length;for(let l=0;l<h;l++)for(var c=0;c<u;c++)a[l][c]=ln._catmullRomInterpolate(t[l][c],e[l][c],i[l][c],n[l][c],r,o,s)}}static _catmullRomInterpolate(t,e,i,n,r,o,s){var a=.5*(i-t),l=.5*(n-e);return(2*(e-i)+a+l)*s+(-3*(e-i)-2*a-l)*o+a*r+e}static _cloneValue(t){var e=Array.prototype.slice;if(ln._isArrayLike(t)){var i=t.length;if(ln._isArrayLike(t[0])){for(var n=[],r=0;r<i;r++)n.push(e.call(t[r]));return n}return e.call(t)}return t}static rgba2String(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}}class hn{constructor(t,e,i,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||function(t,e){return t[e]},this._setter=n||function(t,e,i){t[e]=i},this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[],this.CLASS_NAME="Zondy.LevelRenderer.Animation.Animator"}when(t,e){for(var i in e)this._tracks[i]||(this._tracks[i]=[],0!==t&&this._tracks[i].push({time:0,value:ln._cloneValue(this._getter(this._target,i))})),this._tracks[i].push({time:parseInt(t,10),value:e[i]});return this}during(t){return this._onframeList.push(t),this}start(t){var e=this,i=this._setter,n=this._getter,r=e._onframeList.length,o="spline"===t,s=function(){if(e._clipCount--,0===e._clipCount){e._tracks={};for(var t=e._doneList.length,i=0;i<t;i++)e._doneList[i].call(e)}},a=function(a,l){var h=a.length;if(h){var u=a[0].value,c=ln._isArrayLike(u),p=!1,f=c&&ln._isArrayLike(u[0])?2:1;a.sort(function(t,e){return t.time-e.time});var d=a[h-1].time,g=[],y=[];for(let t=0;t<h;t++){g.push(a[t].time/d);var m=a[t].value;"string"==typeof m&&(0===(m=Di.Util_color.toArray(m)).length&&(m[0]=m[1]=m[2]=0,m[3]=1),p=!0),y.push(m)}var _,v,x,b,w,E,C,L=0,S=0;if(p)var P=[0,0,0,0];var I=new an({target:e._target,life:d,loop:e._loop,delay:e._delay,onframe:function(t,s){if(s<S){for(_=Math.min(L+1,h-1),v=_;v>=0&&!(g[v]<=s);v--);v=Math.min(v,h-2)}else{for(v=L;v<h&&!(g[v]>s);v++);v=Math.min(v-1,h-2)}L=v,S=s;var a=g[v+1]-g[v];if(0!==a){if(x=(s-g[v])/a,o)if(w=y[v],b=y[0===v?v:v-1],E=y[v>h-2?h-1:v+1],C=y[v>h-3?h-1:v+2],c)ln._catmullRomInterpolateArray(b,w,E,C,x,x*x,x*x*x,n(t,l),f);else{let e;e=p?ln.rgba2String(P):ln._catmullRomInterpolate(b,w,E,C,x,x*x,x*x*x),i(t,l,e)}else if(c)ln._interpolateArray(y[v],y[v+1],x,n(t,l),f);else{let e;p?(ln._interpolateArray(y[v],y[v+1],x,P,1),e=ln.rgba2String(P)):e=ln._interpolateNumber(y[v],y[v+1],x),i(t,l,e)}for(v=0;v<r;v++)e._onframeList[v](t,s)}},ondestroy:s});t&&"spline"!==t&&(I.easing=t),e._clipList.push(I),e._clipCount++,e.animation.add(I)}};for(var l in this._tracks)a(this._tracks[l],l);return this}stop(){for(var t=0;t<this._clipList.length;t++){var e=this._clipList[t];this.animation.remove(e)}this._clipList=[]}delay(t){return this._delay=t,this}done(t){return t&&this._doneList.push(t),this}}class un{constructor(t,e){this.id=t,this.storage=new tn,this.painter=new nn(e,this.storage),this.handler=new on(e,this.storage,this.painter),this.animatingElements=[],this.animation=new ln({stage:{update:un.getFrameCallback(this)}}),this._needsRefreshNextFrame=!1,this.animation.start(),this.CLASS_NAME="Zondy.LevelRenderer.Render"}destroy(){this.id=null,this.storage=null,this.painter=null,this.handler=null,this.animatingElements=null,this.animation=null,this._needsRefreshNextFrame=null}getId(){return this.id}addShape(t){return this.storage.addRoot(t),this}addGroup(t){return this.storage.addRoot(t),this}delShape(t){return this.storage.delRoot(t),this}delGroup(t){return this.storage.delRoot(t),this}modShape(t,e){return this.storage.mod(t,e),this}modGroup(t,e){return this.storage.mod(t,e),this}modLayer(t,e){return this.painter.modLayer(t,e),this}addHoverShape(t){return this.storage.addHover(t),this}render(t){return this.painter.render(t),this._needsRefreshNextFrame=!1,this}refresh(t){return this.painter.refresh(t),this._needsRefreshNextFrame=!1,this}refreshNextFrame(){return this._needsRefreshNextFrame=!0,this}refreshHover(t){return this.painter.refreshHover(t),this}refreshShapes(t,e){return this.painter.refreshShapes(t,e),this}resize(){return this.painter.resize(),this}animate(t,e,i){if("string"==typeof t&&(t=this.storage.get(t)),t){var n;if(e){for(var r=e.split("."),o=t,s=0,a=r.length;s<a;s++)o&&(o=o[r[s]]);o&&(n=o)}else n=t;if(!n)return;var l=this.animatingElements;return void 0===t.__aniCount&&(t.__aniCount=0),0===t.__aniCount&&l.push(t),t.__aniCount++,this.animation.animate(n,{loop:i}).done(function(){if(t.__aniCount--,0===t.__aniCount){var e=_i(l,t);l.splice(e,1)}})}}clearAnimation(){this.animation.clear()}getWidth(){return this.painter.getWidth()}getHeight(){return this.painter.getHeight()}toDataURL(t,e,i){return this.painter.toDataURL(t,e,i)}shapeToImage(t,e,i){var n=vi();return this.painter.shapeToImage(n,t,e,i)}on(t,e){return this.handler.on(t,e),this}un(t,e){return this.handler.un(t,e),this}trigger(t,e){return this.handler.trigger(t,e),this.handler.dispatch(t,e),this}clear(){return this.storage.delRoot(),this.painter.clear(),this}dispose(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=null,this.animatingElements=null,this.storage=null,this.painter=null,this.handler=null}updateHoverShapes(t){return this.painter.updateHoverLayer(t),this}getAllShapes(){return this.storage._shapeList}clearAll(){return this.clear(),this.painter.clearHover(),this}getHoverOne(){return this.handler.getLastHoverOne()}static getFrameCallback(t){return function(){var e=t.animatingElements;if(e instanceof Array){for(var i=0,n=e.length;i<n;i++)t.storage.mod(e[i].id);(e.length||t._needsRefreshNextFrame)&&t.refresh()}}}}class cn{constructor(){cn._instances={},cn.Tool={},this.CLASS_NAME="Zondy.LevelRenderer"}destroy(){this.dispose()}init(t){var e=new un(vi(),t);return cn._instances[e.id]=e,e}dispose(t){if(t)t.dispose(),this.delInstance(t.id);else{for(var e in cn._instances)cn._instances[e].dispose();cn._instances={}}return this}getInstance(t){return cn._instances[t]}delInstance(t){return delete cn._instances[t],this}}const pn={Bar:class extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Bar"}destroy(){super.destroy()}assembleShapes(){var t={showShadow:!0,shadowBlur:8,shadowColor:"rgba(100,100,100,0.8)",shadowOffsetX:2,shadowOffsetY:2},e=this.setting;if(e.barLinearGradient||(e.barLinearGradient=[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]),e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.dataViewBox,r=this.dataValues;if(!(r.length<1)){for(let t=0,e=r.length;t<e;t++)if(r[t]<i[0]||r[t]>i[1])return;var o=this.calculateXShapeInfo();if(o){var s=o.xPositions,a=o.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,e)),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(Xi.GraphAxis(this.shapeFactory,n,e,o)));for(var l=0;l<r.length;l++){var h=n[1]-(r[l]-i[0])/this.DVBUnitValue,u=[[s[l]-a/2,n[1]-1],[s[l]+a/2,n[1]-1],[s[l]+a/2,h],[s[l]-a/2,h]],c=new Li(u);if(void 0===e.showShadow||e.showShadow){if(e.barShadowStyle){var p=e.barShadowStyle;p.shadowBlur&&(t.shadowBlur=p.shadowBlur),p.shadowColor&&(t.shadowColor=p.shadowColor),p.shadowOffsetX&&(t.shadowOffsetX=p.shadowOffsetX),p.shadowOffsetY&&(t.shadowOffsetY=p.shadowOffsetY)}c.style={},gi(c.style,t)}c.refDataID=this.data.id,c.dataInfo={field:this.fields[l],value:r[l]},void 0!==e.barHoverAble&&(c.hoverable=e.barHoverAble),void 0!==e.barClickAble&&(c.clickable=e.barClickAble),this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=0,s=this.DVBWidth;if(i.xShapeBlank&&i.xShapeBlank.length&&3===i.xShapeBlank.length){var a=s-((t=i.xShapeBlank)[0]+t[2]+(n-1)*t[1]);if(a<=n)return null;o=a/n}else t=[o=s/(2*n+1),o,o];for(var l=0,h=0;h<n;h++)0===h?l=t[0]+o/2:l+=o+t[1],r.push(e[0]+l);return{xPositions:r,width:o}}resetLinearGradient(){if(this.RelativeCoordinate)for(var t=this.shapes.length,e=this.setting.barLinearGradient,i=-1,n=0;n<t;n++){var r=this.shapes[n];if("Zondy.LevelRenderer.Shape.SmicPolygon"===r.CLASS_NAME){var o=r.style,s=this.location[0]+o.pointList[0][0],a=this.location[0]+o.pointList[1][0];++i>=e.length&&(i%=e.length);var l=e[i][0],h=e[i][1],u=(new ki).getLinearGradient(s,0,a,0,[[0,l],[1,h]]);r.style.color=u}}}},Bar3D:class extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Bar3D"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,25,20,20]:t.dataViewBoxParameter=[5,5,5,5]),t.axisUseArrow=void 0===t.axisUseArrow||t.axisUseArrow,t.axisXLabelsOffset=void 0!==t.axisXLabelsOffset?t.axisXLabelsOffset:[-10,10],this.initBaseParameter()){var e=this.DVBCodomain;this.DVBUnitValue=(e[1]-e[0])/this.DVBHeight;var i=this.dataViewBox,n=this.dataValues;if(!(n.length<1)){for(let t=0,i=n.length;t<i;t++)if(n[t]<e[0]||n[t]>e[1])return;var r=this.calculateXShapeInfo();if(r){var o=r.xPositions,s=r.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,t)),(!t.axis3DParameter||isNaN(t.axis3DParameter)||t.axis3DParameter<15)&&(t.axis3DParameter=20),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(Xi.GraphAxis(this.shapeFactory,i,t,r)));var a=t.bar3DParameter&&!isNaN(t.bar3DParameter)?t.bar3DParameter:10;for(let r=0;r<n.length;r++){var l=i[1]-(n[r]-e[0])/this.DVBUnitValue,h=o[r]-s/2,u=o[r]+s/2,c=[[h,l],[u,l],[u-a,l+a],[h-a,l+a]],p=[[u,l],[u-a,l+a],[u-a,i[1]+a],[u,i[1]]],f=[[h-a,i[1]+a],[u-a,i[1]+a],[u-a,l+a],[h-a,l+a]];a<=0&&(f=[[h,i[1]],[u,i[1]],[u,l],[h,l]]);var d=new Li(c),g=new Li(p),y=new Li(f);t.barSideStyle=t.barSideStyle?t.barSideStyle:t.barFaceStyle,t.barSideStyleByFields=t.barSideStyleByFields?t.barSideStyleByFields:t.barFaceStyleByFields,t.barSideStyleByCodomain=t.barSideStyleByCodomain?t.barSideStyleByCodomain:t.barFaceStyleByCodomain,t.barTopStyle=t.barTopStyle?t.barTopStyle:t.barFaceStyle,t.barTopStyleByFields=t.barTopStyleByFields?t.barTopStyleByFields:t.barFaceStyleByFields,t.barTopStyleByCodomain=t.barTopStyleByCodomain?t.barTopStyleByCodomain:t.barFaceStyleByCodomain,y.style=Xi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barFaceStyle,t.barFaceStyleByFields,t.barFaceStyleByCodomain,r,n[r]),g.style=Xi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barSideStyle,t.barSideStyleByFields,t.barSideStyleByCodomain,r,n[r]),d.style=Xi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barTopStyle,t.barTopStyleByFields,t.barTopStyleByCodomain,r,n[r]),t.barSideHoverStyle=t.barSideHoverStyle?t.barSideHoverStyle:t.barFaceHoverStyle,t.barTopHoverStyle=t.barTopHoverStyle?t.barTopHoverStyle:t.barFaceHoverStyle,y.highlightStyle=Xi.ShapeStyleTool({stroke:!0},t.barFaceHoverStyle),g.highlightStyle=Xi.ShapeStyleTool({stroke:!0},t.barSideHoverStyle),d.highlightStyle=Xi.ShapeStyleTool({stroke:!0},t.barTopHoverStyle),d.refDataID=g.refDataID=y.refDataID=this.data.id,d.isHoverByRefDataID=g.isHoverByRefDataID=y.isHoverByRefDataID=!0,d.refDataHoverGroup=g.refDataHoverGroup=y.refDataHoverGroup=vi(),d.dataInfo=g.dataInfo=y.dataInfo={field:this.fields[r],value:n[r]},void 0!==t.barHoverAble&&(d.hoverable=g.hoverable=y.hoverable=t.barHoverAble),void 0!==t.barClickAble&&(d.clickable=g.clickable=y.clickable=t.barClickAble),this.shapes.push(this.shapeFactory.createShape(g)),this.shapes.push(this.shapeFactory.createShape(d)),this.shapes.push(this.shapeFactory.createShape(y))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=0,s=this.DVBWidth;if(i.xShapeBlank&&i.xShapeBlank.length&&3===i.xShapeBlank.length){var a=s-((t=i.xShapeBlank)[0]+t[2]+(n-1)*t[1]);if(a<=n)return null;o=a/n}else t=[o=s/(2*n+1),o,o];for(var l=0,h=0;h<n;h++)0===h?l=t[0]+o/2:l+=o+t[1],r.push(e[0]+l);return{xPositions:r,width:o}}},OverlayCircle:class extends $i{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Circle"}destroy(){super.destroy()}assembleShapes(){if(!this.setting)return!1;var t=this.setting;if(!t.codomain)return!1;var e=void 0===t.decimalNumber||isNaN(t.decimalNumber)?-1:t.decimalNumber,i=Yi.getDataValues(this.data,this.fields,e);this.dataValues=i||[];var n=this.dataValues;t.maxR||(t.maxR=100),t.minR||(t.minR=0);var r=this.DVBCodomain;r&&r[1]-r[0]>0?this.DVBUnitValue=t.maxR/(r[1]-r[0]):this.DVBUnitValue=t.maxR;var o=this.DVBUnitValue,s=n[0]*o+t.minR;if(this.width=2*s,this.height=2*s,this.initBaseParameter()&&(!r||!(n[0]<r[0]||n[0]>r[1]))){var a=this.DVBCenterPoint,l=new Ti(a[0],a[1],s);l.style=Xi.ShapeStyleTool(null,t.circleStyle,null,null,0),void 0!==t.fillColor?l.style.fillColor=t.fillColor:l.style.fillColor="#ff9277",l.highlightStyle=Xi.ShapeStyleTool(null,t.circleHoverStyle),void 0!==t.circleHoverAble&&(l.hoverable=t.circleHoverAble),void 0!==t.circleClickAble&&(l.clickable=t.circleClickAble),l.refDataID=this.data.id,l.dataInfo={field:this.fields[0],r:s,value:n[0]},this.shapes.push(this.shapeFactory.createShape(l)),this.shapesConvertToRelativeCoordinate()}}}};pn.Graph=Wi,pn.Line=class extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Line"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,15,15,15]:t.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var e=this.dataViewBox,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.DVBUnitValue,r=this.dataValues;if(!(r.length<1)){var o=this.calculateXShapeInfo();if(o){var s,a,l=o.xPositions;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,t)),this.shapes=this.shapes.concat(Xi.GraphAxis(this.shapeFactory,e,t,o));for(var h=[],u=[],c=0,p=r.length;c<p;c++){if(r[c]<i[0]||r[c]>i[1])return null;s=l[c],a=e[1]-(r[c]-i[0])/n;var f=new Ei(s,a);f.style=Xi.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,c,r[c]),f.highlightStyle=Xi.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(f.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(f.clickable=t.pointClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[c],value:r[c]},u.push(this.shapeFactory.createShape(f));var d=[s,a];h.push(d)}var g=new Ci(h);g.style=Xi.ShapeStyleTool({strokeColor:"#ee9900"},t.lineStyle),g.clickable=!1,g.hoverable=!1;var y=this.shapeFactory.createShape(g);this.shapes.push(y),this.shapes=this.shapes.concat(u),this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=this.DVBWidth,s=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2===i.xShapeBlank.length){var a=o-((t=i.xShapeBlank)[0]+t[1]);if(a<=n)return null;s=a/(n-1)}else t=[s=o/(n+1),s,s];for(var l=0,h=0;h<n;h++)0===h?l=t[0]:l+=s,r.push(e[0]+l);return{xPositions:r,width:0}}},pn.Pie=class extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Pie"}destroy(){super.destroy()}assembleShapes(){var t=this.setting,e=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}];if(this.initBaseParameter()){t.useBackground&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,t));var i=this.dataValues;if(!(i.length<1)){var n=this.DVBCodomain;for(let t=0;t<i.length;t++)if(i[t]<n[0]||i[t]>n[1])return;var r=0;for(let t=0;t<i.length;t++)r+=Math.abs(i[t]);this.DVBUnitValue=360/r;for(var o=this.DVBUnitValue,s=this.DVBCenterPoint,a=0,l=0,h=a,u=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,c=0;c<i.length;c++){var p=Math.abs(i[c]);(l=0===c?a+p*o:c===p.length-1?h:a+p*o)-a>=360&&(l=359.9999999);var f=new Pi(s[0],s[1],u,a,l);if(void 0===t.sectorStyleByFields){var d=c%e.length;f.style=Xi.ShapeStyleTool(null,t.sectorStyle,e,null,d)}else f.style=Xi.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,c,i[c]);f.highlightStyle=Xi.ShapeStyleTool(null,t.sectorHoverStyle),void 0!==t.sectorHoverAble&&(f.hoverable=t.sectorHoverAble),void 0!==t.sectorClickAble&&(f.clickable=t.sectorClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[c],value:i[c]},this.shapes.push(this.shapeFactory.createShape(f)),a=l}this.shapesConvertToRelativeCoordinate()}}}},pn.OverlayPoint=Ki,pn.RankSymbol=$i,pn.Ring=class extends Wi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Ring"}destroy(){super.destroy()}assembleShapes(){if(this.initBaseParameter()){var t=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}],e=this.setting;e.useBackground&&this.shapes.push(Xi.Background(this.shapeFactory,this.chartBox,e));var i=this.dataValues;if(!(i.length<1)){var n=this.DVBCodomain;for(let t=0;t<i.length;t++)if(i[t]<n[0]||i[t]>n[1])return;var r=0;for(let t=0;t<i.length;t++)r+=Math.abs(i[t]);this.DVBUnitValue=360/r;for(var o=this.DVBUnitValue,s=this.DVBCenterPoint,a=0,l=0,h=a,u=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,c=e.innerRingRadius>=0&&e.innerRingRadius<u,p=void 0!==e.innerRingRadius&&!isNaN(e.innerRingRadius)&&c?e.innerRingRadius:0,f=0;f<i.length;f++){var d=Math.abs(i[f]);l=0===f?a+d*o:f===d.length-1?h:a+d*o;var g=new Pi(s[0],s[1],u,a,l,p);if(void 0===e.sectorStyleByFields){var y=f%t.length;g.style=Xi.ShapeStyleTool(null,e.sectorStyle,t,null,y)}else g.style=Xi.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,f,i[f]);g.highlightStyle=Xi.ShapeStyleTool(null,e.sectorHoverStyle),void 0!==e.sectorHoverAble&&(g.hoverable=e.sectorHoverAble),void 0!==e.sectorClickAble&&(g.clickable=e.sectorClickAble),g.refDataID=this.data.id,g.dataInfo={field:this.fields[f],value:i[f]},this.shapes.push(this.shapeFactory.createShape(g)),a=l}this.shapesConvertToRelativeCoordinate()}}}},pn.ThemeVector=Qi,pn.Point=Ki;var fn=r.Layer.extend({options:{name:null,opacity:1,TFEvents:null},initialize(t,e){r.Util.setOptions(this,e),this.options.name=t,this.features=[],this.TFEvents=e&&e.TFEvents?e.TFEvents:[],this.levelRenderer=new cn,this.movingOffset=[0,0]},getEvents(){const t=this,e={zoomend:t._reset,moveend:t._reset,resize:t._resize};return this._map._zoomAnimated&&(e.zoomanim=t._zoomAnim),e},onRemove(t){r.DomUtil.remove(this.container),t.off("mousemove",this.mouseMoveHandler)},onAdd(t){const e=this;if(e.map=e._map=t,e._initContainer(),!e.levelRenderer)return void t.removeLayer(e);const i=t.getSize();e.container.style.width=`${i.x}px`,e.container.style.height=`${i.y}px`,e._updateOpacity(),e.renderer=e.levelRenderer.init(e.container),e.renderer.clear(),e.features&&e.features.length>0&&e._reset(),e.addTFEvents(),e.mouseMoveHandler=function(t){const i=t.layerPoint;e.currentMousePosition=r.point(i.x+e.movingOffset[0],i.y+e.movingOffset[1])},t.on("mousemove",e.mouseMoveHandler),e.update()},addFeatures(t){},redrawThematicFeatures(t){},destroyFeatures(t){if(void 0===t&&(t=this.features),t){this.removeFeatures(t);for(let e=t.length-1;e>=0;e--)t[e].destroy()}},removeFeatures(t){const e=this;if(!t||0===t.length)return;if(t===e.features)return e.removeAllFeatures();r.Util.isArray(t)||(t=[t]);const i=[];for(let o=t.length-1;o>=0;o--){var n=t[o];const s=r.Util.indexOf(e.features,n);-1!==s?e.features.splice(s,1):i.push(n)}const o=[];for(let t=0,i=e.features.length;t<i;t++)n=e.features[t],o.push(n);e.features=[],e.addFeatures(o),e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures());const s=0===i.length;e.fire("featuresremoved",{features:i,succeed:s})},removeAllFeatures(){const t=this;t.renderer&&t.renderer.clear(),t.features=[],t.fire("featuresremoved",{features:[],succeed:!0})},getFeatures(){const t=this,e=t.features.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=t.features[n];return i},getFeatureBy(t,e){return this.features.find(i=>{const n=i.attributes;if(i[t]===e||n[t]===e)return i})},getFeatureById(t){return this.getFeatureBy("id",t)},getFeaturesByAttribute(t,e){const i=this;let n;const r=[];for(const o in i.features)(n=i.features[o])&&n.attributes&&n.attributes[t]===e&&r.push(n);return r},update(t){const e=this._map.containerPointToLayerPoint([0,0]);r.DomUtil.setPosition(this.container,e);const i=this;i.renderer&&i.redrawThematicFeatures(t),i.currentMousePosition&&(i.currentMousePosition=r.point(i.currentMousePosition.x-i.movingOffset[0],i.currentMousePosition.y-i.movingOffset[1])),i.movingOffset=[0,0],i._zoom=i._map.getZoom(),i._center=i._map.getCenter()},setOpacity(t){const e=this;t!==e.options.opacity&&(isNaN(t)||(e.options.opacity=t,e._updateOpacity()))},redraw(){const t=this;return!!t.renderer&&(t._map?t.redrawThematicFeatures(t._map.getBounds()):t.redrawThematicFeatures(),!0)},on(t,e,i){return this.renderer?this.renderer.on(t,e):r.Layer.prototype.on.call(this,t,e),this},off(t,e,i){const n=this;return n.renderer?n.renderer.un(t,e):r.Layer.prototype.off.call(this,t,e),this},fire(t,e,i){return this.renderer&&this.renderer.trigger(t,e),r.Layer.prototype.fire.call(this,t,e,i),this},addTFEvents(){const t=this,e=t.TFEvents,i=e.length;for(let n=0;n<i;n++)t.renderer.on(e[n][0],e[n][1])},getLocalXY(t){if(!this._map)return t;let e=t;r.Util.isArray(t)?e=r.point(t[0],t[1]):t instanceof r.Point||(e=t instanceof Zondy.LonLat?r.point(t.lon,t.lat):r.point(t.x,t.y));const i=this._map.latLngToContainerPoint(this._map.options.crs.unproject(e));return[i.x,i.y]},_initContainer(){const t=this.getPane(),e=this._map.options.zoomAnimation&&r.Browser.any3d;let i=this.options.name||"themeLayer";i+=` leaflet-layer leaflet-zoom-${e?"animated":"hide"}`,this.container=r.DomUtil.create("div",i,t);const n=r.DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);this.container.style[n]="50% 50%",this.container.style.position="absolute",this.container.style.zIndex=200},_zoomAnim(t){const e=this._map.getZoomScale(t.zoom),i=this._map._getCenterOffset(t.center)._multiplyBy(-e).subtract(this._map._getMapPanePos());r.DomUtil.setTransform?r.DomUtil.setTransform(this.container,i,e):this.container.style[r.DomUtil.TRANSFORM]=`${r.DomUtil.getTranslateString(i)} scale(${e})`},_updateOpacity(){const t=this;!function(t,e,i,n,r,o,s,a){e&&(t.id=e),i&&(t.style.left=i.x+"px",t.style.top=i.y+"px"),n&&(t.style.width=n.w+"px",t.style.height=n.h+"px"),r&&(t.style.position=r),o&&(t.style.border=o),s&&(t.style.overflow=s),parseFloat(a)>=0&&parseFloat(a)<1?(t.style.filter="alpha(opacity="+100*a+")",t.style.opacity=a):1===parseFloat(a)&&(t.style.filter="",t.style.opacity="")}(t.container,null,null,null,null,null,null,t.options.opacity),null!==t._map&&t._map.fire("changelayer",{layer:t,property:"opacity"})},_reset(){const t=this,e=t._map.getBounds();t.update(e);const i=t._map.getSize(),n=this._map.containerPointToLayerPoint([0,0]);r.DomUtil.setPosition(this.container,n),parseFloat(t.container.width)!==parseFloat(i.x)&&(t.container.width=`${i.x}px`),parseFloat(t.container.height)!==parseFloat(i.y)&&(t.container.height=`${i.y}px`),t.redraw()},_resize(){const t=this._map.getSize();this.container.style.width=`${t.x}px`,this.container.style.height=`${t.y}px`,this.renderer.resize()}});var dn=fn.extend({options:{nodesClipPixel:2,isHoverAble:!1,isMultiHover:!1,isClickAble:!0,isAllowFeatureStyle:!1},initialize(t,e){fn.prototype.initialize.call(this,t,e),r.Util.setOptions(this,e);this.cache={},this.cacheFields=[],this.style={},this.highlightStyle={}},addFeatures(t){const e=this;if(e.fire("beforefeaturesadded",{features:t}),t instanceof n.FeatureSet){const i=null,n=t.AttStruct,r=t.SFEleArray;if(null!==r&&r.length>0)for(let t=0;t<r.length;t++){const o=r[t];if(null!==o.AttValue&&o.AttValue.length>0){const t={};for(let e=0;e<o.AttValue.length;e++)t[n.FldName[e]]=o.AttValue[e];t.FID=o.FID}o.attributes=i,e.features.push(o)}}e.isCustomSetMaxCacheCount||(e.maxCacheCount=5*e.features.length),e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures())},removeFeatures(t){this.clearCache(),fn.prototype.removeFeatures.call(this,arguments)},removeAllFeatures(){this.clearCache(),fn.prototype.removeAllFeatures.call(this,arguments)},redrawThematicFeatures(t){const e=this,i=e.renderer.getHoverOne();let o=null;if(i&&i.refDataID&&(o=i.refDataID),t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent(t.min.x,t.min.y,t.max.x,t.max.y)}e.renderer.clearAll();const s=e.features,a=e.cache,l=e.cacheFields,h=e._map.getZoom(),u=e.maxCacheCount;for(let i=0,n=s.length;i<n;i++){const n=s[i],r=n.bound;if(t&&!t.intersectsBounds(r))continue;const o=`${n.FID}_zoom_${h.toString()}`;if(a[o]){a[o].updateAndAddShapes();continue}const c=e.createThematicFeature(s[i]);if(!(c.getShapesCount()<1)&&(a[o]=c,l.push(o),l.length>u)){const t=l[0];l.splice(0,1),delete a[t]}}if(e.renderer.render(),o&&e.options.isHoverAble&&e.options.isMultiHover){const t=this.getShapesByFeatureID(o);this.renderer.updateHoverShapes(t)}},createThematicFeature(t){const e=this,i=e.getStyleByData(t),n={};n.nodesClipPixel=e.options.nodesClipPixel,n.isHoverAble=e.options.isHoverAble,n.isMultiHover=e.options.isMultiHover,n.isClickAble=e.options.isClickAble,n.highlightStyle=Xi.transformStyle(e.highlightStyle);const r=new Qi(t,e,Xi.transformStyle(i),n);for(let t=0;t<r.shapes.length;t++)e.renderer.addShape(r.shapes[t]);return r},getStyleByData(t){},redraw(){return this.clearCache(),fn.prototype.redraw.apply(this,arguments)},clearCache(){this.cache={},this.cacheFields=[]},clear(){this.renderer.clearAll(),this.renderer.refresh(),this.removeAllFeatures(),this.clearCache()},getCacheCount(){return this.cacheFields.length},setMaxCacheCount(t){isNaN(t)||(this.maxCacheCount=t,this.isCustomSetMaxCacheCount=!0)},getShapesByFeatureID(t){const e=[],i=this.renderer.getAllShapes();if(!t)return i;for(let n=0,r=i.length;n<r;n++){const r=i[n];r.refDataID&&t===r.refDataID&&e.push(r)}return e}});dn.extend({initialize(t,e){dn.prototype.initialize.call(this,t,e),this.style=[],this.themeField=null,this.styleGroups=[]},getStyleByData(t){const e=this,i=t;let n=gi({},e.style);const r=e.styleGroups;let o=!1,s=null;const a=e.styleGroups&&e.styleGroups.length>0;if(e.themeField&&a&&i.attributes){const t=e.themeField,n=i.attributes;for(const e in n)if(t===e){o=!0,s=n[e];break}}if(o&&a)for(let t=0,e=r.length;t<e;t++){if(t===e-1?s>=r[t].start&&s<=r[t].end:s>=r[t].start&&s<r[t].end){const e=r[t].style;n=gi(n,e)}}return n}});dn.extend({initialize(t,e){dn.prototype.initialize.call(this,t,e),this.style=[],this.themeField=null,this.styleGroups=[]},getStyleByData(t){const e=this,i=t;let n=gi({},e.style);const r=e.styleGroups;let o=!1,s=null;const a=e.styleGroups&&e.styleGroups.length>0;if(e.themeField&&a&&i.attributes){const t=e.themeField,n=i.attributes;for(const e in n)if(t===e){o=!0,s=n[e];break}}if(o&&a)for(let t=0,e=r.length;t<e;t++)if(!s&&!r[t].value||s&&r[t].value&&s.toString()===r[t].value.toString()){const e=r[t].style;n=gi(n,e);break}return n}});var gn=fn.extend({options:{isOverLay:!0},initialize(t,e,i){const n=[];n.push(t),n.push(i),fn.prototype.initialize.apply(this,n),this.chartsType=e,this.themeFields=i&&i.themeFields?i.themeFields:null,this.charts=i&&i.charts?i.charts:[],this.cache=i&&i.cache?i.cache:{},this.chartsSetting=i&&i.chartsSetting?i.chartsSetting:{}},setChartsType(t){this.chartsType=t,this.redraw()},addFeatures(t){const e=this;if(e.fire("beforefeaturesadded",{features:t}),t instanceof n.FeatureSet){const i=t.features;if(Array.isArray(i)&&i.length>0)for(let t=0;t<i.length;t++){const n=i[t];e.features.push(n)}}e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures())},redrawThematicFeatures(t){const e=this;e.renderer.clearAll();const i=e.features;if(t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent({xmin:t.min.x,ymin:t.min.y,xmax:t.max.x,ymax:t.max.y})}for(let n=0,r=i.length;n<r;n++){const r=i[n];if(!r||!r.geometry)continue;const o=r.geometry.extent;if(t&&!t.intersects(o))continue;const s=e.cache,a=r.id;if(!s[a]){s[a]=a;const t=e.createThematicFeature(r),i=e.overlayWeightField&&r.attributes[e.overlayWeightField]&&!isNaN(r.attributes[e.overlayWeightField]);t&&i&&(t.__overlayWeight=r.attributes[e.overlayWeightField]),t&&e.charts.push(t)}}e.drawCharts()},createThematicFeature(t){const e=this;let i;return pn[e.chartsType]&&e.themeFields&&e.chartsSetting&&(i=new pn[e.chartsType](t,e,e.themeFields,e.chartsSetting,null,e.options)),!!i&&(i.assembleShapes(),i)},drawCharts(){const t=this;t.renderer&&(t.overlayWeightField&&t._sortChart(),t.options&&!t.options.isOverLay?t._addOverlayShape():t._addNoOverlayShape(),t.renderer.render())},getShapesByFeatureID(t){const e=[],i=this.renderer.getAllShapes();if(!t)return i;for(let n=0,r=i.length;n<r;n++){const r=i[n];r.refDataID&&t===r.refDataID&&e.push(r)}return e},isQuadrilateralOverLap(t,e){const i=[{x:t.xmin,y:t.ymin},{x:t.xmax,y:t.ymin},{x:t.xmax,y:t.ymax},{x:t.xmin,y:t.ymax}],r=[{x:e.xmin,y:e.ymin},{x:e.xmax,y:e.ymin},{x:e.xmax,y:e.ymax},{x:e.xmin,y:e.ymax}],o=this,s=i.length,a=r.length;if(4!==s||4!==a)return null;let l=!1;for(let t=0;t<s;t++)if(o.isPointInPoly(i[t],r)){l=!0;break}for(let t=0;t<a;t++)if(o.isPointInPoly(r[t],i)){l=!0;break}for(let t=0;t<s-1&&!l;t++)for(let e=0;e<a-1;e++){const s=o.lineIntersection(i[t],i[t+1],r[e],r[e+1]);if(s&&s.type===n.GeometryType.point){l=!0;break}}return l},lineIntersection(t,e,i,r){let o,s,a=null;const l=(r.x-i.x)*(t.y-i.y)-(r.y-i.y)*(t.x-i.x),h=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),u=(r.y-i.y)*(e.x-t.x)-(r.x-i.x)*(e.y-t.y);if(0!==u)s=h/u,a=(o=l/u)>=0&&s<=1&&o<=1&&s>=0?new n.Point({coordinates:[t.x+o*(e.x-t.x),t.y+o*(e.y-t.y)]}):"No Intersection";else if(0===l&&0===h){const n=Math.max(t.y,e.y),o=Math.min(t.y,e.y),s=Math.max(t.x,e.x),l=Math.min(t.x,e.x);a=(i.y>=o&&i.y<=n||r.y>=o&&r.y<=n)&&i.x>=l&&i.x<=s||r.x>=l&&r.x<=s?"Coincident":"Parallel"}else a="Parallel";return a},isPointInPoly(t,e){for(var i=!1,n=-1,r=e.length,o=r-1;++n<r;o=n)(e[n].y<=t.y&&t.y<e[o].y||e[o].y<=t.y&&t.y<e[n].y)&&t.x<(e[o].x-e[n].x)*(t.y-e[n].y)/(e[o].y-e[n].y)+e[n].x&&(i=!i);return i},isChartInMap(t,e){const i=t;let n=!1;const r=[{x:e.xmin,y:e.ymin},{x:e.xmax,y:e.ymin},{x:e.xmax,y:e.ymax},{x:e.xmin,y:e.ymax}];for(let t=0,e=r.length;t<e;t++){const e=r[t];if(e.x>=i.xmin&&e.x<=i.xmax&&e.y>=i.ymin&&e.y<=i.ymax){n=!0;break}}return n},isSuitableChart:(t,e,i)=>Math.abs(i)<=1,clearCache(){this.cache={},this.charts=[]},removeFeatures(t){this.clearCache(),fn.prototype.removeFeatures.apply(this,arguments)},removeAllFeatures(){this.clearCache(),fn.prototype.removeAllFeatures.apply(this,arguments)},redraw(){return this.clearCache(),fn.prototype.redraw.apply(this,arguments)},clear(){const t=this;t.renderer&&(t.renderer.clearAll(),t.renderer.refresh()),t.removeAllFeatures(),t.clearCache()},getWeightFieldValue(t,e,i){if((void 0===i||isNaN(i))&&(i=0),!t.attributes)return i;let n=t.attributes[e];return(void 0===n||isNaN(n))&&(n=i),n},_sortChart(){this.charts&&this.charts.sort(function(t,e){return void 0===t.__overlayWeight&&void 0===e.__overlayWeight?0:void 0!==t.__overlayWeight&&void 0===e.__overlayWeight?-1:void 0===t.__overlayWeight&&void 0!==e.__overlayWeight?1:void 0!==t.__overlayWeight&&void 0!==e.__overlayWeight?parseFloat(t.__overlayWeight)<parseFloat(e.__overlayWeight)?1:-1:0})},_addOverlayShape(){const t=this,e=t.charts;for(let i=0,n=e.length;i<n;i++){const n=e[i],r=n.resetLocation(),o=n.shapes;for(let e=0,i=o.length;e<i;e++)o[e].refOriginalPosition=r,t.renderer.addShape(o[e])}},_addNoOverlayShape(){const t=this;let e=t._map.getBounds();const i=this._map.options.crs;e=r.bounds(i.project(e.getSouthWest()),i.project(e.getNorthEast()));const o=t.charts,s=[],a=t.getLocalXY(e.min),l=t.getLocalXY(e.max),h=new n.Extent({xmin:Math.min(parseFloat(a[0]),parseFloat(l[0])),xmax:Math.max(parseFloat(a[0]),parseFloat(l[0])),ymin:Math.min(parseFloat(a[1]),parseFloat(l[1])),ymax:Math.max(parseFloat(a[1]),parseFloat(l[1]))});for(let e=0,i=o.length;e<i;e++){const i=o[e],n=i.resetLocation(),r=i.chartBounds;if(h&&!t.isChartInMap(h,r))continue;const a=t._map.getZoom()-t.options.fitZoom;if(h&&t.options.fitZoom>-1&&!t.isSuitableChart(h,r,a))continue;let l=!1;for(let e=0;e<s.length;e++)if(t.isQuadrilateralOverLap(r,s[e])){l=!0;break}if(l)continue;s.push(r);const u=i.shapes;for(let e=0,i=u.length;e<i;e++)u[e].refOriginalPosition=n,t.renderer.addShape(u[e])}}});dn.extend({initialize(t,e){dn.prototype.initialize.call(this,t,e),this.style=[],this.keepStyle=!0},getColor(){const t="0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f".split(",");let e="#";for(let i=0;i<6;i++)e+=t[Math.floor(16*Math.random())];return e},getStyleByData(){const t=gi({},this.style);return t.fillColor=this.getColor(),t},onAdd(t){const e=this;if(e.map=e._map=t,e._initContainer(),!e.levelRenderer)return void t.removeLayer(e);const i=t.getSize();e.container.style.width=`${i.x}px`,e.container.style.height=`${i.y}px`,e._updateOpacity(),e.renderer=e.levelRenderer.init(e.container),e.renderer.clear(),e.features&&e.features.length>0&&e._reset(),e.addTFEvents(),e.mouseMoveHandler=function(t){const i=t.layerPoint;e.currentMousePosition=r.point(i.x+e.movingOffset[0],i.y+e.movingOffset[1])},t.on("mousemove",e.mouseMoveHandler),e.zoomstartHandler=function(t){e.keepStyle=!1},t.on("zoomstart ",e.zoomstartHandler),e.zoomendHandler=function(t){e.keepStyle=!0},t.on("zoomend",e.zoomendHandler),e.update()},redrawThematicFeatures(t){const e=this,i=e.renderer.getHoverOne();let o=null;i&&i.refDataID&&(o=i.refDataID);const s=e.features;if(t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent({xmin:t.min.x,ymin:t.min.y,xmax:t.max.x,ymax:t.max.y})}e.renderer.clearAll();const a=e.cache,l=e.cacheFields,h=e._map.getZoom(),u=e.maxCacheCount;for(let i=0,n=s.length;i<n;i++){const n=s[i];if(!n||!n.geometry)continue;const r=n.geometry.extent;if(t&&!t.intersects(r))continue;const o=`${n.FID}_zoom_${h.toString()}`;if(a[o]&&e.keepStyle){a[o].updateAndAddShapes();continue}const c=e.createThematicFeature(s[i]);if(!(c.getShapesCount()<1)&&(a[o]=c,l.push(o),l.length>u)){const t=l[0];l.splice(0,1),delete a[t]}}if(e.renderer.render(),o&&e.options.isHoverAble&&e.options.isMultiHover){const t=this.getShapesByFeatureID(o);this.renderer.updateHoverShapes(t)}},redraw(){return this.keepStyle||this.clearCache(),fn.prototype.redraw.apply(this,arguments)}});dn.extend({initialize(t,e){dn.prototype.initialize.call(this,t,e),this.style=[]},getColor(){const t="0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f".split(",");let e="#";for(let i=0;i<6;i++)e+=t[Math.floor(16*Math.random())];return e},getStyleByData(){const t=this,e=gi({},t.style);return null===e.fillColor&&(e.fillColor=t.getColor()),t.style=e,e},redraw(){return fn.prototype.redraw.apply(this,arguments)}});gn.extend({initialize(t,e,i){gn.prototype.initialize.apply(this,arguments),this.symbolType=e,this.symbolSetting={}},setSymbolType(t){this.symbolType=t,this.redraw()},createThematicFeature(t){const e=this;let i;return Yi[e.symbolType]&&e.themeField&&e.symbolSetting&&(i=new Yi[e.symbolType](t,e,[e.themeField],e.symbolSetting,null,e.options)),!!i&&(i.assembleShapes(),i)},_addNoOverlayShape(){const t=this;let e=t._map.getBounds();const i=this._map.options.crs;e=r.bounds(i.project(e.getSouthWest()),i.project(e.getNorthEast()));const o=t.getLocalXY(e.min),s=t.getLocalXY(e.max),a=new n.Extent({xmin:Math.min(parseFloat(o[0]),parseFloat(s[0])),xmax:Math.max(parseFloat(o[0]),parseFloat(s[0])),ymin:Math.min(parseFloat(o[1]),parseFloat(s[1])),ymax:Math.max(parseFloat(o[1]),parseFloat(s[1]))}),l=t.charts,h=[];for(let e=0,i=l.length;e<i;e++){const i=l[e],n=i.resetLocation(),r=i.chartBounds;if(a&&!t.isChartInMap(a,r))continue;const o=t._map.getZoom();t.options.fitZoom;if(a&&t.options.fitZoom>-1&&Math.abs(o-t.options.fitZoom)>1)continue;let s=!1;for(let e=0;e<h.length;e++)if(t.isQuadrilateralOverLap(r,h[e])){s=!0;break}if(s)continue;h.push(r);const u=i.shapes;for(let e=0,i=u.length;e<i;e++)u[e].refOriginalPosition=n,t.renderer.addShape(u[e])}}});var yn=class{constructor(t){t=t||{},this.fill=!0,this.fillColor="#000000",this.fillOpacity=1,this.stroke=!1,this.strokeColor="#000000",this.strokeOpacity=1,this.strokeWidth=1,this.strokeLinecap="butt",this.strokeLineJoin="miter",this.strokeDashstyle="solid",this.pointRadius=6,this.shadowBlur=0,this.shadowColor="#000000",this.shadowOffsetX=0,this.shadowOffsetY=0,this.label="",this.labelRect=!1,this.fontColor="",this.fontSize=12,this.fontStyle="normal",this.fontVariant="normal",this.fontWeight="normal",this.fontFamily="arial,sans-serif",this.labelPosition="top",this.labelAlign="center",this.labelBaseline="middle",this.labelXOffset=0,this.labelYOffset=0,yi(this,t)}};class mn{}mn.convertFeature=si;var _n=mn;i.d(e,"MapViewLeaflet",function(){return ci}),i.d(e,"MapView",function(){return ci}),i.d(e,"Popup",function(){return Zt}),i.d(e,"Screenshot",function(){return $t}),i.d(e,"DrawControl",function(){return fi}),i.d(e,"SketchEditorLeaflet",function(){return di}),i.d(e,"SketchEditor",function(){return di}),i.d(e,"GraphThemeLayer",function(){return gn}),i.d(e,"ThemeStyle",function(){return yn}),i.d(e,"getLayerView",function(){return hi}),i.d(e,"initializeOptions",function(){return at}),i.d(e,"initializeCRS",function(){return st}),i.d(e,"IGSTileLayer",function(){return yt}),i.d(e,"IGSMapImageLayer",function(){return bt}),i.d(e,"ArcGISMapImageLayer",function(){return Ct}),i.d(e,"WebMapServiceLayer",function(){return Lt}),i.d(e,"WebMapTileServiceLayer",function(){return St}),i.d(e,"WebTileLayer",function(){return Pt}),i.d(e,"ArcGISTileLayer",function(){return It}),i.d(e,"VectorTileLayer",function(){return Mt}),i.d(e,"FeatureLayer",function(){return Tt}),i.d(e,"MapVLayer",function(){return At}),i.d(e,"EchartsLayer",function(){return Bt}),i.d(e,"FeatureLayerUtil",function(){return _n}),i.d(e,"L",function(){return r}),window.L=r,n.zondy.leaflet={},n.zondy.leaflet.layer={},n.zondy.leaflet.layer.IGSTileLayer=yt,n.zondy.leaflet.layer.IGSMapImageLayer=bt,n.zondy.leaflet.layer.ArcGISMapImageLayer=Ct,n.zondy.leaflet.layer.WebMapServiceLayer=Lt,n.zondy.leaflet.layer.WebMapTileServiceLayer=St,n.zondy.leaflet.layer.WebTileLayer=Pt,n.zondy.leaflet.layer.ArcGISTileLayer=It,n.zondy.leaflet.layer.VectorTileLayer=Mt,n.zondy.leaflet.layer.FeatureLayer=Tt,n.zondy.leaflet.layer.MapVLayer=At,n.zondy.leaflet.layer.EchartsLayer=Bt,n.zondy.leaflet.GraphThemeLayer=gn,n.zondy.leaflet.tool={},n.zondy.leaflet.tool.sketch={},n.zondy.leaflet.tool.sketch.SketchEditor=di,n.zondy.leaflet.tool.Screenshot=$t,n.zondy.leaflet.widget={},n.zondy.leaflet.widget.DrawControl=fi,n.zondy.leaflet.widget.Popup=Zt,n.zondy.leaflet.util={},n.zondy.leaflet.util.getLayerView=hi,n.zondy.leaflet.util.initializeOptions=at,n.zondy.leaflet.util.initializeCRS=st,n.zondy.leaflet.util.FeatureLayerUtil=_n,n.zondy.leaflet.MapView=ci,n.zondy.leaflet.object={},n.zondy.leaflet.object.theme={},n.zondy.leaflet.object.theme.ThemeStyle=yn,n.zondy.leaflet.VERSION="17.2.2",n.Zondy.SketchEditorLeaflet=di,n.Zondy.PluginVersion=n.zondy.leaflet.VERSION,window.MapGISLeafletPlugin={MapViewLeaflet:ci,MapView:ci,Popup:Zt,Screenshot:$t,DrawControl:fi,SketchEditorLeaflet:di,SketchEditor:di,GraphThemeLayer:gn,ThemeStyle:yn,getLayerView:hi,initializeOptions:at,initializeCRS:st,IGSTileLayer:yt,IGSMapImageLayer:bt,ArcGISMapImageLayer:Ct,WebMapServiceLayer:Lt,WebMapTileServiceLayer:St,WebTileLayer:Pt,ArcGISTileLayer:It,VectorTileLayer:Mt,FeatureLayer:Tt,MapVLayer:At,EchartsLayer:Bt,FeatureLayerUtil:_n,L:r}}]);
|