@zhnyfe/zhnyfe_xnom 0.0.0-alpha.21 → 0.0.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk.common.js +1 -1
- package/dist/sdk.esm.js +2 -1
- package/package.json +1 -1
package/dist/sdk.common.js
CHANGED
|
@@ -33,7 +33,7 @@ object-assign
|
|
|
33
33
|
|
|
34
34
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
35
35
|
and limitations under the License.
|
|
36
|
-
***************************************************************************** */function t(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(e){return u([t,e])}}function u(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}var e=function(){function t(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return t}();function n(t,e){return t>e?1:t<e?-1:0}function r(t,n,r){for(var i=new e(null,null),o=i,s=i;;){var a=r(t,n.key);if(a<0){if(null===n.left)break;if(r(t,n.left.key)<0){var u=n.left;if(n.left=u.right,u.right=n,null===(n=u).left)break}s.left=n,s=n,n=n.left}else{if(!(a>0))break;if(null===n.right)break;if(r(t,n.right.key)>0&&(u=n.right,n.right=u.left,u.left=n,null===(n=u).right))break;o.right=n,o=n,n=n.right}}return o.right=n.left,s.left=n.right,n.left=i.right,n.right=i.left,n}function i(t,n,i,o){var s=new e(t,n);if(null===i)return s.left=s.right=null,s;var a=o(t,(i=r(t,i,o)).key);return a<0?(s.left=i.left,s.right=i,i.left=null):a>=0&&(s.right=i.right,s.left=i,i.right=null),s}function o(t,e,n){var i=null,o=null;if(e){var s=n((e=r(t,e,n)).key,t);0===s?(i=e.left,o=e.right):s<0?(o=e.right,e.right=null,i=e):(i=e.left,e.left=null,o=e)}return{left:i,right:o}}function s(t,e,n){return null===e?t:(null===t||((e=r(t.key,e,n)).left=t),e)}function a(t,e,n,r,i){if(t){r(e+(n?"└── ":"├── ")+i(t)+"\n");var o=e+(n?" ":"│ ");t.left&&a(t.left,o,!1,r,i),t.right&&a(t.right,o,!0,r,i)}}var u=function(){function u(t){void 0===t&&(t=n),this._root=null,this._size=0,this._comparator=t}return u.prototype.insert=function(t,e){return this._size++,this._root=i(t,e,this._root,this._comparator)},u.prototype.add=function(t,n){var i=new e(t,n);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,s=r(t,this._root,o),a=o(t,s.key);return 0===a?this._root=s:(a<0?(i.left=s.left,i.right=s,s.left=null):a>0&&(i.right=s.right,i.left=s,s.right=null),this._size++,this._root=i),this._root},u.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},u.prototype._remove=function(t,e,n){var i;return null===e?null:0===n(t,(e=r(t,e,n)).key)?(null===e.left?i=e.right:(i=r(t,e.left,n)).right=e.right,this._size--,i):e},u.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=r(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},u.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return e;e=r<0?e.left:e.right}return null},u.prototype.find=function(t){return this._root&&(this._root=r(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},u.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},u.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0;return this},u.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,s=this._root;0!==i.length||s;)if(s)i.push(s),s=s.left;else{if(o((s=i.pop()).key,e)>0)break;if(o(s.key,t)>=0&&n.call(r,s))return this;s=s.right}return this},u.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},u.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},u.prototype.min=function(){return this._root?this.minNode(this._root).key:null},u.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},u.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},u.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},u.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},u.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},u.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},u.prototype.clear=function(){return this._root=null,this._size=0,this},u.prototype.toList=function(){return h(this._root)},u.prototype.load=function(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=!1);var r=t.length,i=this._comparator;if(n&&d(t,e,0,r-1,i),null===this._root)this._root=l(t,e,0,r),this._size=r;else{var o=p(this.toList(),c(t,e),i);r=this._size+r,this._root=f({head:o},0,r)}return this},u.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(u.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),u.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return a(this._root,"",!0,function(t){return e.push(t)},t),e.join("")},u.prototype.update=function(t,e,n){var r=this._comparator,a=o(t,this._root,r),u=a.left,l=a.right;r(t,e)<0?l=i(e,n,l,r):u=i(e,n,u,r),this._root=s(u,l,r)},u.prototype.split=function(t){return o(t,this._root,this._comparator)},u.prototype[Symbol.iterator]=function(){var e,n,r;return t(this,function(t){switch(t.label){case 0:e=this._root,n=[],r=!1,t.label=1;case 1:return r?[3,6]:null===e?[3,2]:(n.push(e),e=e.left,[3,5]);case 2:return 0===n.length?[3,4]:[4,e=n.pop()];case 3:return t.sent(),e=e.right,[3,5];case 4:r=!0,t.label=5;case 5:return[3,1];case 6:return[2]}})},u}();function l(t,n,r,i){var o=i-r;if(o>0){var s=r+Math.floor(o/2),a=t[s],u=n[s],c=new e(a,u);return c.left=l(t,n,r,s),c.right=l(t,n,s+1,i),c}return null}function c(t,n){for(var r=new e(null,null),i=r,o=0;o<t.length;o++)i=i.next=new e(t[o],n[o]);return i.next=null,r.next}function h(t){for(var n=t,r=[],i=!1,o=new e(null,null),s=o;!i;)n?(r.push(n),n=n.left):r.length>0?n=(n=s=s.next=r.pop()).right:i=!0;return s.next=null,o.next}function f(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=f(t,e,i),s=t.head;return s.left=o,t.head=t.head.next,s.right=f(t,i+1,n),s}return null}function p(t,n,r){for(var i=new e(null,null),o=i,s=t,a=n;null!==s&&null!==a;)r(s.key,a.key)<0?(o.next=s,s=s.next):(o.next=a,a=a.next),o=o.next;return null!==s?o.next=s:null!==a&&(o.next=a),i.next}function d(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],s=n-1,a=r+1;;){do{s++}while(i(t[s],o)<0);do{a--}while(i(t[a],o)>0);if(s>=a)break;var u=t[s];t[s]=t[a],t[a]=u,u=e[s],e[s]=e[a],e[a]=u}d(t,e,n,a,i),d(t,e,a+1,r,i)}}const g=(t,e)=>t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y,y=(t,e)=>{if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;const n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,r=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:r,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}};let v=Number.EPSILON;void 0===v&&(v=Math.pow(2,-52));const _=v*v,m=(t,e)=>{if(-v<t&&t<v&&-v<e&&e<v)return 0;const n=t-e;return n*n<_*t*e?0:t<e?-1:1};class x{constructor(){this.reset()}reset(){this.xRounder=new b,this.yRounder=new b}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class b{constructor(){this.tree=new u,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(null!==n&&0===m(e.key,n.key))return this.tree.remove(t),n.key;const r=this.tree.next(e);return null!==r&&0===m(e.key,r.key)?(this.tree.remove(t),r.key):t}}const w=new x,E=11102230246251565e-32,C=134217729,S=(3+8*E)*E;function P(t,e,n,r,i){let o,s,a,u,l=e[0],c=r[0],h=0,f=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=r[++f]);let p=0;if(h<t&&f<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=e[++h]):(s=c+o,a=o-(s-c),c=r[++f]),o=s,0!==a&&(i[p++]=a);h<t&&f<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++f]),o=s,0!==a&&(i[p++]=a);for(;h<t;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h],o=s,0!==a&&(i[p++]=a);for(;f<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++f],o=s,0!==a&&(i[p++]=a);return 0===o&&0!==p||(i[p++]=o),p}function I(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function M(t){return new Float64Array(t)}const O=(3+16*E)*E,L=(2+12*E)*E,R=(9+64*E)*E*E,k=M(4),T=M(8),N=M(12),A=M(16),D=M(4);function F(t,e,n,r,i,o,s){let a,u,l,c,h,f,p,d,g,y,v,_,m,x,b,w,E,M;const O=t-i,F=n-i,j=e-o,G=r-o;x=O*G,f=C*O,p=f-(f-O),d=O-p,f=C*G,g=f-(f-G),y=G-g,b=d*y-(x-p*g-d*g-p*y),w=j*F,f=C*j,p=f-(f-j),d=j-p,f=C*F,g=f-(f-F),y=F-g,E=d*y-(w-p*g-d*g-p*y),v=b-E,h=b-v,k[0]=b-(v+h)+(h-E),_=x+v,h=_-x,m=x-(_-h)+(v-h),v=m-w,h=m-v,k[1]=m-(v+h)+(h-w),M=_+v,h=M-_,k[2]=_-(M-h)+(v-h),k[3]=M;let B=I(4,k),z=L*s;if(B>=z||-B>=z)return B;if(h=t-O,a=t-(O+h)+(h-i),h=n-F,l=n-(F+h)+(h-i),h=e-j,u=e-(j+h)+(h-o),h=r-G,c=r-(G+h)+(h-o),0===a&&0===u&&0===l&&0===c)return B;if(z=R*s+S*Math.abs(B),B+=O*c+G*a-(j*l+F*u),B>=z||-B>=z)return B;x=a*G,f=C*a,p=f-(f-a),d=a-p,f=C*G,g=f-(f-G),y=G-g,b=d*y-(x-p*g-d*g-p*y),w=u*F,f=C*u,p=f-(f-u),d=u-p,f=C*F,g=f-(f-F),y=F-g,E=d*y-(w-p*g-d*g-p*y),v=b-E,h=b-v,D[0]=b-(v+h)+(h-E),_=x+v,h=_-x,m=x-(_-h)+(v-h),v=m-w,h=m-v,D[1]=m-(v+h)+(h-w),M=_+v,h=M-_,D[2]=_-(M-h)+(v-h),D[3]=M;const V=P(4,k,4,D,T);x=O*c,f=C*O,p=f-(f-O),d=O-p,f=C*c,g=f-(f-c),y=c-g,b=d*y-(x-p*g-d*g-p*y),w=j*l,f=C*j,p=f-(f-j),d=j-p,f=C*l,g=f-(f-l),y=l-g,E=d*y-(w-p*g-d*g-p*y),v=b-E,h=b-v,D[0]=b-(v+h)+(h-E),_=x+v,h=_-x,m=x-(_-h)+(v-h),v=m-w,h=m-v,D[1]=m-(v+h)+(h-w),M=_+v,h=M-_,D[2]=_-(M-h)+(v-h),D[3]=M;const U=P(V,T,4,D,N);x=a*c,f=C*a,p=f-(f-a),d=a-p,f=C*c,g=f-(f-c),y=c-g,b=d*y-(x-p*g-d*g-p*y),w=u*l,f=C*u,p=f-(f-u),d=u-p,f=C*l,g=f-(f-l),y=l-g,E=d*y-(w-p*g-d*g-p*y),v=b-E,h=b-v,D[0]=b-(v+h)+(h-E),_=x+v,h=_-x,m=x-(_-h)+(v-h),v=m-w,h=m-v,D[1]=m-(v+h)+(h-w),M=_+v,h=M-_,D[2]=_-(M-h)+(v-h),D[3]=M;const W=P(U,N,4,D,A);return A[W-1]}function j(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),u=s-a,l=Math.abs(s+a);return Math.abs(u)>=O*l?u:-F(t,e,n,r,i,o,l)}const G=(t,e)=>t.x*e.y-t.y*e.x,B=(t,e)=>t.x*e.x+t.y*e.y,z=(t,e,n)=>{const r=j(t.x,t.y,e.x,e.y,n.x,n.y);return r>0?-1:r<0?1:0},V=t=>Math.sqrt(B(t,t)),U=(t,e,n)=>{const r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return G(i,r)/V(i)/V(r)},W=(t,e,n)=>{const r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return B(i,r)/V(i)/V(r)},X=(t,e,n)=>0===e.y?null:{x:t.x+e.x/e.y*(n-t.y),y:n},q=(t,e,n)=>0===e.x?null:{x:n,y:t.y+e.y/e.x*(n-t.x)},Y=(t,e,n,r)=>{if(0===e.x)return q(n,r,t.x);if(0===r.x)return q(t,e,n.x);if(0===e.y)return X(n,r,t.y);if(0===r.y)return X(t,e,n.y);const i=G(e,r);if(0==i)return null;const o={x:n.x-t.x,y:n.y-t.y},s=G(o,e)/i,a=G(o,r)/i;return{x:(t.x+a*e.x+(n.x+s*r.x))/2,y:(t.y+a*e.y+(n.y+s*r.y))/2}};class H{static compare(t,e){const n=H.comparePoints(t.point,e.point);return 0!==n?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:K.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){void 0===t.events?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let t=0,n=e.length;t<n;t++){const n=e[t];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(void 0===n.segment.consumedBy)for(let r=e+1;r<t;r++){const t=this.point.events[r];void 0===t.consumedBy&&n.otherSE.point.events===t.otherSE.point.events&&n.segment.consume(t.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}getLeftmostComparator(t){const e=new Map,n=n=>{const r=n.otherSE;e.set(n,{sine:U(this.point,t.point,r.point),cosine:W(this.point,t.point,r.point)})};return(t,r)=>{e.has(t)||n(t),e.has(r)||n(r);const{sine:i,cosine:o}=e.get(t),{sine:s,cosine:a}=e.get(r);return i>=0&&s>=0?o<a?1:o>a?-1:0:i<0&&s<0?o<a?-1:o>a?1:0:s<i?-1:s>i?1:0}}}let Z=0;class K{static compare(t,e){const n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(i<r)return-1;const s=t.leftSE.point.y,a=e.leftSE.point.y,u=t.rightSE.point.y,l=e.rightSE.point.y;if(n<r){if(a<s&&a<u)return 1;if(a>s&&a>u)return-1;const n=t.comparePoint(e.leftSE.point);if(n<0)return 1;if(n>0)return-1;const r=e.comparePoint(t.rightSE.point);return 0!==r?r:-1}if(n>r){if(s<a&&s<l)return-1;if(s>a&&s>l)return 1;const n=e.comparePoint(t.leftSE.point);if(0!==n)return n;const r=t.comparePoint(e.rightSE.point);return r<0?1:r>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(i<o){const n=e.comparePoint(t.rightSE.point);if(0!==n)return n}if(i>o){const n=t.comparePoint(e.rightSE.point);if(n<0)return 1;if(n>0)return-1}if(i!==o){const t=u-s,e=i-n,c=l-a,h=o-r;if(t>e&&c<h)return 1;if(t<e&&c>h)return-1}return i>o?1:i<o||u<l?-1:u>l?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,r){this.id=++Z,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=r}static fromRing(t,e,n){let r,i,o;const s=H.comparePoints(t,e);if(s<0)r=t,i=e,o=1;else{if(!(s>0))throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);r=e,i=t,o=-1}const a=new H(r,!0),u=new H(i,!1);return new K(a,u,[n],[o])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const i=(t.y-e.y)/r.y,o=e.x+i*r.x;if(t.x===o)return 0;const s=(t.x-e.x)/r.x,a=e.y+s*r.y;return t.y===a?0:t.y<a?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),r=y(e,n);if(null===r)return null;const i=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,u=g(e,s)&&0===this.comparePoint(s),l=g(n,i)&&0===t.comparePoint(i),c=g(e,a)&&0===this.comparePoint(a),h=g(n,o)&&0===t.comparePoint(o);if(l&&u)return h&&!c?o:!h&&c?a:null;if(l)return c&&i.x===a.x&&i.y===a.y?null:i;if(u)return h&&o.x===s.x&&o.y===s.y?null:s;if(h&&c)return null;if(h)return o;if(c)return a;const f=Y(i,this.vector(),s,t.vector());return null===f?null:g(r,f)?w.round(f.x,f.y):null}split(t){const e=[],n=void 0!==t.events,r=new H(t,!0),i=new H(t,!1),o=this.rightSE;this.replaceRightSE(i),e.push(i),e.push(r);const s=new K(r,o,this.rings.slice(),this.windings.slice());return H.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),H.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),i.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,e=this.windings.length;t<e;t++)this.windings[t]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=K.compare(e,n);if(0!==r){if(r>0){const t=e;e=n,n=t}if(e.prev===n){const t=e;e=n,n=t}for(let t=0,r=n.rings.length;t<r;t++){const r=n.rings[t],i=n.windings[t],o=e.rings.indexOf(r);-1===o?(e.rings.push(r),e.windings.push(i)):e.windings[o]+=i}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let t=0,r=this.rings.length;t<r;t++){const r=this.rings[t],i=this.windings[t],o=e.indexOf(r);-1===o?(e.push(r),n.push(i)):n[o]+=i}const i=[],o=[];for(let t=0,r=e.length;t<r;t++){if(0===n[t])continue;const r=e[t],s=r.poly;if(-1===o.indexOf(s))if(r.isExterior)i.push(s);else{-1===o.indexOf(s)&&o.push(s);const t=i.indexOf(r.poly);-1!==t&&i.splice(t,1)}}for(let t=0,e=i.length;t<e;t++){const e=i[t].multiPoly;-1===r.indexOf(e)&&r.push(e)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(at.type){case"union":{const n=0===t.length,r=0===e.length;this._isInResult=n!==r;break}case"intersection":{let n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===at.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2==1;break}case"difference":{const n=t=>1===t.length&&t[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${at.type}`)}return this._isInResult}}class J{constructor(t,e,n){if(!Array.isArray(t)||0===t.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],"number"!=typeof t[0][0]||"number"!=typeof t[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=w.round(t[0][0],t[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let i=r;for(let e=1,n=t.length;e<n;e++){if("number"!=typeof t[e][0]||"number"!=typeof t[e][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let n=w.round(t[e][0],t[e][1]);n.x===i.x&&n.y===i.y||(this.segments.push(K.fromRing(i,n,this)),n.x<this.bbox.ll.x&&(this.bbox.ll.x=n.x),n.y<this.bbox.ll.y&&(this.bbox.ll.y=n.y),n.x>this.bbox.ur.x&&(this.bbox.ur.x=n.x),n.y>this.bbox.ur.y&&(this.bbox.ur.y=n.y),i=n)}r.x===i.x&&r.y===i.y||this.segments.push(K.fromRing(i,r,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}class ${constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new J(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let e=1,n=t.length;e<n;e++){const n=new J(t[e],this,!1);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.interiorRings.push(n)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const n=this.interiorRings[e].getSweepEvents();for(let e=0,r=n.length;e<r;e++)t.push(n[e])}return t}}class Q{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof t[0][0][0]&&(t=[t])}catch(t){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let e=0,n=t.length;e<n;e++){const n=new $(t[e],this);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.polys.push(n)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const n=this.polys[e].getSweepEvents();for(let e=0,r=n.length;e<r;e++)t.push(n[e])}return t}}class tt{static factory(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];if(!r.isInResult()||r.ringOut)continue;let i=null,o=r.leftSE,s=r.rightSE;const a=[o],u=o.point,l=[];for(;i=o,o=s,a.push(o),o.point!==u;)for(;;){const t=o.getAvailableLinkedEvents();if(0===t.length){const t=a[0].point,e=a[a.length-1].point;throw new Error(`Unable to complete output ring starting at [${t.x}, ${t.y}]. Last matching segment found ends at [${e.x}, ${e.y}].`)}if(1===t.length){s=t[0].otherSE;break}let n=null;for(let t=0,e=l.length;t<e;t++)if(l[t].point===o.point){n=t;break}if(null!==n){const t=l.splice(n)[0],r=a.splice(t.index);r.unshift(r[0].otherSE),e.push(new tt(r.reverse()));continue}l.push({index:a.length,point:o.point});const r=o.getLeftmostComparator(i);s=t.sort(r)[0].otherSE;break}e.push(new tt(a))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let n=1,r=this.events.length-1;n<r;n++){const r=this.events[n].point,i=this.events[n+1].point;0!==z(r,t,i)&&(e.push(r),t=r)}if(1===e.length)return null;const n=e[0],r=e[1];0===z(n,t,r)&&e.shift(),e.push(e[0]);const i=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,a=[];for(let t=o;t!=s;t+=i)a.push([e[t].x,e[t].y]);return a}isExteriorRing(){if(void 0===this._isExteriorRing){const t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let e=1,n=this.events.length;e<n;e++){const n=this.events[e];H.compare(t,n)>0&&(t=n)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class et{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}class nt{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}_composePolys(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];if(!r.poly)if(r.isExteriorRing())e.push(new et(r));else{const t=r.enclosingRing();t.poly||e.push(new et(t)),t.poly.addInterior(r)}}return e}}class rt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K.compare;this.queue=t,this.tree=new u(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const r=t.isLeft?this.tree.add(e):this.tree.find(e);if(!r)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let i,o,s=r,a=r;for(;void 0===i;)s=this.tree.prev(s),null===s?i=null:void 0===s.key.consumedBy&&(i=s.key);for(;void 0===o;)a=this.tree.next(a),null===a?o=null:void 0===a.key.consumedBy&&(o=a.key);if(t.isLeft){let r=null;if(i){const t=i.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(r=t),!i.isAnEndpoint(t))){const e=this._splitSafely(i,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}let s=null;if(o){const t=o.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(s=t),!o.isAnEndpoint(t))){const e=this._splitSafely(o,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}if(null!==r||null!==s){let t=null;t=null===r?s:null===s||H.comparePoints(r,s)<=0?r:s,this.queue.remove(e.rightSE),n.push(e.rightSE);const i=e.split(t);for(let t=0,e=i.length;t<e;t++)n.push(i[t])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=i)}else{if(i&&o){const t=i.getIntersection(o);if(null!==t){if(!i.isAnEndpoint(t)){const e=this._splitSafely(i,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}if(!o.isAnEndpoint(t)){const e=this._splitSafely(o,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const r=t.split(e);return r.push(n),void 0===t.consumedBy&&this.tree.add(t),r}}const it="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,ot="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class st{run(t,e,n){at.type=t,w.reset();const r=[new Q(e,!0)];for(let t=0,e=n.length;t<e;t++)r.push(new Q(n[t],!1));if(at.numMultiPolys=r.length,"difference"===at.type){const t=r[0];let e=1;for(;e<r.length;)null!==y(r[e].bbox,t.bbox)?e++:r.splice(e,1)}if("intersection"===at.type)for(let t=0,e=r.length;t<e;t++){const e=r[t];for(let n=t+1,i=r.length;n<i;n++)if(null===y(e.bbox,r[n].bbox))return[]}const i=new u(H.compare);for(let t=0,e=r.length;t<e;t++){const e=r[t].getSweepEvents();for(let t=0,n=e.length;t<n;t++)if(i.insert(e[t]),i.size>it)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new rt(i);let s=i.size,a=i.pop();for(;a;){const t=a.key;if(i.size===s){const e=t.segment;throw new Error(`Unable to pop() ${t.isLeft?"left":"right"} SweepEvent [${t.point.x}, ${t.point.y}] from segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] from queue.`)}if(i.size>it)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>ot)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const e=o.process(t);for(let t=0,n=e.length;t<n;t++){const n=e[t];void 0===n.consumedBy&&i.insert(n)}s=i.size,a=i.pop()}w.reset();const l=tt.factory(o.segments);return new nt(l).getGeom()}}const at=new st,ut=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return at.run("union",t,n)},lt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return at.run("intersection",t,n)},ct=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return at.run("xor",t,n)},ht=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return at.run("difference",t,n)};return{union:ut,intersection:lt,xor:ct,difference:ht}}()},9399:function(t){t.exports=function(){"use strict";function t(t,n,i,o,s){e(t,n,i||0,o||t.length-1,s||r)}function e(t,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,u=r-i+1,l=Math.log(a),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(a-c)/a)*(u-a/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-u*c/a+h)),Math.min(o,Math.floor(r+(a-u)*c/a+h)),s)}var f=t[r],p=i,d=o;for(n(t,i,r),s(t[o],f)>0&&n(t,i,o);p<d;){for(n(t,p,d),p++,d--;s(t[p],f)<0;)p++;for(;s(t[d],f)>0;)d--}0===s(t[i],f)?n(t,i,d):n(t,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}return t}()},2519:function(t,e,n){"use strict";t.exports=i,t.exports.default=i;var r=n(9399);function i(t,e){if(!(this instanceof i))return new i(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function s(t,e){a(t,0,t.children.length,e,t)}function a(t,e,n,r,i){i||(i=v(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],u(i,t.leaf?r(o):o);return i}function u(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 l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(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 d(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function y(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _(t,e,n,i,o){for(var s,a=[e,n];a.length;)(n=a.pop())-(e=a.pop())<=i||(s=e+Math.ceil((n-e)/i/2)*i,r(t,s,e,n,o),a.push(e,s,s,n))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!y(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],y(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):g(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!y(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],y(t,s=e.leaf?n(o):o)){if(e.leaf||g(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=v([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,s,a=this.data,u=this.toBBox(t),l=[],c=[];a||l.length;){if(a||(a=l.pop(),r=l[l.length-1],n=c.pop(),s=!0),a.leaf&&-1!==(i=o(t,a.children,e)))return a.children.splice(i,1),l.push(a),this._condense(l),this;s||a.leaf||!g(a,u)?r?(n++,a=r.children[n],s=!1):a=null:(l.push(a),c.push(n),n=0,r=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:c,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,a=this._maxEntries;if(o<=a)return s(i=v(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,r-1))),(i=v([])).leaf=!1,i.height=r;var u,l,c,h,f=Math.ceil(o/a),p=f*Math.ceil(Math.sqrt(a));for(_(t,e,n,p,this.compareMinX),u=e;u<=n;u+=p)for(_(t,u,c=Math.min(u+p-1,n),f,this.compareMinY),l=u;l<=c;l+=f)h=Math.min(l+f-1,c),i.children.push(this._build(t,l,h,r-1));return s(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,u,l,c,f;r.push(e),!e.leaf&&r.length-1!==n;){for(c=f=1/0,i=0,o=e.children.length;i<o;i++)u=h(s=e.children[i]),(l=p(t,s)-u)<f?(f=l,c=u<c?u:c,a=s):l===f&&u<c&&(c=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),u(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),a=v(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,s(n,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,u,l,c,f;for(l=c=1/0,r=e;r<=n-e;r++)s=d(i=a(t,0,r,this.toBBox),o=a(t,r,n,this.toBBox)),u=h(i)+h(o),s<l?(l=s,f=r,c=u<c?u:c):s===l&&u<c&&(c=u,f=r);return f},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,s=this.toBBox,l=a(t,0,e,s),c=a(t,n-e,n,s),h=f(l)+f(c);for(i=e;i<n-e;i++)o=t.children[i],u(l,t.leaf?s(o):o),h+=f(l);for(i=n-e-1;i>=e;i--)o=t.children[i],u(c,t.leaf?s(o):o),h+=f(c);return h},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():s(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},7675:function(t,e,n){"use strict";var r=n(3206),i=n(9675),o=Object;t.exports=r(function(){if(null==this||this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)},1589:function(t,e,n){"use strict";var r=n(8452),i=n(487),o=n(7675),s=n(5330),a=n(3984),u=i(s());r(u,{getPolyfill:s,implementation:o,shim:a}),t.exports=u},5330:function(t,e,n){"use strict";var r=n(7675),i=n(8452).supportsDescriptors,o=Object.getOwnPropertyDescriptor;t.exports=function(){if(i&&"gim"===/a/gim.flags){var t=o(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(n,"sticky",{get:function(){e+="y"}}),t.get.call(n),"dy"===e)return t.get}}return r}},3984:function(t,e,n){"use strict";var r=n(8452).supportsDescriptors,i=n(5330),o=n(5795),s=Object.defineProperty,a=n(9383),u=n(3628),l=/a/;t.exports=function(){if(!r||!u)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=i(),e=u(l),n=o(e,"flags");return n&&n.get===t||s(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},6897:function(t,e,n){"use strict";var r=n(453),i=n(41),o=n(592)(),s=n(5795),a=n(9675),u=r("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||u(e)!==e)throw new a("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],r=!0,l=!0;if("length"in t&&s){var c=s(t,"length");c&&!c.configurable&&(r=!1),c&&!c.writable&&(l=!1)}return(r||l||!n)&&(o?i(t,"length",e,!0,!0):i(t,"length",e)),t}},3206:function(t,e,n){"use strict";var r=n(41),i=n(592)(),o=n(4462).functionsHaveConfigurableNames(),s=n(9675);t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!o||(i?r(t,"name",e,!0,!0):r(t,"name",e)),t}},6766:function(t){"use strict";t.exports={eudist:function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++){var s=(t[o]||0)-(e[o]||0);i+=s*s}return n?Math.sqrt(i):i},mandist:function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++)i+=Math.abs((t[o]||0)-(e[o]||0));return n?Math.sqrt(i):i},dist:function(t,e,n){var r=Math.abs(t-e);return n?r:r*r}}},5810:function(t,e,n){"use strict";var r=n(6766),i=r.eudist,o=r.dist;t.exports={kmrand:function(t,e){for(var n={},r=[],i=e<<2,o=t.length,s=t[0].length>0;r.length<e&&i-- >0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,r.push(a))}if(r.length<e)throw new Error("Error initializating clusters");return r},kmpp:function(t,e){var n=t[0].length?i:o,r=[],s=t.length,a=t[0].length>0,u=t[Math.floor(Math.random()*s)];a&&u.join("_");for(r.push(u);r.length<e;){for(var l=[],c=r.length,h=0,f=[],p=0;p<s;p++){for(var d=1/0,g=0;g<c;g++){var y=n(t[p],r[g]);y<=d&&(d=y)}l[p]=d}for(var v=0;v<s;v++)h+=l[v];for(var _=0;_<s;_++)f[_]={i:_,v:t[_],pr:l[_]/h,cs:0};f.sort(function(t,e){return t.pr-e.pr}),f[0].cs=f[0].pr;for(var m=1;m<s;m++)f[m].cs=f[m-1].cs+f[m].pr;for(var x=Math.random(),b=0;b<s-1&&f[b++].cs<x;);r.push(f[b-1].v)}return r}}},1756:function(t,e,n){"use strict";var r=n(6766),i=n(5810),o=r.eudist,s=(r.mandist,r.dist,i.kmrand),a=i.kmpp;function u(t,e,n){n=n||[];for(var r=0;r<t;r++)n[r]=e;return n}t.exports=function(t,e,n,r){var i=[],l=[],c=[],h=[],f=!1,p=r||1e4,d=t.length,g=t[0].length,y=g>0,v=[];if(n)i="kmrand"==n?s(t,e):"kmpp"==n?a(t,e):n;else for(var _={};i.length<e;){var m=Math.floor(Math.random()*d);_[m]||(_[m]=!0,i.push(t[m]))}do{u(e,0,v);for(var x=0;x<d;x++){for(var b=1/0,w=0,E=0;E<e;E++){(h=y?o(t[x],i[E]):Math.abs(t[x]-i[E]))<=b&&(b=h,w=E)}c[x]=w,v[w]++}for(var C=[],S=(l=[],0);S<e;S++)C[S]=y?u(g,0,C[S]):0,l[S]=i[S];if(y){for(var P=0;P<e;P++)i[P]=[];for(var I=0;I<d;I++)for(var M=C[c[I]],O=t[I],L=0;L<g;L++)M[L]+=O[L];f=!0;for(var R=0;R<e;R++){for(var k=i[R],T=C[R],N=l[R],A=v[R],D=0;D<g;D++)k[D]=T[D]/A||0;if(f)for(var F=0;F<g;F++)if(N[F]!=k[F]){f=!1;break}}}else{for(var j=0;j<d;j++){C[c[j]]+=t[j]}for(var G=0;G<e;G++)i[G]=C[G]/v[G]||0;f=!0;for(var B=0;B<e;B++)if(l[B]!=i[B]){f=!1;break}}f=f||--p<=0}while(!f);return{it:1e4-p,k:e,idxs:c,centroids:i}}},5072:function(t){"use strict";var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var o={},s=[],a=0;a<t.length;a++){var u=t[a],l=r.base?u[0]+r.base:u[0],c=o[l]||0,h="".concat(l," ").concat(c);o[l]=c+1;var f=n(h),p={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==f)e[f].references++,e[f].updater(p);else{var d=i(p,r);r.byIndex=a,e.splice(a,0,{identifier:h,updater:d,references:1})}s.push(h)}return s}function i(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,i){var o=r(t=t||[],i=i||{});return function(t){t=t||[];for(var s=0;s<o.length;s++){var a=n(o[s]);e[a].references--}for(var u=r(t,i),l=0;l<o.length;l++){var c=n(o[l]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}o=u}}},7659:function(t){"use strict";var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:function(t){"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},5056:function(t,e,n){"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7825:function(t){"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},1113:function(t){"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},39:function(t,e){!function(t){"use strict";function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function s(t){return null===t?Nt:t.color}function a(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function l(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function h(){this.root_=null,this.size_=0}function f(){}function p(){this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}function d(){}function g(t){this.message=t||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var v=function(){};v.prototype.interfaces_=function(){return[]},v.prototype.getClass=function(){return v},v.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var _=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),m=function(){},x={MAX_VALUE:{configurable:!0}};m.isNaN=function(t){return Number.isNaN(t)},m.doubleToLongBits=function(t){return t},m.longBitsToDouble=function(t){return t},m.isInfinite=function(t){return!Number.isFinite(t)},x.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(m,x);var b=function(){},w=function(){},E=function(){},C=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},S={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};C.prototype.setOrdinate=function(t,e){switch(t){case C.X:this.x=e;break;case C.Y:this.y=e;break;case C.Z:this.z=e;break;default:throw new _("Invalid ordinate index: "+t)}},C.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!v.equalsWithTolerance(this.x,e.x,n)&&!!v.equalsWithTolerance(this.y,e.y,n)}},C.prototype.getOrdinate=function(t){switch(t){case C.X:return this.x;case C.Y:return this.y;case C.Z:return this.z}throw new _("Invalid ordinate index: "+t)},C.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||m.isNaN(this.z))&&m.isNaN(t.z)},C.prototype.equals=function(t){return t instanceof C&&this.equals2D(t)},C.prototype.equalInZ=function(t,e){return v.equalsWithTolerance(this.z,t.z,e)},C.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},C.prototype.clone=function(){},C.prototype.copy=function(){return new C(this)},C.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},C.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},C.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},C.prototype.hashCode=function(){var t=17;return 37*(t=37*t+C.hashCode(this.x))+C.hashCode(this.y)},C.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},C.prototype.interfaces_=function(){return[b,w,e]},C.prototype.getClass=function(){return C},C.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=m.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},S.DimensionalComparator.get=function(){return P},S.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},S.NULL_ORDINATE.get=function(){return m.NaN},S.X.get=function(){return 0},S.Y.get=function(){return 1},S.Z.get=function(){return 2},Object.defineProperties(C,S);var P=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new _("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};P.prototype.compare=function(t,e){var n=t,r=e,i=P.compare(n.x,r.x);if(0!==i)return i;var o=P.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:P.compare(n.z,r.z)},P.prototype.interfaces_=function(){return[E]},P.prototype.getClass=function(){return P},P.compare=function(t,e){return t<e?-1:t>e?1:m.isNaN(t)?m.isNaN(e)?0:-1:m.isNaN(e)?1:0};var I=function(){};I.prototype.create=function(){},I.prototype.interfaces_=function(){return[]},I.prototype.getClass=function(){return I};var M=function(){},O={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M},M.toLocationSymbol=function(t){switch(t){case M.EXTERIOR:return"e";case M.BOUNDARY:return"b";case M.INTERIOR:return"i";case M.NONE:return"-"}throw new _("Unknown location value: "+t)},O.INTERIOR.get=function(){return 0},O.BOUNDARY.get=function(){return 1},O.EXTERIOR.get=function(){return 2},O.NONE.get=function(){return-1},Object.defineProperties(M,O);var L=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},R=function(){},k={LOG_10:{configurable:!0}};R.prototype.interfaces_=function(){return[]},R.prototype.getClass=function(){return R},R.log10=function(t){var e=Math.log(t);return m.isInfinite(e)||m.isNaN(e)?e:e/R.LOG_10},R.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},R.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return r<i?i:r>o?o:r}},R.wrap=function(t,e){return t<0?e- -t%e:t%e},R.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],o=arguments[3],s=arguments[0];return r>s&&(s=r),i>s&&(s=i),o>s&&(s=o),s}},R.average=function(t,e){return(t+e)/2},k.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(R,k);var T=function(t){this.str=t};T.prototype.append=function(t){this.str+=t},T.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},T.prototype.toString=function(t){return this.str};var N=function(t){this.value=t};N.prototype.intValue=function(){return this.value},N.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},N.isNaN=function(t){return Number.isNaN(t)};var A=function(){};A.isWhitespace=function(t){return t<=32&&t>=0||127===t},A.toUpperCase=function(t){return t.toUpperCase()};var D=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r,i)}},F={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};D.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},D.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=D.magnitude(n._hi),i=D.TEN.pow(r);(n=n.divide(i)).gt(D.TEN)?(n=n.divide(D.TEN),r+=1):n.lt(D.ONE)&&(n=n.multiply(D.TEN),r-=1);for(var o=r+1,s=new T,a=D.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var l=Math.trunc(n._hi);if(l<0)break;var c=!1,h=0;l>9?(c=!0,h="9"):h="0"+l,s.append(h),n=n.subtract(D.valueOf(l)).multiply(D.TEN),c&&n.selfAdd(D.TEN);var f=!0,p=D.magnitude(n._hi);if(p<0&&Math.abs(p)>=a-u&&(f=!1),!f)break}return e[0]=r,s.toString()},D.prototype.sqr=function(){return this.multiply(this)},D.prototype.doubleValue=function(){return this._hi+this._lo},D.prototype.subtract=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},D.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},D.prototype.isZero=function(){return 0===this._hi&&0===this._lo},D.prototype.selfSubtract=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},D.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},D.prototype.min=function(t){return this.le(t)?this:t},D.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,l=null,c=null,h=null;return u=this._hi/n,h=(i=(l=D.SPLIT*u)-(i=l-u))*(s=(h=D.SPLIT*n)-(s=h-n))-(c=u*n)+i*(a=n-s)+(o=u-i)*s+o*a,h=u+(l=(this._hi-c-h+this._lo-u*r)/n),this._hi=h,this._lo=u-h+l,this}},D.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},D.prototype.divide=function(){if(arguments[0]instanceof D){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,s=null,a=null,u=null;return n=(o=this._hi/t._hi)-(e=(s=D.SPLIT*o)-(e=s-o)),u=e*(r=(u=D.SPLIT*t._hi)-(r=u-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,s=(this._hi-a-u+this._lo-o*t._lo)/t._hi,new D(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var l=arguments[0];return m.isNaN(l)?D.createNaN():D.copy(this).selfDivide(l,0)}},D.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},D.prototype.pow=function(t){if(0===t)return D.valueOf(1);var e=new D(this),n=D.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},D.prototype.ceil=function(){if(this.isNaN())return D.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new D(t,e)},D.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},D.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},D.prototype.setValue=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},D.prototype.max=function(t){return this.ge(t)?this:t},D.prototype.sqrt=function(){if(this.isZero())return D.valueOf(0);if(this.isNegative())return D.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=D.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},D.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null;return o=(i=this._hi+e)-(s=i-this._hi),r=(a=(o=e-s+(this._hi-o))+this._lo)+(i-(n=i+a)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var u=arguments[0],l=arguments[1],c=null,h=null,f=null,p=null,d=null,g=null,y=null;p=this._hi+u,h=this._lo+l,d=p-(g=p-this._hi),f=h-(y=h-this._lo);var v=(c=p+(g=(d=u-g+(this._hi-d))+h))+(g=(f=l-y+(this._lo-f))+(g+(p-c))),_=g+(c-v);return this._hi=v,this._lo=_,this}},D.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,l=null;i=(u=D.SPLIT*this._hi)-this._hi,l=D.SPLIT*n,i=u-i,o=this._hi-i,s=l-n;var c=(u=this._hi*n)+(l=i*(s=l-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),h=l+(i=u-c);return this._hi=c,this._lo=h,this}},D.prototype.selfSqr=function(){return this.selfMultiply(this)},D.prototype.floor=function(){if(this.isNaN())return D.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new D(t,e)},D.prototype.negate=function(){return this.isNaN()?this:new D(-this._hi,-this._lo)},D.prototype.clone=function(){},D.prototype.multiply=function(){if(arguments[0]instanceof D){var t=arguments[0];return t.isNaN()?D.createNaN():D.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return m.isNaN(e)?D.createNaN():D.copy(this).selfMultiply(e,0)}},D.prototype.isNaN=function(){return m.isNaN(this._hi)},D.prototype.intValue=function(){return Math.trunc(this._hi)},D.prototype.toString=function(){var t=D.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},D.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+D.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+D.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},D.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,i=null,o=null,s=null,a=null;e=(i=1/this._hi)-(t=(o=D.SPLIT*i)-(t=o-i)),n=(a=D.SPLIT*this._hi)-this._hi;var u=i+(o=(1-(s=i*this._hi)-(a=t*(n=a-n)-s+t*(r=this._hi-n)+e*n+e*r)-i*this._lo)/this._hi);return new D(u,i-u+o)},D.prototype.toSciNotation=function(){if(this.isZero())return D.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=D.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},D.prototype.abs=function(){return this.isNaN()?D.NaN:this.isNegative()?this.negate():new D(this)},D.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},D.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},D.prototype.add=function(){if(arguments[0]instanceof D){var t=arguments[0];return D.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return D.copy(this).selfAdd(e)}},D.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof D){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},D.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},D.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},D.prototype.trunc=function(){return this.isNaN()?D.NaN:this.isPositive()?this.floor():this.ceil()},D.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},D.prototype.interfaces_=function(){return[e,b,w]},D.prototype.getClass=function(){return D},D.sqr=function(t){return D.valueOf(t).selfMultiply(t)},D.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return D.parse(t)}if("number"==typeof arguments[0])return new D(arguments[0])},D.sqrt=function(t){return D.valueOf(t).sqrt()},D.parse=function(t){for(var e=0,n=t.length;A.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new D,s=0,a=0,u=0;!(e>=n);){var l=t.charAt(e);if(e++,A.isDigit(l)){var c=l-"0";o.selfMultiply(D.TEN),o.selfAdd(c),s++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=N.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+l+"' at position "+e+" in string "+t)}a=s}}var f=o,p=s-a-u;if(0===p)f=o;else if(p>0){var d=D.TEN.pow(p);f=o.divide(d)}else if(p<0){var g=D.TEN.pow(-p);f=o.multiply(g)}return r?f.negate():f},D.createNaN=function(){return new D(m.NaN,m.NaN)},D.copy=function(t){return new D(t)},D.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},D.stringOfChar=function(t,e){for(var n=new T,r=0;r<e;r++)n.append(t);return n.toString()},F.PI.get=function(){return new D(3.141592653589793,12246467991473532e-32)},F.TWO_PI.get=function(){return new D(6.283185307179586,24492935982947064e-32)},F.PI_2.get=function(){return new D(1.5707963267948966,6123233995736766e-32)},F.E.get=function(){return new D(2.718281828459045,14456468917292502e-32)},F.NaN.get=function(){return new D(m.NaN,m.NaN)},F.EPS.get=function(){return 123259516440783e-46},F.SPLIT.get=function(){return 134217729},F.MAX_PRINT_DIGITS.get=function(){return 32},F.TEN.get=function(){return D.valueOf(10)},F.ONE.get=function(){return D.valueOf(1)},F.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},F.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(D,F);var j=function(){},G={DP_SAFE_EPSILON:{configurable:!0}};j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j},j.orientationIndex=function(t,e,n){var r=j.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=D.valueOf(e.x).selfAdd(-t.x),o=D.valueOf(e.y).selfAdd(-t.y),s=D.valueOf(n.x).selfAdd(-e.x),a=D.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},j.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},j.intersection=function(t,e,n,r){var i=D.valueOf(r.y).selfSubtract(n.y).selfMultiply(D.valueOf(e.x).selfSubtract(t.x)),o=D.valueOf(r.x).selfSubtract(n.x).selfMultiply(D.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=D.valueOf(r.x).selfSubtract(n.x).selfMultiply(D.valueOf(t.y).selfSubtract(n.y)),u=D.valueOf(r.y).selfSubtract(n.y).selfMultiply(D.valueOf(t.x).selfSubtract(n.x)),l=a.subtract(u).selfDivide(s).doubleValue(),c=D.valueOf(t.x).selfAdd(D.valueOf(e.x).selfSubtract(t.x).selfMultiply(l)).doubleValue(),h=D.valueOf(e.x).selfSubtract(t.x).selfMultiply(D.valueOf(t.y).selfSubtract(n.y)),f=D.valueOf(e.y).selfSubtract(t.y).selfMultiply(D.valueOf(t.x).selfSubtract(n.x)),p=h.subtract(f).selfDivide(s).doubleValue(),d=D.valueOf(n.y).selfAdd(D.valueOf(r.y).selfSubtract(n.y).selfMultiply(p)).doubleValue();return new C(c,d)},j.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=i-o;if(i>0){if(o<=0)return j.signum(s);r=i+o}else{if(!(i<0))return j.signum(s);if(o>=0)return j.signum(s);r=-i-o}var a=j.DP_SAFE_EPSILON*r;return s>=a||-s>=a?j.signum(s):2},j.signum=function(t){return t>0?1:t<0?-1:0},G.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(j,G);var B=function(){},z={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};z.X.get=function(){return 0},z.Y.get=function(){return 1},z.Z.get=function(){return 2},z.M.get=function(){return 3},B.prototype.setOrdinate=function(t,e,n){},B.prototype.size=function(){},B.prototype.getOrdinate=function(t,e){},B.prototype.getCoordinate=function(){},B.prototype.getCoordinateCopy=function(t){},B.prototype.getDimension=function(){},B.prototype.getX=function(t){},B.prototype.clone=function(){},B.prototype.expandEnvelope=function(t){},B.prototype.copy=function(){},B.prototype.getY=function(t){},B.prototype.toCoordinateArray=function(){},B.prototype.interfaces_=function(){return[w]},B.prototype.getClass=function(){return B},Object.defineProperties(B,z);var V=function(){},U=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(V),W=function(){};W.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},W.getProperty=function(t){return{"line.separator":"\n"}[t]};var X=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof C&&arguments[1]instanceof C){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(4===arguments.length){var h=arguments[0],f=arguments[1],p=arguments[2],d=arguments[3],g=h.y-f.y,y=f.x-h.x,v=h.x*f.y-f.x*h.y,_=p.y-d.y,m=d.x-p.x,x=p.x*d.y-d.x*p.y;this.x=y*x-m*v,this.y=_*v-g*x,this.w=g*m-_*y}};X.prototype.getY=function(){var t=this.y/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new U;return t},X.prototype.getX=function(){var t=this.x/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new U;return t},X.prototype.getCoordinate=function(){var t=new C;return t.x=this.getX(),t.y=this.getY(),t},X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X},X.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-r.y,u=r.x-n.x,l=n.x*r.y-r.x*n.y,c=i*u-a*o,h=(o*l-u*s)/c,f=(a*s-i*l)/c;if(m.isNaN(h)||m.isInfinite(h)||m.isNaN(f)||m.isInfinite(f))throw new U;return new C(h,f)};var q=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof C){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},Y={serialVersionUID:{configurable:!0}};q.prototype.getArea=function(){return this.getWidth()*this.getHeight()},q.prototype.equals=function(t){if(!(t instanceof q))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},q.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new q;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new q(e,r,n,i)},q.prototype.isNull=function(){return this._maxx<this._minx},q.prototype.getMaxX=function(){return this._maxx},q.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof q){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},q.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof q){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof C){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},q.prototype.getMinY=function(){return this._miny},q.prototype.getMinX=function(){return this._minx},q.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof q){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},q.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},q.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},q.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},q.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},q.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},q.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},q.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},q.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},q.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},q.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof q){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof C){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},q.prototype.centre=function(){return this.isNull()?null:new C((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},q.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof q){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},q.prototype.getMaxY=function(){return this._maxy},q.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},q.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+C.hashCode(this._minx))+C.hashCode(this._maxx))+C.hashCode(this._miny))+C.hashCode(this._maxy)},q.prototype.interfaces_=function(){return[b,e]},q.prototype.getClass=function(){return q},q.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),l=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(l>u||c<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(r.y,i.y),c=Math.max(r.y,i.y),l>u||c<a))}},Y.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(q,Y);var H={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Z=function(t){this.geometryFactory=t||new ve};Z.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=H.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=H.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],J[n]&&(e=J[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},Z.prototype.write=function(t){return this.extractGeometry(t)},Z.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!K[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+K[e].apply(this,[t])+")"};var K={coordinate:function(t){return t.x+" "+t.y},point:function(t){return K.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+K.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(K.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(K.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+K.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+K.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+K.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+K.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},J={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(H.spaces);return this.geometryFactory.createPoint(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push(J.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(H.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push(J.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,o=t.trim().split(H.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(H.trimParens,"$1"),n=J.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===a?i=r:s.push(r);return this.geometryFactory.createPolygon(i,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(H.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push(J.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},$=function(t){this.parser=new Z(t)};$.prototype.write=function(t){return this.parser.write(t)},$.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Q=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),tt=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Q),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],et.isTrue(t,null);else if(2===arguments.length&&(e=arguments[1],!(t=arguments[0])))throw null===e?new tt:new tt(e)},et.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],et.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new C,this._intPt[1]=new C,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new T;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},nt.prototype.getIntersectionNum=function(){return this._result},nt.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return $.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+$.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new q(this._inputLines[0][0],this._inputLines[0][1]),n=new q(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,q.intersects(n,r,e)&&0===at.orientationIndex(n,r,e)&&0===at.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=X.intersection(t,n,r,i)}catch(s){if(!(s instanceof U))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new C(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=j.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);W.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&W.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new C(t),o=new C(e),s=new C(n),a=new C(r),u=new C;this.normalizeToEnvCentre(i,o,s,a,u);var l=this.safeHCoordinateIntersection(i,o,s,a);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=q.intersects(e,n,r),s=q.intersects(e,n,i),a=q.intersects(r,i,e),u=q.intersects(r,i,n);return o&&s?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=n.x<r.x?n.x:r.x,c=n.y<r.y?n.y:r.y,h=n.x>r.x?n.x:r.x,f=n.y>r.y?n.y:r.y,p=((o>l?o:l)+(a<h?a:h))/2,d=((s>c?s:c)+(u<f?u:f))/2;i.x=p,i.y=d,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!q.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=at.orientationIndex(e,n,r),s=at.orientationIndex(e,n,i);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=at.orientationIndex(r,i,e),u=at.orientationIndex(r,i,n);return a>0&&u>0||a<0&&u<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===u?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new C(r):0===s?this._intPt[0]=new C(i):0===a?this._intPt[0]=new C(e):0===u&&(this._intPt[0]=new C(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=at.distancePointLine(t,n,r),s=at.distancePointLine(e,n,r);return s<o&&(o=s,i=e),(s=at.distancePointLine(n,t,e))<o&&(o=s,i=n),(s=at.distancePointLine(r,t,e))<o&&(o=s,i=r),i},e}(nt),ot=function(){};ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return ot.signOfDet2x2(r,i,o,s)},ot.signOfDet2x2=function(t,e,n,r){var i=null,o=null,s=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(s=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=s*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(s=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=s*n)+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var st=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};st.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=ot.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}},st.prototype.isPointInPolygon=function(){return this.getLocation()!==M.EXTERIOR},st.prototype.getLocation=function(){return this._isPointOnSegment?M.BOUNDARY:this._crossingCount%2==1?M.INTERIOR:M.EXTERIOR},st.prototype.isOnSegment=function(){return this._isPointOnSegment},st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.locatePointInRing=function(){if(arguments[0]instanceof C&&L(arguments[1],B)){for(var t=arguments[1],e=new st(arguments[0]),n=new C,r=new C,i=1;i<t.size();i++)if(t.getCoordinate(i,n),t.getCoordinate(i-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof C&&arguments[1]instanceof Array){for(var o=arguments[1],s=new st(arguments[0]),a=1;a<o.length;a++){var u=o[a],l=o[a-1];if(s.countSegment(u,l),s.isOnSegment())return s.getLocation()}return s.getLocation()}};var at=function(){},ut={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.orientationIndex=function(t,e,n){return j.orientationIndex(t,e,n)},at.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(L(arguments[0],B)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new C,l=new C,c=new C;s.getCoordinate(0,l),s.getCoordinate(1,c);var h=l.x;c.x-=h;for(var f=0,p=1;p<a-1;p++)u.y=l.y,l.x=c.x,l.y=c.y,s.getCoordinate(p+1,c),c.x-=h,f+=l.x*(u.y-c.y);return f/2}},at.distanceLineLine=function(t,e,n,r){if(t.equals(e))return at.distancePointLine(t,n,r);if(n.equals(r))return at.distancePointLine(r,t,e);var i=!1;if(q.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var s=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),a=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,u=s/o;(u<0||u>1||a<0||a>1)&&(i=!0)}}else i=!0;return i?R.min(at.distancePointLine(t,n,r),at.distancePointLine(e,n,r),at.distancePointLine(n,t,e),at.distancePointLine(r,t,e)):0},at.isPointInRing=function(t,e){return at.locatePointInRing(t,e)!==M.EXTERIOR},at.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new C;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;s<e;s++){t.getCoordinate(s,r);var a=r.x,u=r.y,l=a-i,c=u-o;n+=Math.sqrt(l*l+c*c),i=a,o=u}return n},at.isCCW=function(t){var e=t.length-1;if(e<3)throw new _("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var o=t[i];o.y>n.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==r);var u=t[s],l=t[a];if(u.equals2D(n)||l.equals2D(n)||u.equals2D(l))return!1;var c=at.computeOrientation(u,n,l);return 0===c?u.x>l.x:c>0},at.locatePointInRing=function(t,e){return st.locatePointInRing(t,e)},at.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},at.computeOrientation=function(t,e,n){return at.orientationIndex(t,e,n)},at.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new _("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=at.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var u=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),l=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(l<=0)return o.distance(s);if(l>=1)return o.distance(a);var c=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(c)*Math.sqrt(u)}},at.isOnLine=function(t,e){for(var n=new it,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},ut.CLOCKWISE.get=function(){return-1},ut.RIGHT.get=function(){return at.CLOCKWISE},ut.COUNTERCLOCKWISE.get=function(){return 1},ut.LEFT.get=function(){return at.COUNTERCLOCKWISE},ut.COLLINEAR.get=function(){return 0},ut.STRAIGHT.get=function(){return at.COLLINEAR},Object.defineProperties(at,ut);var lt=function(){};lt.prototype.filter=function(t){},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return lt};var ct=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},ht={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION},ct.prototype.getFactory=function(){return this._factory},ct.prototype.getGeometryN=function(t){return this},ct.prototype.getArea=function(){return 0},ct.prototype.isRectangle=function(){return!1},ct.prototype.equals=function(){if(arguments[0]instanceof ct){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ct))return!1;var n=e;return this.equalsExact(n)}},ct.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ct.prototype.geometryChanged=function(){this.apply(ct.geometryChangedFilter)},ct.prototype.geometryChangedAction=function(){this._envelope=null},ct.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ct.prototype.getLength=function(){return 0},ct.prototype.getNumGeometries=function(){return 1},ct.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},ct.prototype.getUserData=function(){return this._userData},ct.prototype.getSRID=function(){return this._SRID},ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ct.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")},ct.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ct.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ct.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new q(this._envelope)},ct.prototype.setSRID=function(t){this._SRID=t},ct.prototype.setUserData=function(t){this._userData=t},ct.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),s=i.compareTo(o);if(0!==s)return s}return n.hasNext()?1:r.hasNext()?-1:0},ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ct.SORTINDEX_MULTIPOLYGON},ct.prototype.interfaces_=function(){return[w,b,e]},ct.prototype.getClass=function(){return ct},ct.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ct.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},ht.serialVersionUID.get=function(){return 0x799ea46522854c00},ht.SORTINDEX_POINT.get=function(){return 0},ht.SORTINDEX_MULTIPOINT.get=function(){return 1},ht.SORTINDEX_LINESTRING.get=function(){return 2},ht.SORTINDEX_LINEARRING.get=function(){return 3},ht.SORTINDEX_MULTILINESTRING.get=function(){return 4},ht.SORTINDEX_POLYGON.get=function(){return 5},ht.SORTINDEX_MULTIPOLYGON.get=function(){return 6},ht.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},ht.geometryChangedFilter.get=function(){return ft},Object.defineProperties(ct,ht);var ft=function(){};ft.interfaces_=function(){return[lt]},ft.filter=function(t){t.geometryChangedAction()};var pt=function(){};pt.prototype.filter=function(t){},pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt};var dt=function(){},gt={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};dt.prototype.isInBoundary=function(t){},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt},gt.Mod2BoundaryNodeRule.get=function(){return yt},gt.EndPointBoundaryNodeRule.get=function(){return vt},gt.MultiValentEndPointBoundaryNodeRule.get=function(){return _t},gt.MonoValentEndPointBoundaryNodeRule.get=function(){return mt},gt.MOD2_BOUNDARY_RULE.get=function(){return new yt},gt.ENDPOINT_BOUNDARY_RULE.get=function(){return new vt},gt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},gt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},gt.OGC_SFS_BOUNDARY_RULE.get=function(){return dt.MOD2_BOUNDARY_RULE},Object.defineProperties(dt,gt);var yt=function(){};yt.prototype.isInBoundary=function(t){return t%2==1},yt.prototype.interfaces_=function(){return[dt]},yt.prototype.getClass=function(){return yt};var vt=function(){};vt.prototype.isInBoundary=function(t){return t>0},vt.prototype.interfaces_=function(){return[dt]},vt.prototype.getClass=function(){return vt};var _t=function(){};_t.prototype.isInBoundary=function(t){return t>1},_t.prototype.interfaces_=function(){return[dt]},_t.prototype.getClass=function(){return _t};var mt=function(){};mt.prototype.isInBoundary=function(t){return 1===t},mt.prototype.interfaces_=function(){return[dt]},mt.prototype.getClass=function(){return mt};var xt=function(){};xt.prototype.add=function(){},xt.prototype.addAll=function(){},xt.prototype.isEmpty=function(){},xt.prototype.iterator=function(){},xt.prototype.size=function(){},xt.prototype.toArray=function(){},xt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var bt=function(){};bt.prototype.hasNext=function(){},bt.prototype.next=function(){},bt.prototype.remove=function(){};var wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(xt);(r.prototype=new Error).name="NoSuchElementException";var Et=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,xt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new Ct(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(wt),Ct=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new r;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(bt),St=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[1],n=!1,r=arguments[0].iterator();r.hasNext();)this.add(r.next(),e),n=!0;return n}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof C&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],u=arguments[1];if(arguments[2])for(var l=0;l<a.length;l++)this.add(a[l],u);else for(var c=a.length-1;c>=0;c--)this.add(a[c],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof C){var h=arguments[0],f=arguments[1];if(!arguments[2]){var p=this.size();if(p>0){if(h>0&&this.get(h-1).equals2D(f))return null;if(h<p&&this.get(h).equals2D(f))return null}}t.prototype.add.call(this,h,f)}}else if(4===arguments.length){var d=arguments[0],g=arguments[1],y=arguments[2],v=arguments[3],_=1;y>v&&(_=-1);for(var m=y;m!==v;m+=_)this.add(d[m],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new C(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(Et),Pt=function(){},It={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};It.ForwardComparator.get=function(){return Mt},It.BidirectionalComparator.get=function(){return Ot},It.coordArrayType.get=function(){return new Array(0).fill(null)},Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt},Pt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Pt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Pt.indexOf(r,e)<0)return r}return null},Pt.scroll=function(t,e){var n=Pt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);W.arraycopy(t,n,r,0,t.length-n),W.arraycopy(t,0,r,t.length-n,n),W.arraycopy(r,0,t,0,t.length)},Pt.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var s=0;s<r.length;s++)if(0!==o.compare(r[s],i[s]))return!1;return!0}},Pt.intersection=function(t,e){for(var n=new St,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Pt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Pt.removeRepeatedPoints=function(t){return Pt.hasRepeatedPoints(t)?new St(t,!1).toCoordinateArray():t},Pt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},Pt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},Pt.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new C(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=0;u<a;u++)o[s+u]=new C(r[i+u])},Pt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},Pt.envelope=function(t){for(var e=new q,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Pt.toCoordinateArray=function(t){return t.toArray(Pt.coordArrayType)},Pt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Pt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Pt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},Pt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},Pt.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},Pt.extract=function(t,e,n){e=R.clamp(e,0,t.length);var r=(n=R.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,s=e;s<=n;s++)i[o++]=t[s];return i},Object.defineProperties(Pt,It);var Mt=function(){};Mt.prototype.compare=function(t,e){return Pt.compare(t,e)},Mt.prototype.interfaces_=function(){return[E]},Mt.prototype.getClass=function(){return Mt};var Ot=function(){};Ot.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var i=Pt.compare(n,r);return Pt.isEqualReversed(n,r)?0:i},Ot.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var i=Pt.increasingDirection(n),o=Pt.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var l=n[s].compareTo(r[a]);if(0!==l)return l;s+=i,a+=o}return 0},Ot.prototype.interfaces_=function(){return[E]},Ot.prototype.getClass=function(){return Ot};var Lt=function(){};Lt.prototype.get=function(){},Lt.prototype.put=function(){},Lt.prototype.size=function(){},Lt.prototype.values=function(){},Lt.prototype.entrySet=function(){};var Rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Lt);(i.prototype=new Error).name="OperationNotSupported",(o.prototype=new xt).contains=function(){};var kt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Tt(this)},e}(o),Tt=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new i},e}(bt),Nt=0;(h.prototype=new Rt).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},h.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Nt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var s={key:t,left:null,right:null,value:e,parent:n,color:Nt,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},h.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(a(t)===l(a(a(t)))){var e=c(a(a(t)));1===s(e)?(u(a(t),Nt),u(e,Nt),u(a(a(t)),1),t=a(a(t))):(t===c(a(t))&&(t=a(t),this.rotateLeft(t)),u(a(t),Nt),u(a(a(t)),1),this.rotateRight(a(a(t))))}else{var n=l(a(a(t)));1===s(n)?(u(a(t),Nt),u(n,Nt),u(a(a(t)),1),t=a(a(t))):(t===l(a(t))&&(t=a(t),this.rotateRight(t)),u(a(t),Nt),u(a(a(t)),1),this.rotateLeft(a(a(t))))}this.root_.color=Nt},h.prototype.values=function(){var t=new Et,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=h.successor(e));)t.add(e.value);return t},h.prototype.entrySet=function(){var t=new kt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=h.successor(e));)t.add(e);return t},h.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},h.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},h.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},h.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},h.prototype.size=function(){return this.size_};var At=function(){};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},f.prototype=new o,(p.prototype=new f).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},p.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},p.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},p.prototype.remove=function(t){throw new i},p.prototype.size=function(){return this.array_.length},p.prototype.isEmpty=function(){return 0===this.array_.length},p.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},p.prototype.iterator=function(){return new Dt(this)};var Dt=function(t){this.treeSet_=t,this.position_=0};Dt.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},Dt.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Dt.prototype.remove=function(){throw new i};var Ft=function(){};Ft.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},Ft.asList=function(t){for(var e=new Et,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var jt=function(){},Gt={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Gt.P.get=function(){return 0},Gt.L.get=function(){return 1},Gt.A.get=function(){return 2},Gt.FALSE.get=function(){return-1},Gt.TRUE.get=function(){return-2},Gt.DONTCARE.get=function(){return-3},Gt.SYM_FALSE.get=function(){return"F"},Gt.SYM_TRUE.get=function(){return"T"},Gt.SYM_DONTCARE.get=function(){return"*"},Gt.SYM_P.get=function(){return"0"},Gt.SYM_L.get=function(){return"1"},Gt.SYM_A.get=function(){return"2"},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.toDimensionSymbol=function(t){switch(t){case jt.FALSE:return jt.SYM_FALSE;case jt.TRUE:return jt.SYM_TRUE;case jt.DONTCARE:return jt.SYM_DONTCARE;case jt.P:return jt.SYM_P;case jt.L:return jt.SYM_L;case jt.A:return jt.SYM_A}throw new _("Unknown dimension value: "+t)},jt.toDimensionValue=function(t){switch(A.toUpperCase(t)){case jt.SYM_FALSE:return jt.FALSE;case jt.SYM_TRUE:return jt.TRUE;case jt.SYM_DONTCARE:return jt.DONTCARE;case jt.SYM_P:return jt.P;case jt.SYM_L:return jt.L;case jt.SYM_A:return jt.A}throw new _("Unknown dimension symbol: "+t)},Object.defineProperties(jt,Gt);var Bt=function(){};Bt.prototype.filter=function(t){},Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt};var zt=function(){};zt.prototype.filter=function(t,e){},zt.prototype.isDone=function(){},zt.prototype.isGeometryChanged=function(){},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt};var Vt=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new _("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new q,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();Ft.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=jt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=jt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new p(Ft.asList(this._geometries)),n=new p(Ft.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],i=arguments[0],o=this.getNumGeometries(),s=i.getNumGeometries(),a=0;a<o&&a<s;){var u=this.getGeometryN(a),l=i.getGeometryN(a),c=u.compareToSameClass(l,r);if(0!==c)return c;a++}return a<o?1:a<s?-1:0}},e.prototype.apply=function(){if(L(arguments[0],pt))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(L(arguments[0],zt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(L(arguments[0],Bt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(L(arguments[0],lt)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),et.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(ct),Ut=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?jt.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new Wt(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[At]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(Vt),Wt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=dt.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};Wt.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Wt.prototype.getBoundary=function(){return this._geom instanceof Zt?this.boundaryLineString(this._geom):this._geom instanceof Ut?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Wt.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Wt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Wt.prototype.computeBoundaryCoordinates=function(t){var e=new Et;this._endpointMap=new h;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return Pt.toCoordinateArray(e)},Wt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Xt,this._endpointMap.put(t,e)),e.count++},Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.getBoundary=function(){return 1===arguments.length?new Wt(arguments[0]).getBoundary():2===arguments.length?new Wt(arguments[0],arguments[1]).getBoundary():void 0};var Xt=function(){this.count=null};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt};var qt=function(){},Yt={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},qt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o="",s=new function(){}(new function(){}(qt.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+qt.NEWLINE}catch(t){if(!(t instanceof d))throw t;et.shouldNeverReachHere()}return o}},qt.split=function(t,e){for(var n=e.length,r=new Et,i=""+t,o=i.indexOf(e);o>=0;){var s=i.substring(0,o);r.add(s),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),u=0;u<a.length;u++)a[u]=r.get(u);return a},qt.toString=function(){if(1===arguments.length){var t=arguments[0];return qt.SIMPLE_ORDINATE_FORMAT.format(t)}},qt.spaces=function(t){return qt.chars(" ",t)},Yt.NEWLINE.get=function(){return W.getProperty("line.separator")},Yt.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(qt,Yt);var Ht=function(){};Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Ht.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,B.X)===t.getOrdinate(e-1,B.X)&&t.getOrdinate(0,B.Y)===t.getOrdinate(e-1,B.Y)},Ht.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var s=t.getOrdinate(i,o),a=e.getOrdinate(i,o);if(!(t.getOrdinate(i,o)===e.getOrdinate(i,o)||m.isNaN(s)&&m.isNaN(a)))return!1}return!0},Ht.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Ht.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Ht.copy(e,i-1,r,o,1);return r},Ht.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Ht.swap(t,r,e-r)},Ht.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Ht.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Ht.copyCoord(t,e+o,n,r+o)},Ht.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new T;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(qt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Ht.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Ht.createClosedRing(t,e,4):e.getOrdinate(0,B.X)===e.getOrdinate(n-1,B.X)&&e.getOrdinate(0,B.Y)===e.getOrdinate(n-1,B.Y)?e:Ht.createClosedRing(t,e,n+1)},Ht.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Ht.copy(e,0,r,0,i);for(var o=i;o<n;o++)Ht.copy(e,0,r,o,1);return r};var Zt=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new q:this._points.expandEnvelope(new q)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Ht.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?jt.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return at.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Ht.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(L(arguments[0],pt))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(L(arguments[0],zt)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Bt)||L(arguments[0],lt))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Wt(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new _("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[At]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ct),Kt=function(){};Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt};var Jt=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new q;var t=new q;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return jt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(L(arguments[0],pt)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(L(arguments[0],zt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Bt)||L(arguments[0],lt))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ct),$t=function(){};$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var Qt=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new _("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new _("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(at.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(at.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),a=1;a<=4;a++){var u=t.getX(a),l=t.getY(a);if(u!==o==(l!==s))return!1;o=u,s=l}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,o=r._shell;if(!i.equalsExact(o,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var s=0;s<this._holes.length;s++)if(!this._holes[s].equalsExact(r._holes[s],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);Ft.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);W.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Pt.minCoordinate(e.getCoordinates());Pt.scroll(r,i),W.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],at.isCCW(e.getCoordinates())===n&&Pt.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[1],i=arguments[0],o=this._shell,s=i._shell,a=o.compareToSameClass(s,r);if(0!==a)return a;for(var u=this.getNumInteriorRing(),l=i.getNumInteriorRing(),c=0;c<u&&c<l;){var h=this.getInteriorRingN(c),f=i.getInteriorRingN(c),p=h.compareToSameClass(f,r);if(0!==p)return p;c++}return c<u?1:c<l?-1:0}},e.prototype.apply=function(t){if(L(t,pt)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(L(t,zt)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(L(t,Bt))t.filter(this);else if(L(t,lt)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ct),te=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return jt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(Vt),ee=function(t){function e(e,n){e instanceof C&&n instanceof ve&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return jt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Ht.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new _("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new _("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Zt),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new Et,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(Vt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof Vt?this.editGeometryCollection(t,e):t instanceof Qt?this.editPolygon(t,e):t instanceof Jt||t instanceof Zt?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new Et,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Ut?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new Et,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||i.add(s)}return this._factory.createPolygon(r,i.toArray([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},ie.NoOpGeometryOperation.get=function(){return oe},ie.CoordinateOperation.get=function(){return se},ie.CoordinateSequenceOperation.get=function(){return ae},Object.defineProperties(re,ie);var oe=function(){};oe.prototype.edit=function(t,e){return t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var se=function(){};se.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof Zt?e.createLineString(n):t instanceof Jt?n.length>0?e.createPoint(n[0]):e.createPoint():t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=function(){};ae.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Zt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Jt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var ue=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new C}else if(L(arguments[0],B)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=new Array(s).fill(null),this._dimension=a;for(var u=0;u<s;u++)this._coordinates[u]=new C}},le={serialVersionUID:{configurable:!0}};ue.prototype.setOrdinate=function(t,e,n){switch(e){case B.X:this._coordinates[t].x=n;break;case B.Y:this._coordinates[t].y=n;break;case B.Z:this._coordinates[t].z=n;break;default:throw new _("invalid ordinateIndex")}},ue.prototype.size=function(){return this._coordinates.length},ue.prototype.getOrdinate=function(t,e){switch(e){case B.X:return this._coordinates[t].x;case B.Y:return this._coordinates[t].y;case B.Z:return this._coordinates[t].z}return m.NaN},ue.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},ue.prototype.getCoordinateCopy=function(t){return new C(this._coordinates[t])},ue.prototype.getDimension=function(){return this._dimension},ue.prototype.getX=function(t){return this._coordinates[t].x},ue.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new ue(t,this._dimension)},ue.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ue.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new ue(t,this._dimension)},ue.prototype.toString=function(){if(this._coordinates.length>0){var t=new T(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},ue.prototype.getY=function(t){return this._coordinates[t].y},ue.prototype.toCoordinateArray=function(){return this._coordinates},ue.prototype.interfaces_=function(){return[B,e]},ue.prototype.getClass=function(){return ue},le.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ue,le);var ce=function(){},he={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ce.prototype.readResolve=function(){return ce.instance()},ce.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new ue(arguments[0]);if(L(arguments[0],B))return new ue(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new ue(t):new ue(t,e)}},ce.prototype.interfaces_=function(){return[I,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new ce},Object.defineProperties(ce,he);var fe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new Et,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new kt;return this.map_.entries().forEach(function(e){return t.add(e)}),t},e.prototype.size=function(){return this.map_.size()},e}(Lt),pe=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ge){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},de={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};pe.prototype.equals=function(t){if(!(t instanceof pe))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},pe.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new N(n).compareTo(new N(r))},pe.prototype.getScale=function(){return this._scale},pe.prototype.isFloating=function(){return this._modelType===pe.FLOATING||this._modelType===pe.FLOATING_SINGLE},pe.prototype.getType=function(){return this._modelType},pe.prototype.toString=function(){var t="UNKNOWN";return this._modelType===pe.FLOATING?t="Floating":this._modelType===pe.FLOATING_SINGLE?t="Floating-Single":this._modelType===pe.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},pe.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return m.isNaN(t)||this._modelType===pe.FLOATING_SINGLE?t:this._modelType===pe.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof C){var e=arguments[0];if(this._modelType===pe.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},pe.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===pe.FLOATING?t=16:this._modelType===pe.FLOATING_SINGLE?t=6:this._modelType===pe.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},pe.prototype.setScale=function(t){this._scale=Math.abs(t)},pe.prototype.interfaces_=function(){return[e,b]},pe.prototype.getClass=function(){return pe},pe.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},de.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},de.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(pe,de);var ge=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ge.prototype.readResolve=function(){return ge.nameToTypeMap.get(this._name)},ge.prototype.toString=function(){return this._name},ge.prototype.interfaces_=function(){return[e]},ge.prototype.getClass=function(){return ge},ye.serialVersionUID.get=function(){return-552860263173159e4},ye.nameToTypeMap.get=function(){return new fe},Object.defineProperties(ge,ye),pe.Type=ge,pe.FIXED=new ge("FIXED"),pe.FLOATING=new ge("FLOATING"),pe.FLOATING_SINGLE=new ge("FLOATING SINGLE");var ve=function t(){this._precisionModel=new pe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?L(arguments[0],I)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof pe&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},_e={serialVersionUID:{configurable:!0}};ve.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new C(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new C(t.getMinX(),t.getMinY()),new C(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new C(t.getMinX(),t.getMinY()),new C(t.getMinX(),t.getMaxY()),new C(t.getMaxX(),t.getMaxY()),new C(t.getMaxX(),t.getMinY()),new C(t.getMinX(),t.getMinY())]),null)},ve.prototype.createLineString=function(t){return t?t instanceof Array?new Zt(this.getCoordinateSequenceFactory().create(t),this):L(t,B)?new Zt(t,this):void 0:new Zt(this.getCoordinateSequenceFactory().create([]),this)},ve.prototype.createMultiLineString=function(){return 0===arguments.length?new Ut(null,this):1===arguments.length?new Ut(arguments[0],this):void 0},ve.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(ve.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Qt)return this.createMultiPolygon(ve.toPolygonArray(t));if(a instanceof Zt)return this.createMultiLineString(ve.toLineStringArray(t));if(a instanceof Jt)return this.createMultiPoint(ve.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},ve.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},ve.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(L(arguments[0],B))return new Jt(arguments[0],this)}},ve.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ve.prototype.createPolygon=function(){if(0===arguments.length)return new Qt(null,null,this);if(1===arguments.length){if(L(arguments[0],B)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Qt(arguments[0],arguments[1],this)},ve.prototype.getSRID=function(){return this._SRID},ve.prototype.createGeometryCollection=function(){return 0===arguments.length?new Vt(null,this):1===arguments.length?new Vt(arguments[0],this):void 0},ve.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},ve.prototype.getPrecisionModel=function(){return this._precisionModel},ve.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],B))return new ee(arguments[0],this)}},ve.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},ve.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],B)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),r=0;r<e.size();r++){var i=this.getCoordinateSequenceFactory().create(1,e.getDimension());Ht.copy(e,r,i,0,1),n[r]=this.createPoint(i)}return this.createMultiPoint(n)}}},ve.prototype.interfaces_=function(){return[e]},ve.prototype.getClass=function(){return ve},ve.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.getDefaultCoordinateSequenceFactory=function(){return ce.instance()},ve.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},_e.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(ve,_e);var me=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],xe=function(t){this.geometryFactory=t||new ve};xe.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!be[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==me.indexOf(n)?be[n].apply(this,[e.coordinates]):"GeometryCollection"===n?be[n].apply(this,[e.geometries]):be[n].apply(this,[e])},xe.prototype.write=function(t){var e=t.getGeometryType();if(!we[e])throw new Error("Geometry is not supported");return we[e].apply(this,[t])};var be={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!be[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=be.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new C(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new C(t[0],t[1]),new C(t[2],t[1]),new C(t[2],t[3]),new C(t[0],t[3]),new C(t[0],t[1])])},Point:function(t){var e=new C(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(be.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=be.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(be.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=be.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=be.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);r.push(a)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(be.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},we={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:we.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(we.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=we.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=we.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(we[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},Ee=function(t){this.geometryFactory=t||new ve,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new xe(this.geometryFactory)};Ee.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===pe.FIXED&&this.reducePrecision(e),e},Ee.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var Ce=function(){this.parser=new xe(this.geometryFactory)};Ce.prototype.write=function(t){return this.parser.write(t)};var Se=function(){},Pe={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se},Se.opposite=function(t){return t===Se.LEFT?Se.RIGHT:t===Se.RIGHT?Se.LEFT:t},Pe.ON.get=function(){return 0},Pe.LEFT.get=function(){return 1},Pe.RIGHT.get=function(){return 2},Object.defineProperties(Se,Pe),(g.prototype=new Error).name="EmptyStackException",(y.prototype=new wt).add=function(t){return this.array_.push(t),!0},y.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},y.prototype.push=function(t){return this.array_.push(t),t},y.prototype.pop=function(t){if(0===this.array_.length)throw new g;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new g;return this.array_[this.array_.length-1]},y.prototype.empty=function(){return 0===this.array_.length},y.prototype.isEmpty=function(){return this.empty()},y.prototype.search=function(t){return this.array_.indexOf(t)},y.prototype.size=function(){return this.array_.length},y.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Ie=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Ie.prototype.getCoordinate=function(){return this._minCoord},Ie.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Ie.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=at.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===at.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===at.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Ie.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Se.LEFT;return n[e].y<n[e+1].y&&(r=Se.RIGHT),r},Ie.prototype.getEdge=function(){return this._orientedDe},Ie.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Ie.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Ie.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Se.LEFT&&(this._orientedDe=this._minDe.getSym())},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie};var Me=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new C(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Q),Oe=function(){this.array_=[]};Oe.prototype.addLast=function(t){this.array_.push(t)},Oe.prototype.removeFirst=function(){return this.array_.shift()},Oe.prototype.isEmpty=function(){return 0===this.array_.length};var Le=function(){this._finder=null,this._dirEdgeList=new Et,this._nodes=new Et,this._rightMostCoord=null,this._env=null,this._finder=new Ie};Le.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Le.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Le.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Me("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Le.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Se.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Le.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Le.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Se.RIGHT)>=1&&e.getDepth(Se.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Le.prototype.computeDepths=function(t){var e=new kt,n=new Oe,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},Le.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Le.prototype.getEnvelope=function(){if(null===this._env){for(var t=new q,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Le.prototype.addReachable=function(t){var e=new y;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Le.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Se.LEFT,t.getDepth(Se.RIGHT)),e.setDepth(Se.RIGHT,t.getDepth(Se.LEFT))},Le.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Le.prototype.getNodes=function(){return this._nodes},Le.prototype.getDirectedEdges=function(){return this._dirEdgeList},Le.prototype.interfaces_=function(){return[b]},Le.prototype.getClass=function(){return Le};var Re=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[Se.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.init(3),this.location[Se.ON]=o,this.location[Se.LEFT]=s,this.location[Se.RIGHT]=a}};Re.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Re.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==M.NONE)return!1;return!0},Re.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===M.NONE&&(this.location[e]=t)},Re.prototype.isLine=function(){return 1===this.location.length},Re.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Se.ON]=this.location[Se.ON],e[Se.LEFT]=M.NONE,e[Se.RIGHT]=M.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===M.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Re.prototype.getLocations=function(){return this.location},Re.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Se.LEFT];this.location[Se.LEFT]=this.location[Se.RIGHT],this.location[Se.RIGHT]=t},Re.prototype.toString=function(){var t=new T;return this.location.length>1&&t.append(M.toLocationSymbol(this.location[Se.LEFT])),t.append(M.toLocationSymbol(this.location[Se.ON])),this.location.length>1&&t.append(M.toLocationSymbol(this.location[Se.RIGHT])),t.toString()},Re.prototype.setLocations=function(t,e,n){this.location[Se.ON]=t,this.location[Se.LEFT]=e,this.location[Se.RIGHT]=n},Re.prototype.get=function(t){return t<this.location.length?this.location[t]:M.NONE},Re.prototype.isArea=function(){return this.location.length>1},Re.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===M.NONE)return!0;return!1},Re.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Se.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Re.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(M.NONE)},Re.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Re.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re};var ke=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Re(e),this.elt[1]=new Re(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Re(n.elt[0]),this.elt[1]=new Re(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Re(M.NONE),this.elt[1]=new Re(M.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new Re(o,s,a),this.elt[1]=new Re(o,s,a)}else if(4===arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new Re(M.NONE,M.NONE,M.NONE),this.elt[1]=new Re(M.NONE,M.NONE,M.NONE),this.elt[u].setLocations(l,c,h)}};ke.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},ke.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},ke.prototype.isNull=function(t){return this.elt[t].isNull()},ke.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},ke.prototype.isLine=function(t){return this.elt[t].isLine()},ke.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Re(t.elt[e]):this.elt[e].merge(t.elt[e])},ke.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},ke.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Se.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},ke.prototype.toString=function(){var t=new T;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},ke.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},ke.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},ke.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Se.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},ke.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},ke.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},ke.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Re(this.elt[t].location[0]))},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},ke.toLineLabel=function(t){for(var e=new ke(M.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Te=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Et,this._pts=new Et,this._label=new ke(M.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Et,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Te.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=at.isCCW(this._ring.getCoordinates())},Te.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Te.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Me("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Me("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Te.prototype.getLinearRing=function(){return this._ring},Te.prototype.getCoordinate=function(t){return this._pts.get(t)},Te.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Te.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var s=r.length-2;n&&(s=r.length-1);for(var a=s;a>=0;a--)this._pts.add(r[a])}},Te.prototype.isHole=function(){return this._isHole},Te.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Te.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!at.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Te.prototype.addHole=function(t){this._holes.add(t)},Te.prototype.isShell=function(){return null===this._shell},Te.prototype.getLabel=function(){return this._label},Te.prototype.getEdges=function(){return this._edges},Te.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Te.prototype.getShell=function(){return this._shell},Te.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,Se.RIGHT);if(n===M.NONE)return null;if(this._label.getLocation(e)===M.NONE)return this._label.setLocation(e,n),null}},Te.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Te.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var Ne=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Te),Ae=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new Et,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Ne(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Te),De=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};De.prototype.setVisited=function(t){this._isVisited=t},De.prototype.setInResult=function(t){this._isInResult=t},De.prototype.isCovered=function(){return this._isCovered},De.prototype.isCoveredSet=function(){return this._isCoveredSet},De.prototype.setLabel=function(t){this._label=t},De.prototype.getLabel=function(){return this._label},De.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},De.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},De.prototype.isInResult=function(){return this._isInResult},De.prototype.isVisited=function(){return this._isVisited},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De};var Fe=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new ke(0,M.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=M.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==M.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new ke(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof ke)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===M.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=M.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case M.BOUNDARY:n=M.INTERIOR;break;case M.INTERIOR:default:n=M.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(De),je=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};je.prototype.find=function(t){return this.nodeMap.get(t)},je.prototype.addNode=function(){if(arguments[0]instanceof C){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Fe){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},je.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},je.prototype.iterator=function(){return this.nodeMap.values().iterator()},je.prototype.values=function(){return this.nodeMap.values()},je.prototype.getBoundaryNodes=function(t){for(var e=new Et,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===M.BOUNDARY&&e.add(r)}return e},je.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var Ge=function(){},Be={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.isNorthern=function(t){return t===Ge.NE||t===Ge.NW},Ge.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Ge.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Ge.isInHalfPlane=function(t,e){return e===Ge.SE?t===Ge.SE||t===Ge.SW:t===e||t===e+1},Ge.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ge.NE:Ge.SE:e>=0?Ge.NW:Ge.SW}if(arguments[0]instanceof C&&arguments[1]instanceof C){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new _("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ge.NE:Ge.SE:r.y>=n.y?Ge.NW:Ge.SW}},Be.NE.get=function(){return 0},Be.NW.get=function(){return 1},Be.SW.get=function(){return 2},Be.SE.get=function(){return 3},Object.defineProperties(Ge,Be);var ze=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=i,this.init(o,s),this._label=a}};ze.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:at.computeOrientation(t._p0,t._p1,this._p1)},ze.prototype.getDy=function(){return this._dy},ze.prototype.getCoordinate=function(){return this._p0},ze.prototype.setNode=function(t){this._node=t},ze.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},ze.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},ze.prototype.getDirectedCoordinate=function(){return this._p1},ze.prototype.getDx=function(){return this._dx},ze.prototype.getLabel=function(){return this._label},ze.prototype.getEdge=function(){return this._edge},ze.prototype.getQuadrant=function(){return this._quadrant},ze.prototype.getNode=function(){return this._node},ze.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},ze.prototype.computeLabel=function(t){},ze.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Ge.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},ze.prototype.interfaces_=function(){return[b]},ze.prototype.getClass=function(){return ze};var Ve=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new ke(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Me("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Se.LEFT)===M.INTERIOR&&this._label.getLocation(e,Se.RIGHT)===M.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Se.LEFT]+"/"+this._depth[Se.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,M.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,M.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Se.LEFT&&(r=-1);var i=Se.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===M.EXTERIOR&&e===M.INTERIOR?1:t===M.INTERIOR&&e===M.EXTERIOR?-1:0},e}(ze),Ue=function(){};Ue.prototype.createNode=function(t){return new Fe(t,null)},Ue.prototype.interfaces_=function(){return[]},Ue.prototype.getClass=function(){return Ue};var We=function(){if(this._edges=new Et,this._nodes=null,this._edgeEndList=new Et,0===arguments.length)this._nodes=new je(new Ue);else if(1===arguments.length){var t=arguments[0];this._nodes=new je(t)}};We.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},We.prototype.find=function(t){return this._nodes.find(t)},We.prototype.addNode=function(){if(arguments[0]instanceof Fe){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof C){var e=arguments[0];return this._nodes.addNode(e)}},We.prototype.getNodeIterator=function(){return this._nodes.iterator()},We.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},We.prototype.debugPrintln=function(t){W.out.println(t)},We.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===M.BOUNDARY},We.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},We.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&at.computeOrientation(t,e,r)===at.COLLINEAR&&Ge.quadrant(t,e)===Ge.quadrant(n,r)},We.prototype.getEdgeEnds=function(){return this._edgeEndList},We.prototype.debugPrint=function(t){W.out.print(t)},We.prototype.getEdgeIterator=function(){return this._edges.iterator()},We.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},We.prototype.insertEdge=function(t){this._edges.add(t)},We.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},We.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new Ve(n,!0),i=new Ve(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},We.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},We.prototype.getNodes=function(){return this._nodes.values()},We.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},We.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Xe=function(){this._geometryFactory=null,this._shellList=new Et;var t=arguments[0];this._geometryFactory=t};Xe.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Xe.prototype.computePolygons=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Xe.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Me("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Xe.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new Et,i=t.iterator();i.hasNext();){var o=i.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else r.add(o)}return r},Xe.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Xe.prototype.buildMaximalEdgeRings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Ae(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Xe.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Xe.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Xe.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(r)&&at.isPointInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=u)}return o},Xe.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Xe.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];We.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new Et,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var qe=function(){};qe.prototype.getBounds=function(){},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe};var Ye=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Ye.prototype.getItem=function(){return this._item},Ye.prototype.getBounds=function(){return this._bounds},Ye.prototype.interfaces_=function(){return[qe,e]},Ye.prototype.getClass=function(){return Ye};var He=function(){this._size=null,this._items=null,this._size=0,this._items=new Et,this._items.add(null)};He.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},He.prototype.size=function(){return this._size},He.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},He.prototype.clear=function(){this._size=0,this._items.clear()},He.prototype.isEmpty=function(){return 0===this._size},He.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var Ze=function(){};Ze.prototype.visitItem=function(t){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var Ke=function(){};Ke.prototype.insert=function(t,e){},Ke.prototype.remove=function(t,e){},Ke.prototype.query=function(){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Je=function(){if(this._childBoundables=new Et,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},$e={serialVersionUID:{configurable:!0}};Je.prototype.getLevel=function(){return this._level},Je.prototype.size=function(){return this._childBoundables.size()},Je.prototype.getChildBoundables=function(){return this._childBoundables},Je.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Je.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Je.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Je.prototype.interfaces_=function(){return[qe,e]},Je.prototype.getClass=function(){return Je},$e.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Je,$e);var Qe=function(){};Qe.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Qe.min=function(t){return Qe.sort(t),t.get(0)},Qe.sort=function(t,e){var n=t.toArray();e?Ft.sort(n,e):Ft.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},Qe.singletonList=function(t){var e=new Et;return e.add(t),e};var tn=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new _("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new tn(o,e,this._itemDistance);s.getDistance()<r&&n.add(s)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[b]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof Je};var en=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new Et,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Je?t+=this.size(n):n instanceof Ye&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof Ye&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new Et:t}if(1===arguments.length){for(var e=arguments[0],n=new Et,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Je){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof Ye?n.add(i.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ye(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Je?this.boundablesAtLevel(n,s,i):(et.isTrue(s instanceof Ye),-1===n&&i.add(s))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new Et;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(L(arguments[2],Ze)&&arguments[0]instanceof Object&&arguments[1]instanceof Je)for(var i=arguments[0],o=arguments[2],s=arguments[1].getChildBoundables(),a=0;a<s.size();a++){var u=s.get(a);this.getIntersectsOp().intersects(u.getBounds(),i)&&(u instanceof Je?this.query(i,u,o):u instanceof Ye?o.visitItem(u.getItem()):et.shouldNeverReachHere())}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Je)for(var l=arguments[0],c=arguments[2],h=arguments[1].getChildBoundables(),f=0;f<h.size();f++){var p=h.get(f);this.getIntersectsOp().intersects(p.getBounds(),l)&&(p instanceof Je?this.query(l,p,c):p instanceof Ye?c.add(p.getItem()):et.shouldNeverReachHere())}},en.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},en.prototype.getRoot=function(){return this.build(),this._root},en.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var s=null,a=r.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Je&&(o=this.remove(n,u,i))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Je){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new Et;n.add(this.createNode(e));var r=new Et(t);Qe.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},on=function(){};on.prototype.distance=function(t,e){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on};var sn=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new Et,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new an(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o<e;o++){r[o]=new Et;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}return r},n.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(L(arguments[2],Ze)&&arguments[0]instanceof Object&&arguments[1]instanceof Je){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Je){var a=arguments[0],u=arguments[1],l=arguments[2];t.prototype.query.call(this,a,u,l)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new Et(t);Qe.sort(i,n.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(L(arguments[0],on)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,m.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&L(arguments[1],on)){var i=arguments[0],o=arguments[1],s=new tn(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var a=arguments[0],u=arguments[1],l=null,c=new He;for(c.add(a);!c.isEmpty()&&u>0;){var h=c.poll(),f=h.getDistance();if(f>=u)break;h.isLeaves()?(u=f,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var p=arguments[2],d=new Ye(arguments[0],arguments[1]),g=new tn(this.getRoot(),d,p);return this.nearestNeighbour(g)[0]}},n.prototype.interfaces_=function(){return[Ke,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return an},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),an=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new q(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Je),un=function(){};un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.relativeSign=function(t,e){return t<e?-1:t>e?1:0},un.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=un.relativeSign(e.x,n.x),i=un.relativeSign(e.y,n.y);switch(t){case 0:return un.compareValue(r,i);case 1:return un.compareValue(i,r);case 2:return un.compareValue(i,-r);case 3:return un.compareValue(-r,i);case 4:return un.compareValue(-r,-i);case 5:return un.compareValue(-i,-r);case 6:return un.compareValue(-i,r);case 7:return un.compareValue(r,-i)}return et.shouldNeverReachHere("invalid octant value"),0},un.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ln=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new C(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};ln.prototype.getCoordinate=function(){return this.coord},ln.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ln.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:un.compare(this._segmentOctant,this.coord,e.coord)},ln.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ln.prototype.isInterior=function(){return this._isInterior},ln.prototype.interfaces_=function(){return[b]},ln.prototype.getClass=function(){return ln};var cn=function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t};cn.prototype.getSplitCoordinates=function(){var t=new St;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},cn.prototype.addCollapsedNodes=function(){var t=new Et;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new N(e+1))}},cn.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new C(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new C(e.coord))},cn.prototype.iterator=function(){return this._nodeMap.values().iterator()},cn.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},cn.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},cn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new N(e[0])),r=i}},cn.prototype.getEdge=function(){return this._edge},cn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new C(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new C(e.coord)),new dn(o,this._edge.getData())},cn.prototype.add=function(t,e){var n=new ln(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},cn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Q("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new Q("bad split edge end point at "+i)},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var hn=function(){};hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn},hn.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof C&&arguments[1]instanceof C){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new _("Cannot compute the octant for two identical points "+i);return hn.octant(s,a)}};var fn=function(){};fn.prototype.getCoordinates=function(){},fn.prototype.size=function(){},fn.prototype.getCoordinate=function(t){},fn.prototype.isClosed=function(){},fn.prototype.setData=function(t){},fn.prototype.getData=function(){},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var pn=function(){};pn.prototype.addIntersection=function(t,e){},pn.prototype.interfaces_=function(){return[fn]},pn.prototype.getClass=function(){return pn};var dn=function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};dn.prototype.getCoordinates=function(){return this._pts},dn.prototype.size=function(){return this._pts.length},dn.prototype.getCoordinate=function(t){return this._pts[t]},dn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},dn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},dn.prototype.setData=function(t){this._data=t},dn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:hn.octant(t,e)},dn.prototype.getData=function(){return this._data},dn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i=new C(arguments[0].getIntersection(r));this.addIntersection(i,n)}},dn.prototype.toString=function(){return $.toLineString(new ue(this._pts))},dn.prototype.getNodeList=function(){return this._nodeList},dn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},dn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},dn.prototype.interfaces_=function(){return[pn]},dn.prototype.getClass=function(){return dn},dn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return dn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(n)};var gn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new C,this.p1=new C;else if(1===arguments.length){var t=arguments[0];this.p0=new C(t.p0),this.p1=new C(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new C(e,n),this.p1=new C(r,i)}},yn={serialVersionUID:{configurable:!0}};gn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},gn.prototype.orientationIndex=function(){if(arguments[0]instanceof gn){var t=arguments[0],e=at.orientationIndex(this.p0,this.p1,t.p0),n=at.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof C){var r=arguments[0];return at.orientationIndex(this.p0,this.p1,r)}},gn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gn.prototype.isVertical=function(){return this.p0.x===this.p1.x},gn.prototype.equals=function(t){if(!(t instanceof gn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gn.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gn.prototype.project=function(){if(arguments[0]instanceof C){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new C(t);var e=this.projectionFactor(t),n=new C;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof gn){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new gn(s,a)}},gn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},gn.prototype.distancePerpendicular=function(t){return at.distancePointLinePerpendicular(t,this.p0,this.p1)},gn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gn.prototype.midPoint=function(){return gn.midPoint(this.p0,this.p1)},gn.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?m.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},gn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=m.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))<r&&(r=i,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);(i=a.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=a);var u=t.closestPoint(this.p1);return(i=u.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=u),n},gn.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},gn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},gn.prototype.getLength=function(){return this.p0.distance(this.p1)},gn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},gn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},gn.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},gn.prototype.lineIntersection=function(t){try{return X.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof U))throw t}return null},gn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},gn.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(i*i+o*o),a=0,u=0;if(0!==e){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");a=e*i/s,u=e*o/s}return new C(n-u,r+a)},gn.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},gn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||m.isNaN(e))&&(e=1),e},gn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gn.prototype.distance=function(){if(arguments[0]instanceof gn){var t=arguments[0];return at.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof C){var e=arguments[0];return at.distancePointLine(e,this.p0,this.p1)}},gn.prototype.pointAlong=function(t){var e=new C;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},gn.prototype.hashCode=function(){var t=m.doubleToLongBits(this.p0.x);t^=31*m.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=m.doubleToLongBits(this.p1.x);return n^=31*m.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},gn.prototype.interfaces_=function(){return[b,e]},gn.prototype.getClass=function(){return gn},gn.midPoint=function(t,e){return new C((t.x+e.x)/2,(t.y+e.y)/2)},yn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gn,yn);var vn=function(){this.tempEnv1=new q,this.tempEnv2=new q,this._overlapSeg1=new gn,this._overlapSeg2=new gn};vn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var _n=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};_n.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_n.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,r),s<n&&this.computeSelect(t,s,n,r)},_n.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},_n.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_n.prototype.setId=function(t){this._id=t},_n.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_n.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new q(t,e)}return this._env},_n.prototype.getEndIndex=function(){return this._end},_n.prototype.getStartIndex=function(){return this._start},_n.prototype.getContext=function(){return this._context},_n.prototype.getId=function(){return this._id},_n.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var s=this._pts[t],a=this._pts[e],u=n._pts[r],l=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,l),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((r+i)/2);t<c&&(r<h&&this.computeOverlapsInternal(t,c,n,r,h,o),h<i&&this.computeOverlapsInternal(t,c,n,h,i,o)),c<e&&(r<h&&this.computeOverlapsInternal(c,e,n,r,h,o),h<i&&this.computeOverlapsInternal(c,e,n,h,i,o))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n};var mn=function(){};mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.getChainStartIndices=function(t){var e=0,n=new Et;n.add(new N(e));do{var r=mn.findChainEnd(t,e);n.add(new N(r)),e=r}while(e<t.length-1);return mn.toIntArray(n)},mn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Ge.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Ge.quadrant(t[i-1],t[i])===r);)i++;return i-1},mn.getChains=function(){if(1===arguments.length){var t=arguments[0];return mn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new Et,i=mn.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new _n(e,i[o],i[o+1],n);r.add(s)}return r}},mn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var xn=function(){};xn.prototype.computeNodes=function(t){},xn.prototype.getNodedSubstrings=function(){},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn};var bn=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};bn.prototype.setSegmentIntersector=function(t){this._segInt=t},bn.prototype.interfaces_=function(){return[xn]},bn.prototype.getClass=function(){return bn};var wn=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new Et,this._index=new sn,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return dn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=mn.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new En(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return En},Object.defineProperties(e,n),e}(bn),En=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],n=arguments[2],r=arguments[3],i=arguments[0].getContext(),o=n.getContext();this._si.processIntersections(i,e,o,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(vn),Cn=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},Sn={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Cn.prototype.getEndCapStyle=function(){return this._endCapStyle},Cn.prototype.isSingleSided=function(){return this._isSingleSided},Cn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Cn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Cn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Cn.JOIN_ROUND&&(this._quadrantSegments=Cn.DEFAULT_QUADRANT_SEGMENTS)},Cn.prototype.getJoinStyle=function(){return this._joinStyle},Cn.prototype.setJoinStyle=function(t){this._joinStyle=t},Cn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Cn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Cn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Cn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Cn.prototype.getMitreLimit=function(){return this._mitreLimit},Cn.prototype.setMitreLimit=function(t){this._mitreLimit=t},Cn.prototype.setSingleSided=function(t){this._isSingleSided=t},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Sn.CAP_ROUND.get=function(){return 1},Sn.CAP_FLAT.get=function(){return 2},Sn.CAP_SQUARE.get=function(){return 3},Sn.JOIN_ROUND.get=function(){return 1},Sn.JOIN_MITRE.get=function(){return 2},Sn.JOIN_BEVEL.get=function(){return 3},Sn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Sn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Sn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Cn,Sn);var Pn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=at.COUNTERCLOCKWISE,this._inputLine=t||null},In={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Pn.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r)},Pn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Pn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Pn.prototype.isShallowConcavity=function(t,e,n,r){return at.computeOrientation(t,e,n)===this._angleOrientation&&at.distancePointLine(e,t,n)<r},Pn.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Pn.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<r;s+=o)if(!this.isShallow(t,e,this._inputLine[s],i))return!1;return!0},Pn.prototype.isConcave=function(t,e,n){return at.computeOrientation(t,e,n)===this._angleOrientation},Pn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=at.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},Pn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Pn.DELETE;)e++;return e},Pn.prototype.isShallow=function(t,e,n,r){return at.distancePointLine(e,t,n)<r},Pn.prototype.collapseLine=function(){for(var t=new St,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Pn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Pn.simplify=function(t,e){return new Pn(t).simplify(e)},In.INIT.get=function(){return 0},In.DELETE.get=function(){return 1},In.KEEP.get=function(){return 1},In.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Pn,In);var Mn=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Et},On={COORDINATE_ARRAY_TYPE:{configurable:!0}};Mn.prototype.getCoordinates=function(){return this._ptList.toArray(Mn.COORDINATE_ARRAY_TYPE)},Mn.prototype.setPrecisionModel=function(t){this._precisionModel=t},Mn.prototype.addPt=function(t){var e=new C(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Mn.prototype.revere=function(){},Mn.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},Mn.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},Mn.prototype.toString=function(){return(new ve).createLineString(this.getCoordinates()).toString()},Mn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new C(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Mn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},On.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Mn,On);var Ln=function(){},Rn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.toDegrees=function(t){return 180*t/Math.PI},Ln.normalize=function(t){for(;t>Math.PI;)t-=Ln.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ln.PI_TIMES_2;return t},Ln.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Ln.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},Ln.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},Ln.interiorAngle=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Math.abs(i-r)},Ln.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ln.PI_TIMES_2;t>=Ln.PI_TIMES_2&&(t=0)}else{for(;t>=Ln.PI_TIMES_2;)t-=Ln.PI_TIMES_2;t<0&&(t=0)}return t},Ln.angleBetween=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Ln.diff(r,i)},Ln.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Ln.toRadians=function(t){return t*Math.PI/180},Ln.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ln.COUNTERCLOCKWISE:n<0?Ln.CLOCKWISE:Ln.NONE},Ln.angleBetweenOriented=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n)-r;return i<=-Math.PI?i+Ln.PI_TIMES_2:i>Math.PI?i-Ln.PI_TIMES_2:i},Rn.PI_TIMES_2.get=function(){return 2*Math.PI},Rn.PI_OVER_2.get=function(){return Math.PI/2},Rn.PI_OVER_4.get=function(){return Math.PI/4},Rn.COUNTERCLOCKWISE.get=function(){return at.COUNTERCLOCKWISE},Rn.CLOCKWISE.get=function(){return at.CLOCKWISE},Rn.NONE.get=function(){return at.COLLINEAR},Object.defineProperties(Ln,Rn);var kn=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new gn,this._seg1=new gn,this._offset0=new gn,this._offset1=new gn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new it,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Cn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Tn={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};kn.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=at.computeOrientation(this._s0,this._s1,this._s2),r=n===at.CLOCKWISE&&this._side===Se.LEFT||n===at.COUNTERCLOCKWISE&&this._side===Se.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},kn.prototype.addLineEndCap=function(t,e){var n=new gn(t,e),r=new gn;this.computeOffsetSegment(n,Se.LEFT,this._distance,r);var i=new gn;this.computeOffsetSegment(n,Se.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case Cn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,at.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Cn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Cn.CAP_SQUARE:var u=new C;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var l=new C(r.p1.x+u.x,r.p1.y+u.y),c=new C(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},kn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},kn.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=X.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof U))throw t;o=new C(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},kn.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,u);r===at.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,r,i),this._segList.addPt(n)},kn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*kn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Cn.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Cn.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},kn.prototype.createSquare=function(t){this._segList.addPt(new C(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new C(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new C(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new C(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},kn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},kn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},kn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},kn.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},kn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=Ln.angle(i,this._seg0.p0),s=Ln.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=Ln.normalize(o+s),u=Ln.normalize(a+Math.PI),l=r*n,c=n-l*Math.abs(Math.sin(s)),h=i.x+l*Math.cos(u),f=i.y+l*Math.sin(u),p=new C(h,f),d=new gn(i,p),g=d.pointAlongOffset(1,c),y=d.pointAlongOffset(1,-c);this._side===Se.LEFT?(this._segList.addPt(g),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(g))},kn.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Se.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),u=i*n*o/a,l=i*n*s/a;r.p0.x=t.p0.x-l,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-l,r.p1.y=t.p1.y+u},kn.prototype.addFilletArc=function(t,e,n,r,i){var o=r===at.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;for(var u=s/a,l=0,c=new C;l<s;){var h=e+o*l;c.x=t.x+i*Math.cos(h),c.y=t.y+i*Math.sin(h),this._segList.addPt(c),l+=u}},kn.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*kn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new C((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new C((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},kn.prototype.createCircle=function(t){var e=new C(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},kn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},kn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Mn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*kn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},kn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Cn.JOIN_BEVEL||this._bufParams.getJoinStyle()===Cn.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,at.CLOCKWISE,this._distance))},kn.prototype.closeRing=function(){this._segList.closeRing()},kn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},Tn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Tn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Tn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Tn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(kn,Tn);var Nn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Nn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Pt.reverse(o),o},Nn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Pn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Se.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Pn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Se.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment(),n.closeRing()},Nn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Se.RIGHT&&(r=-r);var i=Pn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()},Nn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Pn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Se.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Pn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Se.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},Nn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Cn.CAP_ROUND:e.createCircle(t);break;case Cn.CAP_SQUARE:e.createSquare(t)}},Nn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},Nn.prototype.getBufferParameters=function(){return this._bufParams},Nn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Nn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Nn.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Nn.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Pn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Se.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Pn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Se.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment()},Nn.prototype.getSegGen=function(t){return new kn(this._precisionModel,this._bufParams,t)},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn},Nn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new C(t[n]);return e};var An=function(){this._subgraphs=null,this._seg=new gn,this._cga=new at;var t=arguments[0];this._subgraphs=t},Dn={DepthSegment:{configurable:!0}};An.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new Et,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(L(arguments[2],wt)&&arguments[0]instanceof C&&arguments[1]instanceof Ve){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),l=0;l<u.length-1;l++)if(this._seg.p0=u[l],this._seg.p1=u[l+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x||this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||at.computeOrientation(this._seg.p0,this._seg.p1,o)===at.RIGHT)){var c=s.getDepth(Se.LEFT);this._seg.p0.equals(u[l])||(c=s.getDepth(Se.RIGHT));var h=new Fn(this._seg,c);a.add(h)}}else if(L(arguments[2],wt)&&arguments[0]instanceof C&&L(arguments[1],wt))for(var f=arguments[0],p=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&this.findStabbedSegments(f,g,p)}},An.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Qe.min(e)._leftDepth},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},Dn.DepthSegment.get=function(){return Fn},Object.defineProperties(An,Dn);var Fn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gn(t),this._leftDepth=e};Fn.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Fn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Fn.prototype.toString=function(){return this._upwardSeg.toString()},Fn.prototype.interfaces_=function(){return[b]},Fn.prototype.getClass=function(){return Fn};var jn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};jn.prototype.area=function(){return jn.area(this.p0,this.p1,this.p2)},jn.prototype.signedArea=function(){return jn.signedArea(this.p0,this.p1,this.p2)},jn.prototype.interpolateZ=function(t){if(null===t)throw new _("Supplied point is null.");return jn.interpolateZ(t,this.p0,this.p1,this.p2)},jn.prototype.longestSideLength=function(){return jn.longestSideLength(this.p0,this.p1,this.p2)},jn.prototype.isAcute=function(){return jn.isAcute(this.p0,this.p1,this.p2)},jn.prototype.circumcentre=function(){return jn.circumcentre(this.p0,this.p1,this.p2)},jn.prototype.area3D=function(){return jn.area3D(this.p0,this.p1,this.p2)},jn.prototype.centroid=function(){return jn.centroid(this.p0,this.p1,this.p2)},jn.prototype.inCentre=function(){return jn.inCentre(this.p0,this.p1,this.p2)},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},jn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},jn.det=function(t,e,n,r){return t*r-e*n},jn.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,l=r.y-o,c=s*l-a*u,h=t.x-i,f=t.y-o,p=(l*h-a*f)/c,d=(-u*h+s*f)/c;return e.z+p*(n.z-e.z)+d*(r.z-e.z)},jn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s},jn.isAcute=function(t,e,n){return!!Ln.isAcute(t,e,n)&&!!Ln.isAcute(e,n,t)&&!!Ln.isAcute(n,t,e)},jn.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,u=e.y-i,l=2*jn.det(o,s,a,u),c=jn.det(s,o*o+s*s,u,a*a+u*u),h=jn.det(o,o*o+s*s,a,a*a+u*u);return new C(r-c/l,i+h/l)},jn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new X(t.x+n/2,t.y+r/2,1),o=new X(t.x-r+n/2,t.y+n+r/2,1);return new X(i,o)},jn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new C(t.x+i*o,t.y+i*s)},jn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,l=i*u-o*a,c=o*s-r*u,h=r*a-i*s,f=l*l+c*c+h*h;return Math.sqrt(f)/2},jn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new C(r,i)},jn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,u=(r*t.y+i*e.y+o*n.y)/s;return new C(a,u)};var Gn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Et;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,M.EXTERIOR,M.INTERIOR)},Gn.prototype.addPolygon=function(t){var e=this._distance,n=Se.LEFT;this._distance<0&&(e=-this._distance,n=Se.RIGHT);var r=t.getExteriorRing(),i=Pt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,M.EXTERIOR,M.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=Pt.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Se.opposite(n),M.INTERIOR,M.EXTERIOR)}},Gn.prototype.isTriangleErodedCompletely=function(t,e){var n=new jn(t[0],t[1],t[2]),r=n.inCentre();return at.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Gn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Pt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,M.EXTERIOR,M.INTERIOR)},Gn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new dn(t,new ke(0,M.BOUNDARY,e,n));this._curveList.add(r)},Gn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Gn.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=ee.MINIMUM_VALID_SIZE&&at.isCCW(t)&&(o=i,s=r,n=Se.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Qt?this.addPolygon(t):t instanceof Zt?this.addLineString(t):t instanceof Jt?this.addPoint(t):(t instanceof te||t instanceof Ut||t instanceof ne||t instanceof Vt)&&this.addCollection(t)},Gn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},Gn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var Bn=function(){};Bn.prototype.locate=function(t){},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn};var zn=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};zn.prototype.next=function(){if(this._atStart)return this._atStart=!1,zn.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof Vt?(this._subcollectionIterator=new zn(t),this._subcollectionIterator.next()):t},zn.prototype.remove=function(){throw new Error(this.getClass().getName())},zn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},zn.prototype.interfaces_=function(){return[bt]},zn.prototype.getClass=function(){return zn},zn.isAtomic=function(t){return!(t instanceof Vt)};var Vn=function(){this._geom=null;var t=arguments[0];this._geom=t};Vn.prototype.locate=function(t){return Vn.locate(t,this._geom)},Vn.prototype.interfaces_=function(){return[Bn]},Vn.prototype.getClass=function(){return Vn},Vn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&at.isPointInRing(t,e.getCoordinates())},Vn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Vn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(Vn.isPointInRing(t,i))return!1}return!0},Vn.containsPoint=function(t,e){if(e instanceof Qt)return Vn.containsPointInPolygon(t,e);if(e instanceof Vt)for(var n=new zn(e);n.hasNext();){var r=n.next();if(r!==e&&Vn.containsPoint(t,r))return!0}return!1},Vn.locate=function(t,e){return e.isEmpty()?M.EXTERIOR:Vn.containsPoint(t,e)?M.INTERIOR:M.EXTERIOR};var Un=function(){this._edgeMap=new h,this._edgeList=null,this._ptInAreaLocation=[M.NONE,M.NONE]};Un.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Un.prototype.propagateSideLabels=function(t){for(var e=M.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Se.LEFT)!==M.NONE&&(e=r.getLocation(t,Se.LEFT))}if(e===M.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,Se.ON)===M.NONE&&a.setLocation(t,Se.ON,i),a.isArea(t)){var u=a.getLocation(t,Se.LEFT),l=a.getLocation(t,Se.RIGHT);if(l!==M.NONE){if(l!==i)throw new Me("side location conflict",s.getCoordinate());u===M.NONE&&et.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else et.isTrue(a.getLocation(t,Se.LEFT)===M.NONE,"found single null side"),a.setLocation(t,Se.RIGHT,i),a.setLocation(t,Se.LEFT,i)}}},Un.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Un.prototype.print=function(t){W.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},Un.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Un.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Se.LEFT);et.isTrue(r!==M.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();et.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,Se.LEFT),u=s.getLocation(t,Se.RIGHT);if(a===u)return!1;if(u!==i)return!1;i=a}return!0},Un.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},Un.prototype.iterator=function(){return this.getEdges().iterator()},Un.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new Et(this._edgeMap.values())),this._edgeList},Un.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===M.NONE&&(this._ptInAreaLocation[t]=Vn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Un.prototype.toString=function(){var t=new T;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},Un.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},Un.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===M.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel(),u=0;u<2;u++)if(a.isAnyNull(u)){var l=M.NONE;if(e[u])l=M.EXTERIOR;else{var c=s.getCoordinate();l=this.getLocation(u,c,t)}a.setAllLocationsIfNull(u,l)}},Un.prototype.getDegree=function(){return this._edgeMap.size()},Un.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var Wn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Me("no outgoing dirEdge found",this.getCoordinate());et.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),i=n.getQuadrant(),o=r.getQuadrant();return Ge.isNorthern(i)&&Ge.isNorthern(o)?n:Ge.isNorthern(i)||Ge.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){W.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Et;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Se.LEFT),r=t.getDepth(Se.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Me("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a<o;a++){var u=this._edgeList.get(a);u.setEdgeDepths(Se.RIGHT,s),s=u.getDepth(Se.LEFT)}return s}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=this._resultAreaEdgeList.get(i),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=M.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=M.INTERIOR;break}if(r.isInResult()){t=M.EXTERIOR;break}}}if(t===M.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===M.INTERIOR):(s.isInResult()&&(i=M.EXTERIOR),a.isInResult()&&(i=M.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new ke(M.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==M.INTERIOR&&o!==M.BOUNDARY||this._label.setLocation(i,M.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Un),Xn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Fe(t,new Wn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ue),qn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};qn.prototype.compareTo=function(t){var e=t;return qn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},qn.prototype.interfaces_=function(){return[b]},qn.prototype.getClass=function(){return qn},qn.orientation=function(t){return 1===Pt.increasingDirection(t)},qn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,l=r?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(0!==c)return c;var h=(u+=i)===s,f=(l+=o)===a;if(h&&!f)return-1;if(!h&&f)return 1;if(h&&f)return 0}};var Yn=function(){this._edges=new Et,this._ocaMap=new h};Yn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Yn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Yn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Yn.prototype.iterator=function(){return this._edges.iterator()},Yn.prototype.getEdges=function(){return this._edges},Yn.prototype.get=function(t){return this._edges.get(t)},Yn.prototype.findEqualEdge=function(t){var e=new qn(t.getCoordinates());return this._ocaMap.get(e)},Yn.prototype.add=function(t){this._edges.add(t);var e=new qn(t.getCoordinates());this._ocaMap.put(e,t)},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var Hn=function(){};Hn.prototype.processIntersections=function(t,e,n,r){},Hn.prototype.isDone=function(){},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Zn=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Zn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Zn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Zn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Zn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Zn.prototype.getLineIntersector=function(){return this._li},Zn.prototype.hasProperIntersection=function(){return this._hasProper},Zn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Zn.prototype.hasIntersection=function(){return this._hasIntersection},Zn.prototype.isDone=function(){return!1},Zn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Zn.prototype.interfaces_=function(){return[Hn]},Zn.prototype.getClass=function(){return Zn},Zn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Kn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new C(t),this.segmentIndex=e,this.dist=n};Kn.prototype.getSegmentIndex=function(){return this.segmentIndex},Kn.prototype.getCoordinate=function(){return this.coord},Kn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Kn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Kn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Kn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Kn.prototype.getDistance=function(){return this.dist},Kn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Kn.prototype.interfaces_=function(){return[b]},Kn.prototype.getClass=function(){return Kn};var Jn=function(){this._nodeMap=new h,this.edge=null;var t=arguments[0];this.edge=t};Jn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Jn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Jn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},Jn.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Jn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new C(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new nr(o,new ke(this.edge._label))},Jn.prototype.add=function(t,e,n){var r=new Kn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Jn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn};var $n=function(){};$n.prototype.getChainStartIndices=function(t){var e=0,n=new Et;n.add(new N(e));do{var r=this.findChainEnd(t,e);n.add(new N(r)),e=r}while(e<t.length-1);return $n.toIntArray(n)},$n.prototype.findChainEnd=function(t,e){for(var n=Ge.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Ge.quadrant(t[r-1],t[r])===n;)r++;return r-1},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n},$n.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Qn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new q,this.env2=new q;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new $n;this.startIndex=e.getChainStartIndices(this.pts)};Qn.prototype.getCoordinates=function(){return this.pts},Qn.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Qn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Qn.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=arguments[5],c=this.pts[i],h=this.pts[o],f=s.pts[a],p=s.pts[u];if(o-i==1&&u-a==1)return l.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(c,h),this.env2.init(f,p),!this.env1.intersects(this.env2))return null;var d=Math.trunc((i+o)/2),g=Math.trunc((a+u)/2);i<d&&(a<g&&this.computeIntersectsForChain(i,d,s,a,g,l),g<u&&this.computeIntersectsForChain(i,d,s,g,u,l)),d<o&&(a<g&&this.computeIntersectsForChain(d,o,s,a,g,l),g<u&&this.computeIntersectsForChain(d,o,s,g,u,l))}},Qn.prototype.getStartIndexes=function(){return this.startIndex},Qn.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn};var tr=function t(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===tr.NULL_VALUE}},tr.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Se.RIGHT]-this._depth[t][Se.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?M.EXTERIOR:M.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==M.EXTERIOR&&r!==M.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===M.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===M.EXTERIOR?0:t===M.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Jn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,ke.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,s=0;s<this.pts.length;s++)if(this.pts[s].equals2D(n.pts[s])||(r=!1),this.pts[s].equals2D(n.pts[--o])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Qn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new q;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new C(t.getIntersection(r)),o=e,s=t.getEdgeDistance(n,r),a=o+1;if(a<this.pts.length){var u=this.pts[a];i.equals2D(u)&&(o=a,s=0)}this.eiList.add(i,o,s)},e.prototype.toString=function(){var t=new T;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Se.ON),e.getLocation(1,Se.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Se.LEFT),e.getLocation(1,Se.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Se.RIGHT),e.getLocation(1,Se.RIGHT),2))},e}(De),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Yn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new ke(t.getLabel())).flip(),n.merge(r);var i=rr.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new Et,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new An(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new Et,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Le;i.create(r),e.add(i)}}return Qe.sort(e,Qe.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new wn,n=new it;return n.setPrecisionModel(t),e.setSegmentIntersector(new Zn(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Nn(n,this._bufParams),i=new Gn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new We(new Xn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Xe(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=i.getData(),a=new nr(i.getCoordinates(),new ke(s));this.insertUniqueEdge(a)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Se.LEFT),n=t.getLocation(0,Se.RIGHT);return e===M.INTERIOR&&n===M.EXTERIOR?1:e===M.EXTERIOR&&n===M.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new ve,n=new Et;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var ir=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};ir.prototype.rescale=function(){if(L(arguments[0],xt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&W.out.println(n)}},ir.prototype.scale=function(){if(L(arguments[0],xt)){for(var t=arguments[0],e=new Et,n=t.iterator();n.hasNext();){var r=n.next();e.add(new dn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new C(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return Pt.removeRepeatedPoints(o)}},ir.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ir.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ir.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ir.prototype.interfaces_=function(){return[xn]},ir.prototype.getClass=function(){return ir};var or=function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t},sr={fact:{configurable:!0}};or.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new Q("found endpt/interior pt intersection at index "+o+" :pt "+n)},or.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],o=arguments[1],s=i.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var l=0;l<a.length-1;l++)this.checkInteriorIntersections(i,u,o,l);else if(4===arguments.length){var c=arguments[0],h=arguments[1],f=arguments[2],p=arguments[3];if(c===f&&h===p)return null;var d=c.getCoordinates()[h],g=c.getCoordinates()[h+1],y=f.getCoordinates()[p],v=f.getCoordinates()[p+1];if(this._li.computeIntersection(d,g,y,v),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,g)||this.hasInteriorIntersection(this._li,y,v)))throw new Q("found non-noded intersection at "+d+"-"+g+" and "+y+"-"+v)}},or.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},or.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},or.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},or.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Q("found non-noded collapse at "+or.fact.createLineString([t,e,n]))},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},sr.fact.get=function(){return new ve},Object.defineProperties(or,sr);var ar=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new _("Scale factor must be non-zero");1!==e&&(this._pt=new C(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new C,this._p1Scaled=new C),this.initCorners(this._pt)},ur={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ar.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return et.isTrue(!(s&&a),"Found bad envelope test"),a},ar.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new C(this._maxx,this._maxy),this._corner[1]=new C(this._minx,this._maxy),this._corner[2]=new C(this._minx,this._miny),this._corner[3]=new C(this._maxx,this._miny)},ar.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},ar.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ar.prototype.getCoordinate=function(){return this._originalPt},ar.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ar.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=ar.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new q(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},ar.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},ar.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},ar.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},ar.prototype.interfaces_=function(){return[]},ar.prototype.getClass=function(){return ar},ur.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(ar,ur);var lr=function(){this.tempEnv1=new q,this.selectedSegment=new gn};lr.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr};var cr=function(){this._index=null;var t=arguments[0];this._index=t},hr={HotPixelSnapAction:{configurable:!0}};cr.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new fr(e,n,r);return this._index.query(i,{interfaces_:function(){return[Ze]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},hr.HotPixelSnapAction.get=function(){return fr},Object.defineProperties(cr,hr);var fr=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(lr),pr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Et};pr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},pr.prototype.isDone=function(){return!1},pr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},pr.prototype.interfaces_=function(){return[Hn]},pr.prototype.getClass=function(){return pr};var dr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new it,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};dr.prototype.checkCorrectness=function(t){var e=dn.getNodedSubstrings(t),n=new or(e);try{n.checkValid()}catch(t){if(!(t instanceof V))throw t;t.printStackTrace()}},dr.prototype.getNodedSubstrings=function(){return dn.getNodedSubstrings(this._nodedSegStrings)},dr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},dr.prototype.findInteriorIntersections=function(t,e){var n=new pr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},dr.prototype.computeVertexSnaps=function(){if(L(arguments[0],xt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof dn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new ar(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},dr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new wn,this._pointSnapper=new cr(this._noder.getIndex()),this.snapRound(t,this._li)},dr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new ar(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},dr.prototype.interfaces_=function(){return[xn]},dr.prototype.getClass=function(){return dr};var gr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Cn,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},yr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};gr.prototype.bufferFixedPrecision=function(t){var e=new ir(new dr(new pe(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},gr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=gr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Me))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=gr.precisionScaleFactor(this._argGeom,this._distance,n),i=new pe(r);this.bufferFixedPrecision(i)}},gr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===pe.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Q))throw t;this._saveException=t}},gr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr},gr.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new gr(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new gr(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof Cn&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var i=arguments[1];return new gr(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var o=arguments[1],s=arguments[2],a=arguments[3],u=new gr(arguments[0]);return u.setQuadrantSegments(s),u.setEndCapStyle(a),u.getResultGeometry(o)}},gr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=R.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},yr.CAP_ROUND.get=function(){return Cn.CAP_ROUND},yr.CAP_BUTT.get=function(){return Cn.CAP_FLAT},yr.CAP_FLAT.get=function(){return Cn.CAP_FLAT},yr.CAP_SQUARE.get=function(){return Cn.CAP_SQUARE},yr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gr,yr);var vr=function(){this._pt=[new C,new C],this._distance=m.NaN,this._isNull=!0};vr.prototype.getCoordinates=function(){return this._pt},vr.prototype.getCoordinate=function(t){return this._pt[t]},vr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},vr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},vr.prototype.getDistance=function(){return this._distance},vr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr};var _r=function(){};_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.computeDistance=function(){if(arguments[2]instanceof vr&&arguments[0]instanceof Zt&&arguments[1]instanceof C)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new gn,i=0;i<n.length-1;i++){r.setCoordinates(n[i],n[i+1]);var o=r.closestPoint(t);e.setMinimum(o,t)}else if(arguments[2]instanceof vr&&arguments[0]instanceof Qt&&arguments[1]instanceof C){var s=arguments[0],a=arguments[1],u=arguments[2];_r.computeDistance(s.getExteriorRing(),a,u);for(var l=0;l<s.getNumInteriorRing();l++)_r.computeDistance(s.getInteriorRingN(l),a,u)}else if(arguments[2]instanceof vr&&arguments[0]instanceof ct&&arguments[1]instanceof C){var c=arguments[0],h=arguments[1],f=arguments[2];if(c instanceof Zt)_r.computeDistance(c,h,f);else if(c instanceof Qt)_r.computeDistance(c,h,f);else if(c instanceof Vt)for(var p=c,d=0;d<p.getNumGeometries();d++){var g=p.getGeometryN(d);_r.computeDistance(g,h,f)}else f.setMinimum(c.getCoordinate(),h)}else if(arguments[2]instanceof vr&&arguments[0]instanceof gn&&arguments[1]instanceof C){var y=arguments[1],v=arguments[2],_=arguments[0].closestPoint(y);v.setMinimum(_,y)}};var mr=function(t){this._maxPtDist=new vr,this._inputGeom=t||null},xr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};mr.prototype.computeMaxMidpointDistance=function(t){var e=new wr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.computeMaxVertexDistance=function(t){var e=new br(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},mr.prototype.getDistancePoints=function(){return this._maxPtDist},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},xr.MaxPointDistanceFilter.get=function(){return br},xr.MaxMidpointDistanceFilter.get=function(){return wr},Object.defineProperties(mr,xr);var br=function(t){this._maxPtDist=new vr,this._minPtDist=new vr,this._geom=t||null};br.prototype.filter=function(t){this._minPtDist.initialize(),_r.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},br.prototype.getMaxPointDistance=function(){return this._maxPtDist},br.prototype.interfaces_=function(){return[pt]},br.prototype.getClass=function(){return br};var wr=function(t){this._maxPtDist=new vr,this._minPtDist=new vr,this._geom=t||null};wr.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new C((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),_r.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},wr.prototype.isDone=function(){return!1},wr.prototype.isGeometryChanged=function(){return!1},wr.prototype.getMaxPointDistance=function(){return this._maxPtDist},wr.prototype.interfaces_=function(){return[zt]},wr.prototype.getClass=function(){return wr};var Er=function(t){this._comps=t||null};Er.prototype.filter=function(t){t instanceof Qt&&this._comps.add(t)},Er.prototype.interfaces_=function(){return[Bt]},Er.prototype.getClass=function(){return Er},Er.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return Er.getPolygons(t,new Et)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Qt?n.add(e):e instanceof Vt&&e.apply(new Er(n)),n}};var Cr=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Cr.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Zt&&this._lines.add(t)},Cr.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Cr.prototype.interfaces_=function(){return[lt]},Cr.prototype.getClass=function(){return Cr},Cr.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Cr.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Cr.getLines(e,n))}},Cr.getLines=function(){if(1===arguments.length){var t=arguments[0];return Cr.getLines(t,!1)}if(2===arguments.length){if(L(arguments[0],xt)&&L(arguments[1],xt)){for(var e=arguments[1],n=arguments[0].iterator();n.hasNext();){var r=n.next();Cr.getLines(r,e)}return e}if(arguments[0]instanceof ct&&"boolean"==typeof arguments[1]){var i=arguments[0],o=arguments[1],s=new Et;return i.apply(new Cr(s,o)),s}if(arguments[0]instanceof ct&&L(arguments[1],xt)){var a=arguments[0],u=arguments[1];return a instanceof Zt?u.add(a):a.apply(new Cr(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&L(arguments[0],xt)&&L(arguments[1],xt)){for(var l=arguments[1],c=arguments[2],h=arguments[0].iterator();h.hasNext();){var f=h.next();Cr.getLines(f,l,c)}return l}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ct&&L(arguments[1],xt)){var p=arguments[1],d=arguments[2];return arguments[0].apply(new Cr(p,d)),p}}};var Sr=function(){if(this._boundaryRule=dt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new _("Rule must be non-null");this._boundaryRule=t}};Sr.prototype.locateInternal=function(){if(arguments[0]instanceof C&&arguments[1]instanceof Qt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return M.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===M.EXTERIOR)return M.EXTERIOR;if(r===M.BOUNDARY)return M.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===M.INTERIOR)return M.EXTERIOR;if(s===M.BOUNDARY)return M.BOUNDARY}return M.INTERIOR}if(arguments[0]instanceof C&&arguments[1]instanceof Zt){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return M.EXTERIOR;var l=u.getCoordinates();return u.isClosed()||!a.equals(l[0])&&!a.equals(l[l.length-1])?at.isOnLine(a,l)?M.INTERIOR:M.EXTERIOR:M.BOUNDARY}if(arguments[0]instanceof C&&arguments[1]instanceof Jt){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?M.INTERIOR:M.EXTERIOR}},Sr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?at.locatePointInRing(t,e.getCoordinates()):M.EXTERIOR},Sr.prototype.intersects=function(t,e){return this.locate(t,e)!==M.EXTERIOR},Sr.prototype.updateLocationInfo=function(t){t===M.INTERIOR&&(this._isIn=!0),t===M.BOUNDARY&&this._numBoundaries++},Sr.prototype.computeLocation=function(t,e){if(e instanceof Jt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Zt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Qt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ut)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof ne)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);this.updateLocationInfo(this.locateInternal(t,a))}else if(e instanceof Vt)for(var u=new zn(e);u.hasNext();){var l=u.next();l!==e&&this.computeLocation(t,l)}},Sr.prototype.locate=function(t,e){return e.isEmpty()?M.EXTERIOR:e instanceof Zt||e instanceof Qt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?M.BOUNDARY:this._numBoundaries>0||this._isIn?M.INTERIOR:M.EXTERIOR)},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr};var Pr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._component=e,this._segIndex=n,this._pt=r}},Ir={INSIDE_AREA:{configurable:!0}};Pr.prototype.isInsideArea=function(){return this._segIndex===Pr.INSIDE_AREA},Pr.prototype.getCoordinate=function(){return this._pt},Pr.prototype.getGeometryComponent=function(){return this._component},Pr.prototype.getSegmentIndex=function(){return this._segIndex},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},Ir.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Pr,Ir);var Mr=function(t){this._pts=t||null};Mr.prototype.filter=function(t){t instanceof Jt&&this._pts.add(t)},Mr.prototype.interfaces_=function(){return[Bt]},Mr.prototype.getClass=function(){return Mr},Mr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Jt?Qe.singletonList(t):Mr.getPoints(t,new Et)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Jt?n.add(e):e instanceof Vt&&e.apply(new Mr(n)),n}};var Or=function(){this._locations=null;var t=arguments[0];this._locations=t};Or.prototype.filter=function(t){(t instanceof Jt||t instanceof Zt||t instanceof Qt)&&this._locations.add(new Pr(t,0,t.getCoordinate()))},Or.prototype.interfaces_=function(){return[Bt]},Or.prototype.getClass=function(){return Or},Or.getLocations=function(t){var e=new Et;return t.apply(new Or(e)),e};var Lr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Sr,this._minDistanceLocation=null,this._minDistance=m.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Lr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=Er.getPolygons(this._geom[e]);if(i.size()>0){var o=Or.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&L(arguments[0],wt)&&L(arguments[1],wt)){for(var s=arguments[0],a=arguments[1],u=arguments[2],l=0;l<s.size();l++)for(var c=s.get(l),h=0;h<a.size();h++)if(this.computeContainmentDistance(c,a.get(h),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Pr&&arguments[1]instanceof Qt){var f=arguments[0],p=arguments[1],d=arguments[2],g=f.getCoordinate();if(M.EXTERIOR!==this._ptLocator.locate(g,p))return this._minDistance=0,d[0]=f,d[1]=new Pr(p,g),null}},Lr.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Cr.getLines(this._geom[0]),n=Cr.getLines(this._geom[1]),r=Mr.getPoints(this._geom[0]),i=Mr.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Lr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Lr.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Lr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Lr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Zt&&arguments[1]instanceof Jt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var s=at.distancePointLine(i,r[o],r[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new gn(r[o],r[o+1]).closestPoint(i);n[0]=new Pr(t,o,a),n[1]=new Pr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Zt&&arguments[1]instanceof Zt){var u=arguments[0],l=arguments[1],c=arguments[2];if(u.getEnvelopeInternal().distance(l.getEnvelopeInternal())>this._minDistance)return null;for(var h=u.getCoordinates(),f=l.getCoordinates(),p=0;p<h.length-1;p++)for(var d=0;d<f.length-1;d++){var g=at.distanceLineLine(h[p],h[p+1],f[d],f[d+1]);if(g<this._minDistance){this._minDistance=g;var y=new gn(h[p],h[p+1]),v=new gn(f[d],f[d+1]),_=y.closestPoints(v);c[0]=new Pr(u,p,_[0]),c[1]=new Pr(l,d,_[1])}if(this._minDistance<=this._terminateDistance)return null}}},Lr.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new Pr(i,0,i.getCoordinate()),n[1]=new Pr(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Lr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.distance=function(t,e){return new Lr(t,e).distance()},Lr.isWithinDistance=function(t,e,n){return new Lr(t,e,n).distance()<=n},Lr.nearestPoints=function(t,e){return new Lr(t,e).nearestPoints()};var Rr=function(){this._pt=[new C,new C],this._distance=m.NaN,this._isNull=!0};Rr.prototype.getCoordinates=function(){return this._pt},Rr.prototype.getCoordinate=function(t){return this._pt[t]},Rr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Rr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Rr.prototype.toString=function(){return $.toLineString(this._pt[0],this._pt[1])},Rr.prototype.getDistance=function(){return this._distance},Rr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr};var kr=function(){};kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr},kr.computeDistance=function(){if(arguments[2]instanceof Rr&&arguments[0]instanceof Zt&&arguments[1]instanceof C)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new gn,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof Qt&&arguments[1]instanceof C){var a=arguments[0],u=arguments[1],l=arguments[2];kr.computeDistance(a.getExteriorRing(),u,l);for(var c=0;c<a.getNumInteriorRing();c++)kr.computeDistance(a.getInteriorRingN(c),u,l)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof ct&&arguments[1]instanceof C){var h=arguments[0],f=arguments[1],p=arguments[2];if(h instanceof Zt)kr.computeDistance(h,f,p);else if(h instanceof Qt)kr.computeDistance(h,f,p);else if(h instanceof Vt)for(var d=h,g=0;g<d.getNumGeometries();g++){var y=d.getGeometryN(g);kr.computeDistance(y,f,p)}else p.setMinimum(h.getCoordinate(),f)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof gn&&arguments[1]instanceof C){var v=arguments[1],_=arguments[2],m=arguments[0].closestPoint(v);_.setMinimum(m,v)}};var Tr=function(){this._g0=null,this._g1=null,this._ptDist=new Rr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Nr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Tr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Tr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Tr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Tr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Tr.prototype.computeOrientedDistance=function(t,e,n){var r=new Ar(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Dr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Tr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.distance=function(){if(2===arguments.length)return new Tr(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Tr(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Nr.MaxPointDistanceFilter.get=function(){return Ar},Nr.MaxDensifiedByFractionDistanceFilter.get=function(){return Dr},Object.defineProperties(Tr,Nr);var Ar=function(){this._maxPtDist=new Rr,this._minPtDist=new Rr,this._euclideanDist=new kr,this._geom=null;var t=arguments[0];this._geom=t};Ar.prototype.filter=function(t){this._minPtDist.initialize(),kr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ar.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ar.prototype.interfaces_=function(){return[pt]},Ar.prototype.getClass=function(){return Ar};var Dr=function(){this._maxPtDist=new Rr,this._minPtDist=new Rr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Dr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=n.x+s*i,u=n.y+s*o,l=new C(a,u);this._minPtDist.initialize(),kr.computeDistance(this._geom,l,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Dr.prototype.isDone=function(){return!1},Dr.prototype.isGeometryChanged=function(){return!1},Dr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Dr.prototype.interfaces_=function(){return[zt]},Dr.prototype.getClass=function(){return Dr};var Fr=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},jr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Fr.prototype.checkMaximumDistance=function(t,e,n){var r=new Tr(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+$.toLineString(i[0],i[1])+")"}},Fr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Fr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Fr.VERBOSE&&W.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Fr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Qt||this._input instanceof ne||this._input instanceof Vt))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Fr.prototype.getErrorIndicator=function(){return this._errorIndicator},Fr.prototype.checkMinimumDistance=function(t,e,n){var r=new Lr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+$.toLineString(i[0],i[1])+" )"}},Fr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Fr.prototype.getErrorLocation=function(){return this._errorLocation},Fr.prototype.getPolygonLines=function(t){for(var e=new Et,n=new Cr(e),r=Er.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},Fr.prototype.getErrorMessage=function(){return this._errMsg},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr},jr.VERBOSE.get=function(){return!1},jr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Fr,jr);var Gr=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Br={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gr.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Gr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new q(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new q(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Gr.prototype.checkDistance=function(){var t=new Fr(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Gr.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Gr.prototype.checkPolygonal=function(){this._result instanceof Qt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gr.prototype.getErrorIndicator=function(){return this._errorIndicator},Gr.prototype.getErrorLocation=function(){return this._errorLocation},Gr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gr.prototype.report=function(t){if(!Gr.VERBOSE)return null;W.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gr.prototype.getErrorMessage=function(){return this._errorMsg},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.isValidMsg=function(t,e,n){var r=new Gr(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gr.isValid=function(t,e,n){return!!new Gr(t,e,n).isValid()},Br.VERBOSE.get=function(){return!1},Br.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,Br);var zr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};zr.prototype.getCoordinates=function(){return this._pts},zr.prototype.size=function(){return this._pts.length},zr.prototype.getCoordinate=function(t){return this._pts[t]},zr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},zr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:hn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},zr.prototype.setData=function(t){this._data=t},zr.prototype.getData=function(){return this._data},zr.prototype.toString=function(){return $.toLineString(new ue(this._pts))},zr.prototype.interfaces_=function(){return[fn]},zr.prototype.getClass=function(){return zr};var Vr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Et,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Vr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Vr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Vr.prototype.getIntersectionSegments=function(){return this._intSegments},Vr.prototype.count=function(){return this._intersectionCount},Vr.prototype.getIntersections=function(){return this._intersections},Vr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Vr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Vr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Vr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Vr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Vr.prototype.interfaces_=function(){return[Hn]},Vr.prototype.getClass=function(){return Vr},Vr.createAllIntersectionsFinder=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e},Vr.createAnyIntersectionFinder=function(t){return new Vr(t)},Vr.createIntersectionCounter=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Ur=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Ur.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Ur.prototype.getIntersections=function(){return this._segInt.getIntersections()},Ur.prototype.isValid=function(){return this.execute(),this._isValid},Ur.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ur.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Vr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new wn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Ur.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Me(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Ur.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+$.toLineString(t[0],t[1])+" and "+$.toLineString(t[2],t[3])},Ur.prototype.interfaces_=function(){return[]},Ur.prototype.getClass=function(){return Ur},Ur.computeIntersections=function(t){var e=new Ur(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Wr=function t(){this._nv=null;var e=arguments[0];this._nv=new Ur(t.toSegmentStrings(e))};Wr.prototype.checkValid=function(){this._nv.checkValid()},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Wr.toSegmentStrings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next();e.add(new zr(r.getCoordinates(),r))}return e},Wr.checkValid=function(t){new Wr(t).checkValid()};var Xr=function(t){this._mapOp=t};Xr.prototype.map=function(t){for(var e=new Et,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(ve.toGeometryArray(e))},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(t,e){return new Xr(e).map(t)};var qr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Et,this._resultLineList=new Et;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};qr.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},qr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},qr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},qr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Pi.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},qr.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},qr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},qr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},qr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Pi.isResultOfOp(r,e)&&e===Pi.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr};var Yr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Et;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Yr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Yr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==Pi.INTERSECTION)){var r=n.getLabel();Pi.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Yr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr};var Hr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Hr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var i=new Et,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof ee||(n=!1),i.add(s))}if(n)return this._factory.createPolygon(r,i.toArray([]));var a=new Et;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Hr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Hr.prototype.getInputGeometry=function(){return this._inputGeom},Hr.prototype.transformMultiLineString=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Hr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformMultiPoint=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformMultiPolygon=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.copy=function(t){return t.copy()},Hr.prototype.transformGeometryCollection=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(ve.toGeometryArray(n)):this._factory.buildGeometry(n)},Hr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Jt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof Zt)return this.transformLineString(t,null);if(t instanceof Ut)return this.transformMultiLineString(t,null);if(t instanceof Qt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof Vt)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},Hr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Zr=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Zt&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=r}};Zr.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new C(o)),0===r&&this._isClosed&&t.set(t.size()-1,new C(o)))}},Zr.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},Zr.prototype.snapTo=function(t){var e=new St(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Zr.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new C(i),!1)}},Zr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=m.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Zr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Kr=function(t){this._srcGeom=t||null},Jr={SNAP_PRECISION_FACTOR:{configurable:!0}};Kr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new $r(e,n).transform(this._srcGeom)},Kr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new $r(t,n,!0).transform(this._srcGeom),i=r;return e&&L(i,$t)&&(i=r.buffer(0)),i},Kr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Kr.prototype.extractTargetCoordinates=function(t){for(var e=new p,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Kr.prototype.computeMinimumSegmentLength=function(t){for(var e=m.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Kr(t);r[0]=i.snapTo(e,n);var o=new Kr(e);return r[1]=o.snapTo(r[0],n),r},Kr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Kr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===pe.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Kr.computeOverlaySnapTolerance(i),Kr.computeOverlaySnapTolerance(o))}},Kr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Kr.SNAP_PRECISION_FACTOR},Kr.snapToSelf=function(t,e,n){return new Kr(t).snapToSelf(e,n)},Jr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Kr,Jr);var $r=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Zr(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Hr),Qr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Qr.prototype.getCommon=function(){return m.longBitsToDouble(this._commonBits)},Qr.prototype.add=function(t){var e=m.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Qr.signExpBits(this._commonBits),this._isFirst=!1,null):Qr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Qr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Qr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Qr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=m.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+m.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr},Qr.getBit=function(t,e){return t&1<<e?1:0},Qr.signExpBits=function(t){return t>>52},Qr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Qr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Qr.getBit(t,r)!==Qr.getBit(e,r))return n;n++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ni},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ri(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new C(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ri(e);return t.apply(n),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ni},ei.Translater.get=function(){return ri},Object.defineProperties(ti,ei);var ni=function(){this._commonBitsX=new Qr,this._commonBitsY=new Qr};ni.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ni.prototype.getCommonCoordinate=function(){return new C(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ni.prototype.interfaces_=function(){return[pt]},ni.prototype.getClass=function(){return ni};var ri=function(){this.trans=null;var t=arguments[0];this.trans=t};ri.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},ri.prototype.isDone=function(){return!1},ri.prototype.isGeometryChanged=function(){return!0},ri.prototype.interfaces_=function(){return[zt]},ri.prototype.getClass=function(){return ri};var ii=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};ii.prototype.selfSnap=function(t){return new Kr(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Pi.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||W.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=Kr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return Kr.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,n){return new ii(t,e).getResultGeometry(n)},ii.union=function(t,e){return ii.overlayOp(t,e,Pi.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Pi.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Pi.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Pi.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Pi.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Q))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Q?r:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,n){return new oi(t,e).getResultGeometry(n)},oi.union=function(t,e){return oi.overlayOp(t,e,Pi.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Pi.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Pi.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Pi.DIFFERENCE)};var si=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};si.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si};var ai=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};ai.prototype.isDelete=function(){return this._eventType===ai.DELETE},ai.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},ai.prototype.getObject=function(){return this._obj},ai.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},ai.prototype.getInsertEvent=function(){return this._insertEvent},ai.prototype.isInsert=function(){return this._eventType===ai.INSERT},ai.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},ai.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},ai.prototype.interfaces_=function(){return[b]},ai.prototype.getClass=function(){return ai},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(ai,ui);var li=function(){};li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li};var ci=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};ci.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(ci.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},ci.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ci.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ci.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ci.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},ci.prototype.hasProperIntersection=function(){return this._hasProper},ci.prototype.hasIntersection=function(){return this._hasIntersection},ci.prototype.isDone=function(){return this._isDone},ci.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},ci.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ci.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var hi=function(t){function e(){t.call(this),this.events=new Et,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Qe.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof ci&&L(arguments[0],wt)&&L(arguments[1],wt)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&L(arguments[0],wt)&&arguments[1]instanceof ci){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new si(n,i),s=new ai(e,n.getMinX(i),o);this.events.add(s),this.events.add(new ai(n.getMaxX(i),s))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(i.computeIntersections(a,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();){var i=r.next();this.addEdge(i,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(li),fi=function(){this._min=m.POSITIVE_INFINITY,this._max=m.NEGATIVE_INFINITY},pi={NodeComparator:{configurable:!0}};fi.prototype.getMin=function(){return this._min},fi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},fi.prototype.getMax=function(){return this._max},fi.prototype.toString=function(){return $.toLineString(new C(this._min,0),new C(this._max,0))},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},pi.NodeComparator.get=function(){return di},Object.defineProperties(fi,pi);var di=function(){};di.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},di.prototype.interfaces_=function(){return[E]},di.prototype.getClass=function(){return di};var gi=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fi),yi=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fi),vi=function(){this._leaves=new Et,this._root=null,this._level=0};vi.prototype.buildTree=function(){Qe.sort(this._leaves,new fi.NodeComparator);for(var t=this._leaves,e=null,n=new Et;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},vi.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new gi(t,e,n))},vi.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},vi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},vi.prototype.printNode=function(t){W.out.println($.toLineString(new C(t._min,this._level),new C(t._max,this._level)))},vi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},vi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new yi(t.get(n),t.get(n+1));e.add(i)}}},vi.prototype.interfaces_=function(){return[]},vi.prototype.getClass=function(){return vi};var _i=function(){this._items=new Et};_i.prototype.visitItem=function(t){this._items.add(t)},_i.prototype.getItems=function(){return this._items},_i.prototype.interfaces_=function(){return[Ze]},_i.prototype.getClass=function(){return _i};var mi=function(){this._index=null;var t=arguments[0];if(!L(t,$t))throw new _("Argument must be Polygonal");this._index=new wi(t)},xi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};mi.prototype.locate=function(t){var e=new st(t),n=new bi(e);return this._index.query(t.y,t.y,n),e.getLocation()},mi.prototype.interfaces_=function(){return[Bn]},mi.prototype.getClass=function(){return mi},xi.SegmentVisitor.get=function(){return bi},xi.IntervalIndexedGeometry.get=function(){return wi},Object.defineProperties(mi,xi);var bi=function(){this._counter=null;var t=arguments[0];this._counter=t};bi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},bi.prototype.interfaces_=function(){return[Ze]},bi.prototype.getClass=function(){return bi};var wi=function(){this._index=new vi;var t=arguments[0];this.init(t)};wi.prototype.init=function(t){for(var e=Cr.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},wi.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new gn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},wi.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new _i;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var Ei=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new fe,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Sr,2===arguments.length){var e=arguments[0],n=arguments[1],r=dt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;M.NONE,r.getLocation(t,Se.ON)===M.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[1],r=arguments[2],i=new ci(arguments[0],!0,!1);i.setIsDoneIfProperInt(r);var o=this.createEdgeSetIntersector(),s=this._parentGeom instanceof ee||this._parentGeom instanceof Qt||this._parentGeom instanceof ne,a=n||!s;return o.computeIntersections(this._edges,i,a),this.addSelfIntersectionNodes(this._argIndex),i}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new ci(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Jt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,M.INTERIOR)}else if(arguments[0]instanceof C){var e=arguments[0];this.insertPoint(this._argIndex,e,M.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),M.EXTERIOR,M.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,M.INTERIOR,M.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],M.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],M.BOUNDARY)},e.prototype.addLineString=function(t){var e=Pt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new ke(this._argIndex,M.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===M.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=Pt.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;at.isCCW(r)&&(i=n,o=e);var s=new nr(r,new ke(this._argIndex,M.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],M.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new ke(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new hi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Qt)this.addPolygon(e);else if(e instanceof Zt)this.addLineString(e);else if(e instanceof Jt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Ut)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof Vt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return L(this._parentGeom,$t)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new mi(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?M.BOUNDARY:M.INTERIOR},e}(We),Ci=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ei(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=dt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,e,r),this._arg[1]=new Ei(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,i,s),this._arg[1]=new Ei(1,o,s)}};Ci.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ci.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Si=function(){};Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},Si.map=function(){if(arguments[0]instanceof ct&&L(arguments[1],Si.MapOp)){for(var t=arguments[0],e=arguments[1],n=new Et,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(L(arguments[0],xt)&&L(arguments[1],Si.MapOp)){for(var o=arguments[0],s=arguments[1],a=new Et,u=o.iterator();u.hasNext();){var l=u.next(),c=s.map(l);null!==c&&a.add(c)}return a}},Si.MapOp=function(){};var Pi=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Sr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Yn,this._resultPolyList=new Et,this._resultLineList=new Et,this._resultPointList=new Et,this._graph=new We(new Xn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new ke(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new Et;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==M.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new Et,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new Et;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Wr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Xe(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new qr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Yr(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Se.RIGHT),i.getLocation(1,Se.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(et.isTrue(!r.isNull(i,Se.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Se.LEFT,r.getLocation(i,Se.LEFT)),et.isTrue(!r.isNull(i,Se.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Se.RIGHT,r.getLocation(i,Se.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ci);Pi.overlayOp=function(t,e,n){return new Pi(t,e).getResultGeometry(n)},Pi.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Pi.createEmptyResult(Pi.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Xr.map(t,{interfaces_:function(){return[Si.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Pi.INTERSECTION)},Pi.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Pi.createEmptyResult(Pi.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Pi.SYMDIFFERENCE)},Pi.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Pi.INTERSECTION:o=Math.min(r,i);break;case Pi.UNION:o=Math.max(r,i);break;case Pi.DIFFERENCE:o=r;break;case Pi.SYMDIFFERENCE:o=Math.max(r,i)}return o},Pi.createEmptyResult=function(t,e,n,r){var i=null;switch(Pi.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Pi.difference=function(t,e){return t.isEmpty()?Pi.createEmptyResult(Pi.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Pi.DIFFERENCE))},Pi.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Pi.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===M.BOUNDARY&&(i=M.INTERIOR),o===M.BOUNDARY&&(o=M.INTERIOR),s){case Pi.INTERSECTION:return i===M.INTERIOR&&o===M.INTERIOR;case Pi.UNION:return i===M.INTERIOR||o===M.INTERIOR;case Pi.DIFFERENCE:return i===M.INTERIOR&&o!==M.INTERIOR;case Pi.SYMDIFFERENCE:return i===M.INTERIOR&&o!==M.INTERIOR||i!==M.INTERIOR&&o===M.INTERIOR}return!1}},Pi.INTERSECTION=1,Pi.UNION=2,Pi.DIFFERENCE=3,Pi.SYMDIFFERENCE=4;var Ii=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Sr,this._seg=new gn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Ii.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Ii.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?M.BOUNDARY:this._ptLocator.locate(t,this._g)},Ii.prototype.extractLinework=function(t){var e=new Mi;t.apply(e);var n=e.getLinework(),r=ve.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var Mi=function(){this._linework=null,this._linework=new Et};Mi.prototype.getLinework=function(){return this._linework},Mi.prototype.filter=function(t){if(t instanceof Qt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Mi.prototype.interfaces_=function(){return[Bt]},Mi.prototype.getClass=function(){return Mi};var Oi=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Oi.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Oi.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Oi.prototype.getPoints=function(t){for(var e=new Et,n=Cr.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Oi.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,u=n*o/s,l=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var h=new C(l-u,c+a);r.add(h)}if(this._doRight){var f=new C(l+u,c-a);r.add(f)}},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi};var Li=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new Et;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Ii(this._geom[0],this._boundaryDistanceTolerance),new Ii(this._geom[1],this._boundaryDistanceTolerance),new Ii(this._geom[2],this._boundaryDistanceTolerance)]},Ri={TOLERANCE:{configurable:!0}};Li.prototype.reportResult=function(t,e,n){W.out.println("Overlay result invalid - A:"+M.toLocationSymbol(e[0])+" B:"+M.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+M.toLocationSymbol(e[2]))},Li.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Li.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Li.hasLocation(this._location,M.BOUNDARY)||this.isValidResult(r,this._location)}},Li.prototype.addTestPts=function(t){var e=new Oi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Li.prototype.isValidResult=function(t,e){var n=Pi.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===M.INTERIOR);return r||this.reportResult(t,e,n),r},Li.prototype.getInvalidLocation=function(){return this._invalidLocation},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Li.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Kr.computeSizeBasedSnapTolerance(t),Kr.computeSizeBasedSnapTolerance(e))},Li.isValid=function(t,e,n,r){return new Li(t,e,r).isValid(n)},Ri.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Li,Ri);var ki=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};ki.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},ki.prototype.combine=function(){for(var t=new Et,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki},ki.combine=function(){if(1===arguments.length)return new ki(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new ki(ki.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];return new ki(ki.createList(n,r,i)).combine()}},ki.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},ki.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Et;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new Et;return s.add(r),s.add(i),s.add(o),s}};var Ti=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new Et)},Ni={STRTREE_NODE_CAPACITY:{configurable:!0}};Ti.prototype.reduceToGeometries=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next(),i=null;L(r,wt)?i=this.unionTree(r):r instanceof ct&&(i=r),e.add(i)}return e},Ti.prototype.extractByEnvelope=function(t,e,n){for(var r=new Et,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Ti.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return ki.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Ti.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new sn(Ti.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},Ti.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Ti.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Ti.getGeometry(e,n),Ti.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}},Ti.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Ti.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Ti.prototype.unionActual=function(t,e){return Ti.restrictToPolygons(t.union(e))},Ti.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Ti.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new Et,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),ki.combine(r)},Ti.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.restrictToPolygons=function(t){if(L(t,$t))return t;var e=Er.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(ve.toPolygonArray(e))},Ti.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Ti.union=function(t){return new Ti(t).union()},Ni.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ti,Ni);var Ai=function(){};Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Pi.createEmptyResult(Pi.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Pi.UNION)},t.GeoJSONReader=Ee,t.GeoJSONWriter=Ce,t.OverlayOp=Pi,t.UnionOp=Ai,t.BufferOp=gr,Object.defineProperty(t,"__esModule",{value:!0})}(e)},3123:function(t,e,n){"use strict";t.exports=n.p+"assets/92c3faa3acd2054d984b.png"},891:function(t,e,n){"use strict";t.exports=n.p+"assets/213070deae5738d6509b.png"},2494:function(t,e,n){"use strict";var r=n(3027);function i(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const n=[1/0,1/0,-1/0,-1/0];return r.coordEach.call(void 0,t,t=>{n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]<t[0]&&(n[2]=t[0]),n[3]<t[1]&&(n[3]=t[1])}),n}var o=i;e.Ay=o},8905:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=6371008.8,r={centimeters:637100880,centimetres:637100880,degrees:360/(2*Math.PI),feet:20902260.511392,inches:39.37*n,kilometers:6371.0088,kilometres:6371.0088,meters:n,metres:n,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:n/1852,radians:1,yards:6967335.223679999},i={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:2.9155334959812285e-7,millimeters:1e6,millimetres:1e6,yards:1.195990046};function o(t,e,n={}){const r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function s(t,e,n={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!y(t[0])||!y(t[1]))throw new Error("coordinates must contain numbers");return o({type:"Point",coordinates:t},e,n)}function a(t,e,n={}){for(const e of t){if(e.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(e[e.length-1].length!==e[0].length)throw new Error("First and last Position are not equivalent.");for(let t=0;t<e[e.length-1].length;t++)if(e[e.length-1][t]!==e[0][t])throw new Error("First and last Position are not equivalent.")}return o({type:"Polygon",coordinates:t},e,n)}function u(t,e,n={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return o({type:"LineString",coordinates:t},e,n)}function l(t,e={}){const n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function c(t,e,n={}){return o({type:"MultiLineString",coordinates:t},e,n)}function h(t,e,n={}){return o({type:"MultiPoint",coordinates:t},e,n)}function f(t,e,n={}){return o({type:"MultiPolygon",coordinates:t},e,n)}function p(t,e="kilometers"){const n=r[e];if(!n)throw new Error(e+" units is invalid");return t*n}function d(t,e="kilometers"){const n=r[e];if(!n)throw new Error(e+" units is invalid");return t/n}function g(t){return 180*(t%(2*Math.PI))/Math.PI}function y(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}e.areaFactors=i,e.azimuthToBearing=function(t){return(t%=360)>180?t-360:t<-180?t+360:t},e.bearingToAzimuth=function(t){let e=t%360;return e<0&&(e+=360),e},e.convertArea=function(t,e="meters",n="kilometers"){if(!(t>=0))throw new Error("area must be a positive number");const r=i[e];if(!r)throw new Error("invalid original units");const o=i[n];if(!o)throw new Error("invalid final units");return t/r*o},e.convertLength=function(t,e="kilometers",n="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return p(d(t,e),n)},e.degreesToRadians=function(t){return t%360*Math.PI/180},e.earthRadius=n,e.factors=r,e.feature=o,e.featureCollection=l,e.geometry=function(t,e,n={}){switch(t){case"Point":return s(e).geometry;case"LineString":return u(e).geometry;case"Polygon":return a(e).geometry;case"MultiPoint":return h(e).geometry;case"MultiLineString":return c(e).geometry;case"MultiPolygon":return f(e).geometry;default:throw new Error(t+" is invalid")}},e.geometryCollection=function(t,e,n={}){return o({type:"GeometryCollection",geometries:t},e,n)},e.isNumber=y,e.isObject=function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)},e.lengthToDegrees=function(t,e){return g(d(t,e))},e.lengthToRadians=d,e.lineString=u,e.lineStrings=function(t,e,n={}){return l(t.map(t=>u(t,e)),n)},e.multiLineString=c,e.multiPoint=h,e.multiPolygon=f,e.point=s,e.points=function(t,e,n={}){return l(t.map(t=>s(t,e)),n)},e.polygon=a,e.polygons=function(t,e,n={}){return l(t.map(t=>a(t,e)),n)},e.radiansToDegrees=g,e.radiansToLength=p,e.round=function(t,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const n=Math.pow(10,e||0);return Math.round(t*n)/n},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(t=>{if(!y(t))throw new Error("bbox must only contain numbers")})},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},3027:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8905);function i(t,e,n){if(null!==t)for(var r,o,s,a,u,l,c,h,f=0,p=0,d=t.type,g="FeatureCollection"===d,y="Feature"===d,v=g?t.features.length:1,_=0;_<v;_++){u=(h=!!(c=g?t.features[_].geometry:y?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var m=0;m<u;m++){var x=0,b=0;if(null!==(a=h?c.geometries[m]:c)){l=a.coordinates;var w=a.type;switch(f=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(l,p,_,x,b))return!1;p++,x++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===e(l[r],p,_,x,b))return!1;p++,"MultiPoint"===w&&x++}"LineString"===w&&x++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(o=0;o<l[r].length-f;o++){if(!1===e(l[r][o],p,_,x,b))return!1;p++}"MultiLineString"===w&&x++,"Polygon"===w&&b++}"Polygon"===w&&x++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,o=0;o<l[r].length;o++){for(s=0;s<l[r][o].length-f;s++){if(!1===e(l[r][o][s],p,_,x,b))return!1;p++}b++}x++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===i(a.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function s(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function a(t,e){var n,r,i,o,s,a,u,l,c,h,f=0,p="FeatureCollection"===t.type,d="Feature"===t.type,g=p?t.features.length:1;for(n=0;n<g;n++){for(a=p?t.features[n].geometry:d?t.geometry:t,l=p?t.features[n].properties:d?t.properties:{},c=p?t.features[n].bbox:d?t.bbox:void 0,h=p?t.features[n].id:d?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,f,l,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],f,l,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,l,c,h))return!1;f++}}function u(t,e){a(t,function(t,n,i,o,s){var a,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==e(r.feature.call(void 0,t,i,{bbox:o,id:s}),n,0)&&void 0}switch(u){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<t.coordinates.length;l++){var c={type:a,coordinates:t.coordinates[l]};if(!1===e(r.feature.call(void 0,c,i),n,l))return!1}})}function l(t,e){u(t,function(t,n,o){var s=0;if(t.geometry){var a=t.geometry.type;if("Point"!==a&&"MultiPoint"!==a){var u,l=0,c=0,h=0;return!1!==i(t,function(i,a,f,p,d){if(void 0===u||n>l||p>c||d>h)return u=i,l=n,c=p,h=d,void(s=0);var g=r.lineString.call(void 0,[u,i],t.properties);if(!1===e(g,n,o,d,s))return!1;s++,u=i})&&void 0}}})}function c(t,e){if(!t)throw new Error("geojson is required");u(t,function(t,n,i){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,n,i,0,0))return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(!1===e(r.lineString.call(void 0,s[a],t.properties),n,i,a))return!1}}})}e.coordAll=function(t){var e=[];return i(t,function(t){e.push(t)}),e},e.coordEach=i,e.coordReduce=function(t,e,n,r){var o=n;return i(t,function(t,r,i,s,a){o=0===r&&void 0===n?t:e(o,t,r,i,s,a)},r),o},e.featureEach=s,e.featureReduce=function(t,e,n){var r=n;return s(t,function(t,i){r=0===i&&void 0===n?t:e(r,t,i)}),r},e.findPoint=function(t,e){if(e=e||{},!r.isObject.call(void 0,e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.coordIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":return r.point.call(void 0,l,u,e);case"MultiPoint":return o<0&&(o=l.length+o),r.point.call(void 0,l[o],u,e);case"LineString":return a<0&&(a=l.length+a),r.point.call(void 0,l[a],u,e);case"Polygon":return s<0&&(s=l.length+s),a<0&&(a=l[s].length+a),r.point.call(void 0,l[s][a],u,e);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),r.point.call(void 0,l[o][a],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),a<0&&(a=l[o][s].length-a),r.point.call(void 0,l[o][s][a],u,e)}throw new Error("geojson is invalid")},e.findSegment=function(t,e){if(e=e||{},!r.isObject.call(void 0,e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.segmentIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=l.length+a-1),r.lineString.call(void 0,[l[a],l[a+1]],u,e);case"Polygon":return s<0&&(s=l.length+s),a<0&&(a=l[s].length+a-1),r.lineString.call(void 0,[l[s][a],l[s][a+1]],u,e);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a-1),r.lineString.call(void 0,[l[o][a],l[o][a+1]],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),a<0&&(a=l[o][s].length-a-1),r.lineString.call(void 0,[l[o][s][a],l[o][s][a+1]],u,e)}throw new Error("geojson is invalid")},e.flattenEach=u,e.flattenReduce=function(t,e,n){var r=n;return u(t,function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)}),r},e.geomEach=a,e.geomReduce=function(t,e,n){var r=n;return a(t,function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)}),r},e.lineEach=c,e.lineReduce=function(t,e,n){var r=n;return c(t,function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)}),r},e.propEach=o,e.propReduce=function(t,e,n){var r=n;return o(t,function(t,i){r=0===i&&void 0===n?t:e(r,t,i)}),r},e.segmentEach=l,e.segmentReduce=function(t,e,n){var r=n,i=!1;return l(t,function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0}),r}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=t,n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t},function(){var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&(!t||!/^http(s?):/.test(t));)t=r[i--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t}(),n.b="undefined"!=typeof document&&document.baseURI||self.location.href,n.nc=void 0;var r={};return function(){"use strict";n.d(r,{default:function(){return TS}});var t=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function e(t,e){return t>e?1:t<e?-1:0}function i(t,e,n){var r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;var i=void 0;if(n>0){for(i=1;i<r;++i)if(t[i]<e)return i-1}else if(n<0){for(i=1;i<r;++i)if(t[i]<=e)return i}else for(i=1;i<r;++i){if(t[i]==e)return i;if(t[i]<e)return"function"==typeof n?n(e,t[i-1],t[i])>0?i-1:i:t[i-1]-e<e-t[i]?i-1:i}return r-1}function o(t,e,n){for(;e<n;){var r=t[e];t[e]=t[n],t[n]=r,++e,--n}}function s(t,e){for(var n=Array.isArray(e)?e:[e],r=n.length,i=0;i<r;i++)t[t.length]=n[i]}function a(t,e){var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function u(){return!0}function l(){return!1}function c(){}function h(){return function(){throw new Error("Unimplemented abstract method.")}()}var f=0;function p(t){return t.ol_uid||(t.ol_uid=String(++f))}var d,g="6.15.1",y="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",v=-1!==y.indexOf("firefox"),_=(-1!==y.indexOf("safari")&&-1==y.indexOf("chrom")&&(y.indexOf("version/15.4")>=0||y.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==y.indexOf("webkit")&&-1==y.indexOf("edge")),m=-1!==y.indexOf("macintosh"),x="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,b="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,w="undefined"!=typeof Image&&Image.prototype.decode,E=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}(),C=(d=function(t,e){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},d(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),S=function(t){function e(e){var n=this,r="Assertion failed. See https://openlayers.org/en/"+("v"+g.split("-")[0])+"/doc/errors/#"+e+" for details.";return(n=t.call(this,r)||this).code=e,n.name="AssertionError",n.message=r,n}return C(e,t),e}(Error);function P(t,e){if(!t)throw new S(e)}var I;new Array(6);function M(t,e,n,r,i,o,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t}function O(t,e){var n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function L(t,e,n,r,i,o,s,a){var u=Math.sin(o),l=Math.cos(o);return t[0]=r*l,t[1]=i*u,t[2]=-r*u,t[3]=i*l,t[4]=s*r*l-a*r*u+e,t[5]=s*i*u+a*i*l+n,t}function R(t,e){var n,r=(n=e)[0]*n[3]-n[1]*n[2];P(0!==r,32);var i=e[0],o=e[1],s=e[2],a=e[3],u=e[4],l=e[5];return t[0]=a/r,t[1]=-o/r,t[2]=-s/r,t[3]=i/r,t[4]=(s*l-a*u)/r,t[5]=-(i*l-o*u)/r,t}function k(t){var e="matrix("+t.join(", ")+")";if(b)return e;var n=I||(I=document.createElement("div"));return n.style.transform=e,n.style.transform}var T=0,N=1,A=2,D=4,F=8,j=16;function G(t){for(var e=Y(),n=0,r=t.length;n<r;++n)tt(e,t[n]);return e}function B(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function z(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function V(t,e,n){var r,i;return(r=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*r+(i=n<t[1]?t[1]-n:t[3]<n?n-t[3]:0)*i}function U(t,e){return X(t,e[0],e[1])}function W(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function X(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function q(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],s=e[0],a=e[1],u=T;return s<n?u|=j:s>i&&(u|=D),a<r?u|=F:a>o&&(u|=A),u===T&&(u=N),u}function Y(){return[1/0,1/0,-1/0,-1/0]}function H(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function Z(t){return H(1/0,1/0,-1/0,-1/0,t)}function K(t,e){var n=t[0],r=t[1];return H(n,r,n,r,e)}function J(t,e,n,r,i){return et(Z(i),t,e,n,r)}function $(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Q(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function tt(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function et(t,e,n,r,i){for(;n<r;n+=i)nt(t,e[n],e[n+1]);return t}function nt(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function rt(t,e){var n;return(n=e(ot(t)))||(n=e(st(t)))||(n=e(dt(t)))?n:(n=e(pt(t)))||!1}function it(t){var e=0;return vt(t)||(e=gt(t)*ht(t)),e}function ot(t){return[t[0],t[1]]}function st(t){return[t[2],t[1]]}function at(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function ut(t,e){var n;return"bottom-left"===e?n=ot(t):"bottom-right"===e?n=st(t):"top-left"===e?n=pt(t):"top-right"===e?n=dt(t):P(!1,13),n}function lt(t,e,n,r,i){var o=ct(t,e,n,r),s=o[0],a=o[1],u=o[2],l=o[3],c=o[4],h=o[5],f=o[6],p=o[7];return H(Math.min(s,u,c,f),Math.min(a,l,h,p),Math.max(s,u,c,f),Math.max(a,l,h,p),i)}function ct(t,e,n,r){var i=e*r[0]/2,o=e*r[1]/2,s=Math.cos(n),a=Math.sin(n),u=i*s,l=i*a,c=o*s,h=o*a,f=t[0],p=t[1];return[f-u+h,p-l-c,f-u-h,p-l+c,f+u-h,p+l+c,f+u+h,p+l-c,f-u+h,p-l-c]}function ht(t){return t[3]-t[1]}function ft(t,e,n){var r=n||[1/0,1/0,-1/0,-1/0];return yt(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):Z(r),r}function pt(t){return[t[0],t[3]]}function dt(t){return[t[2],t[3]]}function gt(t){return t[2]-t[0]}function yt(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function vt(t){return t[2]<t[0]||t[3]<t[1]}function _t(t,e){var n=(t[2]-t[0])/2*(e-1),r=(t[3]-t[1])/2*(e-1);t[0]-=n,t[2]+=n,t[1]-=r,t[3]+=r}function mt(t,e,n,r){var i=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a<r;++a)i.push(t[0]+o*a/r,t[1],t[2],t[1]+s*a/r,t[2]-o*a/r,t[3],t[0],t[3]-s*a/r);else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);for(var u=[],l=[],c=(a=0,i.length);a<c;a+=2)u.push(i[a]),l.push(i[a+1]);return function(t,e,n){return H(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),n)}(u,l,n)}function xt(t,e){var n=e.getExtent(),r=at(t);if(e.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){var i=gt(n),o=Math.floor((r[0]-n[0])/i)*i;t[0]-=o,t[2]-=o}return t}function bt(t,e,n){return Math.min(Math.max(t,e),n)}var wt="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Et="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Ct(t,e,n,r,i,o){var s=i-n,a=o-r;if(0!==s||0!==a){var u=((t-n)*s+(e-r)*a)/(s*s+a*a);u>1?(n=i,r=o):u>0&&(n+=s*u,r+=a*u)}return St(t,e,n,r)}function St(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function Pt(t){return t*Math.PI/180}function It(t,e){var n=t%e;return n*e<0?n+e:n}function Mt(t,e,n){return t+n*(e-t)}function Ot(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function Lt(t,e){return Math.floor(Ot(t,e))}function Rt(t,e){return Math.ceil(Ot(t,e))}var kt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Tt=/^([a-z]*)$|^hsla?\(.*\)$/i;function Nt(t){return"string"==typeof t?t:Gt(t)}function At(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}return""}var Dt=function(){var t={},e=0;return function(n){var r;if(t.hasOwnProperty(n))r=t[n];else{if(e>=1024){var i=0;for(var o in t)3&i++||(delete t[o],--e)}r=function(t){var e,n,r,i,o;Tt.exec(t)&&(t=At(t));if(kt.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var u=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),n=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),i=u?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,n=(n<<4)+n,r=(r<<4)+r,u&&(i=(i<<4)+i)),o=[e,n,r,i/255]}else 0==t.indexOf("rgba(")?jt(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),jt(o)):P(!1,14);return o}(n),t[n]=r,++e}return r}}();function Ft(t){return Array.isArray(t)?t:Dt(t)}function jt(t){return t[0]=bt(t[0]+.5|0,0,255),t[1]=bt(t[1]+.5|0,0,255),t[2]=bt(t[2]+.5|0,0,255),t[3]=bt(t[3],0,1),t}function Gt(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+e+","+n+","+r+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}var Bt=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var n=this.cache_[e];3&t++||n.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,n){var r=zt(t,e,n);return r in this.cache_?this.cache_[r]:null},t.prototype.set=function(t,e,n,r){var i=zt(t,e,n);this.cache_[i]=r,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function zt(t,e,n){return e+":"+t+":"+(n?Nt(n):"null")}var Vt=new Bt;function Ut(t){t.stopPropagation()}var Wt=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),Xt="propertychange",qt="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,i=arguments.length;r<i;++r){var o=arguments[r];if(null!=o)for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])}return n};function Yt(t){for(var e in t)delete t[e]}var Ht="function"==typeof Object.values?Object.values:function(t){var e=[];for(var n in t)e.push(t[n]);return e};function Zt(t){var e;for(e in t)return!1;return!e}var Kt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jt=function(t){function e(e){var n=t.call(this)||this;return n.eventTarget_=e,n.pendingRemovals_=null,n.dispatching_=null,n.listeners_=null,n}return Kt(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var n=this.listeners_||(this.listeners_={}),r=n[t]||(n[t]=[]);-1===r.indexOf(e)&&r.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t,n=e?t:t.type,r=this.listeners_&&this.listeners_[n];if(r){var i=e?new Wt(t):t;i.target||(i.target=this.eventTarget_||this);var o,s=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in s||(s[n]=0,a[n]=0),++s[n];for(var u=0,l=r.length;u<l;++u)if(!1===(o="handleEvent"in r[u]?r[u].handleEvent(i):r[u].call(this,i))||i.propagationStopped){o=!1;break}if(0===--s[n]){var h=a[n];for(delete a[n];h--;)this.removeEventListener(n,c);delete s[n]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&Yt(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var r=n.indexOf(e);-1!==r&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[r]=c,++this.pendingRemovals_[t]):(n.splice(r,1),0===n.length&&delete this.listeners_[t]))}},e}(t),$t=Jt,Qt="change",te="error",ee="contextmenu",ne="click",re="dblclick",ie="keydown",oe="keypress",se="load",ae="resize",ue="touchmove",le="wheel";function ce(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function he(t,e,n,r){return ce(t,e,n,r,!0)}function fe(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Yt(t))}var pe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),de=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return pe(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Qt)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=ce(this,t[i],e);return r}return ce(this,t,e)},e.prototype.onceInternal=function(t,e){var n;if(Array.isArray(t)){var r=t.length;n=new Array(r);for(var i=0;i<r;++i)n[i]=he(this,t[i],e)}else n=he(this,t,e);return e.ol_key=n,n},e.prototype.unInternal=function(t,e){var n=e.ol_key;if(n)ge(n);else if(Array.isArray(t))for(var r=0,i=t.length;r<i;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)},e}($t);function ge(t){if(Array.isArray(t))for(var e=0,n=t.length;e<n;++e)fe(t[e]);else fe(t)}de.prototype.on,de.prototype.once,de.prototype.un;var ye=de,ve=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_e=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.key=n,i.oldValue=r,i}return ve(e,t),e}(Wt),me=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,p(n),n.values_=null,void 0!==e&&n.setProperties(e),n}return ve(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&qt({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var n;n="change:".concat(t),this.hasListener(n)&&this.dispatchEvent(new _e(n,t,e)),n=Xt,this.hasListener(n)&&this.dispatchEvent(new _e(n,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:".concat(t),e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:".concat(t),e)},e.prototype.set=function(t,e,n){var r=this.values_||(this.values_={});if(n)r[t]=e;else{var i=r[t];r[t]=e,i!==e&&this.notify(t,i)}},e.prototype.setProperties=function(t,e){for(var n in t)this.set(n,t[n],e)},e.prototype.applyProperties=function(t){t.values_&&qt(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var n=this.values_[t];delete this.values_[t],Zt(this.values_)&&(this.values_=null),e||this.notify(t,n)}},e}(ye),xe="opacity",be="visible",we="extent",Ee="zIndex",Ce="maxResolution",Se="minResolution",Pe="maxZoom",Ie="minZoom",Me="source",Oe="map",Le=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Re=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un,n.background_=e.background;var r=qt({},e);return"object"==typeof e.properties&&(delete r.properties,qt(r,e.properties)),r[xe]=void 0!==e.opacity?e.opacity:1,P("number"==typeof r[xe],64),r[be]=void 0===e.visible||e.visible,r[Ee]=e.zIndex,r[Ce]=void 0!==e.maxResolution?e.maxResolution:1/0,r[Se]=void 0!==e.minResolution?e.minResolution:0,r[Ie]=void 0!==e.minZoom?e.minZoom:-1/0,r[Pe]=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==r.className?r.className:"ol-layer",delete r.className,n.setProperties(r),n.state_=null,n}return Le(e,t),e.prototype.getBackground=function(){return this.background_},e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=bt(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==n||e.managed?n:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return h()},e.prototype.getLayerStatesArray=function(t){return h()},e.prototype.getExtent=function(){return this.get(we)},e.prototype.getMaxResolution=function(){return this.get(Ce)},e.prototype.getMinResolution=function(){return this.get(Se)},e.prototype.getMinZoom=function(){return this.get(Ie)},e.prototype.getMaxZoom=function(){return this.get(Pe)},e.prototype.getOpacity=function(){return this.get(xe)},e.prototype.getSourceState=function(){return h()},e.prototype.getVisible=function(){return this.get(be)},e.prototype.getZIndex=function(){return this.get(Ee)},e.prototype.setBackground=function(t){this.background_=t,this.changed()},e.prototype.setExtent=function(t){this.set(we,t)},e.prototype.setMaxResolution=function(t){this.set(Ce,t)},e.prototype.setMinResolution=function(t){this.set(Se,t)},e.prototype.setMaxZoom=function(t){this.set(Pe,t)},e.prototype.setMinZoom=function(t){this.set(Ie,t)},e.prototype.setOpacity=function(t){P("number"==typeof t,64),this.set(xe,t)},e.prototype.setVisible=function(t){this.set(be,t)},e.prototype.setZIndex=function(t){this.set(Ee,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(me),ke=Re,Te="prerender",Ne="postrender",Ae="precompose",De="postcompose",Fe="rendercomplete",je=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ge=function(t){function e(e){var n=this,r=qt({},e);delete r.source,(n=t.call(this,r)||this).on,n.once,n.un,n.mapPrecomposeKey_=null,n.mapRenderKey_=null,n.sourceChangeKey_=null,n.renderer_=null,n.rendered=!1,e.render&&(n.render=e.render),e.map&&n.setMap(e.map),n.addChangeListener(Me,n.handleSourcePropertyChange_);var i=e.source?e.source:null;return n.setSource(i),n}return je(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Me)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(fe(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=ce(t,Qt,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise(function(t){return t([])})},e.prototype.getData=function(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null},e.prototype.render=function(t,e){var n=this.getRenderer();if(n.prepareFrame(t))return this.rendered=!0,n.renderFrame(t,e)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(Oe,t)},e.prototype.getMapInternal=function(){return this.get(Oe)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(fe(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(fe(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ce(t,Ae,function(t){var e=t.frameState.layerStatesArray,n=this.getLayerState(!1);P(!e.some(function(t){return t.layer===n.layer}),67),e.push(n)},this),this.mapRenderKey_=ce(this,Qt,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Me,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(ke);function Be(t,e){if(!t.visible)return!1;var n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}var ze=Ge;function Ve(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Ue(t,e){var n=e.getRadius(),r=e.getCenter(),i=r[0],o=r[1],s=t[0]-i,a=t[1]-o;0===s&&0===a&&(s=1);var u=Math.sqrt(s*s+a*a);return[i+n*s/u,o+n*a/u]}function We(t,e){var n,r,i=t[0],o=t[1],s=e[0],a=e[1],u=s[0],l=s[1],c=a[0],h=a[1],f=c-u,p=h-l,d=0===f&&0===p?0:(f*(i-u)+p*(o-l))/(f*f+p*p||0);return d<=0?(n=u,r=l):d>=1?(n=c,r=h):(n=u+d*f,r=l+d*p),[n,r]}function Xe(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function qe(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function Ye(t,e){return t[0]*=e,t[1]*=e,t}function He(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Ze(t,e){return Math.sqrt(He(t,e))}function Ke(t,e){if(e.canWrapX()){var n=gt(e.getExtent()),r=function(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]<r[0]||t[0]>r[2])){var o=n||gt(r);i=Math.floor((t[0]-r[0])/o)}return i}(t,e,n);r&&(t[0]-=r*n)}return t}var Je=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$e=function(t){function e(e){var n=t.call(this)||this;return n.map_=e,n}return Je(e,t),e.prototype.dispatchRenderEvent=function(t,e){h()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,n=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;L(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),R(r,n)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i,o,s,a){var u,l=e.viewState;function c(t,e,n,r){return i.call(o,e,t?n:null,r)}var h=l.projection,f=Ke(t.slice(),h),p=[[0,0]];if(h.canWrapX()&&r){var d=gt(h.getExtent());p.push([-d,0],[d,0])}for(var g=e.layerStatesArray,y=g.length,v=[],_=[],m=0;m<p.length;m++)for(var x=y-1;x>=0;--x){var b=g[x],w=b.layer;if(w.hasRenderer()&&Be(b,l)&&s.call(a,w)){var E=w.getRenderer(),C=w.getSource();if(E&&C){var S=C.getWrapX()?f:t,P=c.bind(null,b.managed);_[0]=S[0]+p[m][0],_[1]=S[1]+p[m][1],u=E.forEachFeatureAtCoordinate(_,e,n,P,v)}if(u)return u}}if(0!==v.length){var I=1/v.length;return v.forEach(function(t,e){return t.distanceSq+=e*I}),v.sort(function(t,e){return t.distanceSq-e.distanceSq}),v.some(function(t){return u=t.callback(t.feature,t.layer,t.geometry)}),u}},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){return h()},e.prototype.hasFeatureAtCoordinate=function(t,e,n,r,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,r,u,this,i,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){h()},e.prototype.scheduleExpireIconCache=function(t){Vt.canExpireCache()&&t.postRenderFunctions.push(Qe)},e}(t);function Qe(t,e){Vt.expire()}var tn=$e,en=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nn=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.inversePixelTransform=n,o.frameState=r,o.context=i,o}return en(e,t),e}(Wt),rn="ol-hidden",on="ol-unselectable",sn="ol-control",an="ol-collapsed",un=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),ln=["style","variant","weight","size","lineHeight","family"],cn=function(t){var e=t.match(un);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=ln.length;r<i;++r){var o=e[r+1];void 0!==o&&(n[ln[r]]=o)}return n.families=n.family.split(/,\s?/),n};function hn(t,e,n,r){var i;return i=n&&n.length?n.shift():b?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function fn(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function pn(t){var e=t.offsetWidth,n=getComputedStyle(t);return e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10)}function dn(t){var e=t.offsetHeight,n=getComputedStyle(t);return e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10)}function gn(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function yn(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function vn(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var _n="10px sans-serif",mn="#000",xn="round",bn=[],wn="round",En="#000",Cn="center",Sn="middle",Pn=[0,0,0,0],In=new me;(new $t).setSize=function(){console.warn("labelCache is deprecated.")};var Mn,On,Ln=null,Rn={},kn=function(){var t,e,n="32px ",r=["monospace","serif"],i=r.length,o="wmytzilWMYTZIL@#/&?$%10";function s(t,s,a){for(var u=!0,l=0;l<i;++l){var c=r[l];if(e=An(t+" "+s+" "+n+c,o),a!=c){var h=An(t+" "+s+" "+n+a+","+c,o);u=u&&h!=e}}return!!u}function a(){for(var e=!0,n=In.getKeys(),r=0,i=n.length;r<i;++r){var o=n[r];In.get(o)<100&&(s.apply(this,o.split("\n"))?(Yt(Rn),Ln=null,Mn=void 0,In.set(o,100)):(In.set(o,In.get(o)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var n=cn(e);if(n)for(var r=n.families,i=0,o=r.length;i<o;++i){var u=r[i],l=n.style+"\n"+n.weight+"\n"+u;void 0===In.get(l)&&(In.set(l,100,!0),s(n.style,n.weight,u)||(In.set(l,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),Tn=function(t){var e=Rn[t];if(null==e){if(b){var n=cn(t),r=Nn(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else On||((On=document.createElement("div")).innerHTML="M",On.style.minHeight="0",On.style.maxHeight="none",On.style.height="auto",On.style.padding="0",On.style.border="none",On.style.position="absolute",On.style.display="block",On.style.left="-99999px"),On.style.font=t,document.body.appendChild(On),e=On.offsetHeight,document.body.removeChild(On);Rn[t]=e}return e};function Nn(t,e){return Ln||(Ln=hn(1,1)),t!=Mn&&(Ln.font=t,Mn=Ln.font),Ln.measureText(e)}function An(t,e){return Nn(t,e).width}function Dn(t,e,n){if(e in n)return n[e];var r=e.split("\n").reduce(function(e,n){return Math.max(e,An(t,n))},0);return n[e]=r,r}function Fn(t,e,n,r,i,o,s,a,u,l,c){t.save(),1!==n&&(t.globalAlpha*=n),e&&t.setTransform.apply(t,e),r.contextInstructions?(t.translate(u,l),t.scale(c[0],c[1]),function(t,e){for(var n=t.contextInstructions,r=0,i=n.length;r<i;r+=2)Array.isArray(n[r+1])?e[n[r]].apply(e,n[r+1]):e[n[r]]=n[r+1]}(r,t)):c[0]<0||c[1]<0?(t.translate(u,l),t.scale(c[0],c[1]),t.drawImage(r,i,o,s,a,0,0,s,a)):t.drawImage(r,i,o,s,a,u,l,s*c[0],a*c[1]),t.restore()}var jn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gn=function(t){function e(e){var n=t.call(this,e)||this;n.fontChangeListenerKey_=ce(In,Xt,e.redrawText.bind(e)),n.element_=document.createElement("div");var r=n.element_.style;r.position="absolute",r.width="100%",r.height="100%",r.zIndex="0",n.element_.className=on+" ol-layers";var i=e.getViewport();return i.insertBefore(n.element_,i.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return jn(e,t),e.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var r=new nn(t,void 0,e);n.dispatchEvent(r)}},e.prototype.disposeInternal=function(){fe(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(Ae,t);var e=t.layerStatesArray.sort(function(t,e){return t.zIndex-e.zIndex}),n=t.viewState;this.children_.length=0;for(var r=[],i=null,o=0,s=e.length;o<s;++o){var a=e[o];t.layerIndex=o;var u=a.layer,l=u.getSourceState();if(!Be(a,n)||"ready"!=l&&"undefined"!=l)u.unrender();else{var c=u.render(t,i);c&&(c!==i&&(this.children_.push(c),i=c),"getDeclutter"in u&&r.push(u))}}for(o=r.length-1;o>=0;--o)r[o].renderDeclutter(t);!function(t,e){for(var n=t.childNodes,r=0;;++r){var i=n[r],o=e[r];if(!i&&!o)break;i!==o&&(i?o?t.insertBefore(o,i):(t.removeChild(i),--r):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(De,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){for(var o=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var u=s[a],l=u.layer;if(l.hasRenderer()&&Be(u,o)&&i(l)){var c=l.getRenderer().getDataAtPixel(t,e,n);if(c){var h=r(l,c);if(h)return h}}}},e}(tn),Bn=Gn,zn="add",Vn="remove",Un=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wn="length",Xn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.element=n,i.index=r,i}return Un(e,t),e}(Wt),qn=function(t){function e(e,n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};if(r.unique_=!!i.unique,r.array_=e||[],r.unique_)for(var o=0,s=r.array_.length;o<s;++o)r.assertUnique_(r.array_[o],o);return r.updateLength_(),r}return Un(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,n=t.length;e<n;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,n=0,r=e.length;n<r;++n)t(e[n],n,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(Wn)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Xn(zn,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,n=0,r=e.length;n<r;++n)if(e[n]===t)return this.removeAt(n)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Xn(Vn,e,t)),e},e.prototype.setAt=function(t,e){var n=this.getLength();if(t<n){this.unique_&&this.assertUnique_(e,t);var r=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Xn(Vn,r,t)),this.dispatchEvent(new Xn(zn,e,t))}else{for(var i=n;i<t;++i)this.insertAt(i,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(Wn,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var n=0,r=this.array_.length;n<r;++n)if(this.array_[n]===t&&n!==e)throw new S(58)},e}(me),Yn=qn,Hn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.layer=n,r}return Hn(e,t),e}(Wt),Kn="layers",Jn=function(t){function e(e){var n=this,r=e||{},i=qt({},r);delete i.layers;var o=r.layers;return(n=t.call(this,i)||this).on,n.once,n.un,n.layersListenerKeys_=[],n.listenerKeys_={},n.addChangeListener(Kn,n.handleLayersChanged_),o?Array.isArray(o)?o=new Yn(o.slice(),{unique:!0}):P("function"==typeof o.getArray,43):o=new Yn(void 0,{unique:!0}),n.setLayers(o),n}return Hn(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(fe),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(ce(t,zn,this.handleLayersAdd_,this),ce(t,Vn,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(fe);Yt(this.listenerKeys_);for(var n=t.getArray(),r=0,i=n.length;r<i;r++){var o=n[r];this.registerLayerListeners_(o),this.dispatchEvent(new Zn("addlayer",o))}this.changed()},e.prototype.registerLayerListeners_=function(t){var n=[ce(t,Xt,this.handleLayerChange_,this),ce(t,Qt,this.handleLayerChange_,this)];t instanceof e&&n.push(ce(t,"addlayer",this.handleLayerGroupAdd_,this),ce(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[p(t)]=n},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new Zn("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new Zn("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Zn("addlayer",e)),this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,n=p(e);this.listenerKeys_[n].forEach(fe),delete this.listenerKeys_[n],this.dispatchEvent(new Zn("removelayer",e)),this.changed()},e.prototype.getLayers=function(){return this.get(Kn)},e.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var n=e.getArray(),r=0,i=n.length;r<i;++r)this.dispatchEvent(new Zn("removelayer",n[r]));this.set(Kn,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach(function(t){t.getLayersArray(e)}),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],n=e.length;this.getLayers().forEach(function(t){t.getLayerStatesArray(e)});var r=this.getLayerState(),i=r.zIndex;t||void 0!==r.zIndex||(i=0);for(var o=n,s=e.length;o<s;o++){var a=e[o];a.opacity*=r.opacity,a.visible=a.visible&&r.visible,a.maxResolution=Math.min(a.maxResolution,r.maxResolution),a.minResolution=Math.max(a.minResolution,r.minResolution),a.minZoom=Math.max(a.minZoom,r.minZoom),a.maxZoom=Math.min(a.maxZoom,r.maxZoom),void 0!==r.extent&&(void 0!==a.extent?a.extent=ft(a.extent,r.extent):a.extent=r.extent),void 0===a.zIndex&&(a.zIndex=i)}return e},e.prototype.getSourceState=function(){return"ready"},e}(ke),$n=Jn,Qn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),tr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.map=n,i.frameState=void 0!==r?r:null,i}return Qn(e,t),e}(Wt),er=tr,nr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rr=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,o)||this;return a.originalEvent=r,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==i&&i,a.activePointers=s,a}return nr(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(er),ir=rr,or={SINGLECLICK:"singleclick",CLICK:ne,DBLCLICK:re,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},sr="pointermove",ar="pointerdown",ur="pointerup",lr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cr=function(t){function e(e,n){var r=t.call(this,e)||this;r.map_=e,r.clickTimeoutId_,r.emulateClicks_=!1,r.dragging_=!1,r.dragListenerKeys_=[],r.moveTolerance_=void 0===n?1:n,r.down_=null;var i=r.map_.getViewport();return r.activePointers_=[],r.trackedTouches_={},r.element_=i,r.pointerdownListenerKey_=ce(i,ar,r.handlePointerDown_,r),r.originalPointerMoveEvent_,r.relayedListenerKey_=ce(i,sr,r.relayMoveEvent_,r),r.boundHandleTouchMove_=r.handleTouchMove_.bind(r),r.element_.addEventListener(ue,r.boundHandleTouchMove_,!!E&&{passive:!1}),r}return lr(e,t),e.prototype.emulateClick_=function(t){var e=new ir(or.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new ir(or.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new ir(or.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t,n=e.pointerId;if(e.type==or.POINTERUP||e.type==or.POINTERCANCEL){for(var r in delete this.trackedTouches_[n],this.trackedTouches_)if(this.trackedTouches_[r].target!==e.target){delete this.trackedTouches_[r];break}}else e.type!=or.POINTERDOWN&&e.type!=or.POINTERMOVE||(this.trackedTouches_[n]=e);this.activePointers_=Ht(this.trackedTouches_)},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new ir(or.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(fe),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);var e=new ir(or.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);for(var n in this.dispatchEvent(e),this.down_={},t){var r=t[n];this.down_[n]="function"==typeof r?c:r}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(ce(i,or.POINTERMOVE,this.handlePointerMove_,this),ce(i,or.POINTERUP,this.handlePointerUp_,this),ce(this.element_,or.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(ce(this.element_.getRootNode(),or.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;var e=new ir(or.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}},e.prototype.relayMoveEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new ir(or.POINTERMOVE,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(fe(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(ue,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(fe(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(fe),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}($t),hr=cr,fr="postrender",pr="movestart",dr="moveend",gr="loadstart",yr="loadend",vr="layergroup",_r="size",mr="target",xr="view",br=1/0,wr=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Yt(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,n=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var r=this.keyFunction_(n);return delete this.queuedElements_[r],n},t.prototype.enqueue=function(t){P(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=br&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,n=this.priorities_,r=e.length,i=e[t],o=n[t],s=t;t<r>>1;){var a=this.getLeftChildIndex_(t),u=this.getRightChildIndex_(t),l=u<r&&n[u]<n[a]?u:a;e[t]=e[l],n[t]=n[l],t=l}e[t]=i,n[t]=o,this.siftDown_(s,t)},t.prototype.siftDown_=function(t,e){for(var n=this.elements_,r=this.priorities_,i=n[e],o=r[e];e>t;){var s=this.getParentIndex_(e);if(!(r[s]>o))break;n[e]=n[s],r[e]=r[s],e=s}n[e]=i,r[e]=o},t.prototype.reprioritize=function(){var t,e,n,r=this.priorityFunction_,i=this.elements_,o=this.priorities_,s=0,a=i.length;for(e=0;e<a;++e)(n=r(t=i[e]))==br?delete this.queuedElements_[this.keyFunction_(t)]:(o[s]=n,i[s++]=t);i.length=s,o.length=s,this.heapify_()},t}(),Er=wr,Cr=0,Sr=1,Pr=2,Ir=3,Mr=4,Or=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lr=function(t){function e(e,n){var r=t.call(this,function(t){return e.apply(null,t)},function(t){return t[0].getKey()})||this;return r.boundHandleTileChange_=r.handleTileChange.bind(r),r.tileChangeCallback_=n,r.tilesLoading_=0,r.tilesLoadingKeys_={},r}return Or(e,t),e.prototype.enqueue=function(e){var n=t.prototype.enqueue.call(this,e);n&&e[0].addEventListener(Qt,this.boundHandleTileChange_);return n},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,n=e.getState();if(n===Pr||n===Ir||n===Mr){e.removeEventListener(Qt,this.boundHandleTileChange_);var r=e.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var n,r,i=0;this.tilesLoading_<t&&i<e&&this.getCount()>0;)r=(n=this.dequeue()[0]).getKey(),n.getState()!==Cr||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++i,n.load())},e}(Er),Rr=Lr;var kr={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"};var Tr={};Tr[kr.RADIANS]=6370997/(2*Math.PI),Tr[kr.DEGREES]=2*Math.PI*6370997/360,Tr[kr.FEET]=.3048,Tr[kr.METERS]=1,Tr[kr.USFEET]=1200/3937;var Nr=kr,Ar=0,Dr=1,Fr={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},jr=256,Gr=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Tr[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),Br=Gr,zr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vr=6378137,Ur=Math.PI*Vr,Wr=[-Ur,-Ur,Ur,Ur],Xr=[-180,-85,180,85],qr=Vr*Math.log(Math.tan(Math.PI/2)),Yr=function(t){function e(e){return t.call(this,{code:e,units:Nr.METERS,extent:Wr,global:!0,worldExtent:Xr,getPointResolution:function(t,e){return t/wt(e[1]/Vr)}})||this}return zr(e,t),e}(Br),Hr=[new Yr("EPSG:3857"),new Yr("EPSG:102100"),new Yr("EPSG:102113"),new Yr("EPSG:900913"),new Yr("http://www.opengis.net/def/crs/EPSG/0/3857"),new Yr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Zr(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var s=0;s<r;s+=i){o[s]=Ur*t[s]/180;var a=Vr*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>qr?a=qr:a<-qr&&(a=-qr),o[s+1]=a}return o}function Kr(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var s=0;s<r;s+=i)o[s]=180*t[s]/Ur,o[s+1]=360*Math.atan(Math.exp(t[s+1]/Vr))/Math.PI-90;return o}var Jr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$r=[-180,-90,180,90],Qr=6378137*Math.PI/180,ti=function(t){function e(e,n){return t.call(this,{code:e,units:Nr.DEGREES,extent:$r,axisOrientation:n,global:!0,metersPerUnit:Qr,worldExtent:$r})||this}return Jr(e,t),e}(Br),ei=[new ti("CRS:84"),new ti("EPSG:4326","neu"),new ti("urn:ogc:def:crs:OGC:1.3:CRS84"),new ti("urn:ogc:def:crs:OGC:2:84"),new ti("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new ti("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ti("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],ni={};var ri={};function ii(t,e,n){var r=t.getCode(),i=e.getCode();r in ri||(ri[r]={}),ri[r][i]=n}var oi=6371008.8;function si(t,e,n){var r=n||oi,i=Pt(t[1]),o=Pt(e[1]),s=(o-i)/2,a=Pt(e[0]-t[0])/2,u=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))}var ai=!0;function ui(t){ai=!(void 0===t||t)}function li(t,e,n){var r;if(void 0!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];r=e}else r=t.slice();return r}function ci(t,e,n){if(void 0!==e&&t!==e){for(var r=0,i=t.length;r<i;++r)e[r]=t[r];t=e}return t}function hi(t){!function(t,e){ni[t]=e}(t.getCode(),t),ii(t,t,li)}function fi(t){return"string"==typeof t?ni[e=t]||ni[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function pi(t,e,n,r){var i,o=(t=fi(t)).getPointResolutionFunc();if(o){if(i=o(e,n),r&&r!==t.getUnits())(a=t.getMetersPerUnit())&&(i=i*a/Tr[r])}else{var s=t.getUnits();if(s==Nr.DEGREES&&!r||r==Nr.DEGREES)i=e;else{var a,u=vi(t,fi("EPSG:4326"));if(u===ci&&s!==Nr.DEGREES)i=e*t.getMetersPerUnit();else{var l=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];i=(si((l=u(l,l,2)).slice(0,2),l.slice(2,4))+si(l.slice(4,6),l.slice(6,8)))/2}void 0!==(a=r?Tr[r]:t.getMetersPerUnit())&&(i/=a)}}return i}function di(t){!function(t){t.forEach(hi)}(t),t.forEach(function(e){t.forEach(function(t){e!==t&&ii(e,t,li)})})}function gi(t,e){return t?"string"==typeof t?fi(t):t:fi(e)}function yi(t,e){if(t===e)return!0;var n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||vi(t,e)===li)&&n}function vi(t,e){var n=function(t,e){var n;return t in ri&&e in ri[t]&&(n=ri[t][e]),n}(t.getCode(),e.getCode());return n||(n=ci),n}function _i(t,e){return vi(fi(t),fi(e))}function mi(t,e,n){return _i(e,n)(t,void 0,t.length)}function xi(t,e,n,r){return mt(t,_i(e,n),void 0,r)}var bi,wi,Ei,Ci=null;function Si(){return Ci}function Pi(t,e){return Ci?mi(t,e,Ci):t}function Ii(t,e){return Ci?mi(t,Ci,e):(ai&&!Xe(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(ai=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function Mi(t,e){return Ci?xi(t,e,Ci):t}function Oi(t,e){return Ci?xi(t,Ci,e):t}function Li(t,e){if(!Ci)return t;var n=fi(e).getUnits(),r=Ci.getUnits();return n&&r?t*Tr[n]/Tr[r]:t}function Ri(t,e,n){return function(r,i,o,s,a){if(r){if(!i&&!e)return r;var u=e?0:o[0]*i,l=e?0:o[1]*i,c=a?a[0]:0,h=a?a[1]:0,f=t[0]+u/2+c,p=t[2]-u/2+c,d=t[1]+l/2+h,g=t[3]-l/2+h;f>p&&(p=f=(p+f)/2),d>g&&(g=d=(g+d)/2);var y=bt(r[0],f,p),v=bt(r[1],d,g);if(s&&n&&i){var _=30*i;y+=-_*Math.log(1+Math.max(0,f-r[0])/_)+_*Math.log(1+Math.max(0,r[0]-p)/_),v+=-_*Math.log(1+Math.max(0,d-r[1])/_)+_*Math.log(1+Math.max(0,r[1]-g)/_)}return[y,v]}}}function ki(t){return t}function Ti(t,e,n,r){var i=gt(e)/n[0],o=ht(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function Ni(t,e,n){var r=Math.min(t,e);return r*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/t-1))/50+1),bt(r,n/2,2*e)}function Ai(t,e,n,r,i){return function(o,s,a,u){if(void 0!==o){var l=r?Ti(t,r,a,i):t;return(void 0===n||n)&&u?Ni(o,l,e):bt(o,e,l)}}}function Di(t){return void 0!==t?0:void 0}function Fi(t){return void 0!==t?t:void 0}function ji(t){return Math.pow(t,3)}function Gi(t){return 1-ji(1-t)}function Bi(t){return 3*t*t-2*t*t*t}function zi(t){return t}di(Hr),di(ei),bi=Hr,wi=Zr,Ei=Kr,ei.forEach(function(t){bi.forEach(function(e){ii(t,e,wi),ii(e,t,Ei)})});var Vi="XY",Ui="XYZ",Wi="XYM",Xi="XYZM";function qi(t,e,n,r,i,o){for(var s=o||[],a=0,u=e;u<n;u+=r){var l=t[u],c=t[u+1];s[a++]=i[0]*l+i[2]*c+i[4],s[a++]=i[1]*l+i[3]*c+i[5]}return o&&s.length!=a&&(s.length=a),s}function Yi(t,e,n,r,i,o,s){for(var a=s||[],u=Math.cos(i),l=Math.sin(i),c=o[0],h=o[1],f=0,p=e;p<n;p+=r){var d=t[p]-c,g=t[p+1]-h;a[f++]=c+d*u-g*l,a[f++]=h+d*l+g*u;for(var y=p+2;y<p+r;++y)a[f++]=t[y]}return s&&a.length!=f&&(a.length=f),a}function Hi(t,e,n,r,i,o,s){for(var a=s||[],u=0,l=e;l<n;l+=r){a[u++]=t[l]+i,a[u++]=t[l+1]+o;for(var c=l+2;c<l+r;++c)a[u++]=t[c]}return s&&a.length!=u&&(a.length=u),a}var Zi=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ki=[1,0,0,1,0,0],Ji=function(t){function e(){var e,n,r,i,o,s=t.call(this)||this;return s.extent_=[1/0,1/0,-1/0,-1/0],s.extentRevision_=-1,s.simplifiedGeometryMaxMinSquaredTolerance=0,s.simplifiedGeometryRevision=0,s.simplifyTransformedInternal=(e=function(t,e,n){if(!n)return this.getSimplifiedGeometry(e);var r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===i&&a(t,r)||(o=!0,i=this,r=t,n=e.apply(this,arguments)),n}),s}return Zi(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return h()},e.prototype.closestPointXY=function(t,e,n,r){return h()},e.prototype.containsXY=function(t,e){var n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e},e.prototype.getClosestPoint=function(t,e){var n=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],n,1/0),n},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return h()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Z(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){h()},e.prototype.scale=function(t,e,n){h()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return h()},e.prototype.getType=function(){return h()},e.prototype.applyTransform=function(t){h()},e.prototype.intersectsExtent=function(t){return h()},e.prototype.translate=function(t,e){h()},e.prototype.transform=function(t,e){var n=fi(t),r=n.getUnits()==Nr.TILE_PIXELS?function(t,r,i){var o=n.getExtent(),s=n.getWorldExtent(),a=ht(s)/ht(o);return L(Ki,s[0],s[3],a,-a,0,0,0),qi(t,0,t.length,i,Ki,r),_i(n,e)(t,r,i)}:_i(n,e);return this.applyTransform(r),this},e}(me),$i=Ji,Qi=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),to=function(t){function e(){var e=t.call(this)||this;return e.layout=Vi,e.stride=2,e.flatCoordinates=null,e}return Qi(e,t),e.prototype.computeExtent=function(t){return J(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return h()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=eo(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){h()},e.prototype.setLayout=function(t,e,n){var r;if(t)r=eo(t);else{for(var i=0;i<n;++i){if(0===e.length)return this.layout=Vi,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Vi:3==t?e=Ui:4==t&&(e=Xi);return e}(r=e.length)}this.layout=t,this.stride=r},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var n=this.getFlatCoordinates();if(n){var r=this.getStride();Yi(n,0,n.length,r,t,e,n),this.changed()}},e.prototype.scale=function(t,e,n){var r=e;void 0===r&&(r=t);var i=n;i||(i=at(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();!function(t,e,n,r,i,o,s,a){for(var u=a||[],l=s[0],c=s[1],h=0,f=e;f<n;f+=r){var p=t[f]-l,d=t[f+1]-c;u[h++]=l+i*p,u[h++]=c+o*d;for(var g=f+2;g<f+r;++g)u[h++]=t[g]}a&&u.length!=h&&(u.length=h)}(o,0,o.length,s,t,r,i,o),this.changed()}},e.prototype.translate=function(t,e){var n=this.getFlatCoordinates();if(n){var r=this.getStride();Hi(n,0,n.length,r,t,e,n),this.changed()}},e}($i);function eo(t){var e;return t==Vi?e=2:t==Ui||t==Wi?e=3:t==Xi&&(e=4),e}var no=to;function ro(t,e,n,r,i,o,s){var a,u=t[e],l=t[e+1],c=t[n]-u,h=t[n+1]-l;if(0===c&&0===h)a=e;else{var f=((i-u)*c+(o-l)*h)/(c*c+h*h);if(f>1)a=n;else{if(f>0){for(var p=0;p<r;++p)s[p]=Mt(t[e+p],t[n+p],f);return void(s.length=r)}a=e}}for(p=0;p<r;++p)s[p]=t[a+p];s.length=r}function io(t,e,n,r,i){var o=t[e],s=t[e+1];for(e+=r;e<n;e+=r){var a=t[e],u=t[e+1],l=St(o,s,a,u);l>i&&(i=l),o=a,s=u}return i}function oo(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];i=io(t,e,a,r,i),e=a}return i}function so(t,e,n,r,i,o,s,a,u,l,c){if(e==n)return l;var h,f;if(0===i){if((f=St(s,a,t[e],t[e+1]))<l){for(h=0;h<r;++h)u[h]=t[e+h];return u.length=r,f}return l}for(var p=c||[NaN,NaN],d=e+r;d<n;)if(ro(t,d-r,d,r,s,a,p),(f=St(s,a,p[0],p[1]))<l){for(l=f,h=0;h<r;++h)u[h]=p[h];u.length=r,d+=r}else d+=r*Math.max((Math.sqrt(f)-Math.sqrt(l))/i|0,1);if(o&&(ro(t,n-r,e,r,s,a,p),(f=St(s,a,p[0],p[1]))<l)){for(l=f,h=0;h<r;++h)u[h]=p[h];u.length=r}return l}function ao(t,e,n,r,i,o,s,a,u,l,c){for(var h=c||[NaN,NaN],f=0,p=n.length;f<p;++f){var d=n[f];l=so(t,e,d,r,i,o,s,a,u,l,h),e=d}return l}function uo(t,e,n,r){for(var i=0,o=n.length;i<o;++i)t[e++]=n[i];return e}function lo(t,e,n,r){for(var i=0,o=n.length;i<o;++i)for(var s=n[i],a=0;a<r;++a)t[e++]=s[a];return e}function co(t,e,n,r,i){for(var o=i||[],s=0,a=0,u=n.length;a<u;++a){var l=lo(t,e,n[a],r);o[s++]=l,e=l}return o.length=s,o}function ho(t,e,n,r,i,o,s){var a=(n-e)/r;if(a<3){for(;e<n;e+=r)o[s++]=t[e],o[s++]=t[e+1];return s}var u=new Array(a);u[0]=1,u[a-1]=1;for(var l=[e,n-r],c=0;l.length>0;){for(var h=l.pop(),f=l.pop(),p=0,d=t[f],g=t[f+1],y=t[h],v=t[h+1],_=f+r;_<h;_+=r){var m=Ct(t[_],t[_+1],d,g,y,v);m>p&&(c=_,p=m)}p>i&&(u[(c-e)/r]=1,f+r<c&&l.push(f,c),c+r<h&&l.push(c,h))}for(_=0;_<a;++_)u[_]&&(o[s++]=t[e+_*r],o[s++]=t[e+_*r+1]);return s}function fo(t,e,n,r,i,o,s,a){for(var u=0,l=n.length;u<l;++u){var c=n[u];s=ho(t,e,c,r,i,o,s),a.push(s),e=c}return s}function po(t,e){return e*Math.round(t/e)}function go(t,e,n,r,i,o,s){if(e==n)return s;var a,u,l=po(t[e],i),c=po(t[e+1],i);e+=r,o[s++]=l,o[s++]=c;do{if(a=po(t[e],i),u=po(t[e+1],i),(e+=r)==n)return o[s++]=a,o[s++]=u,s}while(a==l&&u==c);for(;e<n;){var h=po(t[e],i),f=po(t[e+1],i);if(e+=r,h!=a||f!=u){var p=a-l,d=u-c,g=h-l,y=f-c;p*y==d*g&&(p<0&&g<p||p==g||p>0&&g>p)&&(d<0&&y<d||d==y||d>0&&y>d)?(a=h,u=f):(o[s++]=a,o[s++]=u,l=a,c=u,a=h,u=f)}}return o[s++]=a,o[s++]=u,s}function yo(t,e,n,r,i,o,s,a){for(var u=0,l=n.length;u<l;++u){var c=n[u];s=go(t,e,c,r,i,o,s),a.push(s),e=c}return s}function vo(t,e,n,r,i){for(var o=void 0!==i?i:[],s=0,a=e;a<n;a+=r)o[s++]=t.slice(a,a+r);return o.length=s,o}function _o(t,e,n,r,i){for(var o=void 0!==i?i:[],s=0,a=0,u=n.length;a<u;++a){var l=n[a];o[s++]=vo(t,e,l,r,o[s]),e=l}return o.length=s,o}function mo(t,e,n,r,i){for(var o=void 0!==i?i:[],s=0,a=0,u=n.length;a<u;++a){var l=n[a];o[s++]=_o(t,e,l,r,o[s]),e=l[l.length-1]}return o.length=s,o}function xo(t,e,n,r){for(var i=0,o=t[n-r],s=t[n-r+1];e<n;e+=r){var a=t[e],u=t[e+1];i+=s*a-o*u,o=a,s=u}return i/2}function bo(t,e,n,r){for(var i=0,o=0,s=n.length;o<s;++o){var a=n[o];i+=xo(t,e,a,r),e=a}return i}var wo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Eo=function(t){function e(e,n){var r=t.call(this)||this;return r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return wo(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,r){return r<V(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),so(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.getArea=function(){return xo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return vo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=ho(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,Vi)},e.prototype.getType=function(){return"LinearRing"},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=lo(this.flatCoordinates,0,t,this.stride),this.changed()},e}(no),Co=Eo,So=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Po=function(t){function e(e,n){var r=t.call(this)||this;return r.setCoordinates(e,n),r}return So(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){var i=this.flatCoordinates,o=St(t,e,i[0],i[1]);if(o<r){for(var s=this.stride,a=0;a<s;++a)n[a]=i[a];return n.length=s,o}return r},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return K(this.flatCoordinates,t)},e.prototype.getType=function(){return"Point"},e.prototype.intersectsExtent=function(t){return X(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=uo(this.flatCoordinates,0,t,this.stride),this.changed()},e}(no),Io=Po;function Mo(t,e,n,r,i){return!rt(i,function(i){return!Oo(t,e,n,r,i[0],i[1])})}function Oo(t,e,n,r,i,o){for(var s=0,a=t[n-r],u=t[n-r+1];e<n;e+=r){var l=t[e],c=t[e+1];u<=o?c>o&&(l-a)*(o-u)-(i-a)*(c-u)>0&&s++:c<=o&&(l-a)*(o-u)-(i-a)*(c-u)<0&&s--,a=l,u=c}return 0!==s}function Lo(t,e,n,r,i,o){if(0===n.length)return!1;if(!Oo(t,e,n[0],r,i,o))return!1;for(var s=1,a=n.length;s<a;++s)if(Oo(t,n[s-1],n[s],r,i,o))return!1;return!0}function Ro(t,n,r,i,o,s,a){for(var u,l,c,h,f,p,d,g=o[s+1],y=[],v=0,_=r.length;v<_;++v){var m=r[v];for(h=t[m-i],p=t[m-i+1],u=n;u<m;u+=i)f=t[u],d=t[u+1],(g<=p&&d<=g||p<=g&&g<=d)&&(c=(g-p)/(d-p)*(f-h)+h,y.push(c)),h=f,p=d}var x=NaN,b=-1/0;for(y.sort(e),h=y[0],u=1,l=y.length;u<l;++u){f=y[u];var w=Math.abs(f-h);w>b&&Lo(t,n,r,i,c=(h+f)/2,g)&&(x=c,b=w),h=f}return isNaN(x)&&(x=o[s]),a?(a.push(x,g,b),a):[x,g,b]}function ko(t,e,n,r,i){var o;for(e+=r;e<n;e+=r)if(o=i(t.slice(e-r,e),t.slice(e,e+r)))return o;return!1}function To(t,e,n,r,i){var o=et([1/0,1/0,-1/0,-1/0],t,e,n,r);return!!yt(i,o)&&(!!W(i,o)||(o[0]>=i[0]&&o[2]<=i[2]||(o[1]>=i[1]&&o[3]<=i[3]||ko(t,e,n,r,function(t,e){return function(t,e,n){var r=!1,i=q(t,e),o=q(t,n);if(i===N||o===N)r=!0;else{var s=t[0],a=t[1],u=t[2],l=t[3],c=e[0],h=e[1],f=n[0],p=n[1],d=(p-h)/(f-c),g=void 0,y=void 0;o&A&&!(i&A)&&(r=(g=f-(p-l)/d)>=s&&g<=u),r||!(o&D)||i&D||(r=(y=p-(f-u)*d)>=a&&y<=l),r||!(o&F)||i&F||(r=(g=f-(p-a)/d)>=s&&g<=u),r||!(o&j)||i&j||(r=(y=p-(f-s)*d)>=a&&y<=l)}return r}(i,t,e)}))))}function No(t,e,n,r,i){return!!To(t,e,n,r,i)||(!!Oo(t,e,n,r,i[0],i[1])||(!!Oo(t,e,n,r,i[0],i[3])||(!!Oo(t,e,n,r,i[2],i[1])||!!Oo(t,e,n,r,i[2],i[3]))))}function Ao(t,e,n,r,i){if(!No(t,e,n[0],r,i))return!1;if(1===n.length)return!0;for(var o=1,s=n.length;o<s;++o)if(Mo(t,n[o-1],n[o],r,i)&&!To(t,n[o-1],n[o],r,i))return!1;return!0}function Do(t,e,n,r){for(;e<n-r;){for(var i=0;i<r;++i){var o=t[e+i];t[e+i]=t[n-r+i],t[n-r+i]=o}e+=r,n-=r}}function Fo(t,e,n,r){for(var i=0,o=t[n-r],s=t[n-r+1];e<n;e+=r){var a=t[e],u=t[e+1];i+=(a-o)*(u+s),o=a,s=u}return 0===i?void 0:i>0}function jo(t,e,n,r,i){for(var o=void 0!==i&&i,s=0,a=n.length;s<a;++s){var u=n[s],l=Fo(t,e,u,r);if(0===s){if(o&&l||!o&&!l)return!1}else if(o&&!l||!o&&l)return!1;e=u}return!0}function Go(t,e,n,r,i){for(var o=void 0!==i&&i,s=0,a=n.length;s<a;++s){var u=n[s],l=Fo(t,e,u,r);(0===s?o&&l||!o&&!l:o&&!l||!o&&l)&&Do(t,e,u,r),e=u}return e}function Bo(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o)e=Go(t,e,n[o],r,i);return e}var zo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vo=function(t){function e(e,n,r){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==n&&r?(i.setFlatCoordinates(n,e),i.ends_=r):i.setCoordinates(e,n),i}return zo(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?s(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<V(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(oo(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ao(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.containsXY=function(t,e){return Lo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return bo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Go(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,_o(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=at(this.getExtent());this.flatInteriorPoint_=Ro(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new Io(this.getFlatInteriorPoint(),Wi)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new Co(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.ends_,r=[],i=0,o=0,s=n.length;o<s;++o){var a=n[o],u=new Co(e.slice(i,a),t);r.push(u),i=a}return r},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;jo(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Go(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=yo(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,r),new e(n,Vi,r)},e.prototype.getType=function(){return"Polygon"},e.prototype.intersectsExtent=function(t){return Ao(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=co(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(no),Uo=Vo;function Wo(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=[e,n,e,i,r,i,r,n,e,n];return new Vo(o,Vi,[o.length])}function Xo(t,e,n){for(var r=e||32,i=t.getStride(),o=t.getLayout(),s=t.getCenter(),a=i*(r+1),u=new Array(a),l=0;l<a;l+=i){u[l]=0,u[l+1]=0;for(var c=2;c<i;c++)u[l+c]=s[c]}var h=[u.length],f=new Vo(u,o,h);return function(t,e,n,r){for(var i=t.getFlatCoordinates(),o=t.getStride(),s=i.length/o-1,a=r||0,u=0;u<=s;++u){var l=u*o,c=a+2*It(u,s)*Math.PI/s;i[l]=e[0]+n*Math.cos(c),i[l+1]=e[1]+n*Math.sin(c)}t.changed()}(f,s,t.getRadius(),n),f}var qo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yo=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=qt({},e);return n.hints_=[0,0],n.animations_=[],n.updateAnimationKey_,n.projection_=gi(r.projection,"EPSG:3857"),n.viewportSize_=[100,100],n.targetCenter_=null,n.targetResolution_,n.targetRotation_,n.nextCenter_=null,n.nextResolution_,n.nextRotation_,n.cancelAnchor_=void 0,r.projection&&ui(),r.center&&(r.center=Ii(r.center,n.projection_)),r.extent&&(r.extent=Oi(r.extent,n.projection_)),n.applyOptions_(r),n}return qo(e,t),e.prototype.applyOptions_=function(t){var e=qt({},t);for(var n in Fr)delete e[n];this.setProperties(e,!0);var r=function(t){var e,n,r,o=28,s=2,a=void 0!==t.minZoom?t.minZoom:0,u=void 0!==t.maxZoom?t.maxZoom:o,l=void 0!==t.zoomFactor?t.zoomFactor:s,c=void 0!==t.multiWorld&&t.multiWorld,h=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,f=void 0!==t.showFullExtent&&t.showFullExtent,p=gi(t.projection,"EPSG:3857"),d=p.getExtent(),g=t.constrainOnlyCenter,y=t.extent;c||y||!p.isGlobal()||(g=!1,y=d);if(void 0!==t.resolutions){var v=t.resolutions;n=v[a],r=void 0!==v[u]?v[u]:v[v.length-1],e=t.constrainResolution?function(t,e,n,r){return function(o,s,a,u){if(void 0!==o){var l=t[0],c=t[t.length-1],h=n?Ti(l,n,a,r):l;if(u)return void 0===e||e?Ni(o,h,c):bt(o,c,h);var f=Math.min(h,o),p=Math.floor(i(t,f,s));return t[p]>h&&p<t.length-1?t[p+1]:t[p]}}}(v,h,!g&&y,f):Ai(n,r,h,!g&&y,f)}else{var _=(d?Math.max(gt(d),ht(d)):360*Tr[Nr.DEGREES]/p.getMetersPerUnit())/jr/Math.pow(s,0),m=_/Math.pow(s,o-0);void 0!==(n=t.maxResolution)?a=0:n=_/Math.pow(l,a),void 0===(r=t.minResolution)&&(r=void 0!==t.maxZoom?void 0!==t.maxResolution?n/Math.pow(l,u):_/Math.pow(l,u):m),u=a+Math.floor(Math.log(n/r)/Math.log(l)),r=n/Math.pow(l,u-a),e=t.constrainResolution?function(t,e,n,r,i,o){return function(s,a,u,l){if(void 0!==s){var c=i?Ti(e,i,u,o):e,h=void 0!==n?n:0;if(l)return void 0===r||r?Ni(s,c,h):bt(s,h,c);var f=Math.ceil(Math.log(e/c)/Math.log(t)-1e-9),p=-a*(.5-1e-9)+.5,d=Math.min(c,s),g=Math.floor(Math.log(e/d)/Math.log(t)+p),y=Math.max(f,g);return bt(e/Math.pow(t,y),h,c)}}}(l,n,r,h,!g&&y,f):Ai(n,r,h,!g&&y,f)}return{constraint:e,maxResolution:n,minResolution:r,minZoom:a,zoomFactor:l}}(t);this.maxResolution_=r.maxResolution,this.minResolution_=r.minResolution,this.zoomFactor_=r.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=r.minZoom;var o=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Ri(t.extent,t.constrainOnlyCenter,e)}var n=gi(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&n.isGlobal()){var r=n.getExtent().slice();return r[0]=-1/0,r[2]=1/0,Ri(r,!1,!1)}return ki}(t),s=r.constraint,a=function(t){var e=void 0===t.enableRotation||t.enableRotation;if(e){var n=t.constrainRotation;return void 0===n||!0===n?(s=o||Pt(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=s?0:t:void 0}):!1===n?Fi:"number"==typeof n?(r=n,i=2*Math.PI/r,function(t,e){return e?t:void 0!==t?t=Math.floor(t/i+.5)*i:void 0}):Fi}return Di;var r,i;var o,s}(t);this.constraints_={center:o,resolution:s,rotation:a},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var n=this.getCenter();if(n){var r=t||[0,0,0,0];e=e||[0,0,0,0];var i=this.getResolution(),o=i/2*(r[3]-e[3]+e[1]-r[1]),s=i/2*(r[0]-e[0]+e[2]-r[2]);this.setCenterInternal([n[0]+o,n[1]-s])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),qt({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),n=0;n<e.length;++n){var r=arguments[n];r.center&&((r=qt({},r)).center=Ii(r.center,this.getProjection())),r.anchor&&((r=qt({},r)).anchor=Ii(r.anchor,this.getProjection())),e[n]=r}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,n=arguments.length;n>1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n);for(var r=0;r<n&&!this.isDef();++r){var i=arguments[r];i.center&&this.setCenterInternal(i.center),void 0!==i.zoom?this.setZoom(i.zoom):i.resolution&&this.setResolution(i.resolution),void 0!==i.rotation&&this.setRotation(i.rotation)}if(r!==n){for(var o=Date.now(),s=this.targetCenter_.slice(),a=this.targetResolution_,u=this.targetRotation_,l=[];r<n;++r){var c=arguments[r],h={start:o,complete:!1,anchor:c.anchor,duration:void 0!==c.duration?c.duration:1e3,easing:c.easing||Bi,callback:e};if(c.center&&(h.sourceCenter=s,h.targetCenter=c.center.slice(),s=h.targetCenter),void 0!==c.zoom?(h.sourceResolution=a,h.targetResolution=this.getResolutionForZoom(c.zoom),a=h.targetResolution):c.resolution&&(h.sourceResolution=a,h.targetResolution=c.resolution,a=h.targetResolution),void 0!==c.rotation){h.sourceRotation=u;var f=It(c.rotation-u+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=u+f,u=h.targetRotation}Zo(h)?h.complete=!0:o+=h.duration,l.push(h)}this.animations_.push(l),this.setHint(Ar,1),this.updateAnimations_()}else e&&Ho(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Ar]>0},e.prototype.getInteracting=function(){return this.hints_[Dr]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Ar,-this.hints_[Ar]);for(var e=0,n=this.animations_.length;e<n;++e){var r=this.animations_[e];if(r[0].callback&&Ho(r[0].callback,!1),!t)for(var i=0,o=r.length;i<o;++i){var s=r[i];if(!s.complete){t=s.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,n=this.animations_.length-1;n>=0;--n){for(var r=this.animations_[n],i=!0,o=0,s=r.length;o<s;++o){var a=r[o];if(!a.complete){var u=t-a.start,l=a.duration>0?u/a.duration:1;l>=1?(a.complete=!0,l=1):i=!1;var c=a.easing(l);if(a.sourceCenter){var h=a.sourceCenter[0],f=a.sourceCenter[1],p=a.targetCenter[0],d=a.targetCenter[1];this.nextCenter_=a.targetCenter;var g=h+c*(p-h),y=f+c*(d-f);this.targetCenter_=[g,y]}if(a.sourceResolution&&a.targetResolution){var v=1===c?a.targetResolution:a.sourceResolution+c*(a.targetResolution-a.sourceResolution);if(a.anchor){var _=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(v,0,_,!0);this.targetCenter_=this.calculateCenterZoom(m,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var x=1===c?It(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+c*(a.targetRotation-a.sourceRotation);if(a.anchor){var b=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(b,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(i){this.animations_[n]=null,this.setHint(Ar,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var w=r[0].callback;w&&Ho(w,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var n,r=this.getCenterInternal();return void 0!==r&&(qe(n=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),Ve(n,e)),n},e.prototype.calculateCenterZoom=function(t,e){var n,r=this.getCenterInternal(),i=this.getResolution();void 0!==r&&void 0!==i&&(n=[e[0]-t*(e[0]-r[0])/i,e[1]-t*(e[1]-r[1])/i]);return n},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],r=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(r*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Pi(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Fr.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Mi(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();P(n,1);var r=this.getResolution();P(void 0!==r,2);var i=this.getRotation();return P(void 0!==i,3),lt(n,r,i,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Fr.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Oi(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),r=gt(t)/n[0],i=ht(t)/n[1];return Math.max(r,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/Math.log(e);return function(t){return n/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(Fr.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/e;return function(t){return Math.log(n/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();r=Ko(r,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,n)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,n,r=this.minZoom_||0;if(this.resolutions_){var o=i(this.resolutions_,t,1);r=o,e=this.resolutions_[o],n=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,n=this.zoomFactor_;return r+Math.log(e/t)/Math.log(n)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=bt(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,bt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n;if(P(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))P(!vt(t),25),n=Wo(r=Oi(t,this.getProjection()));else if("Circle"===t.getType()){var r;(n=Wo(r=Oi(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),at(r))}else{var i=Si();n=i?t.clone().transform(i,this.getProjection()):t}this.fitInternal(n,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),r=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,u=-1/0,l=-1/0,c=0,h=i.length;c<h;c+=o){var f=i[c]*n-i[c+1]*r,p=i[c]*r+i[c+1]*n;s=Math.min(s,f),a=Math.min(a,p),u=Math.max(u,f),l=Math.max(l,p)}return[s,a,u,l]},e.prototype.fitInternal=function(t,e){var n=e||{},r=n.size;r||(r=this.getViewportSizeMinusPadding_());var i,o=void 0!==n.padding?n.padding:[0,0,0,0],s=void 0!==n.nearest&&n.nearest;i=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.getResolutionForZoom(n.maxZoom):0;var a=this.rotatedExtentForGeometry(t),u=this.getResolutionForExtentInternal(a,[r[0]-o[1]-o[3],r[1]-o[0]-o[2]]);u=isNaN(u)?i:Math.max(u,i),u=this.getConstrainedResolution(u,s?0:1);var l=this.getRotation(),h=Math.sin(l),f=Math.cos(l),p=at(a);p[0]+=(o[1]-o[3])/2*u,p[1]+=(o[0]-o[2])/2*u;var d=p[0]*f-p[1]*h,g=p[1]*f+p[0]*h,y=this.getConstrainedCenter([d,g],u),v=n.callback?n.callback:c;void 0!==n.duration?this.animateInternal({resolution:u,center:y,duration:n.duration,easing:n.easing},v):(this.targetResolution_=u,this.targetCenter_=y,this.applyTargetState_(!1,!0),Ho(v,!0))},e.prototype.centerOn=function(t,e,n){this.centerOnInternal(Ii(t,this.getProjection()),e,n)},e.prototype.centerOnInternal=function(t,e,n){this.setCenterInternal(Ko(t,e,n,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,n,r){var i,o=this.padding_;if(o&&t){var s=this.getViewportSizeMinusPadding_(-n),a=Ko(t,r,[s[0]/2+o[3],s[1]/2+o[0]],e,n);i=[t[0]-a[0],t[1]-a[1]]}return i},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=Pi(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var n=e&&Ii(e,this.getProjection());this.adjustResolutionInternal(t,n)},e.prototype.adjustResolutionInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,r,n);e&&(this.targetCenter_=this.calculateCenterZoom(i,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=Ii(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(r,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(t?Ii(t,this.getProjection()):t)},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var n=this.getAnimating()||this.getInteracting()||e,r=this.constraints_.rotation(this.targetRotation_,n),i=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,0,i,n),s=this.constraints_.center(this.targetCenter_,o,i,n,this.calculateCenterShift(this.targetCenter_,o,r,i));this.get(Fr.ROTATION)!==r&&this.set(Fr.ROTATION,r),this.get(Fr.RESOLUTION)!==o&&(this.set(Fr.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),s&&this.get(Fr.CENTER)&&Xe(this.get(Fr.CENTER),s)||this.set(Fr.CENTER,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,n){var r=void 0!==t?t:200,i=e||0,o=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(o),a=this.constraints_.resolution(this.targetResolution_,i,s),u=this.constraints_.center(this.targetCenter_,a,s,!1,this.calculateCenterShift(this.targetCenter_,a,o,s));if(0===r&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=o,this.targetCenter_=u,void this.applyTargetState_();var l=n||(0===r?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===o&&this.getCenterInternal()&&Xe(this.getCenterInternal(),u)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:u,resolution:a,duration:r,easing:Gi,anchor:l}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Dr,1)},e.prototype.endInteraction=function(t,e,n){var r=n&&Ii(n,this.getProjection());this.endInteractionInternal(t,e,r)},e.prototype.endInteractionInternal=function(t,e,n){this.setHint(Dr,-1),this.resolveConstraints(t,e,n)},e.prototype.getConstrainedCenter=function(t,e){var n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)},e.prototype.getConstrainedZoom=function(t,e){var n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))},e.prototype.getConstrainedResolution=function(t,e){var n=e||0,r=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,n,r)},e}(me);function Ho(t,e){setTimeout(function(){t(e)},0)}function Zo(t){return!(t.sourceCenter&&t.targetCenter&&!Xe(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ko(t,e,n,r,i){var o=Math.cos(-i),s=Math.sin(-i),a=t[0]*o-t[1]*s,u=t[1]*o+t[0]*s;return[(a+=(e[0]/2-n[0])*r)*o-(u+=(n[1]-e[1]/2)*r)*(s=-s),u*o+a*s]}var Jo=Yo;function $o(t){return t[0]>0&&t[1]>0}function Qo(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var ts=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function es(t){t instanceof ze?t.setMapInternal(null):t instanceof $n&&t.getLayers().forEach(es)}function ns(t,e){if(t instanceof ze)t.setMapInternal(e);else if(t instanceof $n)for(var n=t.getLayers().getArray(),r=0,i=n.length;r<i;++r)ns(n[r],e)}var rs=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n,r,i,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new $n({layers:t.layers});o[vr]=s,o[mr]=t.target,o[xr]=t.view instanceof Jo?t.view:new Jo,void 0!==t.controls&&(Array.isArray(t.controls)?n=new Yn(t.controls.slice()):(P("function"==typeof t.controls.getArray,47),n=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new Yn(t.interactions.slice()):(P("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new Yn(t.overlays.slice()):(P("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new Yn;return{controls:n,interactions:r,keyboardEventTarget:e,overlays:i,values:o}}(e);n.renderComplete_,n.loaded_=!0,n.boundHandleBrowserEvent_=n.handleBrowserEvent.bind(n),n.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,n.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:x,n.postRenderTimeoutHandle_,n.animationDelayKey_,n.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(n),n.coordinateToPixelTransform_=[1,0,0,1,0,0],n.pixelToCoordinateTransform_=[1,0,0,1,0,0],n.frameIndex_=0,n.frameState_=null,n.previousExtent_=null,n.viewPropertyListenerKey_=null,n.viewChangeListenerKey_=null,n.layerGroupPropertyListenerKeys_=null,n.viewport_=document.createElement("div"),n.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),n.viewport_.style.position="relative",n.viewport_.style.overflow="hidden",n.viewport_.style.width="100%",n.viewport_.style.height="100%",n.overlayContainer_=document.createElement("div"),n.overlayContainer_.style.position="absolute",n.overlayContainer_.style.zIndex="0",n.overlayContainer_.style.width="100%",n.overlayContainer_.style.height="100%",n.overlayContainer_.style.pointerEvents="none",n.overlayContainer_.className="ol-overlaycontainer",n.viewport_.appendChild(n.overlayContainer_),n.overlayContainerStopEvent_=document.createElement("div"),n.overlayContainerStopEvent_.style.position="absolute",n.overlayContainerStopEvent_.style.zIndex="0",n.overlayContainerStopEvent_.style.width="100%",n.overlayContainerStopEvent_.style.height="100%",n.overlayContainerStopEvent_.style.pointerEvents="none",n.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",n.viewport_.appendChild(n.overlayContainerStopEvent_),n.mapBrowserEventHandler_=null,n.moveTolerance_=e.moveTolerance,n.keyboardEventTarget_=r.keyboardEventTarget,n.targetChangeHandlerKeys_=null,n.controls=r.controls||new Yn,n.interactions=r.interactions||new Yn,n.overlays_=r.overlays,n.overlayIdIndex_={},n.renderer_=null,n.postRenderFunctions_=[],n.tileQueue_=new Rr(n.getTilePriority.bind(n),n.handleTileChange_.bind(n)),n.addChangeListener(vr,n.handleLayerGroupChanged_),n.addChangeListener(xr,n.handleViewChanged_),n.addChangeListener(_r,n.handleSizeChanged_),n.addChangeListener(mr,n.handleTargetChanged_),n.setProperties(r.values);var i=n;return!e.view||e.view instanceof Jo||e.view.then(function(t){i.setView(new Jo(t))}),n.controls.addEventListener(zn,function(t){t.element.setMap(this)}.bind(n)),n.controls.addEventListener(Vn,function(t){t.element.setMap(null)}.bind(n)),n.interactions.addEventListener(zn,function(t){t.element.setMap(this)}.bind(n)),n.interactions.addEventListener(Vn,function(t){t.element.setMap(null)}.bind(n)),n.overlays_.addEventListener(zn,function(t){this.addOverlayInternal_(t.element)}.bind(n)),n.overlays_.addEventListener(Vn,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(n)),n.controls.forEach(function(t){t.setMap(this)}.bind(n)),n.interactions.forEach(function(t){t.setMap(this)}.bind(n)),n.overlays_.forEach(n.addOverlayInternal_.bind(n)),n}return ts(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.handleLayerAdd_=function(t){ns(t.layer,this)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,n){if(this.frameState_&&this.renderer_){var r=this.getCoordinateFromPixelInternal(t),i=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,o=void 0!==n.layerFilter?n.layerFilter:u,s=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,s,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,function(t){n.push(t)},e),n},e.prototype.getAllLayers=function(){var t=[];return function e(n){n.forEach(function(n){n instanceof $n?e(n.getLayers()):t.push(n)})}(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,e,n){if(this.frameState_&&this.renderer_){var r=n||{},i=void 0!==r.hitTolerance?r.hitTolerance:0,o=r.layerFilter||u;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_||!this.renderer_)return!1;var n=this.getCoordinateFromPixelInternal(t),r=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:u,i=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,o,r,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),n="changedTouches"in t?t.changedTouches[0]:t;return[n.clientX-e.left,n.clientY-e.top]},e.prototype.getTarget=function(){return this.get(mr)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return Pi(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?O(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(vr)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof Yn)e.setLayers(t);else{var n=e.getLayers();n.clear(),n.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var r=t[e];if(r.visible){var i=r.layer.getRenderer();if(i&&!i.ready)return!0;var o=r.layer.getSource();if(o&&o.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=Ii(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?O(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(_r)},e.prototype.getView=function(){return this.get(xr)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,n,r){return function(t,e,n,r,i){if(!t||!(n in t.wantedTiles))return br;if(!t.wantedTiles[n][e.getKey()])return br;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}(this.frameState_,t,e,n,r)},e.prototype.handleBrowserEvent=function(t,e){var n=e||t.type,r=new ir(n,this,t);this.handleMapBrowserEvent(r)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,n=e.type;if(n===ar||n===le||n===ie){var r=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():r,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(i===r?r.documentElement:i).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var s=this.getInteractions().getArray().slice(),a=s.length-1;a>=0;a--){var u=s[a];if(u.getMap()===this&&u.getActive()&&this.getTargetElement())if(!u.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var n=this.maxTilesLoading_,r=n;if(t){var i=t.viewHints;if(i[Ar]||i[Dr]){var o=Date.now()-t.time>8;n=o?0:8,r=o?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,r))}t&&this.renderer_&&!t.animate&&(!0===this.renderComplete_?(this.hasListener(Fe)&&this.renderer_.dispatchRenderEvent(Fe,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new er(yr,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new er(gr,this,t))));for(var s=this.postRenderFunctions_,a=0,u=s.length;a<u;++a)s[a](this,t);s.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)fe(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(ee,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(le,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,yn(this.viewport_)}var n=this.getTargetElement();if(n){for(var r in n.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new hr(this,this.moveTolerance_),or)this.mapBrowserEventHandler_.addEventListener(or[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(ee,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(le,this.boundHandleBrowserEvent_,!!E&&{passive:!1});var i=this.getOwnerDocument().defaultView,o=this.keyboardEventTarget_?this.keyboardEventTarget_:n;this.targetChangeHandlerKeys_=[ce(o,ie,this.handleBrowserEvent,this),ce(o,oe,this.handleBrowserEvent,this),ce(i,ae,this.updateSize,this)]}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(fe(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(fe(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=ce(t,Xt,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=ce(t,Qt,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(fe),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Zn("addlayer",t)),this.layerGroupPropertyListenerKeys_=[ce(t,Xt,this.render,this),ce(t,Qt,this.render,this),ce(t,"addlayer",this.handleLayerAdd_,this),ce(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var r=t[e].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.handleLayerRemove_=function(t){es(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,n=this.getSize(),r=this.getView(),i=this.frameState_,o=null;if(void 0!==n&&$o(n)&&r&&r.isDef()){var s=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=r.getState();if(o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:lt(a.center,a.resolution,a.rotation,n),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:n,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{},mapId:p(this),renderTargets:{}},a.nextCenter&&a.nextResolution){var u=isNaN(a.nextRotation)?a.rotation:a.nextRotation;o.nextExtent=lt(a.nextCenter,a.nextResolution,u,n)}}if(this.frameState_=o,this.renderer_.renderFrame(o),o){if(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),i)(!this.previousExtent_||!vt(this.previousExtent_)&&!$(o.extent,this.previousExtent_))&&(this.dispatchEvent(new er(pr,this,i)),this.previousExtent_=Z(this.previousExtent_));this.previousExtent_&&!o.viewHints[Ar]&&!o.viewHints[Dr]&&!$(o.extent,this.previousExtent_)&&(this.dispatchEvent(new er(dr,this,o)),z(o.extent,this.previousExtent_))}this.dispatchEvent(new er(fr,this,o)),this.renderComplete_=this.hasListener(gr)||this.hasListener(yr)||this.hasListener(Fe)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()},0))},e.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new Zn("removelayer",e)),this.set(vr,t)},e.prototype.setSize=function(t){this.set(_r,t)},e.prototype.setTarget=function(t){this.set(mr,t)},e.prototype.setView=function(t){if(!t||t instanceof Jo)this.set(xr,t);else{this.set(xr,new Jo);var e=this;t.then(function(t){e.setView(new Jo(t))})}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var n=getComputedStyle(t),r=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),i=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);isNaN(r)||isNaN(i)||!$o(e=[r,i])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,n=getComputedStyle(this.viewport_);n.width&&n.height&&(e=[parseInt(n.width,10),parseInt(n.height,10)]),t.setViewportSize(e)}},e}(me);var is=rs,os=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ss=function(t){function e(e){var n=t.call(this)||this,r=e.element;return!r||e.target||r.style.pointerEvents||(r.style.pointerEvents="auto"),n.element=r||null,n.target_=null,n.map_=null,n.listenerKeys=[],e.render&&(n.render=e.render),e.target&&n.setTarget(e.target),n}return os(e,t),e.prototype.disposeInternal=function(){yn(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&yn(this.element);for(var e=0,n=this.listenerKeys.length;e<n;++e)fe(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,t)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==c&&this.listenerKeys.push(ce(t,fr,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(me),as=ss,us=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ls=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).ulElement_=document.createElement("ul"),n.collapsed_=void 0===r.collapsed||r.collapsed,n.userCollapsed_=n.collapsed_,n.overrideCollapsible_=void 0!==r.collapsible,n.collapsible_=void 0===r.collapsible||r.collapsible,n.collapsible_||(n.collapsed_=!1);var i=void 0!==r.className?r.className:"ol-attribution",o=void 0!==r.tipLabel?r.tipLabel:"Attributions",s=void 0!==r.expandClassName?r.expandClassName:i+"-expand",a=void 0!==r.collapseLabel?r.collapseLabel:"›",u=void 0!==r.collapseClassName?r.collapseClassName:i+"-collapse";"string"==typeof a?(n.collapseLabel_=document.createElement("span"),n.collapseLabel_.textContent=a,n.collapseLabel_.className=u):n.collapseLabel_=a;var l=void 0!==r.label?r.label:"i";"string"==typeof l?(n.label_=document.createElement("span"),n.label_.textContent=l,n.label_.className=s):n.label_=l;var c=n.collapsible_&&!n.collapsed_?n.collapseLabel_:n.label_;n.toggleButton_=document.createElement("button"),n.toggleButton_.setAttribute("type","button"),n.toggleButton_.setAttribute("aria-expanded",String(!n.collapsed_)),n.toggleButton_.title=o,n.toggleButton_.appendChild(c),n.toggleButton_.addEventListener(ne,n.handleClick_.bind(n),!1);var h=i+" "+on+" "+sn+(n.collapsed_&&n.collapsible_?" "+an:"")+(n.collapsible_?"":" ol-uncollapsible"),f=n.element;return f.className=h,f.appendChild(n.toggleButton_),f.appendChild(n.ulElement_),n.renderedAttributions_=[],n.renderedVisible_=!0,n}return us(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},n=[],r=!0,i=t.layerStatesArray,o=0,s=i.length;o<s;++o){var a=i[o];if(Be(a,t.viewState)){var u=a.layer.getSource();if(u){var l=u.getAttributions();if(l){var c=l(t);if(c)if(r=r&&!1!==u.getAttributionsCollapsible(),Array.isArray(c))for(var h=0,f=c.length;h<f;++h)c[h]in e||(n.push(c[h]),e[c[h]]=!0);else c in e||(n.push(c),e[c]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(r),n},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!a(e,this.renderedAttributions_)){vn(this.ulElement_);for(var r=0,i=e.length;r<i;++r){var o=document.createElement("li");o.innerHTML=e[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(an),this.collapsed_?gn(this.collapseLabel_,this.label_):gn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(as),cs=ls,hs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fs=function(t){function e(e){var n=this,r=e||{};n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this;var i=void 0!==r.className?r.className:"ol-rotate",o=void 0!==r.label?r.label:"⇧",s=void 0!==r.compassClassName?r.compassClassName:"ol-compass";n.label_=null,"string"==typeof o?(n.label_=document.createElement("span"),n.label_.className=s,n.label_.textContent=o):(n.label_=o,n.label_.classList.add(s));var a=r.tipLabel?r.tipLabel:"Reset rotation",u=document.createElement("button");u.className=i+"-reset",u.setAttribute("type","button"),u.title=a,u.appendChild(n.label_),u.addEventListener(ne,n.handleClick_.bind(n),!1);var l=i+" "+on+" "+sn,c=n.element;return c.className=l,c.appendChild(u),n.callResetNorth_=r.resetNorth?r.resetNorth:void 0,n.duration_=void 0!==r.duration?r.duration:250,n.autoHide_=void 0===r.autoHide||r.autoHide,n.rotation_=void 0,n.autoHide_&&n.element.classList.add(rn),n}return hs(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:Gi}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var n=e.viewState.rotation;if(n!=this.rotation_){var r="rotate("+n+"rad)";if(this.autoHide_){var i=this.element.classList.contains(rn);i||0!==n?i&&0!==n&&this.element.classList.remove(rn):this.element.classList.add(rn)}this.label_.style.transform=r}this.rotation_=n}},e}(as),ps=fs,ds=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gs=function(t){function e(e){var n=this,r=e||{};n=t.call(this,{element:document.createElement("div"),target:r.target})||this;var i=void 0!==r.className?r.className:"ol-zoom",o=void 0!==r.delta?r.delta:1,s=void 0!==r.zoomInClassName?r.zoomInClassName:i+"-in",a=void 0!==r.zoomOutClassName?r.zoomOutClassName:i+"-out",u=void 0!==r.zoomInLabel?r.zoomInLabel:"+",l=void 0!==r.zoomOutLabel?r.zoomOutLabel:"–",c=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",h=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",f=document.createElement("button");f.className=s,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof u?document.createTextNode(u):u),f.addEventListener(ne,n.handleClick_.bind(n,o),!1);var p=document.createElement("button");p.className=a,p.setAttribute("type","button"),p.title=h,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(ne,n.handleClick_.bind(n,-o),!1);var d=i+" "+on+" "+sn,g=n.element;return g.className=d,g.appendChild(f),g.appendChild(p),n.duration_=void 0!==r.duration?r.duration:250,n}return ds(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var n=e.getZoom();if(void 0!==n){var r=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:r,duration:this.duration_,easing:Gi})):e.setZoom(r)}}},e}(as),ys=gs;function vs(t){var e=t||{},n=new Yn;return(void 0===e.zoom||e.zoom)&&n.push(new ys(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&n.push(new ps(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&n.push(new cs(e.attributionOptions)),n}var _s="active",ms=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xs=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,e&&e.handleEvent&&(n.handleEvent=e.handleEvent),n.map_=null,n.setActive(!0),n}return ms(e,t),e.prototype.getActive=function(){return this.get(_s)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(_s,t)},e.prototype.setMap=function(t){this.map_=t},e}(me);function bs(t,e,n,r){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:n,duration:void 0!==r?r:250,easing:Gi})}}var ws=xs,Es=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cs=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:250,n}return Es(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==or.DBLCLICK){var n=t.originalEvent,r=t.map,i=t.coordinate,o=n.shiftKey?-this.delta_:this.delta_;bs(r.getView(),o,i,this.duration_),n.preventDefault(),e=!0}return!e},e}(ws),Ss=Cs,Ps=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Is=function(t){function e(e){var n=this,r=e||{};return n=t.call(this,r)||this,r.handleDownEvent&&(n.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(n.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(n.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(n.handleUpEvent=r.handleUpEvent),r.stopDown&&(n.stopDown=r.stopDown),n.handlingDownUpSequence=!1,n.targetPointers=[],n}return Ps(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==or.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==or.POINTERUP){var n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==or.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,e=this.stopDown(r)}else t.type==or.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){t.activePointers&&(this.targetPointers=t.activePointers)},e}(ws);function Ms(t){for(var e=t.length,n=0,r=0,i=0;i<e;i++)n+=t[i].clientX,r+=t[i].clientY;return[n/e,r/e]}var Os=Is;function Ls(t){var e=arguments;return function(t){for(var n=!0,r=0,i=e.length;r<i&&(n=n&&e[r](t));++r);return n}}var Rs=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ks=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){var e=t.map.getTargetElement(),n=t.map.getOwnerDocument().activeElement;return e.contains(n)}(t)},Ts=u,Ns=function(t){var e=t.originalEvent;return 0==e.button&&!(_&&m&&e.ctrlKey)},As=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Ds=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Fs=function(t){var e=t.originalEvent,n=e.target.tagName;return"INPUT"!==n&&"SELECT"!==n&&"TEXTAREA"!==n&&!e.target.isContentEditable},js=function(t){var e=t.originalEvent;return P(void 0!==e,56),"mouse"==e.pointerType},Gs=function(t){var e=t.originalEvent;return P(void 0!==e,56),e.isPrimary&&0===e.button},Bs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zs=function(t){function e(e){var n=t.call(this,{stopDown:l})||this,r=e||{};n.kinetic_=r.kinetic,n.lastCentroid=null,n.lastPointersCount_,n.panning_=!1;var i=r.condition?r.condition:Ls(As,Gs);return n.condition_=r.onFocusOnly?Ls(ks,i):i,n.noKinetic_=!1,n}return Bs(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,n=Ms(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],i=t.map.getView();Ye(r,i.getResolution()),qe(r,i.getRotation()),i.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,n=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var r=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),o=n.getCenterInternal(),s=e.getPixelFromCoordinateInternal(o),a=e.getCoordinateFromPixelInternal([s[0]-r*Math.cos(i),s[1]-r*Math.sin(i)]);n.animateInternal({center:n.getConstrainedCenter(a),duration:500,easing:Gi})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Os),Vs=zs,Us=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ws=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{stopDown:l})||this).condition_=r.condition?r.condition:Rs,n.lastAngle_=void 0,n.duration_=void 0!==r.duration?r.duration:250,n}return Us(e,t),e.prototype.handleDragEvent=function(t){if(js(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==Di){var r=e.getSize(),i=t.pixel,o=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;n.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!js(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!js(t)&&(!(!Ns(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Os),Xs=Ws,qs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ys=function(t){function e(e){var n=t.call(this)||this;return n.geometry_=null,n.element_=document.createElement("div"),n.element_.style.position="absolute",n.element_.style.pointerEvents="auto",n.element_.className="ol-box "+e,n.map_=null,n.startPixel_=null,n.endPixel_=null,n}return qs(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,n="px",r=this.element_.style;r.left=Math.min(t[0],e[0])+n,r.top=Math.min(t[1],e[1])+n,r.width=Math.abs(e[0]-t[0])+n,r.height=Math.abs(e[1]-t[1])+n},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new Uo([n])},e.prototype.getGeometry=function(){return this.geometry_},e}(t),Hs=Ys,Zs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ks="boxstart",Js="boxdrag",$s="boxend",Qs="boxcancel",ta=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.coordinate=n,i.mapBrowserEvent=r,i}return Zs(e,t),e}(Wt),ea=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=e||{};return n.box_=new Hs(r.className||"ol-dragbox"),n.minArea_=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(n.onBoxEnd=r.onBoxEnd),n.startPixel_=null,n.condition_=r.condition?r.condition:Ns,n.boxEndCondition_=r.boxEndCondition?r.boxEndCondition:n.defaultBoxEndCondition,n}return Zs(e,t),e.prototype.defaultBoxEndCondition=function(t,e,n){var r=n[0]-e[0],i=n[1]-e[1];return r*r+i*i>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new ta(Js,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new ta(e?$s:Qs,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new ta(Ks,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Os),na=ea,ra=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ia=function(t){function e(e){var n=this,r=e||{},i=r.condition?r.condition:Ds;return(n=t.call(this,{condition:i,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).duration_=void 0!==r.duration?r.duration:200,n.out_=void 0!==r.out&&r.out,n}return ra(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),n=this.getGeometry();if(this.out_){var r=e.rotatedExtentForGeometry(n),i=e.getResolutionForExtentInternal(r),o=e.getResolution()/i;(n=n.clone()).scale(o*o)}e.fitInternal(n,{duration:this.duration_,easing:Gi})},e}(na),oa=ia,sa=37,aa=38,ua=39,la=40,ca=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ha=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.defaultCondition_=function(t){return As(t)&&Fs(t)},n.condition_=void 0!==r.condition?r.condition:n.defaultCondition_,n.duration_=void 0!==r.duration?r.duration:100,n.pixelDelta_=void 0!==r.pixelDelta?r.pixelDelta:128,n}return ca(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ie){var n=t.originalEvent,r=n.keyCode;if(this.condition_(t)&&(r==la||r==sa||r==ua||r==aa)){var i=t.map.getView(),o=i.getResolution()*this.pixelDelta_,s=0,a=0;r==la?a=-o:r==sa?s=-o:r==ua?s=o:a=o;var u=[s,a];qe(u,i.getRotation()),function(t,e,n){var r=t.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];t.animateInternal({duration:void 0!==n?n:250,easing:zi,center:t.getConstrainedCenter(i)})}}(i,u,this.duration_),n.preventDefault(),e=!0}}return!e},e}(ws),fa=ha,pa=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),da=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.condition_=r.condition?r.condition:Fs,n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:100,n}return pa(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ie||t.type==oe){var n=t.originalEvent,r=n.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=t.map,o=r=="+".charCodeAt(0)?this.delta_:-this.delta_;bs(i.getView(),o,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},e}(ws),ga=da,ya=function(){function t(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var n=e-3;n>0&&this.points_[n+2]>t;)n-=3;var r=this.points_[e+2]-this.points_[n+2];if(r<1e3/60)return!1;var i=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/r,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),va=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_a="trackpad",ma="wheel",xa=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,r)||this).totalDelta_=0,n.lastDelta_=0,n.maxDelta_=void 0!==r.maxDelta?r.maxDelta:1,n.duration_=void 0!==r.duration?r.duration:250,n.timeout_=void 0!==r.timeout?r.timeout:80,n.useAnchor_=void 0===r.useAnchor||r.useAnchor,n.constrainResolution_=void 0!==r.constrainResolution&&r.constrainResolution;var i=r.condition?r.condition:Ts;return n.condition_=r.onFocusOnly?Ls(ks,i):i,n.lastAnchor_=null,n.startTime_=void 0,n.timeoutId_,n.mode_=void 0,n.trackpadEventGap_=400,n.trackpadTimeoutId_,n.deltaPerZoom_=300,n}return va(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap();t&&t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==le)return!0;var e,n=t.map,r=t.originalEvent;if(r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==le&&(e=r.deltaY,v&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=x),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?_a:ma);var o=n.getView();if(this.mode_===_a&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-bt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),bs(e,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(ws),ba=xa,wa=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ea=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=l),(n=t.call(this,i)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==r.threshold?r.threshold:.3,n.duration_=void 0!==r.duration?r.duration:250,n}return wa(e,t),e.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Di){var u=s.getViewport().getBoundingClientRect(),l=Ms(this.targetPointers);l[0]-=u.left,l[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(l),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Os),Ca=Ea,Sa=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pa=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=l),(n=t.call(this,i)||this).anchor_=null,n.duration_=void 0!==r.duration?r.duration:400,n.lastDistance_=void 0,n.lastScaleDelta_=1,n}return Sa(e,t),e.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,o=n.clientY-r.clientY,s=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,u=a.getView();1!=e&&(this.lastScaleDelta_=e);var l=a.getViewport().getBoundingClientRect(),c=Ms(this.targetPointers);c[0]-=l.left,c[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(c),a.render(),u.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Os),Ia=Pa;function Ma(t){var e=t||{},n=new Yn,r=new ya(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&n.push(new Xs),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&n.push(new Ss({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&n.push(new Vs({onFocusOnly:e.onFocusOnly,kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&n.push(new Ca),(void 0===e.pinchZoom||e.pinchZoom)&&n.push(new Ia({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(n.push(new fa),n.push(new ga({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&n.push(new ba({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&n.push(new oa({duration:e.zoomDuration})),n}var Oa=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),La=function(t){function e(e){return(e=qt({},e)).controls||(e.controls=vs()),e.interactions||(e.interactions=Ma({onFocusOnly:!0})),t.call(this,e)||this}return Oa(e,t),e.prototype.createRenderer=function(){return new Bn(this)},e}(is),Ra=La,ka=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ta=function(t){function e(e){var n=t.call(this)||this;if(n.on,n.once,n.un,n.id_=void 0,n.geometryName_="geometry",n.style_=null,n.styleFunction_=void 0,n.geometryChangeKey_=null,n.addChangeListener(n.geometryName_,n.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var r=e;n.setGeometry(r)}else{var i=e;n.setProperties(i)}return n}return ka(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var n=this.getGeometry();n&&t.setGeometry(n.clone());var r=this.getStyle();return r&&t.setStyle(r),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(fe(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=ce(t,Qt,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(P("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(me);var Na=Ta,Aa=6371008.8,Da={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*Aa,kilometers:6371.0088,kilometres:6371.0088,meters:Aa,metres:Aa,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:Aa/1852,radians:1,yards:6967335.223679999};function Fa(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function ja(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ha(t[0])||!Ha(t[1]))throw new Error("coordinates must contain numbers");return Fa({type:"Point",coordinates:t},e,n)}function Ga(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return Fa({type:"Polygon",coordinates:t},e,n)}function Ba(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return Fa({type:"LineString",coordinates:t},e,n)}function za(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function Va(t,e,n){return void 0===n&&(n={}),Fa({type:"MultiLineString",coordinates:t},e,n)}function Ua(t,e,n){return void 0===n&&(n={}),Fa({type:"MultiPoint",coordinates:t},e,n)}function Wa(t,e){void 0===e&&(e="kilometers");var n=Da[e];if(!n)throw new Error(e+" units is invalid");return t*n}function Xa(t,e){void 0===e&&(e="kilometers");var n=Da[e];if(!n)throw new Error(e+" units is invalid");return t/n}function qa(t){return 180*(t%(2*Math.PI))/Math.PI}function Ya(t){return t%360*Math.PI/180}function Ha(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function Za(t,e,n){if(null!==t)for(var r,i,o,s,a,u,l,c,h=0,f=0,p=t.type,d="FeatureCollection"===p,g="Feature"===p,y=d?t.features.length:1,v=0;v<y;v++){a=(c=!!(l=d?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===l.type)?l.geometries.length:1;for(var _=0;_<a;_++){var m=0,x=0;if(null!==(s=c?l.geometries[_]:l)){u=s.coordinates;var b=s.type;switch(h=!n||"Polygon"!==b&&"MultiPolygon"!==b?0:1,b){case null:break;case"Point":if(!1===e(u,f,v,m,x))return!1;f++,m++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(!1===e(u[r],f,v,m,x))return!1;f++,"MultiPoint"===b&&m++}"LineString"===b&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-h;i++){if(!1===e(u[r][i],f,v,m,x))return!1;f++}"MultiLineString"===b&&m++,"Polygon"===b&&x++}"Polygon"===b&&m++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(x=0,i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-h;o++){if(!1===e(u[r][i][o],f,v,m,x))return!1;f++}x++}m++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===Za(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ka(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function Ja(t,e){var n,r,i,o,s,a,u,l,c,h,f=0,p="FeatureCollection"===t.type,d="Feature"===t.type,g=p?t.features.length:1;for(n=0;n<g;n++){for(a=p?t.features[n].geometry:d?t.geometry:t,l=p?t.features[n].properties:d?t.properties:{},c=p?t.features[n].bbox:d?t.bbox:void 0,h=p?t.features[n].id:d?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,f,l,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],f,l,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,l,c,h))return!1;f++}}function $a(t,e){Ja(t,function(t,n,r,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(Fa(t,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var l=t.coordinates[u];if(!1===e(Fa({type:s,coordinates:l},r),n,u))return!1}})}function Qa(t,e){$a(t,function(t,n,r){var i=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,u=0,l=0;return!1!==Za(t,function(o,c,h,f,p){if(void 0===s||n>a||f>u||p>l)return s=o,a=n,u=f,l=p,void(i=0);var d=Ba([s,o],t.properties);if(!1===e(d,n,r,p,i))return!1;i++,s=o})&&void 0}}})}function tu(t){var e=[1/0,1/0,-1/0,-1/0];return Za(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}tu.default=tu;var eu=tu;function nu(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function ru(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function iu(t){return"Feature"===t.type?t.geometry:t}n(5228);n(1476);function ou(t){return new Float64Array(t)}ou(4),ou(8),ou(12),ou(16),ou(4);ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(8),ou(8),ou(8),ou(4),ou(8),ou(8),ou(16),ou(12);ou(192),ou(192);ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(8),ou(8),ou(8),ou(8),ou(8),ou(8),ou(8),ou(8),ou(8),ou(4),ou(4),ou(4),ou(8),ou(16),ou(16),ou(16),ou(32),ou(32),ou(48),ou(64);ou(1152),ou(1152);ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(24),ou(24),ou(24),ou(24),ou(24),ou(24),ou(24),ou(24),ou(24),ou(24),ou(1152),ou(1152),ou(1152),ou(1152),ou(1152),ou(2304),ou(2304),ou(3456),ou(5760),ou(8),ou(8),ou(8),ou(16),ou(24),ou(48),ou(48),ou(96),ou(192),ou(384),ou(384),ou(384),ou(768);ou(96),ou(96),ou(96),ou(1152);function su(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=nu(t),i=iu(e),o=i.type,s=e.bbox,a=i.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(r,s))return!1;"Polygon"===o&&(a=[a]);for(var u=!1,l=0;l<a.length&&!u;l++)if(au(r,a[l][0],n.ignoreBoundary)){for(var c=!1,h=1;h<a[l].length&&!c;)au(r,a[l][h],!n.ignoreBoundary)&&(c=!0),h++;c||(u=!0)}return u}function au(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;i<e.length;o=i++){var s=e[i][0],a=e[i][1],u=e[o][0],l=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+l*(t[0]-s)===0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(l-t[1])<=0)return!n;a>t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(r=!r)}return r}var uu=function(t,e,n){void 0===n&&(n={});var r=nu(t),i=nu(e),o=Ya(i[1]-r[1]),s=Ya(i[0]-r[0]),a=Ya(r[1]),u=Ya(i[1]),l=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(u);return Wa(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),n.units)};Object.prototype.hasOwnProperty;var lu=new ArrayBuffer(16);new Float64Array(lu),new Uint32Array(lu);n(2519);!function(){function t(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(e=0;e<this.length-1;e++){var n=this.points[e],r=this.points[e+1];this.centers.push({x:(n.x+r.x)/2,y:(n.y+r.y)/2,z:(n.z+r.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(e=0;e<this.centers.length-1;e++){var i=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,o=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,s=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+s)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}t.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var r=0;r<this.duration;r+=10){var i=this.pos(r);Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y)+(i.z-n.z)*(i.z-n.z))>t&&(e.push(r),n=i)}return e},t.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},t.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t,n=e*t;return[n,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t),s={x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]};return s}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])}}();var cu=function(t){return function(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[n,r];return Ga([[s,[i,r],[i,o],[n,o],s]],e.properties,{bbox:t,id:e.id})}(eu(t))};function hu(t,e,n,r){void 0===r&&(r={});var i=nu(t),o=Ya(i[0]),s=Ya(i[1]),a=Ya(n),u=Xa(e,r.units),l=Math.asin(Math.sin(s)*Math.cos(u)+Math.cos(s)*Math.sin(u)*Math.cos(a));return ja([qa(o+Math.atan2(Math.sin(a)*Math.sin(u)*Math.cos(s),Math.cos(u)-Math.sin(s)*Math.sin(l))),qa(l)],r.properties)}function fu(t,e,n){if(void 0===n&&(n={}),!0===n.final)return function(t,e){var n=fu(e,t);return n=(n+180)%360}(t,e);var r=nu(t),i=nu(e),o=Ya(r[0]),s=Ya(i[0]),a=Ya(r[1]),u=Ya(i[1]),l=Math.sin(s-o)*Math.cos(u),c=Math.cos(a)*Math.sin(u)-Math.sin(a)*Math.cos(u)*Math.cos(s-o);return qa(Math.atan2(l,c))}var pu=function(t,e){void 0===e&&(e={});var n=eu(t);return ja([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)};n(6570);var du=function(t){if(!t)throw new Error("geojson is required");var e=[];return $a(t,function(t){!function(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":n=ru(r);break;case"LineString":n=[ru(r)]}n.forEach(function(n){var r=function(t,e){var n=[];return t.reduce(function(t,r){var i=Ba([t,r],e);return i.bbox=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],s=n<i?n:i,a=r<o?r:o,u=n>i?n:i,l=r>o?r:o;return[s,a,u,l]}(t,r),n.push(i),r}),n}(n,t.properties);r.forEach(function(t){t.id=e.length,e.push(t)})})}}(t,e)}),za(e)},gu=n(4945);function yu(t,e){var n=ru(t),r=ru(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],u=r[0][0],l=r[0][1],c=r[1][0],h=r[1][1],f=(h-l)*(s-i)-(c-u)*(a-o),p=(c-u)*(o-l)-(h-l)*(i-u),d=(s-i)*(o-l)-(a-o)*(i-u);if(0===f)return null;var g=p/f,y=d/f;return g>=0&&g<=1&&y>=0&&y<=1?ja([i+g*(s-i),o+g*(a-o)]):null}var vu=function(t,e){var n={},r=[];if("LineString"===t.type&&(t=Fa(t)),"LineString"===e.type&&(e=Fa(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var i=yu(t,e);return i&&r.push(i),za(r)}var o=gu();return o.load(du(e)),Ka(du(t),function(t){Ka(o.search(t),function(e){var i=yu(t,e);if(i){var o=ru(i).join(",");n[o]||(n[o]=!0,r.push(i))}})}),za(r)};var _u=function(t,e,n){void 0===n&&(n={});var r=ja([1/0,1/0],{dist:1/0}),i=0;return $a(t,function(t){for(var o=ru(t),s=0;s<o.length-1;s++){var a=ja(o[s]);a.properties.dist=uu(e,a,n);var u=ja(o[s+1]);u.properties.dist=uu(e,u,n);var l=uu(a,u,n),c=Math.max(a.properties.dist,u.properties.dist),h=fu(a,u),f=hu(e,c,h+90,n),p=hu(e,c,h-90,n),d=vu(Ba([f.geometry.coordinates,p.geometry.coordinates]),Ba([a.geometry.coordinates,u.geometry.coordinates])),g=null;d.features.length>0&&((g=d.features[0]).properties.dist=uu(e,g,n),g.properties.location=i+uu(a,g,n)),a.properties.dist<r.properties.dist&&((r=a).properties.index=s,r.properties.location=i),u.properties.dist<r.properties.dist&&((r=u).properties.index=s+1,r.properties.location=i+l),g&&g.properties.dist<r.properties.dist&&((r=g).properties.index=s),i+=l}}),r};function mu(t){var e,n,r={type:"FeatureCollection",features:[]};if("LineString"===(n="Feature"===t.type?t.geometry:t).type)e=[n.coordinates];else if("MultiLineString"===n.type)e=n.coordinates;else if("MultiPolygon"===n.type)e=[].concat.apply([],n.coordinates);else{if("Polygon"!==n.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=n.coordinates}return e.forEach(function(t){e.forEach(function(e){for(var n=0;n<t.length-1;n++)for(var i=n;i<e.length-1;i++){if(t===e){if(1===Math.abs(n-i))continue;if(0===n&&i===t.length-2&&t[n][0]===t[t.length-1][0]&&t[n][1]===t[t.length-1][1])continue}var o=xu(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[i][0],e[i][1],e[i+1][0],e[i+1][1]);o&&r.features.push(ja([o[0],o[1]]))}})}),r}function xu(t,e,n,r,i,o,s,a){var u,l,c,h,f={x:null,y:null,onLine1:!1,onLine2:!1};return 0===(u=(a-o)*(n-t)-(s-i)*(r-e))?null!==f.x&&null!==f.y&&f:(h=(n-t)*(l=e-o)-(r-e)*(c=t-i),l=((s-i)*l-(a-o)*c)/u,c=h/u,f.x=t+l*(n-t),f.y=e+l*(r-e),l>=0&&l<=1&&(f.onLine1=!0),c>=0&&c<=1&&(f.onLine2=!0),!(!f.onLine1||!f.onLine2)&&[f.x,f.y])}function bu(t,e){return void 0===e&&(e={}),function(t,e,n){var r=n,i=!1;return Qa(t,function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0}),r}(t,function(t,n){var r=n.geometry.coordinates;return t+uu(r[0],r[1],e)},0)}function wu(t,e,n,r,i){var o=n[0],s=n[1],a=t[0],u=t[1],l=e[0],c=e[1],h=l-a,f=c-u,p=(n[0]-a)*f-(n[1]-u)*h;if(null!==i){if(Math.abs(p)>i)return!1}else if(0!==p)return!1;return r?"start"===r?Math.abs(h)>=Math.abs(f)?h>0?a<o&&o<=l:l<=o&&o<a:f>0?u<s&&s<=c:c<=s&&s<u:"end"===r?Math.abs(h)>=Math.abs(f)?h>0?a<=o&&o<l:l<o&&o<=a:f>0?u<=s&&s<c:c<s&&s<=u:"both"===r&&(Math.abs(h)>=Math.abs(f)?h>0?a<o&&o<l:l<o&&o<a:f>0?u<s&&s<c:c<s&&s<u):Math.abs(h)>=Math.abs(f)?h>0?a<=o&&o<=l:l<=o&&o<=a:f>0?u<=s&&s<=c:c<=s&&s<=u}var Eu=function(t,e,n){void 0===n&&(n={});for(var r=nu(t),i=ru(e),o=0;o<i.length-1;o++){var s=!1;if(n.ignoreEndVertices&&(0===o&&(s="start"),o===i.length-2&&(s="end"),0===o&&o+1===i.length-1&&(s="both")),wu(i[o],i[o+1],r,s,void 0===n.epsilon?null:n.epsilon))return!0}return!1};var Cu=Math.PI/180,Su=180/Math.PI,Pu=function(t,e){this.lon=t,this.lat=e,this.x=Cu*t,this.y=Cu*e};Pu.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},Pu.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new Pu(e,t)};var Iu=function(){this.coords=[],this.length=0};Iu.prototype.move_to=function(t){this.length++,this.coords.push(t)};var Mu=function(t){this.properties=t||{},this.geometries=[]};Mu.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e<this.geometries.length;e++)t.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}},Mu.prototype.wkt=function(){for(var t="",e="LINESTRING(",n=function(t){e+=t[0]+" "+t[1]+","},r=0;r<this.geometries.length;r++){if(0===this.geometries[r].coords.length)return"LINESTRING(empty)";this.geometries[r].coords.forEach(n),t+=e.substring(0,e.length-1)+")"}return t};var Ou=function(t,e,n){if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new Pu(t.x,t.y),this.end=new Pu(e.x,e.y),this.properties=n||{};var r=this.start.x-this.end.x,i=this.start.y-this.end.y,o=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(r/2),2);if(this.g=2*Math.asin(Math.sqrt(o)),this.g===Math.PI)throw new Error("it appears "+t.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+t+" and "+e)};Ou.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),s=Su*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[Su*Math.atan2(i,r),s]},Ou.prototype.Arc=function(t,e){var n=[];if(!t||t<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else for(var r=1/(t-1),i=0;i<t;++i){var o=r*i,s=this.interpolate(o);n.push(s)}for(var a=!1,u=0,l=e&&e.offset?e.offset:10,c=180-l,h=-180+l,f=360-l,p=1;p<n.length;++p){var d=n[p-1][0],g=n[p][0],y=Math.abs(g-d);y>f&&(g>c&&d<h||d>c&&g<h)?a=!0:y>u&&(u=y)}var v=[];if(a&&u<l){var _=[];v.push(_);for(var m=0;m<n.length;++m){var x=parseFloat(n[m][0]);if(m>0&&Math.abs(x-n[m-1][0])>f){var b=parseFloat(n[m-1][0]),w=parseFloat(n[m-1][1]),E=parseFloat(n[m][0]),C=parseFloat(n[m][1]);if(b>-180&&b<h&&180===E&&m+1<n.length&&n[m-1][0]>-180&&n[m-1][0]<h){_.push([-180,n[m][1]]),m++,_.push([n[m][0],n[m][1]]);continue}if(b>c&&b<180&&-180===E&&m+1<n.length&&n[m-1][0]>c&&n[m-1][0]<180){_.push([180,n[m][1]]),m++,_.push([n[m][0],n[m][1]]);continue}if(b<h&&E>c){var S=b;b=E,E=S;var P=w;w=C,C=P}if(b>c&&E<h&&(E+=360),b<=180&&E>=180&&b<E){var I=(180-b)/(E-b),M=I*C+(1-I)*w;_.push([n[m-1][0]>c?180:-180,M]),(_=[]).push([n[m-1][0]>c?-180:180,M]),v.push(_)}else _=[],v.push(_);_.push([x,n[m][1]])}else _.push([n[m][0],n[m][1]])}}else{var O=[];v.push(O);for(var L=0;L<n.length;++L)O.push([n[L][0],n[L][1]])}for(var R=new Mu(this.properties),k=0;k<v.length;++k){var T=new Iu;R.geometries.push(T);for(var N=v[k],A=0;A<N.length;++A)T.move_to(N[A])}return R};var Lu=n(4982);function Ru(t,e){var n=ru(e),r=ru(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;return Lu(n[0],i)?s.unshift(n[1]):Lu(n[0],o)?s.push(n[1]):Lu(n[1],i)?s.unshift(n[0]):Lu(n[1],o)&&s.push(n[0]),t}var ku=function(t,e,n){if(void 0===n&&(n={}),!(r=n=n||{})||r.constructor!==Object)throw new Error("options is invalid");var r,i,o=n.tolerance||0,s=[],a=gu(),u=du(t);return a.load(u),Qa(e,function(t){var e=!1;t&&(Ka(a.search(t),function(n){if(!1===e){var r=ru(t).sort(),s=ru(n).sort();Lu(r,s)||(0===o?Eu(r[0],n)&&Eu(r[1],n):_u(n,r[0]).properties.dist<=o&&_u(n,r[1]).properties.dist<=o)?(e=!0,i=i?Ru(i,t):t):(0===o?Eu(s[0],t)&&Eu(s[1],t):_u(t,s[0]).properties.dist<=o&&_u(t,s[1]).properties.dist<=o)&&(i=i?Ru(i,n):n)}}),!1===e&&i&&(s.push(i),i=void 0))}),i&&s.push(i),za(s)};var Tu=[],Nu=[],Au=[],Du=[],Fu=[],ju=[],Gu=[],Bu=[],zu=[],Vu=[],Uu=[],Wu=[],Xu=[],qu=[],Yu=[],Hu=[],Zu=[],Ku=[],Ju=[],$u=[],Qu=[],tl=[],el=[],nl=[];Gu[85]=Vu[85]=-1,Bu[85]=Uu[85]=0,zu[85]=Wu[85]=1,Ju[85]=tl[85]=1,$u[85]=el[85]=0,Qu[85]=nl[85]=1,Tu[85]=Du[85]=0,Nu[85]=Fu[85]=-1,Au[85]=Yu[85]=0,Hu[85]=Xu[85]=0,Zu[85]=qu[85]=1,ju[85]=Ku[85]=1,tl[1]=tl[169]=0,el[1]=el[169]=-1,nl[1]=nl[169]=0,Xu[1]=Xu[169]=-1,qu[1]=qu[169]=0,Yu[1]=Yu[169]=0,Vu[4]=Vu[166]=0,Uu[4]=Uu[166]=-1,Wu[4]=Wu[166]=1,Hu[4]=Hu[166]=1,Zu[4]=Zu[166]=0,Ku[4]=Ku[166]=0,Gu[16]=Gu[154]=0,Bu[16]=Bu[154]=1,zu[16]=zu[154]=1,Du[16]=Du[154]=1,Fu[16]=Fu[154]=0,ju[16]=ju[154]=1,Ju[64]=Ju[106]=0,$u[64]=$u[106]=1,Qu[64]=Qu[106]=0,Tu[64]=Tu[106]=-1,Nu[64]=Nu[106]=0,Au[64]=Au[106]=1,Ju[2]=Ju[168]=0,$u[2]=$u[168]=-1,Qu[2]=Qu[168]=1,tl[2]=tl[168]=0,el[2]=el[168]=-1,nl[2]=nl[168]=0,Xu[2]=Xu[168]=-1,qu[2]=qu[168]=0,Yu[2]=Yu[168]=0,Hu[2]=Hu[168]=-1,Zu[2]=Zu[168]=0,Ku[2]=Ku[168]=1,Gu[8]=Gu[162]=0,Bu[8]=Bu[162]=-1,zu[8]=zu[162]=0,Vu[8]=Vu[162]=0,Uu[8]=Uu[162]=-1,Wu[8]=Wu[162]=1,Xu[8]=Xu[162]=1,qu[8]=qu[162]=0,Yu[8]=Yu[162]=1,Hu[8]=Hu[162]=1,Zu[8]=Zu[162]=0,Ku[8]=Ku[162]=0,Gu[32]=Gu[138]=0,Bu[32]=Bu[138]=1,zu[32]=zu[138]=1,Vu[32]=Vu[138]=0,Uu[32]=Uu[138]=1,Wu[32]=Wu[138]=0,Tu[32]=Tu[138]=1,Nu[32]=Nu[138]=0,Au[32]=Au[138]=0,Du[32]=Du[138]=1,Fu[32]=Fu[138]=0,ju[32]=ju[138]=1,tl[128]=tl[42]=0,el[128]=el[42]=1,nl[128]=nl[42]=1,Ju[128]=Ju[42]=0,$u[128]=$u[42]=1,Qu[128]=Qu[42]=0,Tu[128]=Tu[42]=-1,Nu[128]=Nu[42]=0,Au[128]=Au[42]=1,Du[128]=Du[42]=-1,Fu[128]=Fu[42]=0,ju[128]=ju[42]=0,Vu[5]=Vu[165]=-1,Uu[5]=Uu[165]=0,Wu[5]=Wu[165]=0,tl[5]=tl[165]=1,el[5]=el[165]=0,nl[5]=nl[165]=0,Hu[20]=Hu[150]=0,Zu[20]=Zu[150]=1,Ku[20]=Ku[150]=1,Du[20]=Du[150]=0,Fu[20]=Fu[150]=-1,ju[20]=ju[150]=1,Gu[80]=Gu[90]=-1,Bu[80]=Bu[90]=0,zu[80]=zu[90]=1,Ju[80]=Ju[90]=1,$u[80]=$u[90]=0,Qu[80]=Qu[90]=1,Xu[65]=Xu[105]=0,qu[65]=qu[105]=1,Yu[65]=Yu[105]=0,Tu[65]=Tu[105]=0,Nu[65]=Nu[105]=-1,Au[65]=Au[105]=0,Gu[160]=Gu[10]=-1,Bu[160]=Bu[10]=0,zu[160]=zu[10]=1,Vu[160]=Vu[10]=-1,Uu[160]=Uu[10]=0,Wu[160]=Wu[10]=0,tl[160]=tl[10]=1,el[160]=el[10]=0,nl[160]=nl[10]=0,Ju[160]=Ju[10]=1,$u[160]=$u[10]=0,Qu[160]=Qu[10]=1,Hu[130]=Hu[40]=0,Zu[130]=Zu[40]=1,Ku[130]=Ku[40]=1,Xu[130]=Xu[40]=0,qu[130]=qu[40]=1,Yu[130]=Yu[40]=0,Tu[130]=Tu[40]=0,Nu[130]=Nu[40]=-1,Au[130]=Au[40]=0,Du[130]=Du[40]=0,Fu[130]=Fu[40]=-1,ju[130]=ju[40]=1,Vu[37]=Vu[133]=0,Uu[37]=Uu[133]=1,Wu[37]=Wu[133]=1,tl[37]=tl[133]=0,el[37]=el[133]=1,nl[37]=nl[133]=0,Tu[37]=Tu[133]=-1,Nu[37]=Nu[133]=0,Au[37]=Au[133]=0,Du[37]=Du[133]=1,Fu[37]=Fu[133]=0,ju[37]=ju[133]=0,Hu[148]=Hu[22]=-1,Zu[148]=Zu[22]=0,Ku[148]=Ku[22]=0,tl[148]=tl[22]=0,el[148]=el[22]=-1,nl[148]=nl[22]=1,Ju[148]=Ju[22]=0,$u[148]=$u[22]=1,Qu[148]=Qu[22]=1,Du[148]=Du[22]=-1,Fu[148]=Fu[22]=0,ju[148]=ju[22]=1,Gu[82]=Gu[88]=0,Bu[82]=Bu[88]=-1,zu[82]=zu[88]=1,Hu[82]=Hu[88]=1,Zu[82]=Zu[88]=0,Ku[82]=Ku[88]=1,Xu[82]=Xu[88]=-1,qu[82]=qu[88]=0,Yu[82]=Yu[88]=1,Ju[82]=Ju[88]=0,$u[82]=$u[88]=-1,Qu[82]=Qu[88]=0,Gu[73]=Gu[97]=0,Bu[73]=Bu[97]=1,zu[73]=zu[97]=0,Vu[73]=Vu[97]=0,Uu[73]=Uu[97]=-1,Wu[73]=Wu[97]=0,Xu[73]=Xu[97]=1,qu[73]=qu[97]=0,Yu[73]=Yu[97]=0,Tu[73]=Tu[97]=1,Nu[73]=Nu[97]=0,Au[73]=Au[97]=1,Gu[145]=Gu[25]=0,Bu[145]=Bu[25]=-1,zu[145]=zu[25]=0,Xu[145]=Xu[25]=1,qu[145]=qu[25]=0,Yu[145]=Yu[25]=1,tl[145]=tl[25]=0,el[145]=el[25]=1,nl[145]=nl[25]=1,Du[145]=Du[25]=-1,Fu[145]=Fu[25]=0,ju[145]=ju[25]=0,Vu[70]=Vu[100]=0,Uu[70]=Uu[100]=1,Wu[70]=Wu[100]=0,Hu[70]=Hu[100]=-1,Zu[70]=Zu[100]=0,Ku[70]=Ku[100]=1,Ju[70]=Ju[100]=0,$u[70]=$u[100]=-1,Qu[70]=Qu[100]=1,Tu[70]=Tu[100]=1,Nu[70]=Nu[100]=0,Au[70]=Au[100]=0,Vu[101]=Vu[69]=0,Uu[101]=Uu[69]=1,Wu[101]=Wu[69]=0,Tu[101]=Tu[69]=1,Nu[101]=Nu[69]=0,Au[101]=Au[69]=0,tl[149]=tl[21]=0,el[149]=el[21]=1,nl[149]=nl[21]=1,Du[149]=Du[21]=-1,Fu[149]=Fu[21]=0,ju[149]=ju[21]=0,Hu[86]=Hu[84]=-1,Zu[86]=Zu[84]=0,Ku[86]=Ku[84]=1,Ju[86]=Ju[84]=0,$u[86]=$u[84]=-1,Qu[86]=Qu[84]=1,Gu[89]=Gu[81]=0,Bu[89]=Bu[81]=-1,zu[89]=zu[81]=0,Xu[89]=Xu[81]=1,qu[89]=qu[81]=0,Yu[89]=Yu[81]=1,Gu[96]=Gu[74]=0,Bu[96]=Bu[74]=1,zu[96]=zu[74]=0,Vu[96]=Vu[74]=-1,Uu[96]=Uu[74]=0,Wu[96]=Wu[74]=1,Ju[96]=Ju[74]=1,$u[96]=$u[74]=0,Qu[96]=Qu[74]=0,Tu[96]=Tu[74]=1,Nu[96]=Nu[74]=0,Au[96]=Au[74]=1,Gu[24]=Gu[146]=0,Bu[24]=Bu[146]=-1,zu[24]=zu[146]=1,Hu[24]=Hu[146]=1,Zu[24]=Zu[146]=0,Ku[24]=Ku[146]=1,Xu[24]=Xu[146]=0,qu[24]=qu[146]=1,Yu[24]=Yu[146]=1,Du[24]=Du[146]=0,Fu[24]=Fu[146]=-1,ju[24]=ju[146]=0,Vu[6]=Vu[164]=-1,Uu[6]=Uu[164]=0,Wu[6]=Wu[164]=1,Hu[6]=Hu[164]=-1,Zu[6]=Zu[164]=0,Ku[6]=Ku[164]=0,tl[6]=tl[164]=0,el[6]=el[164]=-1,nl[6]=nl[164]=1,Ju[6]=Ju[164]=1,$u[6]=$u[164]=0,Qu[6]=Qu[164]=0,Xu[129]=Xu[41]=0,qu[129]=qu[41]=1,Yu[129]=Yu[41]=1,tl[129]=tl[41]=0,el[129]=el[41]=1,nl[129]=nl[41]=0,Tu[129]=Tu[41]=-1,Nu[129]=Nu[41]=0,Au[129]=Au[41]=0,Du[129]=Du[41]=0,Fu[129]=Fu[41]=-1,ju[129]=ju[41]=0,Hu[66]=Hu[104]=0,Zu[66]=Zu[104]=1,Ku[66]=Ku[104]=0,Xu[66]=Xu[104]=-1,qu[66]=qu[104]=0,Yu[66]=Yu[104]=1,Ju[66]=Ju[104]=0,$u[66]=$u[104]=-1,Qu[66]=Qu[104]=0,Tu[66]=Tu[104]=0,Nu[66]=Nu[104]=-1,Au[66]=Au[104]=1,Gu[144]=Gu[26]=-1,Bu[144]=Bu[26]=0,zu[144]=zu[26]=0,tl[144]=tl[26]=1,el[144]=el[26]=0,nl[144]=nl[26]=1,Ju[144]=Ju[26]=0,$u[144]=$u[26]=1,Qu[144]=Qu[26]=1,Du[144]=Du[26]=-1,Fu[144]=Fu[26]=0,ju[144]=ju[26]=1,Vu[36]=Vu[134]=0,Uu[36]=Uu[134]=1,Wu[36]=Wu[134]=1,Hu[36]=Hu[134]=0,Zu[36]=Zu[134]=1,Ku[36]=Ku[134]=0,Tu[36]=Tu[134]=0,Nu[36]=Nu[134]=-1,Au[36]=Au[134]=1,Du[36]=Du[134]=1,Fu[36]=Fu[134]=0,ju[36]=ju[134]=0,Gu[9]=Gu[161]=-1,Bu[9]=Bu[161]=0,zu[9]=zu[161]=0,Vu[9]=Vu[161]=0,Uu[9]=Uu[161]=-1,Wu[9]=Wu[161]=0,Xu[9]=Xu[161]=1,qu[9]=qu[161]=0,Yu[9]=Yu[161]=0,tl[9]=tl[161]=1,el[9]=el[161]=0,nl[9]=nl[161]=1,Gu[136]=0,Bu[136]=1,zu[136]=1,Vu[136]=0,Uu[136]=1,Wu[136]=0,Hu[136]=-1,Zu[136]=0,Ku[136]=1,Xu[136]=-1,qu[136]=0,Yu[136]=0,tl[136]=0,el[136]=-1,nl[136]=0,Ju[136]=0,$u[136]=-1,Qu[136]=1,Tu[136]=1,Nu[136]=0,Au[136]=0,Du[136]=1,Fu[136]=0,ju[136]=1,Gu[34]=0,Bu[34]=-1,zu[34]=0,Vu[34]=0,Uu[34]=-1,Wu[34]=1,Hu[34]=1,Zu[34]=0,Ku[34]=0,Xu[34]=1,qu[34]=0,Yu[34]=1,tl[34]=0,el[34]=1,nl[34]=1,Ju[34]=0,$u[34]=1,Qu[34]=0,Tu[34]=-1,Nu[34]=0,Au[34]=1,Du[34]=-1,Fu[34]=0,ju[34]=0,Gu[35]=0,Bu[35]=1,zu[35]=1,Vu[35]=0,Uu[35]=-1,Wu[35]=1,Hu[35]=1,Zu[35]=0,Ku[35]=0,Xu[35]=-1,qu[35]=0,Yu[35]=0,tl[35]=0,el[35]=-1,nl[35]=0,Ju[35]=0,$u[35]=1,Qu[35]=0,Tu[35]=-1,Nu[35]=0,Au[35]=1,Du[35]=1,Fu[35]=0,ju[35]=1,Gu[153]=0,Bu[153]=1,zu[153]=1,Xu[153]=-1,qu[153]=0,Yu[153]=0,tl[153]=0,el[153]=-1,nl[153]=0,Du[153]=1,Fu[153]=0,ju[153]=1,Vu[102]=0,Uu[102]=-1,Wu[102]=1,Hu[102]=1,Zu[102]=0,Ku[102]=0,Ju[102]=0,$u[102]=1,Qu[102]=0,Tu[102]=-1,Nu[102]=0,Au[102]=1,Gu[155]=0,Bu[155]=-1,zu[155]=0,Xu[155]=1,qu[155]=0,Yu[155]=1,tl[155]=0,el[155]=1,nl[155]=1,Du[155]=-1,Fu[155]=0,ju[155]=0,Vu[103]=0,Uu[103]=1,Wu[103]=0,Hu[103]=-1,Zu[103]=0,Ku[103]=1,Ju[103]=0,$u[103]=-1,Qu[103]=1,Tu[103]=1,Nu[103]=0,Au[103]=0,Gu[152]=0,Bu[152]=1,zu[152]=1,Hu[152]=-1,Zu[152]=0,Ku[152]=1,Xu[152]=-1,qu[152]=0,Yu[152]=0,tl[152]=0,el[152]=-1,nl[152]=0,Ju[152]=0,$u[152]=-1,Qu[152]=1,Du[152]=1,Fu[152]=0,ju[152]=1,Gu[156]=0,Bu[156]=-1,zu[156]=1,Hu[156]=1,Zu[156]=0,Ku[156]=1,Xu[156]=-1,qu[156]=0,Yu[156]=0,tl[156]=0,el[156]=-1,nl[156]=0,Ju[156]=0,$u[156]=1,Qu[156]=1,Du[156]=-1,Fu[156]=0,ju[156]=1,Gu[137]=0,Bu[137]=1,zu[137]=1,Vu[137]=0,Uu[137]=1,Wu[137]=0,Xu[137]=-1,qu[137]=0,Yu[137]=0,tl[137]=0,el[137]=-1,nl[137]=0,Tu[137]=1,Nu[137]=0,Au[137]=0,Du[137]=1,Fu[137]=0,ju[137]=1,Gu[139]=0,Bu[139]=1,zu[139]=1,Vu[139]=0,Uu[139]=-1,Wu[139]=0,Xu[139]=1,qu[139]=0,Yu[139]=0,tl[139]=0,el[139]=1,nl[139]=0,Tu[139]=-1,Nu[139]=0,Au[139]=0,Du[139]=1,Fu[139]=0,ju[139]=1,Gu[98]=0,Bu[98]=-1,zu[98]=0,Vu[98]=0,Uu[98]=-1,Wu[98]=1,Hu[98]=1,Zu[98]=0,Ku[98]=0,Xu[98]=1,qu[98]=0,Yu[98]=1,Ju[98]=0,$u[98]=1,Qu[98]=0,Tu[98]=-1,Nu[98]=0,Au[98]=1,Gu[99]=0,Bu[99]=1,zu[99]=0,Vu[99]=0,Uu[99]=-1,Wu[99]=1,Hu[99]=1,Zu[99]=0,Ku[99]=0,Xu[99]=-1,qu[99]=0,Yu[99]=1,Ju[99]=0,$u[99]=-1,Qu[99]=0,Tu[99]=1,Nu[99]=0,Au[99]=1,Vu[38]=0,Uu[38]=-1,Wu[38]=1,Hu[38]=1,Zu[38]=0,Ku[38]=0,tl[38]=0,el[38]=1,nl[38]=1,Ju[38]=0,$u[38]=1,Qu[38]=0,Tu[38]=-1,Nu[38]=0,Au[38]=1,Du[38]=-1,Fu[38]=0,ju[38]=0,Vu[39]=0,Uu[39]=1,Wu[39]=1,Hu[39]=-1,Zu[39]=0,Ku[39]=0,tl[39]=0,el[39]=-1,nl[39]=1,Ju[39]=0,$u[39]=1,Qu[39]=0,Tu[39]=-1,Nu[39]=0,Au[39]=1,Du[39]=1,Fu[39]=0,ju[39]=0;var rl=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},il=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},ol=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},sl=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},al=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},ul=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},ll=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},cl=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},hl=[],fl=[],pl=[],dl=[],gl=[],yl=[],vl=[],_l=[];dl[1]=gl[1]=18,dl[169]=gl[169]=18,pl[4]=fl[4]=12,pl[166]=fl[166]=12,hl[16]=_l[16]=4,hl[154]=_l[154]=4,yl[64]=vl[64]=22,yl[106]=vl[106]=22,pl[2]=yl[2]=17,dl[2]=gl[2]=18,pl[168]=yl[168]=17,dl[168]=gl[168]=18,hl[8]=dl[8]=9,fl[8]=pl[8]=12,hl[162]=dl[162]=9,fl[162]=pl[162]=12,hl[32]=_l[32]=4,fl[32]=vl[32]=1,hl[138]=_l[138]=4,fl[138]=vl[138]=1,gl[128]=_l[128]=21,yl[128]=vl[128]=22,gl[42]=_l[42]=21,yl[42]=vl[42]=22,fl[5]=gl[5]=14,fl[165]=gl[165]=14,pl[20]=_l[20]=6,pl[150]=_l[150]=6,hl[80]=yl[80]=11,hl[90]=yl[90]=11,dl[65]=vl[65]=3,dl[105]=vl[105]=3,hl[160]=yl[160]=11,fl[160]=gl[160]=14,hl[10]=yl[10]=11,fl[10]=gl[10]=14,pl[130]=_l[130]=6,dl[130]=vl[130]=3,pl[40]=_l[40]=6,dl[40]=vl[40]=3,fl[101]=vl[101]=1,fl[69]=vl[69]=1,gl[149]=_l[149]=21,gl[21]=_l[21]=21,pl[86]=yl[86]=17,pl[84]=yl[84]=17,hl[89]=dl[89]=9,hl[81]=dl[81]=9,hl[96]=vl[96]=0,fl[96]=yl[96]=15,hl[74]=vl[74]=0,fl[74]=yl[74]=15,hl[24]=pl[24]=8,dl[24]=_l[24]=7,hl[146]=pl[146]=8,dl[146]=_l[146]=7,fl[6]=yl[6]=15,pl[6]=gl[6]=16,fl[164]=yl[164]=15,pl[164]=gl[164]=16,dl[129]=_l[129]=7,gl[129]=vl[129]=20,dl[41]=_l[41]=7,gl[41]=vl[41]=20,pl[66]=vl[66]=2,dl[66]=yl[66]=19,pl[104]=vl[104]=2,dl[104]=yl[104]=19,hl[144]=gl[144]=10,yl[144]=_l[144]=23,hl[26]=gl[26]=10,yl[26]=_l[26]=23,fl[36]=_l[36]=5,pl[36]=vl[36]=2,fl[134]=_l[134]=5,pl[134]=vl[134]=2,hl[9]=gl[9]=10,fl[9]=dl[9]=13,hl[161]=gl[161]=10,fl[161]=dl[161]=13,fl[37]=_l[37]=5,gl[37]=vl[37]=20,fl[133]=_l[133]=5,gl[133]=vl[133]=20,pl[148]=gl[148]=16,yl[148]=_l[148]=23,pl[22]=gl[22]=16,yl[22]=_l[22]=23,hl[82]=pl[82]=8,dl[82]=yl[82]=19,hl[88]=pl[88]=8,dl[88]=yl[88]=19,hl[73]=vl[73]=0,fl[73]=dl[73]=13,hl[97]=vl[97]=0,fl[97]=dl[97]=13,hl[145]=dl[145]=9,gl[145]=_l[145]=21,hl[25]=dl[25]=9,gl[25]=_l[25]=21,fl[70]=vl[70]=1,pl[70]=yl[70]=17,fl[100]=vl[100]=1,pl[100]=yl[100]=17,hl[34]=dl[34]=9,fl[34]=pl[34]=12,gl[34]=_l[34]=21,yl[34]=vl[34]=22,hl[136]=_l[136]=4,fl[136]=vl[136]=1,pl[136]=yl[136]=17,dl[136]=gl[136]=18,hl[35]=_l[35]=4,fl[35]=pl[35]=12,dl[35]=gl[35]=18,yl[35]=vl[35]=22,hl[153]=_l[153]=4,dl[153]=gl[153]=18,fl[102]=pl[102]=12,yl[102]=vl[102]=22,hl[155]=dl[155]=9,gl[155]=_l[155]=23,fl[103]=vl[103]=1,pl[103]=yl[103]=17,hl[152]=_l[152]=4,pl[152]=yl[152]=17,dl[152]=gl[152]=18,hl[156]=pl[156]=8,dl[156]=gl[156]=18,yl[156]=_l[156]=23,hl[137]=_l[137]=4,fl[137]=vl[137]=1,dl[137]=gl[137]=18,hl[139]=_l[139]=4,fl[139]=dl[139]=13,gl[139]=vl[139]=20,hl[98]=dl[98]=9,fl[98]=pl[98]=12,yl[98]=vl[98]=22,hl[99]=vl[99]=0,fl[99]=pl[99]=12,dl[99]=yl[99]=19,fl[38]=pl[38]=12,gl[38]=_l[38]=21,yl[38]=vl[38]=22,fl[39]=_l[39]=5,pl[39]=gl[39]=16,yl[39]=vl[39]=22;var ml=[];ml[1]=ml[169]=rl,ml[4]=ml[166]=il,ml[16]=ml[154]=ol,ml[64]=ml[106]=sl,ml[168]=ml[2]=al,ml[162]=ml[8]=ul,ml[138]=ml[32]=ll,ml[42]=ml[128]=cl,ml[5]=ml[165]=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},ml[20]=ml[150]=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},ml[80]=ml[90]=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},ml[65]=ml[105]=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},ml[160]=ml[10]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},ml[130]=ml[40]=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},ml[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},ml[101]=ml[69]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},ml[149]=ml[21]=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},ml[86]=ml[84]=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},ml[89]=ml[81]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},ml[96]=ml[74]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},ml[24]=ml[146]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},ml[6]=ml[164]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},ml[129]=ml[41]=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},ml[66]=ml[104]=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},ml[144]=ml[26]=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},ml[36]=ml[134]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},ml[9]=ml[161]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},ml[37]=ml[133]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},ml[148]=ml[22]=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},ml[82]=ml[88]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},ml[73]=ml[97]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},ml[145]=ml[25]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},ml[70]=ml[100]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},ml[34]=function(t){return[cl(t),ul(t)]},ml[35]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},ml[136]=function(t){return[ll(t),al(t)]},ml[153]=function(t){return[ol(t),rl(t)]},ml[102]=function(t){return[il(t),sl(t)]},ml[155]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},ml[103]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},ml[152]=function(t){return[ol(t),al(t)]},ml[156]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},ml[137]=function(t){return[ll(t),rl(t)]},ml[139]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},ml[98]=function(t){return[ul(t),sl(t)]},ml[99]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},ml[38]=function(t){return[il(t),cl(t)]},ml[39]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]};function xl(t,e,n){var r,i=e[0]-t[0],o=e[1]-t[1],s=n[0]-e[0],a=n[1]-e[1];return((r=i*a-s*o)>0)-(r<0)||+r}function bl(t,e){return e.geometry.coordinates[0].every(function(e){return su(ja(e),t)})}var wl=function(){function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return t.buildId=function(t){return t.join(",")},t.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},t.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},t.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},t.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]===0&&i.coordinates[0]-t.coordinates[0]===0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=xl(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)},t.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},t.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},t.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},t}(),El=wl,Cl=function(){function t(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return t.prototype.getSymetric=function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric},t.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},t.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},t.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},t.prototype.toLineString=function(){return Ba([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return xl(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}(),Sl=function(){function t(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return t.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},t.prototype.get=function(t){return this.edges[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.edges.forEach(t)},t.prototype.map=function(t){return this.edges.map(t)},t.prototype.some=function(t){return this.edges.some(t)},t.prototype.isValid=function(){return!0},t.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e},0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=xl(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},t.prototype.toMultiPoint=function(){return Ua(this.edges.map(function(t){return t.from.coordinates}))},t.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Ga([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=cu(this.toPolygon())},t.findEdgeRingContaining=function(t,e){var n,r,i=t.getEnvelope();return e.forEach(function(e){var o,s,a,u,l,c,h=e.getEnvelope();if((r&&(n=r.getEnvelope()),s=i,a=(o=h).geometry.coordinates[0].map(function(t){return t[0]}),u=o.geometry.coordinates[0].map(function(t){return t[1]}),l=s.geometry.coordinates[0].map(function(t){return t[0]}),c=s.geometry.coordinates[0].map(function(t){return t[1]}),Math.max.apply(null,a)!==Math.max.apply(null,l)||Math.max.apply(null,u)!==Math.max.apply(null,c)||Math.min.apply(null,a)!==Math.min.apply(null,l)||Math.min.apply(null,u)!==Math.min.apply(null,c))&&bl(h,i)){for(var f=t.map(function(t){return t.from.coordinates}),p=void 0,d=function(t){e.some(function(e){return n=t,r=e.from.coordinates,n[0]===r[0]&&n[1]===r[1];var n,r})||(p=t)},g=0,y=f;g<y.length;g++){d(y[g])}p&&e.inside(ja(p))&&(r&&!bl(n,h)||(r=e))}}),r},t.prototype.inside=function(t){return su(t,this.toPolygon())},t}(),Pl=Sl;!function(){function t(){this.edges=[],this.nodes={}}t.fromGeoJson=function(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(e);var n=new t;return $a(e,function(t){var e,r,i,o;!function(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}(t,"LineString","Graph::fromGeoJson"),e=function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e},o=r,Za(t,function(t,n,i,s,a){o=0===n&&void 0===r?t:e(o,t,n,i,s,a)},i)}),n},t.prototype.getNode=function(t){var e=El.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new El(t)),n},t.prototype.addEdge=function(t,e){var n=new Cl(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},t.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},t.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(t){return t.to});this.removeNode(t),n.forEach(function(t){return e._removeIfDangle(t)})}},t.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},t.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach(function(t){return e._computeNextCWEdges(e.nodes[t])}):t.getOuterEdges().forEach(function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e})},t.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,l=void 0;s.label===e&&(u=s),a.label===e&&(l=a),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},t.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}}),t},t.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n,e.label)})});var e=[];return this.edges.forEach(function(n){n.ring||e.push(t._findEdgeRing(n))}),e},t.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++r}),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e},t.prototype._findEdgeRing=function(t){var e=t,n=new Pl;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},t.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(t){return e.removeEdge(t)}),t.innerEdges.forEach(function(t){return e.removeEdge(t)}),delete this.nodes[t.id]},t.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()}}();function Il(t,e){var n=iu(t),r=iu(e),i=n.type,o=r.type,s=n.coordinates,a=r.coordinates;switch(i){case"Point":if("Point"===o)return Ol(s,a);throw new Error("feature2 "+o+" geometry not supported");case"MultiPoint":switch(o){case"Point":return function(t,e){var n,r=!1;for(n=0;n<t.coordinates.length;n++)if(Ol(t.coordinates[n],e.coordinates)){r=!0;break}return r}(n,r);case"MultiPoint":return function(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){for(var i=r[n],o=!1,s=0,a=t.coordinates;s<a.length;s++){if(Ol(i,a[s])){o=!0;break}}if(!o)return!1}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"Point":return Eu(r,n,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var n=!1,r=0,i=e.coordinates;r<i.length;r++){var o=i[r];if(Eu({type:"Point",coordinates:o},t,{ignoreEndVertices:!0})&&(n=!0),!Eu({type:"Point",coordinates:o},t,{ignoreEndVertices:!1}))return!1}return n}(n,r);case"MultiPoint":return function(t,e){for(var n=!1,r=0,i=e.coordinates;r<i.length;r++){var o=i[r];if(Eu(o,t,{ignoreEndVertices:!0})&&(n=!0),!Eu(o,t))return!1}if(n)return!0;return!1}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Point":return su(r,n,{ignoreBoundary:!0});case"LineString":return function(t,e){var n=!1,r=0,i=eu(t),o=eu(e);if(!Ml(i,o))return!1;for(;r<e.coordinates.length-1;r++){if(su({type:"Point",coordinates:Ll(e.coordinates[r],e.coordinates[r+1])},t,{ignoreBoundary:!0})){n=!0;break}}return n}(n,r);case"Polygon":return function(t,e){if("Feature"===t.type&&null===t.geometry)return!1;if("Feature"===e.type&&null===e.geometry)return!1;var n=eu(t),r=eu(e);if(!Ml(n,r))return!1;for(var i=iu(e).coordinates,o=0,s=i;o<s.length;o++)for(var a=0,u=s[o];a<u.length;a++){if(!su(u[a],t))return!1}return!0}(n,r);case"MultiPoint":return function(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){if(!su(r[n],t,{ignoreBoundary:!0}))return!1}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Ml(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function Ol(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ll(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}var Rl=n(8635);function kl(t,e){var n=iu(t),r=iu(e),i=n.type,o=r.type;if("MultiPoint"===i&&"MultiPoint"!==o||("LineString"===i||"MultiLineString"===i)&&"LineString"!==o&&"MultiLineString"!==o||("Polygon"===i||"MultiPolygon"===i)&&"Polygon"!==o&&"MultiPolygon"!==o)throw new Error("features must be of the same type");if("Point"===i)throw new Error("Point geometry not supported");if(new Rl({precision:6}).compare(t,e))return!1;var s=0;switch(i){case"MultiPoint":for(var a=0;a<n.coordinates.length;a++)for(var u=0;u<r.coordinates.length;u++){var l=n.coordinates[a],c=r.coordinates[u];if(l[0]===c[0]&&l[1]===c[1])return!0}return!1;case"LineString":case"MultiLineString":Qa(t,function(t){Qa(e,function(e){ku(t,e).features.length&&s++})});break;case"Polygon":case"MultiPolygon":Qa(t,function(t){Qa(e,function(e){vu(t,e).features.length&&s++})})}return s>0}n(6112);n(1756);function Tl(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}var Nl={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||Nl.heuristics.manhattan,o=r.closest||!1,s=new Fl(function(t){return t.f}),a=e;for(e.h=i(e,n),s.push(e);s.size()>0;){var u=s.pop();if(u===n)return Tl(u);u.closed=!0;for(var l=t.neighbors(u),c=0,h=l.length;c<h;++c){var f=l[c];if(!f.closed&&!f.isWall()){var p=u.g+f.getCost(u),d=f.visited;(!d||p<f.g)&&(f.visited=!0,f.parent=u,f.h=f.h||i(f,n),f.g=p,f.f=f.g+f.h,t.markDirty(f),o&&(f.h<a.h||f.h===a.h&&f.g<a.g)&&(a=f),d?s.rescoreElement(f):s.push(f))}}}return o?Tl(a):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=null}};function Al(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n<t.length;n++){this.grid[n]=[];for(var r=0,i=t[n];r<i.length;r++){var o=new Dl(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function Dl(t,e,n){this.x=t,this.y=e,this.weight=n}function Fl(t){this.content=[],this.scoreFunction=t}Al.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)Nl.cleanNode(this.nodes[t])},Al.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)Nl.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},Al.prototype.markDirty=function(t){this.dirtyNodes.push(t)},Al.prototype.neighbors=function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e},Al.prototype.toString=function(){for(var t,e,n,r,i=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,r=(e=o[s]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\n")},Dl.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},Dl.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},Dl.prototype.isWall=function(){return 0===this.weight},Fl.prototype={push:function(t){this.content.push(t),this.sinkDown(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(t){this.sinkDown(this.content.indexOf(t))},sinkDown:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},bubbleUp:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,s=o-1,a=null;if(s<e){var u=this.content[s];(i=this.scoreFunction(u))<r&&(a=s)}if(o<e){var l=this.content[o];this.scoreFunction(l)<(null===a?r:i)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}};function jl(){this._=null}function Gl(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Bl(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function zl(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Vl(t){for(;t.L;)t=t.L;return t}jl.prototype={constructor:jl,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Vl(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(Bl(this,n),n=(t=n).U),n.C=!1,r.C=!0,zl(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(zl(this,n),n=(t=n).U),n.C=!1,r.C=!0,Bl(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,s=t.R;if(n=o?s?Vl(s):o:s,i?i.L===t?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=s,s.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Bl(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,zl(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Bl(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,zl(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Bl(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,zl(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var Ul=jl;function Wl(t,e,n,r){var i=[null,null],o=dc.push(i)-1;return i.left=t,i.right=e,n&&ql(i,t,e,n),r&&ql(i,e,t,r),fc[t.index].halfedges.push(o),fc[e.index].halfedges.push(o),i}function Xl(t,e,n){var r=[e,n];return r.left=t,r}function ql(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function Yl(t,e,n,r,i){var o,s=t[0],a=t[1],u=s[0],l=s[1],c=0,h=1,f=a[0]-u,p=a[1]-l;if(o=e-u,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<h&&(h=o)}else if(f>0){if(o>h)return;o>c&&(c=o)}if(o=r-u,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<h&&(h=o)}if(o=n-l,p||!(o>0)){if(o/=p,p<0){if(o<c)return;o<h&&(h=o)}else if(p>0){if(o>h)return;o>c&&(c=o)}if(o=i-l,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o<c)return;o<h&&(h=o)}return!(c>0||h<1)||(c>0&&(t[0]=[u+c*f,l+c*p]),h<1&&(t[1]=[u+h*f,l+h*p]),!0)}}}}}function Hl(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],l=t.left,c=t.right,h=l[0],f=l[1],p=c[0],d=c[1],g=(h+p)/2,y=(f+d)/2;if(d===f){if(g<e||g>=r)return;if(h>p){if(u){if(u[1]>=i)return}else u=[g,n];o=[g,i]}else{if(u){if(u[1]<n)return}else u=[g,i];o=[g,n]}}else if(a=y-(s=(h-p)/(d-f))*g,s<-1||s>1)if(h>p){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]<n)return}else u=[(i-a)/s,i];o=[(n-a)/s,n]}else if(f<d){if(u){if(u[0]>=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]<e)return}else u=[r,s*r+a];o=[e,s*e+a]}return t[0]=u,t[1]=o,!0}function Zl(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function Kl(t,e){return e[+(e.left!==t.site)]}function Jl(t,e){return e[+(e.left===t.site)]}var $l,Ql=[];function tc(){Gl(this),this.x=this.y=this.arc=this.site=this.cy=null}function ec(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var s=i[0],a=i[1],u=r[0]-s,l=r[1]-a,c=o[0]-s,h=o[1]-a,f=2*(u*h-l*c);if(!(f>=-yc)){var p=u*u+l*l,d=c*c+h*h,g=(h*p-l*d)/f,y=(u*d-c*p)/f,v=Ql.pop()||new tc;v.arc=t,v.site=i,v.x=g+s,v.y=(v.cy=y+a)+Math.sqrt(g*g+y*y),t.circle=v;for(var _=null,m=pc._;m;)if(v.y<m.y||v.y===m.y&&v.x<=m.x){if(!m.L){_=m.P;break}m=m.L}else{if(!m.R){_=m;break}m=m.R}pc.insert(_,v),_||($l=v)}}}}function nc(t){var e=t.circle;e&&(e.P||($l=e.N),pc.remove(e),Ql.push(e),Gl(e),t.circle=null)}var rc=[];function ic(){Gl(this),this.edge=this.site=this.circle=null}function oc(t){var e=rc.pop()||new ic;return e.site=t,e}function sc(t){nc(t),hc.remove(t),rc.push(t),Gl(t)}function ac(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];sc(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)<gc&&Math.abs(r-u.circle.cy)<gc;)o=u.P,a.unshift(u),sc(u),u=o;a.unshift(u),nc(u);for(var l=s;l.circle&&Math.abs(n-l.circle.x)<gc&&Math.abs(r-l.circle.cy)<gc;)s=l.N,a.push(l),sc(l),l=s;a.push(l),nc(l);var c,h=a.length;for(c=1;c<h;++c)l=a[c],u=a[c-1],ql(l.edge,u.site,l.site,i);u=a[0],(l=a[h-1]).edge=Wl(u.site,l.site,null,i),ec(u),ec(l)}function uc(t){for(var e,n,r,i,o=t[0],s=t[1],a=hc._;a;)if((r=lc(a,s)-o)>gc)a=a.L;else{if(!((i=o-cc(a,s))>gc)){r>-gc?(e=a.P,n=a):i>-gc?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){fc[t.index]={site:t,halfedges:[]}}(t);var u=oc(t);if(hc.insert(e,u),e||n){if(e===n)return nc(e),n=oc(e.site),hc.insert(u,n),u.edge=n.edge=Wl(e.site,u.site),ec(e),void ec(n);if(n){nc(e),nc(n);var l=e.site,c=l[0],h=l[1],f=t[0]-c,p=t[1]-h,d=n.site,g=d[0]-c,y=d[1]-h,v=2*(f*y-p*g),_=f*f+p*p,m=g*g+y*y,x=[(y*_-p*m)/v+c,(f*m-g*_)/v+h];ql(n.edge,l,d,x),u.edge=Wl(l,t,null,x),n.edge=Wl(t,d,null,x),ec(e),ec(n)}else u.edge=Wl(e.site,u.site)}}function lc(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],l=u-e;if(!l)return a;var c=a-r,h=1/o-1/l,f=c/l;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*l)-u+l/2+i-o/2)))/h+r:(r+a)/2}function cc(t,e){var n=t.N;if(n)return lc(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var hc,fc,pc,dc,gc=1e-6,yc=1e-12;function vc(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function _c(t,e){return e[1]-t[1]||e[0]-t[0]}function mc(t,e){var n,r,i,o=t.sort(_c).pop();for(dc=[],fc=new Array(t.length),hc=new Ul,pc=new Ul;;)if(i=$l,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===n&&o[1]===r||(uc(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;ac(i.arc)}if(function(){for(var t,e,n,r,i=0,o=fc.length;i<o;++i)if((t=fc[i])&&(r=(e=t.halfedges).length)){var s=new Array(r),a=new Array(r);for(n=0;n<r;++n)s[n]=n,a[n]=Zl(t,dc[e[n]]);for(s.sort(function(t,e){return a[e]-a[t]}),n=0;n<r;++n)a[n]=e[s[n]];for(n=0;n<r;++n)e[n]=a[n]}}(),e){var s=+e[0][0],a=+e[0][1],u=+e[1][0],l=+e[1][1];!function(t,e,n,r){for(var i,o=dc.length;o--;)Hl(i=dc[o],t,e,n,r)&&Yl(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>gc||Math.abs(i[0][1]-i[1][1])>gc)||delete dc[o]}(s,a,u,l),function(t,e,n,r){var i,o,s,a,u,l,c,h,f,p,d,g,y=fc.length,v=!0;for(i=0;i<y;++i)if(o=fc[i]){for(s=o.site,a=(u=o.halfedges).length;a--;)dc[u[a]]||u.splice(a,1);for(a=0,l=u.length;a<l;)d=(p=Jl(o,dc[u[a]]))[0],g=p[1],h=(c=Kl(o,dc[u[++a%l]]))[0],f=c[1],(Math.abs(d-h)>gc||Math.abs(g-f)>gc)&&(u.splice(a,0,dc.push(Xl(s,p,Math.abs(d-t)<gc&&r-g>gc?[t,Math.abs(h-t)<gc?f:r]:Math.abs(g-r)<gc&&n-d>gc?[Math.abs(f-r)<gc?h:n,r]:Math.abs(d-n)<gc&&g-e>gc?[n,Math.abs(h-n)<gc?f:e]:Math.abs(g-e)<gc&&d-t>gc?[Math.abs(f-e)<gc?h:t,e]:null))-1),++l);l&&(v=!1)}if(v){var _,m,x,b=1/0;for(i=0,v=null;i<y;++i)(o=fc[i])&&(x=(_=(s=o.site)[0]-t)*_+(m=s[1]-e)*m)<b&&(b=x,v=o);if(v){var w=[t,e],E=[t,r],C=[n,r],S=[n,e];v.halfedges.push(dc.push(Xl(s=v.site,w,E))-1,dc.push(Xl(s,E,C))-1,dc.push(Xl(s,C,S))-1,dc.push(Xl(s,S,w))-1)}}for(i=0;i<y;++i)(o=fc[i])&&(o.halfedges.length||delete fc[i])}(s,a,u,l)}this.edges=dc,this.cells=fc,hc=pc=dc=fc=null}mc.prototype={constructor:mc,polygons:function(){var t=this.edges;return this.cells.map(function(e){var n=e.halfedges.map(function(n){return Kl(e,t[n])});return n.data=e.site.data,n})},triangles:function(){var t=[],e=this.edges;return this.cells.forEach(function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a=n.site,u=-1,l=e[i[o-1]],c=l.left===a?l.right:l.left;++u<o;)s=c,c=(l=e[i[u]]).left===a?l.right:l.left,s&&c&&r<s.index&&r<c.index&&vc(a,s,c)<0&&t.push([a.data,s.data,c.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})},find:function(t,e,n){for(var r,i,o=this,s=o._found||0,a=o.cells.length;!(i=o.cells[s]);)if(++s>=a)return null;var u=t-i.site[0],l=e-i.site[1],c=u*u+l*l;do{i=o.cells[r=s],s=null,i.halfedges.forEach(function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],l=e-a[1],h=u*u+l*l;h<c&&(c=h,s=a.index)}})}while(null!==s);return o._found=r,null==n||c<=n*n?i.site:null}};n(9004);var xc=n(39);function bc(){return new wc}function wc(){this.reset()}wc.prototype={constructor:wc,reset:function(){this.s=this.t=0},add:function(t){Cc(Ec,t,this.t),Cc(this,Ec.s,this.s),this.s?this.t+=Ec.t:this.s=Ec.t},valueOf:function(){return this.s}};var Ec=new wc;function Cc(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var Sc=1e-6,Pc=Math.PI,Ic=Pc/2,Mc=Pc/4,Oc=2*Pc,Lc=180/Pc,Rc=Pc/180,kc=Math.abs,Tc=Math.atan,Nc=Math.atan2,Ac=Math.cos,Dc=(Math.ceil,Math.exp),Fc=(Math.floor,Math.log),jc=(Math.pow,Math.sin),Gc=(Math.sign,Math.sqrt),Bc=Math.tan;function zc(t){return t>1?0:t<-1?Pc:Math.acos(t)}function Vc(t){return t>1?Ic:t<-1?-Ic:Math.asin(t)}function Uc(){}function Wc(t,e){t&&qc.hasOwnProperty(t.type)&&qc[t.type](t,e)}var Xc={Feature:function(t,e){Wc(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Wc(n[r].geometry,e)}},qc={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Yc(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Yc(n[r],e,0)},Polygon:function(t,e){Hc(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Hc(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Wc(n[r],e)}};function Yc(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function Hc(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Yc(t[n],e,1);e.polygonEnd()}function Zc(t,e){t&&Xc.hasOwnProperty(t.type)?Xc[t.type](t,e):Wc(t,e)}bc(),bc();function Kc(t){return[Nc(t[1],t[0]),Vc(t[2])]}function Jc(t){var e=t[0],n=t[1],r=Ac(n);return[r*Ac(e),r*jc(e),jc(n)]}function $c(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Qc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function th(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function eh(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function nh(t){var e=Gc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}bc();function rh(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function ih(t,e){return[t>Pc?t-Oc:t<-Pc?t+Oc:t,e]}function oh(t,e,n){return(t%=Oc)?e||n?rh(ah(t),uh(e,n)):ah(t):e||n?uh(e,n):ih}function sh(t){return function(e,n){return[(e+=t)>Pc?e-Oc:e<-Pc?e+Oc:e,n]}}function ah(t){var e=sh(t);return e.invert=sh(-t),e}function uh(t,e){var n=Ac(t),r=jc(t),i=Ac(e),o=jc(e);function s(t,e){var s=Ac(e),a=Ac(t)*s,u=jc(t)*s,l=jc(e),c=l*n+a*r;return[Nc(u*i-c*o,a*n-l*r),Vc(c*i+u*o)]}return s.invert=function(t,e){var s=Ac(e),a=Ac(t)*s,u=jc(t)*s,l=jc(e),c=l*i-u*o;return[Nc(u*i+l*o,a*n+c*r),Vc(c*n-a*r)]},s}function lh(t,e,n,r,i,o){if(n){var s=Ac(e),a=jc(e),u=r*n;null==i?(i=e+r*Oc,o=e-u/2):(i=ch(s,i),o=ch(s,o),(r>0?i<o:i>o)&&(i+=r*Oc));for(var l,c=i;r>0?c>o:c<o;c-=u)l=Kc([s,-a*Ac(c),-a*jc(c)]),t.point(l[0],l[1])}}function ch(t,e){(e=Jc(e))[0]-=t,nh(e);var n=zc(-e[1]);return((-e[2]<0?-n:n)+Oc-Sc)%Oc}function hh(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Uc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function fh(t,e){return kc(t[0]-e[0])<Sc&&kc(t[1]-e[1])<Sc}function ph(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function dh(t,e,n,r,i){var o,s,a=[],u=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(fh(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else a.push(n=new ph(r,t,null,!0)),u.push(n.o=new ph(r,null,n,!1)),a.push(n=new ph(s,t,null,!1)),u.push(n.o=new ph(s,null,n,!0))}}),a.length){for(u.sort(e),gh(a),gh(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var l,c,h=a[0];;){for(var f=h,p=!0;f.v;)if((f=f.n)===h)return;l=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(o=0,s=l.length;o<s;++o)i.point((c=l[o])[0],c[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(p)for(l=f.p.z,o=l.length-1;o>=0;--o)i.point((c=l[o])[0],c[1]);else r(f.x,f.p.x,-1,i);f=f.p}l=(f=f.o).z,p=!p}while(!f.v);i.lineEnd()}}}function gh(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function yh(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}ih.invert=ih;1===(vh=yh).length&&(_h=vh,vh=function(t,e){return yh(_h(t),e)});var vh,_h,mh=Array.prototype;mh.slice,mh.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);function xh(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}var bh=1e9,wh=-bh;function Eh(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,l){var c=0,h=0;if(null==i||(c=s(i,a))!==(h=s(o,a))||u(i,o)<0^a>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+a+4)%4)!==h);else l.point(o[0],o[1])}function s(r,i){return kc(r[0]-t)<Sc?i>0?0:3:kc(r[0]-n)<Sc?i>0?2:1:kc(r[1]-e)<Sc?i>0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var u,l,c,h,f,p,d,g,y,v,_,m=s,x=hh(),b={point:w,lineStart:function(){b.point=E,l&&l.push(c=[]);v=!0,y=!1,d=g=NaN},lineEnd:function(){u&&(E(h,f),p&&y&&x.rejoin(),u.push(x.result()));b.point=w,y&&m.lineEnd()},polygonStart:function(){m=x,u=[],l=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,s,a=l[n],u=1,c=a.length,h=a[0],f=h[0],p=h[1];u<c;++u)o=f,s=p,f=(h=a[u])[0],p=h[1],s<=r?p>r&&(f-o)*(r-s)>(p-s)*(t-o)&&++e:p<=r&&(f-o)*(r-s)<(p-s)*(t-o)&&--e;return e}(),n=_&&e,i=(u=xh(u)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&dh(u,a,e,o,s),s.polygonEnd());m=s,u=l=c=null}};function w(t,e){i(t,e)&&m.point(t,e)}function E(o,s){var a=i(o,s);if(l&&c.push([o,s]),v)h=o,f=s,p=a,v=!1,a&&(m.lineStart(),m.point(o,s));else if(a&&y)m.point(o,s);else{var u=[d=Math.max(wh,Math.min(bh,d)),g=Math.max(wh,Math.min(bh,g))],x=[o=Math.max(wh,Math.min(bh,o)),s=Math.max(wh,Math.min(bh,s))];!function(t,e,n,r,i,o){var s,a=t[0],u=t[1],l=0,c=1,h=e[0]-a,f=e[1]-u;if(s=n-a,h||!(s>0)){if(s/=h,h<0){if(s<l)return;s<c&&(c=s)}else if(h>0){if(s>c)return;s>l&&(l=s)}if(s=i-a,h||!(s<0)){if(s/=h,h<0){if(s>c)return;s>l&&(l=s)}else if(h>0){if(s<l)return;s<c&&(c=s)}if(s=r-u,f||!(s>0)){if(s/=f,f<0){if(s<l)return;s<c&&(c=s)}else if(f>0){if(s>c)return;s>l&&(l=s)}if(s=o-u,f||!(s<0)){if(s/=f,f<0){if(s>c)return;s>l&&(l=s)}else if(f>0){if(s<l)return;s<c&&(c=s)}return l>0&&(t[0]=a+l*h,t[1]=u+l*f),c<1&&(e[0]=a+c*h,e[1]=u+c*f),!0}}}}}(u,x,t,e,n,r)?a&&(m.lineStart(),m.point(o,s),_=!1):(y||(m.lineStart(),m.point(u[0],u[1])),m.point(x[0],x[1]),a||m.lineEnd(),_=!1)}d=o,g=s,y=a}return b}}var Ch=bc();function Sh(t,e){var n=e[0],r=e[1],i=[jc(n),-Ac(n),0],o=0,s=0;Ch.reset();for(var a=0,u=t.length;a<u;++a)if(c=(l=t[a]).length)for(var l,c,h=l[c-1],f=h[0],p=h[1]/2+Mc,d=jc(p),g=Ac(p),y=0;y<c;++y,f=_,d=x,g=b,h=v){var v=l[y],_=v[0],m=v[1]/2+Mc,x=jc(m),b=Ac(m),w=_-f,E=w>=0?1:-1,C=E*w,S=C>Pc,P=d*x;if(Ch.add(Nc(P*E*jc(C),g*b+P*Ac(C))),o+=S?w+E*Oc:w,S^f>=n^_>=n){var I=Qc(Jc(h),Jc(v));nh(I);var M=Qc(i,I);nh(M);var O=(S^w>=0?-1:1)*Vc(M[2]);(r>O||r===O&&(I[0]||I[1]))&&(s+=S^w>=0?1:-1)}}return(o<-1e-6||o<Sc&&Ch<-1e-6)^1&s}bc();bc(),bc();var Ph=1/0,Ih=Ph,Mh=-Ph,Oh=Mh,Lh={point:function(t,e){t<Ph&&(Ph=t);t>Mh&&(Mh=t);e<Ih&&(Ih=e);e>Oh&&(Oh=e)},lineStart:Uc,lineEnd:Uc,polygonStart:Uc,polygonEnd:Uc,result:function(){var t=[[Ph,Ih],[Mh,Oh]];return Mh=Oh=-(Ih=Ph=1/0),t}};var Rh=Lh;bc();function kh(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Th(t,e,n,r){return function(i,o){var s,a,u,l=e(o),c=i.invert(r[0],r[1]),h=hh(),f=e(h),p=!1,d={point:g,lineStart:v,lineEnd:_,polygonStart:function(){d.point=m,d.lineStart=x,d.lineEnd=b,a=[],s=[]},polygonEnd:function(){d.point=g,d.lineStart=v,d.lineEnd=_,a=xh(a);var t=Sh(s,c);a.length?(p||(o.polygonStart(),p=!0),dh(a,Ah,t,n,o)):t&&(p||(o.polygonStart(),p=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),p&&(o.polygonEnd(),p=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function g(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function y(t,e){var n=i(t,e);l.point(n[0],n[1])}function v(){d.point=y,l.lineStart()}function _(){d.point=g,l.lineEnd()}function m(t,e){u.push([t,e]);var n=i(t,e);f.point(n[0],n[1])}function x(){f.lineStart(),u=[]}function b(){m(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),l=h.result(),c=l.length;if(u.pop(),s.push(u),u=null,c)if(1&i){if((e=(n=l[0]).length-1)>0){for(p||(o.polygonStart(),p=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else c>1&&2&i&&l.push(l.pop().concat(l.shift())),a.push(l.filter(Nh))}return d}}function Nh(t){return t.length>1}function Ah(t,e){return((t=t.x)[0]<0?t[1]-Ic-Sc:Ic-t[1])-((e=e.x)[0]<0?e[1]-Ic-Sc:Ic-e[1])}kh(4.5);var Dh=Th(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Pc:-Pc,u=kc(o-n);kc(u-Pc)<Sc?(t.point(n,r=(r+s)/2>0?Ic:-Ic),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=Pc&&(kc(n-i)<Sc&&(n-=i*Sc),kc(o-a)<Sc&&(o-=a*Sc),r=function(t,e,n,r){var i,o,s=jc(t-n);return kc(s)>Sc?Tc((jc(e)*(o=Ac(r))*jc(n)-jc(r)*(i=Ac(e))*jc(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*Ic,r.point(-Pc,i),r.point(0,i),r.point(Pc,i),r.point(Pc,0),r.point(Pc,-i),r.point(0,-i),r.point(-Pc,-i),r.point(-Pc,0),r.point(-Pc,i);else if(kc(t[0]-e[0])>Sc){var o=t[0]<e[0]?Pc:-Pc;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])},[-Pc,-Ic]);function Fh(t){return t}function jh(t){return function(e){var n=new Gh;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Gh(){}function Bh(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),Zc(n,t.stream(Rh));var s=Rh.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,l=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,l])}Gh.prototype={constructor:Gh,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var zh=Ac(30*Rc);function Vh(t,e){return+e?function(t,e){function n(r,i,o,s,a,u,l,c,h,f,p,d,g,y){var v=l-r,_=c-i,m=v*v+_*_;if(m>4*e&&g--){var x=s+f,b=a+p,w=u+d,E=Gc(x*x+b*b+w*w),C=Vc(w/=E),S=kc(kc(w)-1)<Sc||kc(o-h)<Sc?(o+h)/2:Nc(b,x),P=t(S,C),I=P[0],M=P[1],O=I-r,L=M-i,R=_*O-v*L;(R*R/m>e||kc((v*O+_*L)/m-.5)>.3||s*f+a*p+u*d<zh)&&(n(r,i,o,s,a,u,I,M,S,x/=E,b/=E,w,g,y),y.point(I,M),n(I,M,S,x,b,w,l,c,h,f,p,d,g,y))}}return function(e){var r,i,o,s,a,u,l,c,h,f,p,d,g={point:y,lineStart:v,lineEnd:m,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=v}};function y(n,r){n=t(n,r),e.point(n[0],n[1])}function v(){c=NaN,g.point=_,e.lineStart()}function _(r,i){var o=Jc([r,i]),s=t(r,i);n(c,h,l,f,p,d,c=s[0],h=s[1],l=r,f=o[0],p=o[1],d=o[2],16,e),e.point(c,h)}function m(){g.point=y,e.lineEnd()}function x(){v(),g.point=b,g.lineEnd=w}function b(t,e){_(r=t,e),i=c,o=h,s=f,a=p,u=d,g.point=_}function w(){n(c,h,l,f,p,d,i,o,r,s,a,u,16,e),g.lineEnd=m,m()}return g}}(t,e):function(t){return jh({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Uh=jh({point:function(t,e){this.stream.point(t*Rc,e*Rc)}});function Wh(t){return function(t){var e,n,r,i,o,s,a,u,l,c,h=150,f=480,p=250,d=0,g=0,y=0,v=0,_=0,m=null,x=Dh,b=null,w=Fh,E=.5,C=Vh(I,E);function S(t){return[(t=o(t[0]*Rc,t[1]*Rc))[0]*h+n,r-t[1]*h]}function P(t){return(t=o.invert((t[0]-n)/h,(r-t[1])/h))&&[t[0]*Lc,t[1]*Lc]}function I(t,i){return[(t=e(t,i))[0]*h+n,r-t[1]*h]}function M(){o=rh(i=oh(y,v,_),e);var t=e(d,g);return n=f-t[0]*h,r=p+t[1]*h,O()}function O(){return l=c=null,S}return S.stream=function(t){return l&&c===t?l:l=Uh(x(i,C(w(c=t))))},S.clipAngle=function(t){return arguments.length?(x=+t?function(t,e){var n=Ac(t),r=n>0,i=kc(n)>Sc;function o(t,e){return Ac(t)*Ac(e)>n}function s(t,e,r){var i=[1,0,0],o=Qc(Jc(t),Jc(e)),s=$c(o,o),a=o[0],u=s-a*a;if(!u)return!r&&t;var l=n*s/u,c=-n*a/u,h=Qc(i,o),f=eh(i,l);th(f,eh(o,c));var p=h,d=$c(f,p),g=$c(p,p),y=d*d-g*($c(f,f)-1);if(!(y<0)){var v=Gc(y),_=eh(p,(-d-v)/g);if(th(_,f),_=Kc(_),!r)return _;var m,x=t[0],b=e[0],w=t[1],E=e[1];b<x&&(m=x,x=b,b=m);var C=b-x,S=kc(C-Pc)<Sc;if(!S&&E<w&&(m=w,w=E,E=m),S||C<Sc?S?w+E>0^_[1]<(kc(_[0]-x)<Sc?w:E):w<=_[1]&&_[1]<=E:C>Pc^(x<=_[0]&&_[0]<=b)){var P=eh(p,(-d+v)/g);return th(P,f),[_,Kc(P)]}}}function a(e,n){var i=r?t:Pc-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Th(o,function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,f){var p,d=[h,f],g=o(h,f),y=r?g?0:a(h,f):g?a(h+(h<0?Pc:-Pc),f):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(p=s(e,d))||fh(e,p)||fh(d,p))&&(d[0]+=Sc,d[1]+=Sc,g=o(d[0],d[1])),g!==u)c=0,g?(t.lineStart(),p=s(d,e),t.point(p[0],p[1])):(p=s(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(i&&e&&r^g){var v;y&n||!(v=s(d,e,!0))||(c=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&fh(e,d)||t.point(d[0],d[1]),e=d,u=g,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}},function(n,r,i,o){lh(o,t,e,i,n,r)},r?[0,-t]:[-Pc,t-Pc])}(m=t*Rc,6*Rc):(m=null,Dh),O()):m*Lc},S.clipExtent=function(t){return arguments.length?(w=null==t?(b=s=a=u=null,Fh):Eh(b=+t[0][0],s=+t[0][1],a=+t[1][0],u=+t[1][1]),O()):null==b?null:[[b,s],[a,u]]},S.scale=function(t){return arguments.length?(h=+t,M()):h},S.translate=function(t){return arguments.length?(f=+t[0],p=+t[1],M()):[f,p]},S.center=function(t){return arguments.length?(d=t[0]%360*Rc,g=t[1]%360*Rc,M()):[d*Lc,g*Lc]},S.rotate=function(t){return arguments.length?(y=t[0]%360*Rc,v=t[1]%360*Rc,_=t.length>2?t[2]%360*Rc:0,M()):[y*Lc,v*Lc,_*Lc]},S.precision=function(t){return arguments.length?(C=Vh(I,E=t*t),O()):Gc(E)},S.fitExtent=function(t,e){return Bh(S,t,e)},S.fitSize=function(t,e){return function(t,e,n){return Bh(t,[[0,0],e],n)}(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&P,M()}}(function(){return t})()}function Xh(t){return function(e,n){var r=Ac(e),i=Ac(n),o=t(r*i);return[o*i*jc(e),o*jc(n)]}}function qh(t){return function(e,n){var r=Gc(e*e+n*n),i=t(r),o=jc(i),s=Ac(i);return[Nc(e*o,r*s),Vc(r&&n*o/r)]}}var Yh=Xh(function(t){return Gc(2/(1+t))});Yh.invert=qh(function(t){return 2*Vc(t/2)});var Hh=Xh(function(t){return(t=zc(t))&&t/jc(t)});function Zh(){return Wh(Hh).scale(79.4188).clipAngle(179.999)}function Kh(t,e){return[t,Fc(Bc((Ic+e)/2))]}function Jh(t,e){return[t,e]}function $h(t,e){var n=Ac(e),r=Ac(t)*n;return[n*jc(t)/r,jc(e)/r]}function Qh(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function tf(t,e){return[Ac(e)*jc(t),jc(e)]}function ef(t,e){var n=Ac(e),r=1+Ac(t)*n;return[n*jc(t)/r,jc(e)/r]}function nf(t,e){return[Fc(Bc((Ic+e)/2)),-t]}function rf(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return Ja(t,function(t){var i=rf(t,e,n,r);i&&s.push(i)}),za(s)}var a=function(t){var e=pu(t).geometry.coordinates,n=[-e[0],-e[1]];return Zh().rotate(n).scale(Aa)}(o),u={type:o.type,coordinates:sf(o.coordinates,a)},l=(new xc.GeoJSONReader).read(u),c=Wa(Xa(e,n),"meters"),h=xc.BufferOp.bufferOp(l,c,r);if(!of((h=(new xc.GeoJSONWriter).write(h)).coordinates))return Fa({type:h.type,coordinates:af(h.coordinates,a)},i)}function of(t){return Array.isArray(t[0])?of(t[0]):isNaN(t[0])}function sf(t,e){return"object"!=typeof t[0]?e(t):t.map(function(t){return sf(t,e)})}function af(t,e){return"object"!=typeof t[0]?e.invert(t):t.map(function(t){return af(t,e)})}Hh.invert=qh(function(t){return t}),Kh.invert=function(t,e){return[t,2*Tc(Dc(e))-Ic]},Jh.invert=Jh,$h.invert=qh(Tc),Qh.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,s=o*o;r-=n=(r*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-e)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while(kc(n)>Sc&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},tf.invert=qh(Vc),ef.invert=qh(function(t){return 2*Tc(t)}),nf.invert=function(t,e){return[-e,2*Tc(Dc(t))-Ic]};var uf=function(t,e,n){var r=(n=n||{}).units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return Ja(t,function(t){var n=rf(t,e,r,i);n&&o.push(n)}),za(o);case"FeatureCollection":return Ka(t,function(t){var n=rf(t,e,r,i);n&&Ka(n,function(t){t&&o.push(t)})}),za(o)}return rf(t,e,r,i)};var lf=n(8260),cf=function(){function t(t){this.rbush_=new lf(t),this.items_={}}return t.prototype.insert=function(t,e){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[p(e)]=n},t.prototype.load=function(t,e){for(var n=new Array(e.length),r=0,i=e.length;r<i;r++){var o=t[r],s=e[r],a={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};n[r]=a,this.items_[p(s)]=a}this.rbush_.load(n)},t.prototype.remove=function(t){var e=p(t),n=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(n)},t.prototype.update=function(t,e){var n=this.items_[p(e)];$([n.minX,n.minY,n.maxX,n.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map(function(t){return t.value})},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(t){return t.value})},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var n,r=0,i=t.length;r<i;r++)if(n=e(t[r]))return n;return n},t.prototype.isEmpty=function(){return Zt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return H(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),hf=cf,ff="addfeature",pf="changefeature",df="clear",gf="removefeature",yf="featuresloadstart",vf="featuresloadend",_f="featuresloaderror",mf=0,xf=1,bf=2,wf=3,Ef=4,Cf=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Qo(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return h()},t.prototype.getImage=function(t){return h()},t.prototype.getHitDetectionImage=function(){return h()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return h()},t.prototype.getImageSize=function(){return h()},t.prototype.getOrigin=function(){return h()},t.prototype.getSize=function(){return h()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Qo(t)},t.prototype.listenImageChange=function(t){h()},t.prototype.load=function(){h()},t.prototype.unlistenImageChange=function(t){h()},t}(),Sf=Cf;function Pf(t){return Array.isArray(t)?Gt(t):t}var If=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mf=function(t){function e(e){var n=this,r=void 0!==e.rotateWithView&&e.rotateWithView;return(n=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0],declutterMode:e.declutterMode})||this).canvas_=void 0,n.hitDetectionCanvas_=null,n.fill_=void 0!==e.fill?e.fill:null,n.origin_=[0,0],n.points_=e.points,n.radius_=void 0!==e.radius?e.radius:e.radius1,n.radius2_=e.radius2,n.angle_=void 0!==e.angle?e.angle:0,n.stroke_=void 0!==e.stroke?e.stroke:null,n.size_=null,n.renderOptions_=null,n.render(),n}return If(e,t),e.prototype.clone=function(){var t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.setFill=function(t){this.fill_=t,this.render()},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var n=this.renderOptions_,r=hn(n.size*t,n.size*t);this.draw_(n,r,t),e=r.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return bf},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.setStroke=function(t){this.stroke_=t,this.render()},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,n){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var r=this.radius_,i=void 0===this.radius2_?r:this.radius2_;if(r<i){var o=r;r=i,i=o}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,u=i*Math.sin(a),l=r-Math.sqrt(i*i-u*u),c=Math.sqrt(u*u+l*l),h=c/u;if("miter"===t&&h<=n)return h*e;var f=e/2/h,p=e/2*(l/c),d=Math.sqrt((r+f)*(r+f)+p*p)-r;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=r*Math.sin(a),y=i-Math.sqrt(r*r-g*g),v=Math.sqrt(g*g+y*y)/g;if(v<=n){var _=v*e/2-i-r;return 2*Math.max(d,_)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=wn,n=0,r=null,i=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=En),t=Pf(t),void 0===(o=this.stroke_.getWidth())&&(o=1),r=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=wn),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var s=this.calculateLineJoinSize_(e,o,n),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*a+s),lineDash:r,lineDashOffset:i,lineJoin:e,miterLimit:n}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var r=this.fill_.getColor();null===r&&(r=mn),e.fillStyle=Pf(r),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),n=0;if("string"==typeof e&&(e=Ft(e)),null===e?n=1:Array.isArray(e)&&(n=4===e.length?e[3]:1),0===n){var r=hn(t.size,t.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(t,r)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,n=this.radius_;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{var r=void 0===this.radius2_?n:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var i=this.angle_-Math.PI/2,o=2*Math.PI/e,s=0;s<e;s++){var a=i+s*o,u=s%2==0?n:r;t.lineTo(u*Math.cos(a),u*Math.sin(a))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=mn,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(Sf),Of=Mf,Lf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rf=function(t){function e(e){var n=e||{};return t.call(this,{points:1/0,fill:n.fill,radius:n.radius,stroke:n.stroke,scale:void 0!==n.scale?n.scale:1,rotation:void 0!==n.rotation?n.rotation:0,rotateWithView:void 0!==n.rotateWithView&&n.rotateWithView,displacement:void 0!==n.displacement?n.displacement:[0,0],declutterMode:n.declutterMode})||this}return Lf(e,t),e.prototype.clone=function(){var t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Of),kf=Rf,Tf=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Nf=Tf,Af=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),Df=Af,Ff=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=zf,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=zf,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var jf=null;function Gf(t,e){if(!jf){var n=new Nf({color:"rgba(255,255,255,0.4)"}),r=new Df({color:"#3399CC",width:1.25});jf=[new Ff({image:new kf({fill:n,stroke:r,radius:5}),fill:n,stroke:r})]}return jf}function Bf(){var t={},e=[255,255,255,1],n=[0,153,255,1];return t.Polygon=[new Ff({fill:new Nf({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new Ff({stroke:new Df({color:e,width:5})}),new Ff({stroke:new Df({color:n,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new Ff({image:new kf({radius:6,fill:new Nf({color:n}),stroke:new Df({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function zf(t){return t.getGeometry()}var Vf=Ff,Uf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wf="renderOrder",Xf=function(t){function e(e){var n=this,r=e||{},i=qt({},r);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(n=t.call(this,i)||this).declutter_=void 0!==r.declutter&&r.declutter,n.renderBuffer_=void 0!==r.renderBuffer?r.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(r.style),n.updateWhileAnimating_=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,n.updateWhileInteracting_=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,n}return Uf(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(Wf)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new lf(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(Wf,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Gf,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var n;Array.isArray(t)?n=t:(P("function"==typeof t.getZIndex,41),n=[t]),e=function(){return n}}return e}(this.style_),this.changed()},e}(ze),qf=Xf,Yf={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Hf=[Yf.FILL],Zf=[Yf.STROKE],Kf=[Yf.BEGIN_PATH],Jf=[Yf.CLOSE_PATH],$f=Yf,Qf=function(){function t(){}return t.prototype.drawCustom=function(t,e,n,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),tp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ep=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=n,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return tp(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},e.prototype.appendFlatPointCoordinates=function(t,e){for(var n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,o=i.length,s=0,a=t.length;s<a;s+=e)r[0]=t[s],r[1]=t[s+1],U(n,r)&&(i[o++]=r[0],i[o++]=r[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,n,r,i,o){var s=this.coordinates,a=s.length,u=this.getBufferedMaxExtent();o&&(e+=r);var l,c,h,f=t[e],p=t[e+1],d=this.tmpCoordinate_,g=!0;for(l=e+r;l<n;l+=r)d[0]=t[l],d[1]=t[l+1],(h=q(u,d))!==c?(g&&(s[a++]=f,s[a++]=p,g=!1),s[a++]=d[0],s[a++]=d[1]):h===N?(s[a++]=d[0],s[a++]=d[1],g=!1):g=!0,f=d[0],p=d[1],c=h;return(i&&g||l===e+r)&&(s[a++]=f,s[a++]=p),a},e.prototype.drawCustomCoordinates_=function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o],u=this.appendFlatLineCoordinates(t,e,a,r,!1,!1);i.push(u),e=a}return e},e.prototype.drawCustom=function(t,e,n,r){this.beginGeometry(t,e);var i,o,s,a,u,l=t.getType(),c=t.getStride(),h=this.coordinates.length;switch(l){case"MultiPolygon":i=t.getOrientedFlatCoordinates(),a=[];var f=t.getEndss();u=0;for(var p=0,d=f.length;p<d;++p){var g=[];u=this.drawCustomCoordinates_(i,u,f[p],c,g),a.push(g)}this.instructions.push([$f.CUSTOM,h,a,t,n,mo]),this.hitDetectionInstructions.push([$f.CUSTOM,h,a,t,r||n,mo]);break;case"Polygon":case"MultiLineString":s=[],i="Polygon"==l?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),u=this.drawCustomCoordinates_(i,0,t.getEnds(),c,s),this.instructions.push([$f.CUSTOM,h,s,t,n,_o]),this.hitDetectionInstructions.push([$f.CUSTOM,h,s,t,r||n,_o]);break;case"LineString":case"Circle":i=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(i,0,i.length,c,!1,!1),this.instructions.push([$f.CUSTOM,h,o,t,n,vo]),this.hitDetectionInstructions.push([$f.CUSTOM,h,o,t,r||n,vo]);break;case"MultiPoint":i=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(i,c))>h&&(this.instructions.push([$f.CUSTOM,h,o,t,n,vo]),this.hitDetectionInstructions.push([$f.CUSTOM,h,o,t,r||n,vo]));break;case"Point":i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([$f.CUSTOM,h,o,t,n]),this.hitDetectionInstructions.push([$f.CUSTOM,h,o,t,r||n])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[$f.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[$f.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var n,r,i=e.length,s=-1;for(t=0;t<i;++t)(r=(n=e[t])[0])==$f.END_GEOMETRY?s=t:r==$f.BEGIN_GEOMETRY&&(n[2]=t,o(this.hitDetectionInstructions,s,t),s=-1)},e.prototype.setFillStrokeStyle=function(t,e){var n=this.state;if(t){var r=t.getColor();n.fillStyle=Pf(r||mn)}else n.fillStyle=void 0;if(e){var i=e.getColor();n.strokeStyle=Pf(i||En);var o=e.getLineCap();n.lineCap=void 0!==o?o:xn;var s=e.getLineDash();n.lineDash=s?s.slice():bn;var a=e.getLineDashOffset();n.lineDashOffset=a||0;var u=e.getLineJoin();n.lineJoin=void 0!==u?u:wn;var l=e.getWidth();n.lineWidth=void 0!==l?l:1;var c=e.getMiterLimit();n.miterLimit=void 0!==c?c:10,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,n=[$f.SET_FILL_STYLE,e];return"string"!=typeof e&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[$f.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,r=t.lineCap,i=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,u=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=r||i!=t.currentLineDash&&!a(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=u||t.currentMiterLimit!=l)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=r,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=u,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[$f.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=z(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;B(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Qf),np=ep,rp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ip=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterMode_=void 0,o.declutterImageWithText_=void 0,o}return rp(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([$f.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([$f.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([$f.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([$f.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),r=t.getSize(),i=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e},e}(np),op=ip,sp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ap=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return sp(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,r){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,r,!1,!1),s=[$f.MOVE_TO_LINE_TO,i,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),n},e.prototype.drawLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([$f.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,bn,0],Kf);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(Zf),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([$f.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],Kf);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),u=0,l=0,c=o.length;l<c;++l)u=this.drawFlatCoordinates_(s,u,o[l],a);this.hitDetectionInstructions.push(Zf),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Zf),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Zf),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(Kf)},e}(np),up=ap,lp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cp=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return lp(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,n,r){var i=this.state,o=void 0!==i.fillStyle,s=void 0!==i.strokeStyle,a=n.length;this.instructions.push(Kf),this.hitDetectionInstructions.push(Kf);for(var u=0;u<a;++u){var l=n[u],c=this.coordinates.length,h=this.appendFlatLineCoordinates(t,e,l,r,!0,!s),f=[$f.MOVE_TO_LINE_TO,c,h];this.instructions.push(f),this.hitDetectionInstructions.push(f),s&&(this.instructions.push(Jf),this.hitDetectionInstructions.push(Jf)),e=l}return o&&(this.instructions.push(Hf),this.hitDetectionInstructions.push(Hf)),s&&(this.instructions.push(Zf),this.hitDetectionInstructions.push(Zf)),e},e.prototype.drawCircle=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([$f.SET_FILL_STYLE,mn]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([$f.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);var u=[$f.CIRCLE,a];this.instructions.push(Kf,u),this.hitDetectionInstructions.push(Kf,u),void 0!==n.fillStyle&&(this.instructions.push(Hf),this.hitDetectionInstructions.push(Hf)),void 0!==n.strokeStyle&&(this.instructions.push(Zf),this.hitDetectionInstructions.push(Zf)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([$f.SET_FILL_STYLE,mn]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([$f.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([$f.SET_FILL_STYLE,mn]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([$f.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),u=0,l=0,c=o.length;l<c;++l)u=this.drawFlatCoordinatess_(s,u,o[l],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var n=this.coordinates,r=0,i=n.length;r<i;++r)n[r]=po(n[r],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(np),hp=cp,fp="point",pp="line";function dp(t,e,n,r,i){var o,s,a,u,l,c,h,f,p,d=n,g=n,y=0,v=0,_=n;for(o=n;o<r;o+=i){var m=e[o],x=e[o+1];void 0!==u&&(f=m-u,p=x-l,a=Math.sqrt(f*f+p*p),void 0!==c&&(v+=s,Math.acos((c*f+h*p)/(s*a))>t&&(v>y&&(y=v,d=_,g=o),v=0,_=o-i)),s=a,c=f,h=p),u=m,l=x}return(v+=a)>y?[_,o]:[d,g]}var gp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yp={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},vp=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return gp(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var n=this.textFillState_,r=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(n||r)){var o=this.coordinates,s=o.length,a=t.getType(),u=null,l=t.getStride();if(i.placement!==pp||"LineString"!=a&&"MultiLineString"!=a&&"Polygon"!=a&&"MultiPolygon"!=a){var c=i.overflow?null:[];switch(a){case"Point":case"MultiPoint":u=t.getFlatCoordinates();break;case"LineString":u=t.getFlatMidpoint();break;case"Circle":u=t.getCenter();break;case"MultiLineString":u=t.getFlatMidpoints(),l=2;break;case"Polygon":u=t.getFlatInteriorPoint(),i.overflow||c.push(u[2]/this.resolution),l=3;break;case"MultiPolygon":var h=t.getFlatInteriorPoints();u=[];for(w=0,E=h.length;w<E;w+=3)i.overflow||c.push(h[w+2]/this.resolution),u.push(h[w],h[w+1]);if(0===u.length)return;l=2}if((L=this.appendFlatPointCoordinates(u,l))===s)return;if(c&&(L-s)/2!==u.length/l){var f=s/2;c=c.filter(function(t,e){var n=o[2*(f+e)]===u[e*l]&&o[2*(f+e)+1]===u[e*l+1];return n||--f,n})}this.saveTextStates_(),(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var p=i.padding;if(p!=Pn&&(i.scale[0]<0||i.scale[1]<0)){var d=i.padding[0],g=i.padding[1],y=i.padding[2],v=i.padding[3];i.scale[0]<0&&(g=-g,v=-v),i.scale[1]<0&&(d=-d,y=-y),p=[d,g,y,v]}var _=this.pixelRatio;this.instructions.push([$f.DRAW_IMAGE,s,L,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,p==Pn?Pn:p.map(function(t){return t*_}),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,c]);var m=1/_;this.hitDetectionInstructions.push([$f.DRAW_IMAGE,s,L,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,void 0,this.declutterImageWithText_,p,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,c]),this.endGeometry(e)}else{if(!yt(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(u=t.getFlatCoordinates(),"LineString"==a)x=[u.length];else if("MultiLineString"==a)x=t.getEnds();else if("Polygon"==a)x=t.getEnds().slice(0,1);else if("MultiPolygon"==a){var b=t.getEndss();x=[];for(var w=0,E=b.length;w<E;++w)x.push(b[w][0])}this.beginGeometry(t,e);for(var C=i.textAlign,S=0,P=void 0,I=0,M=x.length;I<M;++I){if(null==C){var O=dp(i.maxAngle,u,S,x[I],l);S=O[0],P=O[1]}else P=x[I];for(var w=S;w<P;w+=l)o.push(u[w],u[w+1]);var L=o.length;S=x[I],this.drawChars_(s,L),s=L}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||Cn,justify:e.justify,textBaseline:e.textBaseline||Sn,scale:e.scale});var o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))},e.prototype.drawChars_=function(t,e){var n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,o=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,u=yp[r.textBaseline],l=this.textOffsetY_*a,c=this.text_,h=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([$f.DRAW_CHARS,t,e,u,r.overflow,s,r.maxAngle,a,l,i,h*a,c,o,1]),this.hitDetectionInstructions.push([$f.DRAW_CHARS,t,e,u,r.overflow,s,r.maxAngle,1,l,i,h,c,o,1/a])},e.prototype.setTextStyle=function(t,e){var n,r,i;if(t){var o=t.getFill();o?((r=this.textFillState_)||(r={},this.textFillState_=r),r.fillStyle=Pf(o.getColor()||mn)):(r=null,this.textFillState_=r);var s=t.getStroke();if(s){(i=this.textStrokeState_)||(i={},this.textStrokeState_=i);var a=s.getLineDash(),u=s.getLineDashOffset(),l=s.getWidth(),c=s.getMiterLimit();i.lineCap=s.getLineCap()||xn,i.lineDash=a?a.slice():bn,i.lineDashOffset=void 0===u?0:u,i.lineJoin=s.getLineJoin()||wn,i.lineWidth=void 0===l?1:l,i.miterLimit=void 0===c?10:c,i.strokeStyle=Pf(s.getColor()||En)}else i=null,this.textStrokeState_=i;n=this.textState_;var h=t.getFont()||_n;kn(h);var f=t.getScaleArray();n.overflow=t.getOverflow(),n.font=h,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||Sn,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Pn,n.scale=void 0===f?[1,1]:f;var d=t.getOffsetX(),g=t.getOffsetY(),y=t.getRotateWithView(),v=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0===v?0:v,this.strokeKey_=i?("string"==typeof i.strokeStyle?i.strokeStyle:p(i.strokeStyle))+i.lineCap+i.lineDashOffset+"|"+i.lineWidth+i.lineJoin+i.miterLimit+"["+i.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+p(r.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(np),_p={Circle:hp,Default:np,Image:op,LineString:up,Polygon:hp,Text:vp},mp=function(){function t(t,e,n,r){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var n=this.buildersByZIndex_[e];for(var r in n){var i=n[r].finish();t[e][r]=i}}return t},t.prototype.getBuilder=function(t,e){var n=void 0!==t?t.toString():"0",r=this.buildersByZIndex_[n];void 0===r&&(r={},this.buildersByZIndex_[n]=r);var i=r[e];void 0===i&&(i=new(0,_p[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[e]=i);return i},t}(),xp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bp=function(t){function e(e){var n=t.call(this)||this;return n.ready=!0,n.boundHandleImageChange_=n.handleImageChange_.bind(n),n.layer_=e,n.declutterExecutorGroup=null,n}return xp(e,t),e.prototype.getFeatures=function(t){return h()},e.prototype.getData=function(t){return null},e.prototype.prepareFrame=function(t){return h()},e.prototype.renderFrame=function(t,e){return h()},e.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},e.prototype.createLoadedTileFinder=function(t,e,n){return function(r,i){var o=this.loadedTileCallback.bind(this,n,r);return t.forEachLoadedTile(e,r,i,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){},e.prototype.getDataAtPixel=function(t,e,n){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===bf&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=bf&&e!=wf&&t.addEventListener(Qt,this.boundHandleImageChange_),e==mf&&(t.load(),e=t.getState()),e==bf},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()},e.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},e}(ye),wp=bp,Ep=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cp=[],Sp=null;var Pp=function(t){function e(e){var n=t.call(this,e)||this;return n.container=null,n.renderedResolution,n.tempTransform=[1,0,0,1,0,0],n.pixelTransform=[1,0,0,1,0,0],n.inversePixelTransform=[1,0,0,1,0,0],n.context=null,n.containerReused=!1,n.pixelContext_=null,n.frameState=null,n}return Ep(e,t),e.prototype.getImageData=function(t,e,n){var r,i;Sp||((r=document.createElement("canvas")).width=1,r.height=1,Sp=r.getContext("2d")),Sp.clearRect(0,0,1,1);try{Sp.drawImage(t,e,n,1,1,0,0,1,1),i=Sp.getImageData(0,0,1,1).data}catch(t){return Sp=null,null}return i},e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,n){var r,i,o=this.getLayer().getClassName();t&&t.className===o&&(!n||t&&t.style.backgroundColor&&a(Ft(t.style.backgroundColor),Ft(n)))&&((u=t.firstElementChild)instanceof HTMLCanvasElement&&(i=u.getContext("2d")));if(i&&i.canvas.style.transform===e?(this.container=t,this.context=i,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(r=document.createElement("div")).className=o;var s=r.style;s.position="absolute",s.width="100%",s.height="100%";var u=(i=hn()).canvas;r.appendChild(u),(s=u.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=r,this.context=i}this.containerReused||!n||this.container.style.backgroundColor||(this.container.style.backgroundColor=n)},e.prototype.clipUnrotated=function(t,e,n){var r=pt(n),i=dt(n),o=st(n),s=ot(n);O(e.coordinateToPixelTransform,r),O(e.coordinateToPixelTransform,i),O(e.coordinateToPixelTransform,o),O(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;O(a,r),O(a,i),O(a,o),O(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,n){var r=this.getLayer();if(r.hasListener(t)){var i=new nn(t,this.inversePixelTransform,n,e);r.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(Te,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ne,t,e)},e.prototype.getRenderTransform=function(t,e,n,r,i,o,s){var a=i/2,u=o/2,l=r/e,c=-l,h=-t[0]+s,f=-t[1];return L(this.tempTransform,a,u,l,c,-n,h,f)},e.prototype.getDataAtPixel=function(t,e,n){var r=O(this.inversePixelTransform,t.slice()),i=this.context,o=this.getLayer().getExtent();if(o&&!U(o,O(e.pixelToCoordinateTransform,t.slice())))return null;var s,a=Math.round(r[0]),u=Math.round(r[1]),l=this.pixelContext_;if(!l){var c=document.createElement("canvas");c.width=1,c.height=1,l=c.getContext("2d"),this.pixelContext_=l}l.clearRect(0,0,1,1);try{l.drawImage(i.canvas,a,u,1,1,0,0,1,1),s=l.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):s}return 0===s[3]?null:s},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(wp),Ip=Pp;function Mp(t,e,n,r,i,o,s,a,u,l,c,h){var f=t[e],p=t[e+1],d=0,g=0,y=0,v=0;function _(){d=f,g=p,f=t[e+=r],p=t[e+1],v+=y,y=Math.sqrt((f-d)*(f-d)+(p-g)*(p-g))}do{_()}while(e<n-r&&v+y<o);for(var m=0===y?0:(o-v)/y,x=Mt(d,f,m),b=Mt(g,p,m),w=e-r,E=v,C=o+a*u(l,i,c);e<n-r&&v+y<C;)_();var S,P=Mt(d,f,m=0===y?0:(C-v)/y),I=Mt(g,p,m);if(h){var M=[x,b,P,I];Yi(M,0,4,2,h,M,M),S=M[0]>M[2]}else S=x>P;var O,L=Math.PI,R=[],k=w+r===e;if(y=0,v=E,f=t[e=w],p=t[e+1],k){_(),O=Math.atan2(p-g,f-d),S&&(O+=O>0?-L:L);var T=(P+x)/2,N=(I+b)/2;return R[0]=[T,N,(C-o)/2,O,i],R}for(var A=0,D=(i=i.replace(/\n/g," ")).length;A<D;){_();var F=Math.atan2(p-g,f-d);if(S&&(F+=F>0?-L:L),void 0!==O){var j=F-O;if(j+=j>L?-2*L:j<-L?2*L:0,Math.abs(j)>s)return null}O=F;for(var G=A,B=0;A<D;++A){var z=a*u(l,i[S?D-A-1:A],c);if(e+r<n&&v+y<o+B+z/2)break;B+=z}if(A!==G){var V=S?i.substring(D-G,D-A):i.substring(G,A);T=Mt(d,f,m=0===y?0:(o+B/2-v)/y),N=Mt(g,p,m);R.push([T,N,B/2,F,V]),o+=B}}return R}function Op(t,e,n,r){for(var i=t[e],o=t[e+1],s=0,a=e+r;a<n;a+=r){var u=t[a],l=t[a+1];s+=Math.sqrt((u-i)*(u-i)+(l-o)*(l-o)),i=u,o=l}return s}var Lp=[1/0,1/0,-1/0,-1/0],Rp=[],kp=[],Tp=[],Np=[];function Ap(t){return t[3].declutterBox}var Dp=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Fp(t,e){return"start"!==e&&"end"!==e||Dp.test(t)||(e="start"===e?"left":"right"),yp[e]}function jp(t,e,n){return n>0&&t.push("\n",""),t.push(e,""),t}var Gp=function(){function t(t,e,n,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,n,r){var i=t+e+n+r;if(this.labels_[i])return this.labels_[i];var o=r?this.strokeStates[r]:null,s=n?this.fillStates[n]:null,a=this.textStates[e],u=this.pixelRatio,l=[a.scale[0]*u,a.scale[1]*u],c=Array.isArray(t),h=a.justify?yp[a.justify]:Fp(Array.isArray(t)?t[0]:t,a.textAlign||Cn),f=r&&o.lineWidth?o.lineWidth:0,p=c?t:t.split("\n").reduce(jp,[]),d=function(t,e){for(var n=[],r=[],i=[],o=0,s=0,a=0,u=0,l=0,c=e.length;l<=c;l+=2){var h=e[l];if("\n"!==h&&l!==c){var f=e[l+1]||t.font,p=An(f,h);n.push(p),s+=p;var d=Tn(f);r.push(d),u=Math.max(u,d)}else o=Math.max(o,s),i.push(s),s=0,a+=u}return{width:o,height:a,widths:n,heights:r,lineWidths:i}}(a,p),g=d.width,y=d.height,v=d.widths,_=d.heights,m=d.lineWidths,x=g+f,w=[],E=(x+2)*l[0],C=(y+f)*l[1],S={width:E<0?Math.floor(E):Math.ceil(E),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:w};(1==l[0]&&1==l[1]||w.push("scale",l),r)&&(w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",f),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit),(b?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset)));n&&w.push("fillStyle",s.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var P,I=.5-h,M=h*x+I*f,O=[],L=[],R=0,k=0,T=0,N=0,A=0,D=p.length;A<D;A+=2){var F=p[A];if("\n"!==F){var j=p[A+1]||a.font;j!==P&&(r&&O.push("font",j),n&&L.push("font",j),P=j),R=Math.max(R,_[T]);var G=[F,M+I*v[T]+h*(v[T]-m[N]),.5*(f+R)+k];M+=v[T],r&&O.push("strokeText",G),n&&L.push("fillText",G),++T}else k+=R,R=0,M=h*x+I*f,++N}return Array.prototype.push.apply(w,O),Array.prototype.push.apply(w,L),this.labels_[i]=S,S},t.prototype.replayTextBackground_=function(t,e,n,r,i,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,n,r,i,o,s,a,u,l,c,h,f,p,d,g){var y,v=n-(s*=h[0]),_=r-(a*=h[1]),m=i+u>t?t-u:i,x=o+l>e?e-l:o,b=p[3]+m*h[0]+p[1],w=p[0]+x*h[1]+p[2],E=v-p[3],C=_-p[0];return(d||0!==c)&&(Rp[0]=E,Np[0]=E,Rp[1]=C,kp[1]=C,kp[0]=E+b,Tp[0]=kp[0],Tp[1]=C+w,Np[1]=Tp[1]),0!==c?(O(y=L([1,0,0,1,0,0],n,r,1,1,c,-n,-r),Rp),O(y,kp),O(y,Tp),O(y,Np),H(Math.min(Rp[0],kp[0],Tp[0],Np[0]),Math.min(Rp[1],kp[1],Tp[1],Np[1]),Math.max(Rp[0],kp[0],Tp[0],Np[0]),Math.max(Rp[1],kp[1],Tp[1],Np[1]),Lp)):H(Math.min(E,E+b),Math.min(C,C+w),Math.max(E,E+b),Math.max(C,C+w),Lp),f&&(v=Math.round(v),_=Math.round(_)),{drawImageX:v,drawImageY:_,drawImageW:m,drawImageH:x,originX:u,originY:l,declutterBox:{minX:Lp[0],minY:Lp[1],maxX:Lp[2],maxY:Lp[3],value:g},canvasTransform:y,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,n,r,i,o,s){var a=!(!o&&!s),u=r.declutterBox,l=t.canvas,c=s?s[2]*r.scale[0]/2:0;return u.minX-c<=l.width/e&&u.maxX+c>=0&&u.minY-c<=l.height/e&&u.maxY+c>=0&&(a&&this.replayTextBackground_(t,Rp,kp,Tp,Np,o,s),Fn(t,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=O(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,n,r){var i=this.textStates[e],o=this.createLabel(t,e,r,n),s=this.strokeStates[n],a=this.pixelRatio,u=Fp(Array.isArray(t)?t[0]:t,i.textAlign||Cn),l=yp[i.textBaseline||Sn],c=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:u*(o.width/a-2*i.scale[0])+2*(.5-u)*c,anchorY:l*o.height/a+2*(.5-l)*c}},t.prototype.execute_=function(t,e,n,r,i,o,s,u){var l,c,h;this.pixelCoordinates_&&a(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=qi(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),c=this.renderedTransform_,h=n,c[0]=h[0],c[1]=h[1],c[2]=h[2],c[3]=h[3],c[4]=h[4],c[5]=h[5]);for(var f,p,d,g,y,v,_,m,x,b,w,E,C,S,P,I,M=0,O=r.length,L=0,R=0,k=0,T=null,N=null,A=this.coordinateCache_,D=this.viewRotation_,F=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:D},G=this.instructions!=r||this.overlaps?0:200;M<O;){var B=r[M];switch(B[0]){case $f.BEGIN_GEOMETRY:C=B[1],I=B[3],C.getGeometry()?void 0===s||yt(s,I.getExtent())?++M:M=B[2]+1:M=B[2];break;case $f.BEGIN_PATH:R>G&&(this.fill_(t),R=0),k>G&&(t.stroke(),k=0),R||k||(t.beginPath(),g=NaN,y=NaN),++M;break;case $f.CIRCLE:var z=l[L=B[1]],V=l[L+1],U=l[L+2]-z,W=l[L+3]-V,X=Math.sqrt(U*U+W*W);t.moveTo(z+X,V),t.arc(z,V,X,0,2*Math.PI,!0),++M;break;case $f.CLOSE_PATH:t.closePath(),++M;break;case $f.CUSTOM:L=B[1],f=B[2];var q=B[3],Y=B[4],H=6==B.length?B[5]:void 0;j.geometry=q,j.feature=C,M in A||(A[M]=[]);var Z=A[M];H?H(l,L,f,2,Z):(Z[0]=l[L],Z[1]=l[L+1],Z.length=2),Y(Z,j),++M;break;case $f.DRAW_IMAGE:L=B[1],f=B[2],m=B[3],p=B[4],d=B[5];var K=B[6],J=B[7],$=B[8],Q=B[9],tt=B[10],et=B[11],nt=B[12],rt=B[13],it=B[14],ot=B[15];if(!m&&B.length>=20){x=B[19],b=B[20],w=B[21],E=B[22];var st=this.drawLabelWithPointPlacement_(x,b,w,E);m=st.label,B[3]=m;var at=B[23];p=(st.anchorX-at)*this.pixelRatio,B[4]=p;var ut=B[24];d=(st.anchorY-ut)*this.pixelRatio,B[5]=d,K=m.height,B[6]=K,rt=m.width,B[13]=rt}var lt=void 0;B.length>25&&(lt=B[25]);var ct=void 0,ht=void 0,ft=void 0;B.length>17?(ct=B[16],ht=B[17],ft=B[18]):(ct=Pn,ht=!1,ft=!1),tt&&F?et+=D:tt||F||(et-=D);for(var pt=0;L<f;L+=2)if(!(lt&<[pt++]<rt/this.pixelRatio)){var dt=[t,e,m,Vt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[L],l[L+1],rt,K,p,d,$,Q,et,nt,i,ct,ht||ft,C),J,ht?T:null,ft?N:null];if(u){if("none"===it)continue;if("obstacle"===it){u.insert(Vt.declutterBox);continue}var gt=void 0,vt=void 0;if(ot){var _t=f-L;if(!ot[_t]){ot[_t]=dt;continue}if(gt=ot[_t],delete ot[_t],vt=Ap(gt),u.collides(vt))continue}if(u.collides(Vt.declutterBox))continue;gt&&(u.insert(vt),this.replayImageOrLabel_.apply(this,gt)),u.insert(Vt.declutterBox)}this.replayImageOrLabel_.apply(this,dt)}++M;break;case $f.DRAW_CHARS:var mt=B[1],xt=B[2],bt=B[3],wt=B[4];E=B[5];var Et=B[6],Ct=B[7],St=B[8];w=B[9];var Pt=B[10];x=B[11],b=B[12];var It=[B[13],B[13]],Mt=this.textStates[b],Ot=Mt.font,Lt=[Mt.scale[0]*Ct,Mt.scale[1]*Ct],Rt=void 0;Ot in this.widths_?Rt=this.widths_[Ot]:(Rt={},this.widths_[Ot]=Rt);var kt=Op(l,mt,xt,2),Tt=Math.abs(Lt[0])*Dn(Ot,x,Rt);if(wt||Tt<=kt){var Nt=this.textStates[b].textAlign,At=Mp(l,mt,xt,2,x,(kt-Tt)*yp[Nt],Et,Math.abs(Lt[0]),Dn,Ot,Rt,F?0:this.viewRotation_);t:if(At){var Dt=[],Ft=void 0,jt=void 0,Gt=void 0,Bt=void 0,zt=void 0;if(w)for(Ft=0,jt=At.length;Ft<jt;++Ft){Gt=(zt=At[Ft])[4],Bt=this.createLabel(Gt,b,"",w),p=zt[2]+(Lt[0]<0?-Pt:Pt),d=bt*Bt.height+2*(.5-bt)*Pt*Lt[1]/Lt[0]-St;var Vt=this.calculateImageOrLabelDimensions_(Bt.width,Bt.height,zt[0],zt[1],Bt.width,Bt.height,p,d,0,0,zt[3],It,!1,Pn,!1,C);if(u&&u.collides(Vt.declutterBox))break t;Dt.push([t,e,Bt,Vt,1,null,null])}if(E)for(Ft=0,jt=At.length;Ft<jt;++Ft){Gt=(zt=At[Ft])[4],Bt=this.createLabel(Gt,b,E,""),p=zt[2],d=bt*Bt.height-St;Vt=this.calculateImageOrLabelDimensions_(Bt.width,Bt.height,zt[0],zt[1],Bt.width,Bt.height,p,d,0,0,zt[3],It,!1,Pn,!1,C);if(u&&u.collides(Vt.declutterBox))break t;Dt.push([t,e,Bt,Vt,1,null,null])}u&&u.load(Dt.map(Ap));for(var Ut=0,Wt=Dt.length;Ut<Wt;++Ut)this.replayImageOrLabel_.apply(this,Dt[Ut])}}++M;break;case $f.END_GEOMETRY:if(void 0!==o){var Xt=o(C=B[1],I);if(Xt)return Xt}++M;break;case $f.FILL:G?R++:this.fill_(t),++M;break;case $f.MOVE_TO_LINE_TO:for(L=B[1],f=B[2],S=l[L],_=(P=l[L+1])+.5|0,(v=S+.5|0)===g&&_===y||(t.moveTo(S,P),g=v,y=_),L+=2;L<f;L+=2)v=(S=l[L])+.5|0,_=(P=l[L+1])+.5|0,L!=f-2&&v===g&&_===y||(t.lineTo(S,P),g=v,y=_);++M;break;case $f.SET_FILL_STYLE:T=B,this.alignFill_=B[2],R&&(this.fill_(t),R=0,k&&(t.stroke(),k=0)),t.fillStyle=B[1],++M;break;case $f.SET_STROKE_STYLE:N=B,k&&(t.stroke(),k=0),this.setStrokeStyle_(t,B),++M;break;case $f.STROKE:G?k++:t.stroke(),++M;break;default:++M}}R&&this.fill_(t),k&&t.stroke()},t.prototype.execute=function(t,e,n,r,i,o){this.viewRotation_=r,this.execute_(t,e,n,this.instructions,i,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,n,r,i){return this.viewRotation_=n,this.execute_(t,1,e,this.hitDetectionInstructions,!0,r,i)},t}(),Bp=Gp,zp=["Polygon","Circle","LineString","Image","Text","Default"],Vp=function(){function t(t,e,n,r,i,o){this.maxExtent_=t,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(i)}return t.prototype.clip=function(t,e){var n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var n=this.executorsByZIndex_[e];void 0===n&&(n={},this.executorsByZIndex_[e]=n);var r=t[e];for(var i in r){var o=r[i];n[i]=new Bp(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var n=this.executorsByZIndex_[e],r=0,i=t.length;r<i;++r)if(t[r]in n)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,n,r,i,o,s){var a=2*(i=Math.round(i))+1,u=L(this.hitDetectionTransform_,i+.5,i+.5,1/n,-1/n,-r,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=hn(a,a));var c,h=this.hitDetectionContext_;h.canvas.width!==a||h.canvas.height!==a?(h.canvas.width=a,h.canvas.height=a):l||h.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(tt(c=[1/0,1/0,-1/0,-1/0],t),B(c,n*(this.renderBuffer_+i),c));var f,p=function(t){if(void 0!==Up[t])return Up[t];for(var e=2*t+1,n=t*t,r=new Array(n+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var s=i*i+o*o;if(s>n)break;var a=r[s];a||(a=[],r[s]=a),a.push(4*((t+i)*e+(t+o))+3),i>0&&a.push(4*((t-i)*e+(t+o))+3),o>0&&(a.push(4*((t+i)*e+(t-o))+3),i>0&&a.push(4*((t-i)*e+(t-o))+3))}for(var u=[],l=(i=0,r.length);i<l;++i)r[i]&&u.push.apply(u,r[i]);return Up[t]=u,u}(i);function d(t,e){for(var n=h.getImageData(0,0,a,a).data,r=0,u=p.length;r<u;r++)if(n[p[r]]>0){if(!s||"Image"!==f&&"Text"!==f||-1!==s.indexOf(t)){var l=(p[r]-3)/4,c=i-l%a,d=i-(l/a|0),g=o(t,e,c*c+d*d);if(g)return g}h.clearRect(0,0,a,a);break}}var g,y,v,_,m,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(e),g=x.length-1;g>=0;--g){var b=x[g].toString();for(v=this.executorsByZIndex_[b],y=zp.length-1;y>=0;--y)if(void 0!==(_=v[f=zp[y]])&&(m=_.executeHitDetection(h,u,r,d,c)))return m}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],r=e[1],i=e[2],o=e[3],s=[n,r,n,o,i,o,i,r];return qi(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return Zt(this.executorsByZIndex_)},t.prototype.execute=function(t,n,r,i,o,s,a){var u=Object.keys(this.executorsByZIndex_).map(Number);u.sort(e),this.maxExtent_&&(t.save(),this.clip(t,r));var l,c,h,f,p,d,g=s||zp;for(a&&u.reverse(),l=0,c=u.length;l<c;++l){var y=u[l].toString();for(p=this.executorsByZIndex_[y],h=0,f=g.length;h<f;++h){void 0!==(d=p[g[h]])&&d.execute(t,n,r,i,o,a)}}this.maxExtent_&&t.restore()},t}(),Up={};var Wp=Vp,Xp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qp=function(t){function e(e,n,r,i,o,s,a){var u=t.call(this)||this;return u.context_=e,u.pixelRatio_=n,u.extent_=r,u.transform_=i,u.viewRotation_=o,u.squaredTolerance_=s,u.userTransform_=a,u.contextFillState_=null,u.contextStrokeState_=null,u.contextTextState_=null,u.fillState_=null,u.strokeState_=null,u.image_=null,u.imageAnchorX_=0,u.imageAnchorY_=0,u.imageHeight_=0,u.imageOpacity_=0,u.imageOriginX_=0,u.imageOriginY_=0,u.imageRotateWithView_=!1,u.imageRotation_=0,u.imageScale_=[0,0],u.imageWidth_=0,u.text_="",u.textOffsetX_=0,u.textOffsetY_=0,u.textRotateWithView_=!1,u.textRotation_=0,u.textScale_=[0,0],u.textFillState_=null,u.textStrokeState_=null,u.textState_=null,u.pixelCoordinates_=[],u.tmpLocalTransform_=[1,0,0,1,0,0],u}return Xp(e,t),e.prototype.drawImages_=function(t,e,n,r){if(this.image_){var i=qi(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var u=this.imageRotation_;this.imageRotateWithView_&&(u+=this.viewRotation_);for(var l=0,c=i.length;l<c;l+=2){var h=i[l]-this.imageAnchorX_,f=i[l+1]-this.imageAnchorY_;if(0!==u||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var p=h+this.imageAnchorX_,d=f+this.imageAnchorY_;L(s,p,d,1,1,u,-p,-d),o.setTransform.apply(o,s),o.translate(p,d),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,h,f,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=a)}},e.prototype.drawText_=function(t,e,n,r){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=qi(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<n;e+=r){var a=i[e]+this.textOffsetX_,u=i[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var l=L(this.tmpLocalTransform_,a,u,1,1,s,-a,-u);o.setTransform.apply(o,l),o.translate(a,u),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,a,u),this.textFillState_&&o.fillText(this.text_,a,u)}}},e.prototype.moveToLineTo_=function(t,e,n,r,i){var o=this.context_,s=qi(t,e,n,r,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;i&&(a-=2);for(var u=2;u<a;u+=2)o.lineTo(s[u],s[u+1]);return i&&o.closePath(),n},e.prototype.drawRings_=function(t,e,n,r){for(var i=0,o=n.length;i<o;++i)e=this.moveToLineTo_(t,e,n[i],r,!0);return e},e.prototype.drawCircle=function(t){if(yt(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,n){var r=t.getFlatCoordinates();if(r){var i=t.getStride();return qi(r,0,r.length,i,e,n)}return null}(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],r=e[3]-e[1],i=Math.sqrt(n*n+r*r),o=this.context_;o.beginPath(),o.arc(e[0],e[1],i,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var n=e.getGeometryFunction()(t);n&&yt(this.extent_,n.getExtent())&&(this.setStyle(e),this.drawGeometry(n))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),n=0,r=e.length;n<r;++n)this.drawGeometry(e[n])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),yt(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var r=t.getFlatMidpoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(yt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var n=this.context_,r=t.getFlatCoordinates(),i=0,o=t.getEnds(),s=t.getStride();n.beginPath();for(var a=0,u=o.length;a<u;++a)i=this.moveToLineTo_(r,i,o[a],s,!1);n.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),yt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var n=t.getFlatInteriorPoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),yt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getOrientedFlatCoordinates(),r=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=i.length;s<a;++s){var u=i[s];r=this.drawRings_(n,r,u,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(a(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,n=this.contextTextState_,r=t.textAlign?t.textAlign:Cn;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=r&&(n.textAlign=r,e.textAlign=r),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=r,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:r,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var n=this;if(t){var r=t.getColor();this.fillState_={fillStyle:Pf(r||mn)}}else this.fillState_=null;if(e){var i=e.getColor(),o=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),u=e.getLineJoin(),l=e.getWidth(),c=e.getMiterLimit(),h=s||bn;this.strokeState_={lineCap:void 0!==o?o:xn,lineDash:1===this.pixelRatio_?h:h.map(function(t){return t*n.pixelRatio_}),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==u?u:wn,lineWidth:(void 0!==l?l:1)*this.pixelRatio_,miterLimit:void 0!==c?c:10,strokeStyle:Pf(i||En)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var n=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*this.pixelRatio_,this.imageAnchorY_=n[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var n=e.getColor();this.textFillState_={fillStyle:Pf(n||mn)}}else this.textFillState_=null;var r=t.getStroke();if(r){var i=r.getColor(),o=r.getLineCap(),s=r.getLineDash(),a=r.getLineDashOffset(),u=r.getLineJoin(),l=r.getWidth(),c=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:xn,lineDash:s||bn,lineDashOffset:a||0,lineJoin:void 0!==u?u:wn,lineWidth:void 0!==l?l:1,miterLimit:void 0!==c?c:10,strokeStyle:Pf(i||En)}}else this.textStrokeState_=null;var h=t.getFont(),f=t.getOffsetX(),p=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation(),y=t.getScaleArray(),v=t.getText(),_=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==h?h:_n,textAlign:void 0!==_?_:Cn,textBaseline:void 0!==m?m:Sn},this.text_=void 0!==v?Array.isArray(v)?v.reduce(function(t,e,n){return t+(n%2?" ":e)},""):v:"",this.textOffsetX_=void 0!==f?this.pixelRatio_*f:0,this.textOffsetY_=void 0!==p?this.pixelRatio_*p:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*y[0],this.pixelRatio_*y[1]]}else this.text_=""},e}(Qf),Yp=qp,Hp="fraction",Zp="pixels",Kp="bottom-left",Jp="bottom-right",$p="top-left",Qp="top-right",td=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ed=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=r,o.resolution=n,o.state=i,o}return td(e,t),e.prototype.changed=function(){this.dispatchEvent(Qt)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return h()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){h()},e}($t),nd=ed,rd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,r,mf)||this;return a.src_=i,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=mf,a.imageLoadFunction_=s,a}rd(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=wf,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=ht(this.extent)/this.image_.height),this.state=bf,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=mf&&this.state!=wf||(this.state=xf,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=id(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=ht(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(nd);function id(t,e,n){var r=t,i=!0,o=!1,s=!1,a=[he(r,se,function(){s=!0,o||e()})];return r.src&&w?(o=!0,r.decode().then(function(){i&&e()}).catch(function(t){i&&(s?e():n())})):a.push(he(r,te,n)),function(){i=!1,a.forEach(fe)}}var od=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sd=null,ad=function(t){function e(e,n,r,i,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==i&&(a.image_.crossOrigin=i),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=r,a.src_=n,a.tainted_,a}return od(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===bf){sd||(sd=hn(1,1)),sd.drawImage(this.image_,0,0);try{sd.getImageData(0,0,1,1),this.tainted_=!1}catch(t){sd=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Qt)},e.prototype.handleImageError_=function(){this.imageState_=wf,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=bf,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],n=hn(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==mf){this.imageState_=xf;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=id(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===bf){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),n.globalCompositeOperation="multiply","multiply"===n.globalCompositeOperation||this.isTainted_())n.fillStyle=Nt(this.color_),n.fillRect(0,0,e.width/t,e.height/t),n.globalCompositeOperation="destination-in",n.drawImage(this.image_,0,0);else{for(var r=n.getImageData(0,0,e.width,e.height),i=r.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,u=this.color_[3],l=0,c=i.length;l<c;l+=4)i[l]*=o,i[l+1]*=s,i[l+2]*=a,i[l+3]*=u;n.putImageData(r,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}($t);var ud=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ld=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.opacity?r.opacity:1,o=void 0!==r.rotation?r.rotation:0,s=void 0!==r.scale?r.scale:1,a=void 0!==r.rotateWithView&&r.rotateWithView;(n=t.call(this,{opacity:i,rotation:o,scale:s,displacement:void 0!==r.displacement?r.displacement:[0,0],rotateWithView:a,declutterMode:r.declutterMode})||this).anchor_=void 0!==r.anchor?r.anchor:[.5,.5],n.normalizedAnchor_=null,n.anchorOrigin_=void 0!==r.anchorOrigin?r.anchorOrigin:$p,n.anchorXUnits_=void 0!==r.anchorXUnits?r.anchorXUnits:Hp,n.anchorYUnits_=void 0!==r.anchorYUnits?r.anchorYUnits:Hp,n.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null;var u=void 0!==r.img?r.img:null;n.imgSize_=r.imgSize;var l=r.src;P(!(void 0!==l&&u),4),P(!u||u&&n.imgSize_,5),void 0!==l&&0!==l.length||!u||(l=u.src||p(u)),P(void 0!==l&&l.length>0,6);var c=void 0!==r.src?mf:bf;return n.color_=void 0!==r.color?Ft(r.color):null,n.iconImage_=function(t,e,n,r,i,o){var s=Vt.get(e,r,o);return s||(s=new ad(t,e,n,r,i,o),Vt.set(e,r,o,s)),s}(u,l,void 0!==n.imgSize_?n.imgSize_:null,n.crossOrigin_,c,n.color_),n.offset_=void 0!==r.offset?r.offset:[0,0],n.offsetOrigin_=void 0!==r.offsetOrigin?r.offsetOrigin:$p,n.origin_=null,n.size_=void 0!==r.size?r.size:null,n}return ud(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==Hp||this.anchorYUnits_==Hp){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Hp&&(t[0]*=e[0]),this.anchorYUnits_==Hp&&(t[1]*=e[1])}if(this.anchorOrigin_!=$p){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Qp&&this.anchorOrigin_!=Jp||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Kp&&this.anchorOrigin_!=Jp||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var n=this.getDisplacement();return[t[0]-n[0],t[1]+n[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=$p){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),this.offsetOrigin_!=Qp&&this.offsetOrigin_!=Jp||(t[0]=n[0]-e[0]-t[0]),this.offsetOrigin_!=Kp&&this.offsetOrigin_!=Jp||(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(Qt,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Qt,t)},e}(Sf),cd=ld,hd=.5;var fd={Point:function(t,e,n,r,i){var o,s=n.getImage(),a=n.getText();if(s){if(s.getImageState()!=bf)return;var u=t;if(i){var l=s.getDeclutterMode();if("none"!==l)if(u=i,"obstacle"===l){var c=t.getBuilder(n.getZIndex(),"Image");c.setImageStyle(s,o),c.drawPoint(e,r)}else a&&a.getText()&&(o={})}var h=u.getBuilder(n.getZIndex(),"Image");h.setImageStyle(s,o),h.drawPoint(e,r)}if(a&&a.getText()){var f=t;i&&(f=i);var p=f.getBuilder(n.getZIndex(),"Text");p.setTextStyle(a,o),p.drawText(e,r)}},LineString:function(t,e,n,r,i){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawLineString(e,r)}var a=n.getText();if(a&&a.getText()){var u=(i||t).getBuilder(n.getZIndex(),"Text");u.setTextStyle(a),u.drawText(e,r)}},Polygon:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(o,s),a.drawPolygon(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}},MultiPoint:function(t,e,n,r,i){var o,s=n.getImage(),a=n.getText();if(s){if(s.getImageState()!=bf)return;var u=t;if(i){var l=s.getDeclutterMode();if("none"!==l)if(u=i,"obstacle"===l){var c=t.getBuilder(n.getZIndex(),"Image");c.setImageStyle(s,o),c.drawMultiPoint(e,r)}else a&&a.getText()&&(o={})}var h=u.getBuilder(n.getZIndex(),"Image");h.setImageStyle(s,o),h.drawMultiPoint(e,r)}if(a&&a.getText()){var f=t;i&&(f=i);var p=f.getBuilder(n.getZIndex(),"Text");p.setTextStyle(a,o),p.drawText(e,r)}},MultiLineString:function(t,e,n,r,i){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,r)}var a=n.getText();if(a&&a.getText()){var u=(i||t).getBuilder(n.getZIndex(),"Text");u.setTextStyle(a),u.drawText(e,r)}},MultiPolygon:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(s||o){var a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}},GeometryCollection:function(t,e,n,r,i){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o<s;++o){(0,fd[a[o].getType()])(t,a[o],n,r,i)}},Circle:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),"Circle");a.setFillStrokeStyle(o,s),a.drawCircle(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}}};function pd(t,e){return parseInt(p(t),10)-parseInt(p(e),10)}function dd(t,e){return.5*t/e}function gd(t,e,n,r,i,o,s){var a=!1,u=n.getImage();if(u){var l=u.getImageState();l==bf||l==wf?u.unlistenImageChange(i):(l==mf&&u.load(),u.listenImageChange(i),a=!0)}return function(t,e,n,r,i,o){var s=n.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(r,i),u=n.getRenderer();if(u)yd(t,a,n,e);else{(0,fd[a.getType()])(t,a,n,e,o)}}(t,e,n,r,o,s),a}function yd(t,e,n,r){if("GeometryCollection"!=e.getType())t.getBuilder(n.getZIndex(),"Default").drawCustom(e,r,n.getRenderer(),n.getHitDetectionRenderer());else for(var i=e.getGeometries(),o=0,s=i.length;o<s;++o)yd(t,i[o],n,r)}var vd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_d=function(t){function n(e){var n=t.call(this,e)||this;return n.boundHandleStyleImageChange_=n.handleStyleImageChange_.bind(n),n.animatingOrInteracting_,n.hitDetectionImageData_=null,n.renderedFeatures_=null,n.renderedRevision_=-1,n.renderedResolution_=NaN,n.renderedExtent_=[1/0,1/0,-1/0,-1/0],n.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],n.renderedRotation_,n.renderedCenter_=null,n.renderedProjection_=null,n.renderedRenderOrder_=null,n.replayGroup_=null,n.replayGroupChanged=!0,n.declutterExecutorGroup=null,n.clipping=!0,n.compositionContext_=null,n.opacity_=1,n}return vd(n,t),n.prototype.renderWorlds=function(t,e,n){var r=e.extent,i=e.viewState,o=i.center,s=i.resolution,a=i.projection,u=i.rotation,l=a.getExtent(),c=this.getLayer().getSource(),h=e.pixelRatio,f=e.viewHints,p=!(f[Ar]||f[Dr]),d=this.compositionContext_,g=Math.round(e.size[0]*h),y=Math.round(e.size[1]*h),v=c.getWrapX()&&a.canWrapX(),_=v?gt(l):null,m=v?Math.ceil((r[2]-l[2])/_)+1:1,x=v?Math.floor((r[0]-l[0])/_):0;do{var b=this.getRenderTransform(o,s,u,h,g,y,x*_);t.execute(d,1,b,u,p,void 0,n)}while(++x<m)},n.prototype.setupCompositionContext_=function(){if(1!==this.opacity_){var t=hn(this.context.canvas.width,this.context.canvas.height,Cp);this.compositionContext_=t}else this.compositionContext_=this.context},n.prototype.releaseCompositionContext_=function(){if(1!==this.opacity_){var t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,fn(this.compositionContext_),Cp.push(this.compositionContext_.canvas),this.compositionContext_=null}},n.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())},n.prototype.renderFrame=function(t,e){var n=t.pixelRatio,r=t.layerStatesArray[t.layerIndex];!function(t,e,n){M(t,e,0,0,n,0,0)}(this.pixelTransform,1/n,1/n),R(this.inversePixelTransform,this.pixelTransform);var i=k(this.pixelTransform);this.useContainer(e,i,this.getBackground(t));var o=this.context,s=o.canvas,a=this.replayGroup_,u=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!u||u.isEmpty()))return null;var l=Math.round(t.size[0]*n),c=Math.round(t.size[1]*n);s.width!=l||s.height!=c?(s.width=l,s.height=c,s.style.transform!==i&&(s.style.transform=i)):this.containerReused||o.clearRect(0,0,l,c),this.preRender(o,t);var h=t.viewState,f=h.projection;this.opacity_=r.opacity,this.setupCompositionContext_();var p=!1,d=!0;if(r.extent&&this.clipping){var g=Oi(r.extent,f);(p=(d=yt(g,t.extent))&&!W(g,t.extent))&&this.clipUnrotated(this.compositionContext_,t,g)}return d&&this.renderWorlds(a,t),p&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(o,t),this.renderedRotation_!==h.rotation&&(this.renderedRotation_=h.rotation,this.hitDetectionImageData_=null),this.container},n.prototype.getFeatures=function(t){return new Promise(function(n){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var r=[this.context.canvas.width,this.context.canvas.height];O(this.pixelTransform,r);var i=this.renderedCenter_,o=this.renderedResolution_,s=this.renderedRotation_,a=this.renderedProjection_,u=this.wrappedRenderedExtent_,l=this.getLayer(),c=[],h=r[0]*hd,f=r[1]*hd;c.push(this.getRenderTransform(i,o,s,hd,h,f,0).slice());var p=l.getSource(),d=a.getExtent();if(p.getWrapX()&&a.canWrapX()&&!W(d,u)){for(var g=u[0],y=gt(d),v=0,_=void 0;g<d[0];)_=y*--v,c.push(this.getRenderTransform(i,o,s,hd,h,f,_).slice()),g+=y;for(v=0,g=u[2];g>d[2];)_=y*++v,c.push(this.getRenderTransform(i,o,s,hd,h,f,_).slice()),g-=y}this.hitDetectionImageData_=function(t,n,r,i,o,s,a){var u=hn(t[0]*hd,t[1]*hd);u.imageSmoothingEnabled=!1;for(var l=u.canvas,c=new Yp(u,hd,o,null,a),h=r.length,f=Math.floor(16777215/h),p={},d=1;d<=h;++d){var g=r[d-1],y=g.getStyleFunction()||i;if(i){var v=y(g,s);if(v){Array.isArray(v)||(v=[v]);for(var _="#"+("000000"+(d*f).toString(16)).slice(-6),m=0,x=v.length;m<x;++m){var b=v[m],w=b.getGeometryFunction()(g);if(w&&yt(o,w.getExtent())){var E=b.clone(),C=E.getFill();C&&C.setColor(_);var S=E.getStroke();S&&(S.setColor(_),S.setLineDash(null)),E.setText(void 0);var P=b.getImage();if(P&&0!==P.getOpacity()){var I=P.getImageSize();if(!I)continue;var M=hn(I[0],I[1],void 0,{alpha:!1}),O=M.canvas;M.fillStyle=_,M.fillRect(0,0,O.width,O.height),E.setImage(new cd({img:O,imgSize:I,anchor:P.getAnchor(),anchorXUnits:Zp,anchorYUnits:Zp,offset:P.getOrigin(),opacity:1,size:P.getSize(),scale:P.getScale(),rotation:P.getRotation(),rotateWithView:P.getRotateWithView()}))}var L=E.getZIndex()||0;(T=p[L])||(T={},p[L]=T,T.Polygon=[],T.Circle=[],T.LineString=[],T.Point=[]),T[w.getType().replace("Multi","")].push(w,E)}}}}}for(var R=Object.keys(p).map(Number).sort(e),k=(d=0,R.length);d<k;++d){var T=p[R[d]];for(var N in T){var A=T[N];for(m=0,x=A.length;m<x;m+=2){c.setStyle(A[m+1]);for(var D=0,F=n.length;D<F;++D)c.setTransform(n[D]),c.drawGeometry(A[m])}}}return u.getImageData(0,0,l.width,l.height)}(r,c,this.renderedFeatures_,l.getStyleFunction(),u,o,s)}n(function(t,e,n){var r=[];if(n){var i=Math.floor(Math.round(t[0])*hd),o=Math.floor(Math.round(t[1])*hd),s=4*(bt(i,0,n.width-1)+bt(o,0,n.height-1)*n.width),a=n.data[s],u=n.data[s+1],l=n.data[s+2]+256*(u+256*a),c=Math.floor(16777215/e.length);l&&l%c===0&&r.push(e[l/c-1])}return r}(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},n.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){var o=this;if(this.replayGroup_){var s,a=e.viewState.resolution,u=e.viewState.rotation,l=this.getLayer(),c={},h=function(t,e,n){var o=p(t),s=c[o];if(s){if(!0!==s&&n<s.distanceSq){if(0===n)return c[o]=!0,i.splice(i.lastIndexOf(s),1),r(t,l,e);s.geometry=e,s.distanceSq=n}}else{if(0===n)return c[o]=!0,r(t,l,e);i.push(c[o]={feature:t,layer:l,geometry:e,distanceSq:n,callback:r})}},f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some(function(r){return s=r.forEachFeatureAtCoordinate(t,a,u,n,h,r===o.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(function(t){return t.value}):null)}),s}},n.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},n.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},n.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource();if(!n)return!1;var r=t.viewHints[Ar],i=t.viewHints[Dr],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(this.ready&&!o&&r||!s&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var u=t.extent,l=t.viewState,c=l.projection,h=l.resolution,f=t.pixelRatio,p=e.getRevision(),d=e.getRenderBuffer(),g=e.getRenderOrder();void 0===g&&(g=pd);var y=l.center.slice(),v=B(u,d*h),_=v.slice(),m=[v.slice()],x=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!W(x,t.extent)){var b=gt(x),w=Math.max(gt(v)/2,b);v[0]=x[0]-w,v[2]=x[2]+w,Ke(y,c);var E=xt(m[0],c);E[0]<x[0]&&E[2]<x[2]?m.push([E[0]+b,E[1],E[2]+b,E[3]]):E[0]>x[0]&&E[2]>x[2]&&m.push([E[0]-b,E[1],E[2]-b,E[3]])}if(this.ready&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==g&&W(this.wrappedRenderedExtent_,v))return a(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var C,S=new mp(dd(h,f),v,h,f);this.getLayer().getDeclutter()&&(C=new mp(dd(h,f),v,h,f));var P,I=Si();if(I){for(var M=0,O=m.length;M<O;++M){var L=Mi(m[M],c);n.loadFeatures(L,Li(h,c),I)}P=vi(I,c)}else for(M=0,O=m.length;M<O;++M)n.loadFeatures(m[M],h,c);var R=function(t,e){var n=dd(t,e);return n*n}(h,f),k=!0,T=function(t){var n,r=t.getStyleFunction()||e.getStyleFunction();if(r&&(n=r(t,h)),n){var i=this.renderFeature(t,R,n,S,P,C);k=k&&!i}}.bind(this),N=Mi(v,c),A=n.getFeaturesInExtent(N);g&&A.sort(g);for(M=0,O=A.length;M<O;++M)T(A[M]);this.renderedFeatures_=A,this.ready=k;var D=S.finish(),F=new Wp(v,h,f,n.getOverlaps(),D,e.getRenderBuffer());return C&&(this.declutterExecutorGroup=new Wp(v,h,f,n.getOverlaps(),C.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=g,this.renderedExtent_=_,this.wrappedRenderedExtent_=v,this.renderedCenter_=y,this.renderedProjection_=c,this.replayGroup_=F,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},n.prototype.renderFeature=function(t,e,n,r,i,o){if(!n)return!1;var s=!1;if(Array.isArray(n))for(var a=0,u=n.length;a<u;++a)s=gd(r,t,n[a],e,this.boundHandleStyleImageChange_,i,o)||s;else s=gd(r,t,n,e,this.boundHandleStyleImageChange_,i,o);return s},n}(Ip),md=_d,xd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bd=function(t){function e(e){return t.call(this,e)||this}return xd(e,t),e.prototype.createRenderer=function(){return new md(this)},e}(qf),wd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ed=function(t){function e(e){var n=t.call(this)||this;n.projection=fi(e.projection),n.attributions_=Cd(e.attributions),n.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,n.loading=!1,n.state_=void 0!==e.state?e.state:"ready",n.wrapX_=void 0!==e.wrapX&&e.wrapX,n.interpolate_=!!e.interpolate,n.viewResolver=null,n.viewRejector=null;var r=n;return n.viewPromise_=new Promise(function(t,e){r.viewResolver=t,r.viewRejector=e}),n}return wd(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return h()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Cd(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(me);function Cd(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Sd=Ed;function Pd(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Id=!1;function Md(t,e){return function(n,r,i,o,s){var a=this;!function(t,e,n,r,i,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,r,i):t,!0),"arraybuffer"==e.getType()&&(a.responseType="arraybuffer"),a.withCredentials=Id,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=e.getType(),u=void 0;"json"==r||"text"==r?u=a.responseText:"xml"==r?(u=a.responseXML)||(u=(new DOMParser).parseFromString(a.responseText,"application/xml")):"arraybuffer"==r&&(u=a.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):s()}else s()},a.onerror=s,a.send()}(t,e,n,r,i,function(t,e){a.addFeatures(t),void 0!==o&&o(t)},s||c)}}var Od=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ld=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.feature=n,i.features=r,i}return Od(e,t),e}(Wt),Rd=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{attributions:r.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===r.wrapX||r.wrapX})||this).on,n.once,n.un,n.loader_=c,n.format_=r.format,n.overlaps_=void 0===r.overlaps||r.overlaps,n.url_=r.url,void 0!==r.loader?n.loader_=r.loader:void 0!==n.url_&&(P(n.format_,7),n.loader_=Md(n.url_,n.format_)),n.strategy_=void 0!==r.strategy?r.strategy:Pd;var i,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return n.featuresRtree_=s?new hf:null,n.loadedExtentsRtree_=new hf,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(i=r.features).getArray()),s||void 0!==i||(i=new Yn(o)),void 0!==o&&n.addFeaturesInternal(o),void 0!==i&&n.bindFeaturesCollection_(i),n}return Od(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=p(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var r=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Ld(ff,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[ce(e,Qt,this.handleFeatureChange_,this),ce(e,Xt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,r=e.getId();return void 0!==r&&(r.toString()in this.idIndex_?n=!1:this.idIndex_[r.toString()]=e),n&&(P(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],r=[],i=0,o=t.length;i<o;i++){var s=p(u=t[i]);this.addToIndex_(s,u)&&n.push(u)}i=0;for(var a=n.length;i<a;i++){var u;s=p(u=n[i]);this.setupChangeEvents_(s,u);var l=u.getGeometry();if(l){var c=l.getExtent();e.push(c),r.push(u)}else this.nullGeometryFeatures_[s]=u}if(this.featuresRtree_&&this.featuresRtree_.load(e,r),this.hasListener(ff)){i=0;for(var h=n.length;i<h;i++)this.dispatchEvent(new Ld(ff,n[i]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(ff,function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener(gf,function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener(zn,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(Vn,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(fe)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var n=function(t){this.removeFeatureInternal(t)}.bind(this);for(var r in this.featuresRtree_.forEach(n),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new Ld(df);this.dispatchEvent(i),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(n){return n.getGeometry().intersectsCoordinate(t)?e(n):void 0})},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,function(n){if(n.getGeometry().intersectsExtent(t)){var r=e(n);if(r)return r}})},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Zt(this.nullGeometryFeatures_)||s(t,Ht(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,function(t){e.push(t)}),e},e.prototype.getFeaturesInExtent=function(t,e){var n=this;if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);var r=function(t,e){if(e.canWrapX()){var n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];xt(t,e);var r=gt(n);if(gt(t)>r)return[[n[0],t[1],n[2],t[3]]];if(t[0]<n[0])return[[t[0]+r,t[1],n[2],t[3]],[n[0],t[1],t[2],t[3]]];if(t[2]>n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}(t,e);return[].concat.apply([],r.map(function(t){return n.featuresRtree_.getInExtent(t)}))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var n=t[0],r=t[1],i=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||u;return this.featuresRtree_.forEachInExtent(a,function(t){if(l(t)){var e=t.getGeometry(),u=s;if((s=e.closestPointXY(n,r,o,s))<u){i=t;var c=Math.sqrt(s);a[0]=n-c,a[1]=r-c,a[2]=n+c,a[3]=r+c}}}),i},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,n=p(e),r=e.getGeometry();if(r){var i=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(i,e)):this.featuresRtree_&&this.featuresRtree_.update(i,e)}else n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);var o=e.getId();if(void 0!==o){var s=o.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new Ld(pf,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:p(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Zt(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()},e.prototype.loadFeatures=function(t,e,n){for(var r=this.loadedExtentsRtree_,i=this.strategy_(t,e,n),o=function(t,o){var a=i[t],u=r.forEachInExtent(a,function(t){return W(t.extent,a)});u||(++s.loadingExtentsCount_,s.dispatchEvent(new Ld(yf)),s.loader_.call(s,a,e,n,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Ld(vf,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Ld(_f))}.bind(s)),r.insert(a,{extent:a.slice()}))},s=this,a=0,u=i.length;a<u;++a)o(a);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,n=this.loadedExtentsRtree_;n.forEachInExtent(t,function(n){if($(n.extent,t))return e=n,!0}),e&&n.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=p(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}},e.prototype.removeFeatureInternal=function(t){var e=p(t),n=this.featureChangeKeys_[e];if(n){n.forEach(fe),delete this.featureChangeKeys_[e];var r=t.getId();return void 0!==r&&delete this.idIndex_[r.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Ld(gf,t)),t}},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){P(this.format_,7),this.url_=t,this.setLoader(Md(t,this.format_))},e}(Sd),kd=Rd,Td=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nd=[0,0,0,0],Ad=[],Dd="modifystart",Fd="modifyend",jd=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.features=n,i.mapBrowserEvent=r,i}return Td(e,t),e}(Wt),Gd=function(t){function e(e){var n,r=t.call(this,e)||this;if(r.on,r.once,r.un,r.boundHandleFeatureChange_=r.handleFeatureChange_.bind(r),r.condition_=e.condition?e.condition:Gs,r.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==or.SINGLECLICK}(t)},r.deleteCondition_=e.deleteCondition?e.deleteCondition:r.defaultDeleteCondition_,r.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Ts,r.vertexFeature_=null,r.vertexSegments_=null,r.lastPixel_=[0,0],r.ignoreNextSingleClick_=!1,r.featuresBeingModified_=null,r.rBush_=new hf,r.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,r.snappedToVertex_=!1,r.changingFeature_=!1,r.dragSegments_=[],r.overlay_=new bd({source:new kd({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Ud(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r)},r.source_=null,r.hitDetection_=null,e.features?n=e.features:e.source&&(r.source_=e.source,n=new Yn(r.source_.getFeatures()),r.source_.addEventListener(ff,r.handleSourceAdd_.bind(r)),r.source_.addEventListener(gf,r.handleSourceRemove_.bind(r))),!n)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(r.hitDetection_=e.hitDetection),r.features_=n,r.features_.forEach(r.addFeature_.bind(r)),r.features_.addEventListener(zn,r.handleFeatureAdd_.bind(r)),r.features_.addEventListener(Vn,r.handleFeatureRemove_.bind(r)),r.lastPointerEvent_=null,r.delta_=[0,0],r.snapToPointer_=void 0===e.snapToPointer?!r.hitDetection_:e.snapToPointer,r}return Td(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var n=this.SEGMENT_WRITERS_[e.getType()];n&&n(t,e)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,r),t.addEventListener(Qt,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Yn;for(var n=this.featuresBeingModified_.getArray(),r=0,i=e.length;r<i;++r)for(var o=e[r],s=0,a=o.length;s<a;++s){var u=o[s].feature;u&&-1===n.indexOf(u)&&this.featuresBeingModified_.push(u)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new jd(Dd,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(Qt,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,n=[];e.forEach(function(e){t===e.feature&&n.push(e)});for(var r=n.length-1;r>=0;--r){for(var i=n[r],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var n=e.getCoordinates(),r={feature:t,geometry:e,segment:[n,n]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r){var o=n[r],s={feature:t,geometry:e,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r){var o=n.slice(r,r+2),s={feature:t,geometry:e,index:r,segment:o};this.rBush_.insert(G(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var u=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:u};this.rBush_.insert(G(u),l)}},e.prototype.writePolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var u=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:u};this.rBush_.insert(G(u),l)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length;s<a;++s)for(var u=o[s],l=0,c=u.length-1;l<c;++l){var h=u.slice(l,l+2),f={feature:t,geometry:e,depth:[s,r],index:l,segment:h};this.rBush_.insert(G(h),f)}},e.prototype.writeCircleGeometry_=function(t,e){var n=e.getCenter(),r={feature:t,geometry:e,index:0,segment:[n,n]},i={feature:t,geometry:e,index:1,segment:[n,n]},o=[r,i];r.featureSegments=o,i.featureSegments=o,this.rBush_.insert(K(n),r);var s=e,a=Si();if(a&&this.getMap()){var u=this.getMap().getView().getProjection();s=Xo(s=s.clone().transform(a,u)).transform(u,a)}this.rBush_.insert(s.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=n[r];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,n){var r=this.vertexFeature_;r?r.getGeometry().setCoordinates(t):(r=new Na(new Io(t)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r));return r.set("features",e),r.set("geometries",n),r},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=or.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(n=!(e.type!=or.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==or.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!n);var n},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],n=[],r=[],i=0,o=this.dragSegments_.length;i<o;++i){var s=this.dragSegments_[i],a=s[0],u=a.feature;-1===n.indexOf(u)&&n.push(u);var l=a.geometry;-1===r.indexOf(l)&&r.push(l);for(var c=a.depth,h=void 0,f=a.segment,p=s[1];e.length<l.getStride();)e.push(f[p][e.length]);switch(l.getType()){case"Point":h=e,f[0]=e,f[1]=e;break;case"MultiPoint":(h=l.getCoordinates())[a.index]=e,f[0]=e,f[1]=e;break;case"LineString":(h=l.getCoordinates())[a.index+p]=e,f[p]=e;break;case"MultiLineString":case"Polygon":(h=l.getCoordinates())[c[0]][a.index+p]=e,f[p]=e;break;case"MultiPolygon":(h=l.getCoordinates())[c[1]][c[0]][a.index+p]=e,f[p]=e;break;case"Circle":if(f[0]=e,f[1]=e,0===a.index)this.changingFeature_=!0,l.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;var d=t.map.getView().getProjection(),g=Ze(Ii(l.getCenter(),d),Ii(e,d)),y=Si();if(y){var v=l.clone().transform(y,d);v.setRadius(g),g=v.transform(d,y).getRadius()}l.setRadius(g),this.changingFeature_=!1}}h&&this.setGeometryCoordinates_(l,h)}this.createOrUpdateVertexFeature_(e,n,r)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var n=this.vertexFeature_;if(n){var r=t.map.getView().getProjection(),i=[],o=n.getGeometry().getCoordinates(),s=G([o]),a=this.rBush_.getInExtent(s),u={};a.sort(Bd);for(var l=0,c=a.length;l<c;++l){var h=a[l],f=h.segment,d=p(h.geometry),g=h.depth;if(g&&(d+="-"+g.join("-")),u[d]||(u[d]=new Array(2)),"Circle"!==h.geometry.getType()||1!==h.index)if(!Xe(f[0],o)||u[d][0])if(!Xe(f[1],o)||u[d][1])p(f)in this.vertexSegments_&&!u[d][0]&&!u[d][1]&&this.insertVertexCondition_(t)&&i.push(h);else{if(u[d][0]&&0===u[d][0].index){var y=h.geometry.getCoordinates();switch(h.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":y=y[g[1]];case"Polygon":if(h.index!==y[g[0]].length-2)continue}}this.dragSegments_.push([h,1]),u[d][1]=h}else this.dragSegments_.push([h,0]),u[d][0]=h;else Xe(Vd(e,h,r),o)&&!u[d][0]&&(this.dragSegments_.push([h,0]),u[d][0]=h)}i.length&&this.willModifyFeatures_(t,[i]);for(var v=i.length-1;v>=0;--v)this.insertVertex_(i[v],o)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var n=this.dragSegments_[e][0],r=n.geometry;if("Circle"===r.getType()){var i=r.getCenter(),o=n.featureSegments[0],s=n.featureSegments[1];o.segment[0]=i,o.segment[1]=i,s.segment[0]=i,s.segment[1]=i,this.rBush_.update(K(i),o);var a=r,u=Si();if(u){var l=t.map.getView().getProjection();a=Xo(a=a.clone().transform(u,l)).transform(l,u)}this.rBush_.update(a.getExtent(),s)}else this.rBush_.update(G(n.segment),n)}return this.featuresBeingModified_&&(this.dispatchEvent(new jd(Fd,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,n){var r,i,o=this,s=n||e.getCoordinateFromPixel(t),a=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===o.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,function(t,e,n){if("Point"===(n=n||t.getGeometry()).getType()&&(a=o.features_.getArray(),u=t,a.indexOf(u)>=0)){i=n;var s=n.getFlatCoordinates().slice(0,2);r=[{feature:t,geometry:n,segment:[s,s]}]}var a,u;return!0},{layerFilter:u})}if(!r){var l=Mi(B(Oi(K(s,Nd),a),e.getView().getResolution()*this.pixelTolerance_,Nd),a);r=this.rBush_.getInExtent(l)}if(r&&r.length>0){var c=r.sort(function(t,e){return zd(s,t,a)-zd(s,e,a)})[0],h=c.segment,f=Vd(s,c,a),d=e.getPixelFromCoordinate(f),g=Ze(t,d);if(i||g<=this.pixelTolerance_){var y={};if(y[p(h)]=!0,this.snapToPointer_||(this.delta_[0]=f[0]-s[0],this.delta_[1]=f[1]-s[1]),"Circle"===c.geometry.getType()&&1===c.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);else{var v=e.getPixelFromCoordinate(h[0]),_=e.getPixelFromCoordinate(h[1]),m=He(d,v),x=He(d,_);g=Math.sqrt(Math.min(m,x)),this.snappedToVertex_=g<=this.pixelTolerance_,this.snappedToVertex_&&(f=m>x?h[1]:h[0]),this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);var b={};b[p(c.geometry)]=!0;for(var w=1,E=r.length;w<E;++w){var C=r[w].segment;if(!(Xe(h[0],C[0])&&Xe(h[1],C[1])||Xe(h[0],C[1])&&Xe(h[1],C[0])))break;var S=p(r[w].geometry);S in b||(b[S]=!0,y[p(C)]=!0)}}return void(this.vertexSegments_=y)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var n,r=t.segment,i=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case"MultiLineString":case"Polygon":(n=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case"MultiPolygon":(n=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case"LineString":(n=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,n);var u=this.rBush_;u.remove(t),this.updateSegmentIndices_(o,a,s,1);var l={segment:[r[0],e],feature:i,geometry:o,depth:s,index:a};u.insert(G(l.segment),l),this.dragSegments_.push([l,1]);var c={segment:[e,r[1]],feature:i,geometry:o,depth:s,index:a+1};u.insert(G(c.segment),c),this.dragSegments_.push([c,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=or.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new jd(Fd,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,n,r,i,o,s,a,u,l,c,h=this.dragSegments_,f={},d=!1;for(i=h.length-1;i>=0;--i)c=p((l=(n=h[i])[0]).feature),l.depth&&(c+="-"+l.depth.join("-")),c in f||(f[c]={}),0===n[1]?(f[c].right=l,f[c].index=l.index):1==n[1]&&(f[c].left=l,f[c].index=l.index+1);for(c in f){switch(u=f[c].right,s=f[c].left,(a=(o=f[c].index)-1)<0&&(a=0),t=e=(r=(l=void 0!==s?s:u).geometry).getCoordinates(),d=!1,r.getType()){case"MultiLineString":e[l.depth[0]].length>2&&(e[l.depth[0]].splice(o,1),d=!0);break;case"LineString":e.length>2&&(e.splice(o,1),d=!0);break;case"MultiPolygon":t=t[l.depth[1]];case"Polygon":(t=t[l.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),d=!0,0===o&&(t.pop(),t.push(t[0]),a=t.length-1))}if(d){this.setGeometryCoordinates_(r,e);var g=[];if(void 0!==s&&(this.rBush_.remove(s),g.push(s.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==s&&void 0!==u){var y={depth:l.depth,feature:l.feature,geometry:l.geometry,index:a,segment:g};this.rBush_.insert(G(y.segment),y)}this.updateSegmentIndices_(r,o,l.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),h.length=0}}return d},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,n,r){this.rBush_.forEachInExtent(t.getExtent(),function(i){i.geometry===t&&(void 0===n||void 0===i.depth||a(i.depth,n))&&i.index>e&&(i.index+=r)})},e}(Os);function Bd(t,e){return t.index-e.index}function zd(t,e,n){var r=e.geometry;if("Circle"===r.getType()){var i=r;if(1===e.index){var o=Si();o&&(i=i.clone().transform(o,n));var s=He(i.getCenter(),Ii(t,n)),a=Math.sqrt(s)-i.getRadius();return a*a}}var u=Ii(t,n);return Ad[0]=Ii(e.segment[0],n),Ad[1]=Ii(e.segment[1],n),function(t,e){return He(t,We(t,e))}(u,Ad)}function Vd(t,e,n){var r=e.geometry;if("Circle"===r.getType()&&1===e.index){var i=r,o=Si();return o&&(i=i.clone().transform(o,n)),Pi(i.getClosestPoint(Ii(t,n)),n)}var s=Ii(t,n);return Ad[0]=Ii(e.segment[0],n),Ad[1]=Ii(e.segment[1],n),Pi(We(s,Ad),n)}function Ud(){var t=Bf();return function(e,n){return t.Point}}var Wd=Gd,Xd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function qd(t){return t.feature?t.feature:t.element?t.element:void 0}var Yd=[],Hd=function(t){function e(e){var n=this,r=e||{},i=r;return i.handleDownEvent||(i.handleDownEvent=u),i.stopDown||(i.stopDown=l),(n=t.call(this,i)||this).source_=r.source?r.source:null,n.vertex_=void 0===r.vertex||r.vertex,n.edge_=void 0===r.edge||r.edge,n.features_=r.features?r.features:null,n.featuresListenerKeys_=[],n.featureChangeListenerKeys_={},n.indexedFeaturesExtents_={},n.pendingFeatures_={},n.pixelTolerance_=void 0!==r.pixelTolerance?r.pixelTolerance:10,n.rBush_=new hf,n.GEOMETRY_SEGMENTERS_={Point:n.segmentPointGeometry_.bind(n),LineString:n.segmentLineStringGeometry_.bind(n),LinearRing:n.segmentLineStringGeometry_.bind(n),Polygon:n.segmentPolygonGeometry_.bind(n),MultiPoint:n.segmentMultiPointGeometry_.bind(n),MultiLineString:n.segmentMultiLineStringGeometry_.bind(n),MultiPolygon:n.segmentMultiPolygonGeometry_.bind(n),GeometryCollection:n.segmentGeometryCollectionGeometry_.bind(n),Circle:n.segmentCircleGeometry_.bind(n)},n}return Xd(e,t),e.prototype.addFeature=function(t,e){var n=void 0===e||e,r=p(t),i=t.getGeometry();if(i){var o=this.GEOMETRY_SEGMENTERS_[i.getType()];if(o){this.indexedFeaturesExtents_[r]=i.getExtent([1/0,1/0,-1/0,-1/0]);var s=[];if(o(s,i),1===s.length)this.rBush_.insert(G(s[0]),{feature:t,segment:s[0]});else if(s.length>1){var a=s.map(function(t){return G(t)}),u=s.map(function(e){return{feature:t,segment:e}});this.rBush_.load(a,u)}}}n&&(this.featureChangeListenerKeys_[r]=ce(t,Qt,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var n=this.snapTo(e.pixel,e.coordinate,e.map);return n&&(e.coordinate=n.vertex.slice(0,2),e.pixel=n.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=qd(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=qd(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var n=p(e);n in this.pendingFeatures_||(this.pendingFeatures_[n]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=Ht(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var n=void 0===e||e,r=p(t),i=this.indexedFeaturesExtents_[r];if(i){var o=this.rBush_,s=[];o.forEachInExtent(i,function(e){t===e.feature&&s.push(e)});for(var a=s.length-1;a>=0;--a)o.remove(s[a])}n&&(fe(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])},e.prototype.setMap=function(e){var n=this.getMap(),r=this.featuresListenerKeys_,i=this.getFeatures_();n&&(r.forEach(fe),r.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?r.push(ce(this.features_,zn,this.handleFeatureAdd_,this),ce(this.features_,Vn,this.handleFeatureRemove_,this)):this.source_&&r.push(ce(this.source_,ff,this.handleFeatureAdd_,this),ce(this.source_,gf,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,n){var r=G([n.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),n.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(r),o=i.length;if(0===o)return null;var s,a=n.getView().getProjection(),u=Ii(e,a),l=1/0,c=this.pixelTolerance_*this.pixelTolerance_,h=function(){if(s){var e=n.getPixelFromCoordinate(s);if(He(t,e)<=c)return{vertex:s,vertexPixel:[Math.round(e[0]),Math.round(e[1])]}}return null};if(this.vertex_){for(var f=0;f<o;++f){"Circle"!==(p=i[f]).feature.getGeometry().getType()&&p.segment.forEach(function(t){var e=Ii(t,a),n=He(u,e);n<l&&(s=t,l=n)})}if(b=h())return b}if(this.edge_){for(f=0;f<o;++f){var p,d=null;if("Circle"===(p=i[f]).feature.getGeometry().getType()){var g=p.feature.getGeometry(),y=Si();y&&(g=g.clone().transform(y,a)),d=Pi(Ue(u,g),a)}else{var v=p.segment,_=v[0],m=v[1];m&&(Yd[0]=Ii(_,a),Yd[1]=Ii(m,a),d=We(u,Yd))}if(d){var x=He(u,d);x<l&&(s=d,l=x)}}var b;if(b=h())return b}return null},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.segmentCircleGeometry_=function(t,e){var n=this.getMap().getView().getProjection(),r=e,i=Si();i&&(r=r.clone().transform(i,n));var o=Xo(r);i&&o.transform(n,i);for(var s=o.getCoordinates()[0],a=0,u=s.length-1;a<u;++a)t.push(s.slice(a,a+2))},e.prototype.segmentGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=this.GEOMETRY_SEGMENTERS_[n[r].getType()];i&&i(t,n[r])}},e.prototype.segmentLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r)t.push(n.slice(r,r+2))},e.prototype.segmentMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},e.prototype.segmentMultiPointGeometry_=function(t,e){e.getCoordinates().forEach(function(e){t.push([e])})},e.prototype.segmentMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length;s<a;++s)for(var u=o[s],l=0,c=u.length-1;l<c;++l)t.push(u.slice(l,l+2))},e.prototype.segmentPointGeometry_=function(t,e){t.push([e.getCoordinates()])},e.prototype.segmentPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},e}(Os),Zd=Hd,Kd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jd=function(t){function e(e,n,r){var i=t.call(this)||this;if(void 0!==r&&void 0===n)i.setFlatCoordinates(r,e);else{var o=n||0;i.setCenterAndRadius(e,o,r)}return i}return Kd(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){var i=this.flatCoordinates,o=t-i[0],s=e-i[1],a=o*o+s*s;if(a<r){if(0===a)for(var u=0;u<this.stride;++u)n[u]=i[u];else{var l=this.getRadius()/Math.sqrt(a);n[0]=i[0]+l*o,n[1]=i[1]+l*s;for(u=2;u<this.stride;++u)n[u]=i[u]}return n.length=this.stride,a}return r},e.prototype.containsXY=function(t,e){var n=this.flatCoordinates,r=t-n[0],i=e-n[1];return r*r+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,n=e[this.stride]-e[0];return H(e[0]-n,e[1]-n,e[0]+n,e[1]+n,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return"Circle"},e.prototype.intersectsExtent=function(t){if(yt(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||rt(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,n=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+n;for(var i=1;i<e;++i)r[e+i]=t[i];this.setFlatCoordinates(this.layout,r),this.changed()},e.prototype.setCenterAndRadius=function(t,e,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,i=uo(r,0,t,this.stride);r[i++]=r[0]+e;for(var o=1,s=this.stride;o<s;++o)r[i++]=r[o];r.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var n=this.getCenter(),r=this.getStride();this.setCenter(Yi(n,0,n.length,r,t,e,n)),this.changed()},e.prototype.translate=function(t,e){var n=this.getCenter(),r=this.getStride();this.setCenter(Hi(n,0,n.length,r,t,e,n)),this.changed()},e}(no);Jd.prototype.transform;var $d=Jd;function Qd(t,n,r,i,o,s,a){var u,l,c=(r-n)/i;if(1===c)u=n;else if(2===c)u=n,l=o;else if(0!==c){for(var h=t[n],f=t[n+1],p=0,d=[0],g=n+i;g<r;g+=i){var y=t[g],v=t[g+1];p+=Math.sqrt((y-h)*(y-h)+(v-f)*(v-f)),d.push(p),h=y,f=v}var _=o*p,m=function(t,n,r){for(var i,o,s=r||e,a=0,u=t.length,l=!1;a<u;)(o=+s(t[i=a+(u-a>>1)],n))<0?a=i+1:(u=i,l=!o);return l?a:~a}(d,_);m<0?(l=(_-d[-m-2])/(d[-m-1]-d[-m-2]),u=n+(-m-2)*i):u=n+m*i}var x=a>1?a:2,b=s||new Array(x);for(g=0;g<x;++g)b[g]=void 0===u?NaN:void 0===l?t[u+g]:Mt(t[u+g],t[u+i+g],l);return b}function tg(t,e,n,r,i,o){if(n==e)return null;var s;if(i<t[e+r-1])return o?((s=t.slice(e,e+r))[r-1]=i,s):null;if(t[n-1]<i)return o?((s=t.slice(n-r,n))[r-1]=i,s):null;if(i==t[e+r-1])return t.slice(e,e+r);for(var a=e/r,u=n/r;a<u;){var l=a+u>>1;i<t[(l+1)*r-1]?u=l:a=l+1}var c=t[a*r-1];if(i==c)return t.slice((a-1)*r,(a-1)*r+r);var h=(i-c)/(t[(a+1)*r-1]-c);s=[];for(var f=0;f<r-1;++f)s.push(Mt(t[(a-1)*r+f],t[a*r+f],h));return s.push(i),s}var eg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ng=function(t){function e(e,n){var r=t.call(this)||this;return r.flatMidpoint_=null,r.flatMidpointRevision_=-1,r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return eg(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?s(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<V(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),so(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.forEachSegment=function(t){return ko(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Wi&&this.layout!=Xi)return null;var n=void 0!==e&&e;return tg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n)},e.prototype.getCoordinates=function(){return vo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Qd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return Op(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=ho(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,Vi)},e.prototype.getType=function(){return"LineString"},e.prototype.intersectsExtent=function(t){return To(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=lo(this.flatCoordinates,0,t,this.stride),this.changed()},e}(no),rg=ng,ig=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),og=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,n);else if(void 0!==n&&r)i.setFlatCoordinates(n,e),i.ends_=r;else{for(var o=i.getLayout(),a=e,u=[],l=[],c=0,h=a.length;c<h;++c){var f=a[c];0===c&&(o=f.getLayout()),s(u,f.getFlatCoordinates()),l.push(u.length)}i.setFlatCoordinates(o,u),i.ends_=l}return i}return ig(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?s(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<V(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(oo(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ao(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.getCoordinateAtM=function(t,e,n){if(this.layout!=Wi&&this.layout!=Xi||0===this.flatCoordinates.length)return null;var r=void 0!==e&&e,i=void 0!==n&&n;return function(t,e,n,r,i,o,s){if(s)return tg(t,e,n[n.length-1],r,i,o);var a;if(i<t[r-1])return o?((a=t.slice(0,r))[r-1]=i,a):null;if(t[t.length-1]<i)return o?((a=t.slice(t.length-r))[r-1]=i,a):null;for(var u=0,l=n.length;u<l;++u){var c=n[u];if(e!=c){if(i<t[e+r-1])return null;if(i<=t[c-1])return tg(t,e,c,r,i,!1);e=c}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,r,i)},e.prototype.getCoordinates=function(){return _o(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new rg(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,n=this.layout,r=[],i=0,o=0,s=e.length;o<s;++o){var a=e[o],u=new rg(t.slice(i,a),n);r.push(u),i=a}return r},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,n=0,r=this.ends_,i=this.stride,o=0,a=r.length;o<a;++o){var u=r[o];s(t,Qd(e,n,u,i,.5)),n=u}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=fo(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,r),new e(n,Vi,r)},e.prototype.getType=function(){return"MultiLineString"},e.prototype.intersectsExtent=function(t){return function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){if(To(t,e,n[o],r,i))return!0;e=n[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=co(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(no),sg=og,ag=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ug=function(t){function e(e,n){var r=t.call(this)||this;return n&&!Array.isArray(e[0])?r.setFlatCoordinates(n,e):r.setCoordinates(e,n),r}return ag(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?s(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){if(r<V(this.getExtent(),t,e))return r;for(var i=this.flatCoordinates,o=this.stride,s=0,a=i.length;s<a;s+=o){var u=St(t,e,i[s],i[s+1]);if(u<r){r=u;for(var l=0;l<o;++l)n[l]=i[s+l];n.length=o}}return r},e.prototype.getCoordinates=function(){return vo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new Io(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,n=this.stride,r=[],i=0,o=t.length;i<o;i+=n){var s=new Io(t.slice(i,i+n),e);r.push(s)}return r},e.prototype.getType=function(){return"MultiPoint"},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,n=this.stride,r=0,i=e.length;r<i;r+=n){if(X(t,e[r],e[r+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=lo(this.flatCoordinates,0,t,this.stride),this.changed()},e}(no),lg=ug;var cg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hg=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){for(var o=i.getLayout(),a=e,u=[],l=[],c=0,h=a.length;c<h;++c){var f=a[c];0===c&&(o=f.getLayout());for(var p=u.length,d=f.getEnds(),g=0,y=d.length;g<y;++g)d[g]+=p;s(u,f.getFlatCoordinates()),l.push(d)}n=o,e=u,r=l}return void 0!==n&&r?(i.setFlatCoordinates(n,e),i.endss_=r):i.setCoordinates(e,n),i}return cg(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var n=this.flatCoordinates.length;s(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,i=(e=t.getEnds().slice()).length;r<i;++r)e[r]+=n}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,n=new Array(t),r=0;r<t;++r)n[r]=this.endss_[r].slice();var i=new e(this.flatCoordinates.slice(),this.layout,n);return i.applyProperties(this),i},e.prototype.closestPointXY=function(t,e,n,r){return r<V(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];i=oo(t,e,a,r,i),e=a[a.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,n,r,i,o,s,a,u,l,c){for(var h=c||[NaN,NaN],f=0,p=n.length;f<p;++f){var d=n[f];l=ao(t,e,d,r,i,o,s,a,u,l,h),e=d[d.length-1]}return l}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.containsXY=function(t,e){return function(t,e,n,r,i,o){if(0===n.length)return!1;for(var s=0,a=n.length;s<a;++s){var u=n[s];if(Lo(t,e,u,r,i,o))return!0;e=u[u.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,n,r){for(var i=0,o=0,s=n.length;o<s;++o){var a=n[o];i+=bo(t,e,a,r),e=a[a.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Bo(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,mo(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=function(t,e,n,r){for(var i=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=n.length;s<a;++s){var u=n[s];o=J(t,e,u[0],r),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=u[u.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=function(t,e,n,r,i){for(var o=[],s=0,a=n.length;s<a;++s){var u=n[s];o=Ro(t,e,u,r,i,2*s,o),e=u[u.length-1]}return o}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new lg(this.getFlatInteriorPoints().slice(),Wi)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(!jo(t,e,a,r,i))return!1;a.length&&(e=a[a.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Bo(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=function(t,e,n,r,i,o,s,a){for(var u=0,l=n.length;u<l;++u){var c=n[u],h=[];s=yo(t,e,c,r,i,o,s,h),a.push(h),e=c[c.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,r),new e(n,Vi,r)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var n=this.endss_[t-1];e=n[n.length-1]}var r=this.endss_[t].slice(),i=r[r.length-1];if(0!==e)for(var o=0,s=r.length;o<s;++o)r[o]-=e;return new Uo(this.flatCoordinates.slice(e,i),this.layout,r)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.endss_,r=[],i=0,o=0,s=n.length;o<s;++o){var a=n[o].slice(),u=a[a.length-1];if(0!==i)for(var l=0,c=a.length;l<c;++l)a[l]-=i;var h=new Uo(e.slice(i,u),t,a);r.push(h),i=u}return r},e.prototype.getType=function(){return"MultiPolygon"},e.prototype.intersectsExtent=function(t){return function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(Ao(t,e,a,r,i))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var n=function(t,e,n,r,i){for(var o=i||[],s=0,a=0,u=n.length;a<u;++a){var l=co(t,e,n[a],r,o[s]);o[s++]=l,e=l[l.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===n.length)this.flatCoordinates.length=0;else{var r=n[n.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},e}(no),fg=hg,pg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dg="Point",gg="LineString",yg="Polygon",vg="Circle",_g="drawstart",mg="drawend",xg="drawabort",bg=function(t){function e(e,n){var r=t.call(this,e)||this;return r.feature=n,r}return pg(e,t),e}(Wt),wg=function(t){function e(e){var n=this,r=e;r.stopDown||(r.stopDown=l),(n=t.call(this,r)||this).on,n.once,n.un,n.shouldHandle_=!1,n.downPx_=null,n.downTimeout_,n.lastDragTime_,n.pointerType_,n.freehand_=!1,n.source_=e.source?e.source:null,n.features_=e.features?e.features:null,n.snapTolerance_=e.snapTolerance?e.snapTolerance:12,n.type_=e.type,n.mode_=function(t){switch(t){case"Point":case"MultiPoint":return dg;case"LineString":case"MultiLineString":return gg;case"Polygon":case"MultiPolygon":return yg;case"Circle":return vg;default:throw new Error("Invalid type: "+t)}}(n.type_),n.stopClick_=!!e.stopClick,n.minPoints_=e.minPoints?e.minPoints:n.mode_===yg?3:2,n.maxPoints_=n.mode_===vg?2:e.maxPoints?e.maxPoints:1/0,n.finishCondition_=e.finishCondition?e.finishCondition:u,n.geometryLayout_=e.geometryLayout?e.geometryLayout:Vi;var i,o=e.geometryFunction;if(!o){var s,a=n.mode_;if(a===vg)o=function(t,e,n){var r=e||new $d([NaN,NaN]),i=Ii(t[0],n),o=He(i,Ii(t[t.length-1],n));r.setCenterAndRadius(i,Math.sqrt(o),this.geometryLayout_);var s=Si();return s&&r.transform(n,s),r};else a===dg?s=Io:a===gg?s=rg:a===yg&&(s=Uo),o=function(t,e,n){return e?a===yg?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])],this.geometryLayout_):e.setCoordinates([],this.geometryLayout_):e.setCoordinates(t,this.geometryLayout_):e=new s(t,this.geometryLayout_),e}}return n.geometryFunction_=o,n.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,n.finishCoordinate_=null,n.sketchFeature_=null,n.sketchPoint_=null,n.sketchCoords_=null,n.sketchLine_=null,n.sketchLineCoords_=null,n.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,n.overlay_=new bd({source:new kd({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=Bf(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),n.geometryName_=e.geometryName,n.condition_=e.condition?e.condition:As,n.freehandCondition_,e.freehand?n.freehandCondition_=Ts:n.freehandCondition_=e.freehandCondition?e.freehandCondition:Ds,n.addChangeListener(_s,n.updateState_),n}return pg(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===ee&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==dg&&this.freehandCondition_(e);var n=e.type===or.POINTERMOVE,r=!0;!this.freehand_&&this.lastDragTime_&&e.type===or.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===or.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===or.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===or.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===or.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===or.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,e)&&r},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new ir(or.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var n=!this.finishCoordinate_;n&&this.startDrawing_(t.coordinate),!n&&this.freehand_?this.finishDrawing():this.freehand_||n&&this.mode_!==dg||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,n=t.pixel,r=e[0]-n[0],i=e[1]-n[1],o=r*r+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var n=!1,r=[this.finishCoordinate_],i=this.mode_;if(i===dg)e=!0;else if(i===vg)e=2===this.sketchCoords_.length;else if(i===gg)n=this.sketchCoords_.length>this.minPoints_;else if(i===yg){var o=this.sketchCoords_;n=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(n)for(var s=this.getMap(),a=0,u=r.length;a<u;a++){var l=r[a],c=s.getPixelFromCoordinate(l),h=t[0]-c[0],f=t[1]-c[1],p=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(h*h+f*f)<=p){this.finishCoordinate_=l;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new Na(new Io(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new Na);var e=t.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),n.changed()):(n=new rg(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(n))},e.prototype.startDrawing_=function(t){for(var e=this.getMap().getView().getProjection(),n=eo(this.geometryLayout_);t.length<n;)t.push(0);this.finishCoordinate_=t,this.mode_===dg?this.sketchCoords_=t.slice():this.mode_===yg?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Na(new rg(this.sketchLineCoords_)));var r=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new Na,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new bg(_g,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){for(var e,n,r=this.getMap(),i=this.sketchFeature_.getGeometry(),o=r.getView().getProjection(),s=eo(this.geometryLayout_);t.length<s;)t.push(0);(this.mode_===dg?n=this.sketchCoords_:this.mode_===yg?(n=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(r.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):n=(e=this.sketchCoords_)[e.length-1],n[0]=t[0],n[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if("Polygon"===i.getType()&&this.mode_!==yg)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,n,r=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;o===gg||o===vg?(this.finishCoordinate_=t.slice(),(n=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),this.geometryFunction_(n,r,i)):o===yg&&((n=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),e&&(this.finishCoordinate_=n[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;if(r===gg||r===vg){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var i=this.finishCoordinate_.slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}this.geometryFunction_(t,e,n),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===yg){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){i=t[t.length-2].slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,n)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,n=t.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===gg?(e.pop(),this.geometryFunction_(e,n,r)):this.mode_===yg&&(e[0].pop(),this.geometryFunction_(e,n,r),e=n.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new lg([e])):"MultiLineString"===this.type_?t.setGeometry(new sg([e])):"MultiPolygon"===this.type_&&t.setGeometry(new fg([e])),this.dispatchEvent(new bg(mg,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new bg(xg,t))},e.prototype.appendCoordinates=function(t){var e,n=this.mode_,r=!this.sketchFeature_;if(r&&this.startDrawing_(t[0]),n===gg||n===vg)e=this.sketchCoords_;else{if(n!==yg)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}r&&e.shift(),e.pop();for(var i=0;i<t.length;i++)this.addToDrawing_(t[i]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new Na(new Io(n)),this.updateSketchFeatures_(),this.dispatchEvent(new bg(_g,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(Os);var Eg=wg,Cg="preload",Sg="useInterimTilesOnError",Pg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ig=function(t){function e(e){var n=this,r=e||{},i=qt({},r);return delete i.preload,delete i.useInterimTilesOnError,(n=t.call(this,i)||this).on,n.once,n.un,n.setPreload(void 0!==r.preload?r.preload:0),n.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),n}return Pg(e,t),e.prototype.getPreload=function(){return this.get(Cg)},e.prototype.setPreload=function(t){this.set(Cg,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Sg)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Sg,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(ze),Mg=Ig,Og=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lg=function(t){function e(e,n,r){var i=t.call(this)||this,o=r||{};return i.tileCoord=e,i.state=n,i.interimTile=null,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i.interpolate=!!o.interpolate,i}return Og(e,t),e.prototype.changed=function(){this.dispatchEvent(Qt)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Pr)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Pr){t.interimTile=null;break}t.getState()==Sr?e=t:t.getState()==Cr?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Ir&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){h()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var r=e-n+1e3/60;return r>=this.transition_?1:ji(r/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}($t),Rg=Lg,kg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tg=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,s)||this;return a.crossOrigin_=i,a.src_=r,a.key=r,a.image_=new Image,null!==i&&(a.image_.crossOrigin=i),a.unlisten_=null,a.tileLoadFunction_=o,a}return kg(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Pr,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Ir,this.unlistenImage_(),this.image_=((t=hn(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Pr:this.state=Mr,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Ir&&(this.state=Cr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Cr&&(this.state=Sr,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=id(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Rg);var Ng,Ag=Tg,Dg=function(){function t(t,e,n,r,i,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=_i(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&>(r)==gt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?gt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?gt(this.targetProj_.getExtent()):null;var u=pt(n),l=dt(n),c=st(n),h=ot(n),f=this.transformInv_(u),p=this.transformInv_(l),d=this.transformInv_(c),g=this.transformInv_(h),y=10+(o?Math.max(0,Math.ceil(Et(it(n)/(o*o*256*256)))):0);if(this.addQuad_(u,l,c,h,f,p,d,g,y),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach(function(t,e,n){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,n,r,i,o){this.triangles_.push({source:[r,i,o],target:[t,e,n]})},t.prototype.addQuad_=function(t,e,n,r,i,o,s,a,u){var l=G([i,o,s,a]),c=this.sourceWorldWidth_?gt(l)/this.sourceWorldWidth_:null,h=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&c>.5&&c<1,p=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)p=gt(G([t,e,n,r]))/this.targetWorldWidth_>.25||p;!f&&this.sourceProj_.isGlobal()&&c&&(p=c>.25||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3]))||yt(l,this.maxSourceExtent_)){var d=0;if(!(p||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(u>0)p=!0;else if(1!=(d=(isFinite(i[0])&&isFinite(i[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(u>0){if(!p){var g=[(t[0]+n[0])/2,(t[1]+n[1])/2],y=this.transformInv_(g),v=void 0;if(f)v=(It(i[0],h)+It(s[0],h))/2-It(y[0],h);else v=(i[0]+s[0])/2-y[0];var _=(i[1]+s[1])/2-y[1];p=v*v+_*_>this.errorThresholdSquared_}if(p){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var m=[(e[0]+n[0])/2,(e[1]+n[1])/2],x=this.transformInv_(m),b=[(r[0]+t[0])/2,(r[1]+t[1])/2],w=this.transformInv_(b);this.addQuad_(t,e,m,b,i,o,x,w,u-1),this.addQuad_(b,m,n,r,w,x,s,a,u-1)}else{var E=[(t[0]+e[0])/2,(t[1]+e[1])/2],C=this.transformInv_(E),S=[(n[0]+r[0])/2,(n[1]+r[1])/2],P=this.transformInv_(S);this.addQuad_(t,E,S,r,i,C,P,a,u-1),this.addQuad_(E,e,n,S,C,o,s,P,u-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}11&d||this.addTriangle_(t,n,r,i,s,a),14&d||this.addTriangle_(t,n,e,i,s,o),d&&(13&d||this.addTriangle_(e,r,t,o,a,i),7&d||this.addTriangle_(e,r,n,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(e,n,r){var i=e.source;tt(t,i[0]),tt(t,i[1]),tt(t,i[2])}),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),Fg=Dg,jg={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Gg={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},Bg=[];function zg(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function Vg(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Ug(t,e,n,r){var i=mi(n,e,t),o=pi(e,r,n),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var u=t.getExtent();if(!u||U(u,i)){var l=pi(t,o,i)/o;isFinite(l)&&l>0&&(o/=l)}return o}function Wg(t,e,n,r,i,o,s,a,u,l,c,h){var f=hn(Math.round(n*t),Math.round(n*e),Bg);if(h||qt(f,jg),0===u.length)return f.canvas;function p(t){return Math.round(t*n)/n}f.scale(n,n),f.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];u.forEach(function(t,e,n){Q(d,t.extent)});var g=gt(d),y=ht(d),v=hn(Math.round(n*g/r),Math.round(n*y/r));h||qt(v,jg);var _=n/r;u.forEach(function(t,e,n){var r=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=gt(t.extent),s=ht(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,r*_,i*_,o*_,s*_)});var m=pt(s);return a.getTriangles().forEach(function(t,e,i){var s=t.source,a=t.target,u=s[0][0],l=s[0][1],c=s[1][0],g=s[1][1],y=s[2][0],_=s[2][1],x=p((a[0][0]-m[0])/o),b=p(-(a[0][1]-m[1])/o),w=p((a[1][0]-m[0])/o),E=p(-(a[1][1]-m[1])/o),C=p((a[2][0]-m[0])/o),S=p(-(a[2][1]-m[1])/o),P=u,I=l;u=0,l=0;var M=function(t){for(var e=t.length,n=0;n<e;n++){for(var r=n,i=Math.abs(t[n][n]),o=n+1;o<e;o++){var s=Math.abs(t[o][n]);s>i&&(i=s,r=o)}if(0===i)return null;var a=t[r];t[r]=t[n],t[n]=a;for(var u=n+1;u<e;u++)for(var l=-t[u][n]/t[n][n],c=n;c<e+1;c++)n==c?t[u][c]=0:t[u][c]+=l*t[n][c]}for(var h=new Array(e),f=e-1;f>=0;f--){h[f]=t[f][e]/t[f][f];for(var p=f-1;p>=0;p--)t[p][e]-=t[p][f]*h[f]}return h}([[c-=P,g-=I,0,0,w-x],[y-=P,_-=I,0,0,C-x],[0,0,c,g,E-b],[0,0,y,_,S-b]]);if(M){if(f.save(),f.beginPath(),function(){if(void 0===Ng){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",zg(t,4,5,4,0),zg(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Ng=Vg(e,0)||Vg(e,4)||Vg(e,8)}return Ng}()||!h){f.moveTo(w,E);for(var O=x-w,L=b-E,R=0;R<4;R++)f.lineTo(w+p((R+1)*O/4),E+p(R*L/3)),3!=R&&f.lineTo(w+p((R+1)*O/4),E+p((R+1)*L/3));f.lineTo(C,S)}else f.moveTo(w,E),f.lineTo(x,b),f.lineTo(C,S);f.clip(),f.transform(M[0],M[2],M[1],M[3],x,b),f.translate(d[0]-P,d[3]-I),f.scale(r/n,-r/n),f.drawImage(v.canvas,0,0),f.restore()}}),c&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach(function(t,e,n){var r=t.target,i=(r[0][0]-m[0])/o,s=-(r[0][1]-m[1])/o,a=(r[1][0]-m[0])/o,u=-(r[1][1]-m[1])/o,l=(r[2][0]-m[0])/o,c=-(r[2][1]-m[1])/o;f.beginPath(),f.moveTo(a,u),f.lineTo(i,s),f.lineTo(l,c),f.closePath(),f.stroke()}),f.restore()),f.canvas}var Xg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qg=function(t){function e(e,n,r,i,o,s,a,u,l,c,h,f){var p=t.call(this,o,Cr,{interpolate:!!f})||this;p.renderEdges_=void 0!==h&&h,p.pixelRatio_=a,p.gutter_=u,p.canvas_=null,p.sourceTileGrid_=n,p.targetTileGrid_=i,p.wrappedTileCoord_=s||o,p.sourceTiles_=[],p.sourcesListenerKeys_=null,p.sourceZ_=0;var d=i.getTileCoordExtent(p.wrappedTileCoord_),g=p.targetTileGrid_.getExtent(),y=p.sourceTileGrid_.getExtent(),v=g?ft(d,g):d;if(0===it(v))return p.state=Mr,p;var _=e.getExtent();_&&(y=y?ft(y,_):_);var m=i.getResolution(p.wrappedTileCoord_[0]),x=function(t,e,n,r){var i=at(n),o=Ug(t,e,i,r);return(!isFinite(o)||o<=0)&&rt(n,function(n){return o=Ug(t,e,n,r),isFinite(o)&&o>0}),o}(e,r,v,m);if(!isFinite(x)||x<=0)return p.state=Mr,p;var b=void 0!==c?c:.5;if(p.triangulation_=new Fg(e,r,v,y,x*b,m),0===p.triangulation_.getTriangles().length)return p.state=Mr,p;p.sourceZ_=n.getZForResolution(x);var w=p.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(w[1]=bt(w[1],y[1],y[3]),w[3]=bt(w[3],y[1],y[3])):w=ft(w,y)),it(w)){for(var E=n.getTileRangeForExtentAndZ(w,p.sourceZ_),C=E.minX;C<=E.maxX;C++)for(var S=E.minY;S<=E.maxY;S++){var P=l(p.sourceZ_,C,S,a);P&&p.sourceTiles_.push(P)}0===p.sourceTiles_.length&&(p.state=Mr)}else p.state=Mr;return p}return Xg(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,r){e&&e.getState()==Pr&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Ir;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),r="number"==typeof n?n:n[0],i="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Wg(r,i,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=Pr}this.changed()},e.prototype.load=function(){if(this.state==Cr){this.state=Sr,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,r){var i=e.getState();if(i==Cr||i==Sr){t++;var o=ce(e,Qt,function(n){var r=e.getState();r!=Pr&&r!=Ir&&r!=Mr||(fe(o),0===--t&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(t,e,n){t.getState()==Cr&&t.load()})}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(fe),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(fn(this.canvas_.getContext("2d")),Bg.push(this.canvas_),this.canvas_=null),t.prototype.release.call(this)},e}(Rg),Yg=qg,Hg=function(){function t(t,e,n,r){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Zg(t,e,n,r,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new Hg(t,e,n,r)}var Kg=Hg,Jg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$g=function(t){function n(e){var n=t.call(this,e)||this;return n.extentChanged=!0,n.renderedExtent_=null,n.renderedPixelRatio,n.renderedProjection=null,n.renderedRevision,n.renderedTiles=[],n.newTiles_=!1,n.tmpExtent=[1/0,1/0,-1/0,-1/0],n.tmpTileRange_=new Kg(0,0,0,0),n}return Jg(n,t),n.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),r=e.getUseInterimTilesOnError();return n==Pr||n==Mr||n==Ir&&!r},n.prototype.getTile=function(t,e,n,r){var i=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,n,i,o);return a.getState()==Ir&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(Pr)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},n.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),r=O(e.pixelToCoordinateTransform,t.slice()),i=n.getExtent();if(i&&!U(i,r))return null;for(var o=e.pixelRatio,s=e.viewState.projection,a=e.viewState,u=n.getRenderSource(),l=u.getTileGridForProjection(a.projection),c=u.getTilePixelRatio(e.pixelRatio),h=l.getZForResolution(a.resolution);h>=l.getMinZoom();--h){var f=l.getTileCoordForCoordAndZ(r,h),p=u.getTile(h,f[1],f[2],o,s);if(!(p instanceof Ag||p instanceof Yg))return null;if(p.getState()===Pr){var d=l.getOrigin(h),g=Qo(l.getTileSize(h)),y=l.getResolution(h),v=Math.floor(c*((r[0]-d[0])/y-f[1]*g[0])),_=Math.floor(c*((d[1]-r[1])/y-f[2]*g[1])),m=Math.round(c*u.getGutterForProjection(a.projection));return this.getImageData(p.getImage(),v+m,_+m)}}return null},n.prototype.loadedTileCallback=function(e,n,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,e,n,r)},n.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},n.prototype.renderFrame=function(t,n){var r=t.layerStatesArray[t.layerIndex],i=t.viewState,o=i.projection,s=i.resolution,a=i.center,u=i.rotation,l=t.pixelRatio,c=this.getLayer(),h=c.getSource(),f=h.getRevision(),d=h.getTileGridForProjection(o),g=d.getZForResolution(s,h.zDirection),y=d.getResolution(g),v=t.extent,_=t.viewState.resolution,m=h.getTilePixelRatio(l),x=Math.round(gt(v)/_*l),b=Math.round(ht(v)/_*l),w=r.extent&&Oi(r.extent,o);w&&(v=ft(v,Oi(r.extent,o)));var E=y*x/2/m,C=y*b/2/m,S=[a[0]-E,a[1]-C,a[0]+E,a[1]+C],P=d.getTileRangeForExtentAndZ(v,g),I={};I[g]={};var M=this.createLoadedTileFinder(h,o,I),T=this.tmpExtent,N=this.tmpTileRange_;this.newTiles_=!1;for(var A=u?ct(i.center,_,u,t.size):void 0,D=P.minX;D<=P.maxX;++D)for(var F=P.minY;F<=P.maxY;++F)if(!u||d.tileCoordIntersectsViewport([g,D,F],A)){var j=this.getTile(g,D,F,t);if(this.isDrawableTile(j)){var G=p(this);if(j.getState()==Pr)I[g][j.tileCoord.toString()]=j,(lt=j.inTransition(G))&&1!==r.opacity&&(j.endTransition(G),lt=!1),this.newTiles_||!lt&&-1!==this.renderedTiles.indexOf(j)||(this.newTiles_=!0);if(1===j.getAlpha(G,t.time))continue}var B=d.getTileCoordChildTileRange(j.tileCoord,N,T),z=!1;B&&(z=M(g+1,B)),z||d.forEachTileCoordParentTileRange(j.tileCoord,M,N,T)}var V=y/s*l/m;L(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/l,1/l,u,-x/2,-b/2);var U=k(this.pixelTransform);this.useContainer(n,U,this.getBackground(t));var W=this.context,X=W.canvas;R(this.inversePixelTransform,this.pixelTransform),L(this.tempTransform,x/2,b/2,V,V,0,-x/2,-b/2),X.width!=x||X.height!=b?(X.width=x,X.height=b):this.containerReused||W.clearRect(0,0,x,b),w&&this.clipUnrotated(W,t,w),h.getInterpolate()||qt(W,jg),this.preRender(W,t),this.renderedTiles.length=0;var q,Y,H,Z=Object.keys(I).map(Number);Z.sort(e),1!==r.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(q=[],Y=[]):Z=Z.reverse();for(var K=Z.length-1;K>=0;--K){var J=Z[K],Q=h.getTilePixelSize(J,l,o),tt=d.getResolution(J)/y,et=Q[0]*tt*V,nt=Q[1]*tt*V,rt=d.getTileCoordForCoordAndZ(pt(S),J),it=d.getTileCoordExtent(rt),ot=O(this.tempTransform,[m*(it[0]-S[0])/y,m*(S[3]-it[3])/y]),st=m*h.getGutterForProjection(o),at=I[J];for(var ut in at){var lt,dt=(j=at[ut]).tileCoord,vt=rt[1]-dt[1],_t=Math.round(ot[0]-(vt-1)*et),mt=rt[2]-dt[2],xt=Math.round(ot[1]-(mt-1)*nt),bt=_t-(D=Math.round(ot[0]-vt*et)),wt=xt-(F=Math.round(ot[1]-mt*nt)),Et=g===J,Ct=!1;if(!(lt=Et&&1!==j.getAlpha(p(this),t.time)))if(q){H=[D,F,D+bt,F,D+bt,F+wt,D,F+wt];for(var St=0,Pt=q.length;St<Pt;++St)if(g!==J&&J<Y[St]){var It=q[St];yt([D,F,D+bt,F+wt],[It[0],It[3],It[4],It[7]])&&(Ct||(W.save(),Ct=!0),W.beginPath(),W.moveTo(H[0],H[1]),W.lineTo(H[2],H[3]),W.lineTo(H[4],H[5]),W.lineTo(H[6],H[7]),W.moveTo(It[6],It[7]),W.lineTo(It[4],It[5]),W.lineTo(It[2],It[3]),W.lineTo(It[0],It[1]),W.clip())}q.push(H),Y.push(J)}else W.clearRect(D,F,bt,wt);this.drawTileImage(j,t,D,F,bt,wt,st,Et),q&&!lt?(Ct&&W.restore(),this.renderedTiles.unshift(j)):this.renderedTiles.push(j),this.updateUsedTiles(t.usedTiles,h,j)}}return this.renderedRevision=f,this.renderedResolution=y,this.extentChanged=!this.renderedExtent_||!$(this.renderedExtent_,S),this.renderedExtent_=S,this.renderedPixelRatio=l,this.renderedProjection=o,this.manageTilePyramid(t,h,d,l,o,v,g,c.getPreload()),this.scheduleExpireCache(t,h),this.postRender(W,t),r.extent&&W.restore(),qt(W,Gg),U!==X.style.transform&&(X.style.transform=U),this.container},n.prototype.drawTileImage=function(t,e,n,r,i,o,s,a){var u=this.getTileImage(t);if(u){var l=p(this),c=e.layerStatesArray[e.layerIndex],h=c.opacity*(a?t.getAlpha(l,e.time):1),f=h!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=h),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,n,r,i,o),f&&this.context.restore(),h!==c.opacity?e.animate=!0:a&&t.endTransition(l)}},n.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},n.prototype.getTileImage=function(t){return t.getImage()},n.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var n=function(t,e,n){var r=p(t);r in n.usedTiles&&t.expireCache(n.viewState.projection,n.usedTiles[r])}.bind(null,e);t.postRenderFunctions.push(n)}},n.prototype.updateUsedTiles=function(t,e,n){var r=p(e);r in t||(t[r]={}),t[r][n.getKey()]=!0},n.prototype.manageTilePyramid=function(t,e,n,r,i,o,s,a,u){var l=p(e);l in t.wantedTiles||(t.wantedTiles[l]={});var c,h,f,d,g,y,v=t.wantedTiles[l],_=t.tileQueue,m=n.getMinZoom(),x=t.viewState.rotation,b=x?ct(t.viewState.center,t.viewState.resolution,x,t.size):void 0,w=0;for(y=m;y<=s;++y)for(h=n.getTileRangeForExtentAndZ(o,y,h),f=n.getResolution(y),d=h.minX;d<=h.maxX;++d)for(g=h.minY;g<=h.maxY;++g)x&&!n.tileCoordIntersectsViewport([y,d,g],b)||(s-y<=a?(++w,(c=e.getTile(y,d,g,r,i)).getState()==Cr&&(v[c.getKey()]=!0,_.isKeyQueued(c.getKey())||_.enqueue([c,l,n.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(y,d,g,i));e.updateCacheSize(w,i)},n}(Ip),Qg=$g,ty=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ey=function(t){function e(e){return t.call(this,e)||this}return ty(e,t),e.prototype.createRenderer=function(){return new Qg(this)},e}(Mg),ny=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var n=this.entries_[t];return P(void 0!==n,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_},t.prototype.remove=function(t){var e=this.entries_[t];return P(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(t){if(this.containsKey(t))return this.entries_[t].value_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){P(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),ry=ny;function iy(t,e,n,r){return void 0!==r?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function oy(t,e,n){return t+"/"+e+"/"+n}function sy(t){return oy(t[0],t[1],t[2])}var ay=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uy=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ay(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=function(t){return t.split("/").map(Number)}(this.peekFirstKey()),e=t[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(sy(t.tileCoord)),t.release())}.bind(this))}},e}(ry),ly=uy,cy="tileloadstart",hy="tileloadend",fy="tileloaderror",py=[0,0,0],dy=function(){function t(t){var n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,P(function(t,n,r){var i=n||e;return t.every(function(e,n){if(0===n)return!0;var o=i(t[n-1],e);return!(o>0||r&&0===o)})}(this.resolutions_,function(t,e){return e-t},!0),17),!t.origins)for(var r=0,i=this.resolutions_.length-1;r<i;++r)if(n){if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}else n=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,P(this.origins_.length==this.resolutions_.length,20));var o=t.extent;void 0===o||this.origin_||this.origins_||(this.origin_=pt(o)),P(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,P(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:jr,P(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==o?o:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map(function(t,e){var n=new Kg(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(o){var r=this.getTileRangeForExtentAndZ(o,e);n.minX=Math.max(r.minX,n.minX),n.maxX=Math.min(r.maxX,n.maxX),n.minY=Math.max(r.minY,n.minY),n.maxY=Math.min(r.maxY,n.maxY)}return n},this):o&&this.calculateTileRanges_(o)}return t.prototype.forEachTileCoord=function(t,e,n){for(var r=this.getTileRangeForExtentAndZ(t,e),i=r.minX,o=r.maxX;i<=o;++i)for(var s=r.minY,a=r.maxY;s<=a;++s)n([e,i,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,n,r){var i,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):s=this.getTileCoordExtent(t,r);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?Zg(i=Math.floor(i/2),i,o=Math.floor(o/2),o,n):this.getTileRangeForExtentAndZ(s,a,n)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,n){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var r=2*t[1],i=2*t[2];return Zg(r,r+1,i,i+1,e)}var o=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;var r=t[0],i=t[1],o=t[2];if(e===r)return Zg(i,o,i,o,n);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-r),a=Math.floor(i*s),u=Math.floor(o*s);return e<r?Zg(a,a,u,u,n):Zg(a,Math.floor(s*(i+1))-1,u,Math.floor(s*(o+1))-1,n)}var l=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(l,e,n)},t.prototype.getTileRangeExtent=function(t,e,n){var r=this.getOrigin(t),i=this.getResolution(t),o=Qo(this.getTileSize(t),this.tmpSize_),s=r[0]+e.minX*o[0]*i,a=r[0]+(e.maxX+1)*o[0]*i;return H(s,r[1]+e.minY*o[1]*i,a,r[1]+(e.maxY+1)*o[1]*i,n)},t.prototype.getTileRangeForExtentAndZ=function(t,e,n){var r=py;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,r);var i=r[1],o=r[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,r),Zg(i,r[1],o,r[2],n)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=Qo(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*r[0]*n,e[1]-(t[2]+.5)*r[1]*n]},t.prototype.getTileCoordExtent=function(t,e){var n=this.getOrigin(t[0]),r=this.getResolution(t[0]),i=Qo(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*i[0]*r,s=n[1]-(t[2]+1)*i[1]*r;return H(o,s,o+i[0]*r,s+i[1]*r,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,n,r,i){var o=this.getZForResolution(n),s=n/this.getResolution(o),a=this.getOrigin(o),u=Qo(this.getTileSize(o),this.tmpSize_),l=s*(t-a[0])/n/u[0],c=s*(a[1]-e)/n/u[1];return r?(l=Rt(l,5)-1,c=Rt(c,5)-1):(l=Lt(l,5),c=Lt(c,5)),iy(o,l,c,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,n,r,i){var o=this.getOrigin(n),s=this.getResolution(n),a=Qo(this.getTileSize(n),this.tmpSize_),u=(t-o[0])/s/a[0],l=(o[1]-e)/s/a[1];return r?(u=Rt(u,5)-1,l=Rt(l,5)-1):(u=Lt(u,5),l=Lt(l,5)),iy(n,u,l,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return bt(i(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.tileCoordIntersectsViewport=function(t,e){return No(e,0,e.length,2,this.getTileCoordExtent(t))},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,n=new Array(e),r=this.minZoom;r<e;++r)n[r]=this.getTileRangeForExtentAndZ(t,r);this.fullTileRanges_=n},t}(),gy=dy;function yy(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,n,r){var i=_y(t);return function(t,e,n,r){var i=void 0!==r?r:"top-left",o=vy(t,e,n);return new gy({extent:t,origin:ut(t,i),resolutions:o,tileSize:n})}(i,e,n,r)}(t),t.setDefaultTileGrid(e)),e}function vy(t,e,n,r){for(var i=void 0!==e?e:42,o=ht(t),s=gt(t),a=Qo(void 0!==n?n:jr),u=r>0?r:Math.max(s/a[0],o/a[1]),l=i+1,c=new Array(l),h=0;h<l;++h)c[h]=u/Math.pow(2,h);return c}function _y(t){var e=(t=fi(t)).getExtent();if(!e){var n=180*Tr[Nr.DEGREES]/t.getMetersPerUnit();e=H(-n,-n,n,n)}return e}var my=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xy=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||this;n.on,n.once,n.un,n.opaque_=void 0!==e.opaque&&e.opaque,n.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,n.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;return n.tileGrid&&Qo(n.tileGrid.getTileSize(n.tileGrid.getMinZoom()),[256,256]),n.tileCache=new ly(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition,interpolate:e.interpolate},n.zDirection=e.zDirection?e.zDirection:0,n}return my(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,n,r){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,s,a,u=!0,l=n.minX;l<=n.maxX;++l)for(var c=n.minY;c<=n.maxY;++c)s=oy(e,l,c),a=!1,i.containsKey(s)&&(a=(o=i.get(s)).getState()===Pr)&&(a=!1!==r(o)),a||(u=!1);return u},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,e,n,r,i){return h()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:yy(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return P(null===e||yi(e,t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,n){var r,i,o,s=this.getTileGridForProjection(n),a=this.getTilePixelRatio(e),u=Qo(s.getTileSize(t),this.tmpSize);return 1==a?u:(r=u,i=a,void 0===(o=this.tmpSize)&&(o=[0,0]),o[0]=r[0]*i+.5|0,o[1]=r[1]*i+.5|0,o)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=function(t,e,n){var r=e[0],i=t.getTileCoordCenter(e),o=_y(n);if(U(o,i))return e;var s=gt(o),a=Math.ceil((o[0]-i[0])/s);return i[0]+=s*a,t.getTileCoordForCoordAndZ(i,r)}(r,t,n)),function(t,e){var n=t[0],r=t[1],i=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return!o||o.containsXY(r,i)}(t,r)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},e.prototype.useTile=function(t,e,n,r){},e}(Sd),by=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tile=n,r}return my(e,t),e}(Wt),wy=xy;function Ey(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,u){return s?t.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,function(){var t=s[0],n=e.getFullTileRange(t);return P(n,55),(n.getHeight()-s[2]-1).toString()}):void 0}}function Cy(t,e){for(var n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=Ey(t[i],e);return function(t){if(1===t.length)return t[0];return function(e,n,r){if(e){var i=function(t){return(t[1]<<t[0])+t[2]}(e),o=It(i,t.length);return t[o](e,n,r)}}}(r)}var Sy=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Py=function(t){function e(n){var r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,interpolate:n.interpolate,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return r.generateTileUrlFunction_=r.tileUrlFunction===e.prototype.tileUrlFunction,r.tileLoadFunction=n.tileLoadFunction,n.tileUrlFunction&&(r.tileUrlFunction=n.tileUrlFunction),r.urls=null,n.urls?r.setUrls(n.urls):n.url&&r.setUrl(n.url),r.tileLoadingKeys_={},r}return Sy(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,n=t.target,r=p(n),i=n.getState();i==Sr?(this.tileLoadingKeys_[r]=!0,e=cy):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=i==Ir?fy:i==Pr?hy:void 0),null!=e&&this.dispatchEvent(new by(e,n))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],n=/\{([a-z])-([a-z])\}/.exec(t);if(n){var r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),o=void 0;for(o=r;o<=i;++o)e.push(t.replace(n[0],String.fromCharCode(o)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(n[2],10),a=parseInt(n[1],10);a<=s;a++)e.push(t.replace(n[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Cy(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,n){},e.prototype.useTile=function(t,e,n){var r=oy(t,e,n);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(wy),Iy=Py,My=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Oy=function(t){function e(e){var n=this,r=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(r=e.interpolate),(n=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Ly,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:r,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,n.tileClass=void 0!==e.tileClass?e.tileClass:Ag,n.tileCacheForProjection={},n.tileGridForProjection={},n.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,n.renderReprojectionEdges_=!1,n}return My(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==n?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[r];i.expireCache(i==n?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!yi(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!yi(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!yi(e,t)){var n=p(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=yy(t)),this.tileGridForProjection[n]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||yi(e,t))return this.tileCache;var n=p(t);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new ly(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]},e.prototype.createTile_=function(t,e,n,r,i,o){var s=[t,e,n],a=this.getTileCoordForTileUrlFunction(s,i),u=a?this.tileUrlFunction(a,r,i):void 0,l=new this.tileClass(s,void 0!==u?Cr:Mr,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=o,l.addEventListener(Qt,this.handleTileChange.bind(this)),l},e.prototype.getTile=function(t,e,n,r,i){var o=this.getProjection();if(o&&i&&!yi(o,i)){var s=this.getTileCacheForProjection(i),a=[t,e,n],u=void 0,l=sy(a);s.containsKey(l)&&(u=s.get(l));var c=this.getKey();if(u&&u.key==c)return u;var h=this.getTileGridForProjection(o),f=this.getTileGridForProjection(i),p=this.getTileCoordForTileUrlFunction(a,i),d=new Yg(o,h,i,f,a,p,this.getTilePixelRatio(r),this.getGutter(),function(t,e,n,r){return this.getTileInternal(t,e,n,r,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return d.key=c,u?(d.interimTile=u,d.refreshInterimChain(),s.replace(l,d)):s.set(l,d),d}return this.getTileInternal(t,e,n,r,o||i)},e.prototype.getTileInternal=function(t,e,n,r,i){var o=null,s=oy(t,e,n),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var u=o;o=this.createTile_(t,e,n,r,i,a),u.getState()==Cr?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,n,r,i,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var n=fi(t);if(n){var r=p(n);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}},e}(Iy);function Ly(t,e){t.getImage().src=e}var Ry=Oy,ky=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ty=function(t){function e(e){var n=this,r=e||{},i=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(i=r.interpolate);var o=void 0!==r.projection?r.projection:"EPSG:3857",s=void 0!==r.tileGrid?r.tileGrid:function(t){var e=t||{},n=e.extent||fi("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:vy(n,e.maxZoom,e.tileSize,e.maxResolution)};return new gy(r)}({extent:_y(o),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return(n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:i,opaque:r.opaque,projection:o,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:s,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this).gutter_=void 0!==r.gutter?r.gutter:0,n}return ky(e,t),e.prototype.getGutter=function(){return this.gutter_},e}(Ry),Ny=Ty,Ay=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dy="element",Fy="map",jy="offset",Gy="position",By="positioning",zy=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un,n.options=e,n.id=e.id,n.insertFirst=void 0===e.insertFirst||e.insertFirst,n.stopEvent=void 0===e.stopEvent||e.stopEvent,n.element=document.createElement("div"),n.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",n.element.style.position="absolute",n.element.style.pointerEvents="auto";var r=e.autoPan;return r&&"object"!=typeof r&&(r={animation:e.autoPanAnimation,margin:e.autoPanMargin}),n.autoPan=r||!1,n.rendered={transform_:"",visible:!0},n.mapPostrenderListenerKey=null,n.addChangeListener(Dy,n.handleElementChanged),n.addChangeListener(Fy,n.handleMapChanged),n.addChangeListener(jy,n.handleOffsetChanged),n.addChangeListener(Gy,n.handlePositionChanged),n.addChangeListener(By,n.handlePositioningChanged),void 0!==e.element&&n.setElement(e.element),n.setOffset(void 0!==e.offset?e.offset:[0,0]),n.setPositioning(e.positioning||"top-left"),void 0!==e.position&&n.setPosition(e.position),n}return Ay(e,t),e.prototype.getElement=function(){return this.get(Dy)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Fy)||null},e.prototype.getOffset=function(){return this.get(jy)},e.prototype.getPosition=function(){return this.get(Gy)},e.prototype.getPositioning=function(){return this.get(By)},e.prototype.handleElementChanged=function(){vn(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(yn(this.element),fe(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=ce(t,fr,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(Dy,t)},e.prototype.setMap=function(t){this.set(Fy,t)},e.prototype.setOffset=function(t){this.set(jy,t)},e.prototype.setPosition=function(t){this.set(Gy,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(Gy)){var n=this.getRect(e.getTargetElement(),e.getSize()),r=this.getElement(),i=this.getRect(r,[pn(r),dn(r)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!W(n,i)){var a=i[0]-n[0],u=n[2]-i[2],l=i[1]-n[1],c=n[3]-i[3],h=[0,0];if(a<0?h[0]=a-s:u<0&&(h[0]=Math.abs(u)+s),l<0?h[1]=l-s:c<0&&(h[1]=Math.abs(c)+s),0!==h[0]||0!==h[1]){var f=e.getView().getCenterInternal(),p=e.getPixelFromCoordinateInternal(f);if(!p)return;var d=[p[0]+h[0],p[1]+h[1]],g=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(d),duration:g.duration,easing:g.easing})}}}},e.prototype.getRect=function(t,e){var n=t.getBoundingClientRect(),r=n.left+window.pageXOffset,i=n.top+window.pageYOffset;return[r,i,r+e[0],i+e[1]]},e.prototype.setPositioning=function(t){this.set(By,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var n=t.getPixelFromCoordinate(e),r=t.getSize();this.updateRenderedPosition(n,r)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var n=this.element.style,r=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+r[0])+"px",s=Math.round(t[1]+r[1])+"px",a="0%",u="0%";"bottom-right"==i||"center-right"==i||"top-right"==i?a="-100%":"bottom-center"!=i&&"center-center"!=i&&"top-center"!=i||(a="-50%"),"bottom-left"==i||"bottom-center"==i||"bottom-right"==i?u="-100%":"center-left"!=i&&"center-center"!=i&&"center-right"!=i||(u="-50%");var l="translate(".concat(a,", ").concat(u,") translate(").concat(o,", ").concat(s,")");this.rendered.transform_!=l&&(this.rendered.transform_=l,n.transform=l,n.msTransform=l)},e.prototype.getOptions=function(){return this.options},e}(me),Vy=zy,Uy=n(5072),Wy=n.n(Uy),Xy=n(7825),qy=n.n(Xy),Yy=n(7659),Hy=n.n(Yy),Zy=n(5056),Ky=n.n(Zy),Jy=n(540),$y=n.n(Jy),Qy=n(1113),tv=n.n(Qy),ev=n(7819),nv={};nv.styleTagTransform=tv(),nv.setAttributes=Ky(),nv.insert=Hy().bind(null,"head"),nv.domAPI=qy(),nv.insertStyleElement=$y();Wy()(ev.A,nv),ev.A&&ev.A.locals&&ev.A.locals;function rv(t){return rv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rv(t)}function iv(t){return function(t){if(Array.isArray(t))return ov(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ov(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ov(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ov(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function sv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,uv(r.key),r)}}function av(t,e,n){return(e=uv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uv(t){var e=function(t,e){if("object"!=rv(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=rv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==rv(e)?e:e+""}function lv(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function cv(t,e){return t.get(hv(t,e))}function hv(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var fv=new WeakMap,pv=function(){return t=function t(e){var n=this;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),lv(this,fv,{}),av(this,"source",void 0),av(this,"getSource",function(){return n.source}),av(this,"setSource",function(t){cv(fv,n).setSource(t),n.source=t}),av(this,"getStyle",function(){return n.style}),av(this,"setStyle",function(t){cv(fv,n).setstyle(t),n.style=t}),av(this,"addFeature",function(t){n.source.addFeature(t)}),av(this,"removeFeature",function(t){n.source.removeFeature(t)}),this.init(e),cv(fv,this).addFeature=this.addFeature,cv(fv,this).removeFeature=this.removeFeature,cv(fv,this).getSource=this.getSource,cv(fv,this)},(e=[{key:"init",value:function(t){if(!t)return new bd({source:new kd});var e={};Array.isArray(t)?(e.features=t,e.zIndex=1e3):(e.features=t.features,e.zIndex=t.zIndex);var n,r,i,o=new kd({features:iv(e.features)});this.source=o,n=fv,r=this,i=new bd({source:o,zIndex:e.zIndex}),n.set(hv(n,r),i)}}])&&sv(t.prototype,e),n&&sv(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),dv=fi("EPSG:4326"),gv={projection:dv,center:[120.566032634,33.355905081],zoom:13,maxZoom:18,minZoom:3,extent:[65.32783475401652,.4243521114706,160.16017906160056,73.83501005646247]},yv={CLICK:"click",DBLCLICK:"dbclick"};function vv(t){return vv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vv(t)}function _v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function mv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_v(Object(n),!0).forEach(function(e){xv(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_v(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function xv(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=vv(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=vv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vv(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var bv=mv(mv({},yv),{},{POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",LOADEND:"loadend"});function wv(t){return wv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wv(t)}function Ev(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Cv(r.key),r)}}function Cv(t){var e=function(t,e){if("object"!=wv(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=wv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==wv(e)?e:e+""}function Sv(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function Pv(t,e){return t.get(function(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}(t,e))}var Iv=new WeakMap,Mv=function(){return t=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Sv(this,Iv,{}),this.context=e,this.target=n},e=[{key:"eventList",get:function(){return Pv(Iv,this)}},{key:"eventCallback",value:function(t,e,n){n&&"function"===wv(n).toLocaleLowerCase()&&n({lnglat:t.coordinate,type:e,target:this.context,MAP_EVENT:t})}},{key:"onEvent",value:function(t,e,n,r){var i=t[e.toLocaleUpperCase()];if(Pv(Iv,this)[i])Pv(Iv,this)[i].set(n,r);else{var o=new WeakMap;o.set(n,r),Pv(Iv,this)[i]=o}var s=this.target.on(i,r);return s&&(s.eventType=e),s}},{key:"on",value:function(t,e,n){var r=this;if(t){var i;if(n||(n=yv),Array.isArray(t))return i=t.map(function(t){return r.on(t,e)});var o=n[t.toLocaleUpperCase()];if(o){var s=this;if(Pv(Iv,this)[o])Pv(Iv,this)[o].set(e,u);else{var a=new WeakMap;a.set(e,u),Pv(Iv,this)[o]=a}return(i=this.target.on(o,u))&&(i.eventType=t),i}console.error("Current events are not supported.")}function u(t){return s.eventCallback(t,o,e)}}},{key:"off",value:function(t,e,n){var r,i=this;if(!t)return!1;if(Array.isArray(t))return t.map(function(t){return i.off(t,e)});var o=n[t.toLocaleUpperCase()];return this.target.un(o,e),!(null===(r=Pv(Iv,this)[o])||void 0===r||!r.get(e)||(this.target.un(o,Pv(Iv,this)[o].get(e)),Pv(Iv,this)[o].delete(e),0))}},{key:"featureOn",value:function(t,e,n){var r=this;if(t){var i;if(n||(n=yv),Array.isArray(t))return i=t.map(function(t){return r.featureOn(t,e)});var o=n[t.toLocaleUpperCase()];if(o){var s=this;if(Pv(Iv,this)[o])Pv(Iv,this)[o].set(e,u);else{var a=new WeakMap;a.set(e,u),Pv(Iv,this)[o]=a}return(i=this.target.on(o,u))&&(i.eventType=t),i}console.error("Current events are not supported.")}function u(t){var n=[];s.target.forEachFeatureAtPixel(t.pixel,function(t,e,r){n.push(t)});var r=n.find(function(t){return Array.isArray(s.context.feature)?s.context.feature.some(function(e){return e===t}):t===s.context.feature});if(r)return s.eventCallback(t,o,e)}}}],e&&Ev(t.prototype,e),n&&Ev(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Ov(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Lv(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lv(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lv(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Rv(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function kv(t){var e=.017453292519943295,n=111319.49079327357,r=0;if(t.length<3)return 0;for(var i=0;i<t.length-1;i++){var o=Ov(t[i].map(parseFloat),2),s=o[0],a=o[1],u=Ov(t[i+1].map(parseFloat),2),l=u[0],c=u[1],h=a*n;r+=s*n*Math.cos(a*e)*c*n-l*n*Math.cos(c*e)*h}var f=Ov(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=Ov(t[0].map(parseFloat),2),y=g[0],v=g[1],_=d*n;return r+=p*n*Math.cos(d*e)*v*n-y*n*Math.cos(v*e)*_,.5*Math.abs(r)}function Tv(t){return Tv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tv(t)}function Nv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Av(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Nv(Object(n),!0).forEach(function(e){Dv(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nv(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Dv(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=Tv(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Tv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Tv(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Fv=Av(Av({},yv),{},{POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup"});function jv(t){return jv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jv(t)}function Gv(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Bv(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bv(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bv(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function zv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Vv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zv(Object(n),!0).forEach(function(e){Uv(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zv(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Uv(t,e,n){return(e=Xv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xv(r.key),r)}}function Xv(t){var e=function(t,e){if("object"!=jv(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=jv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==jv(e)?e:e+""}function qv(t,e,n){Yv(t,e),e.set(t,n)}function Yv(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hv(t,e){return t.get(Kv(t,e))}function Zv(t,e,n){return t.set(Kv(t,e),n),n}function Kv(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Jv=new WeakMap,$v=new WeakMap,Qv=new WeakMap,t_=new WeakMap,e_=new WeakMap,n_=new WeakSet,r_=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Yv(n=this,r=n_),r.add(n),qv(this,Jv,void 0),qv(this,$v,void 0),qv(this,Qv,void 0),qv(this,t_,void 0),qv(this,e_,void 0),this.init(Kv(n_,this,i_).call(this,e))},e=[{key:"init",value:function(t){var e=this;if(console.log("options",t),!t)return!1;Zv(Qv,this,Rv()),t.isGeomPolygon?(this.isGeomPolygon=!0,Zv(Jv,this,new Na({type:"polygon",geometry:new Uo(t.path),name:Hv(Qv,this)}))):Array.isArray(t.path[0][0])?(Zv(Jv,this,[]),t.path.forEach(function(t){Hv(Jv,e).push(new Na({type:"polygon",geometry:new Uo([t]),name:Hv(Qv,e)}))})):Zv(Jv,this,new Na({type:"polygon",geometry:new Uo([t.path]),name:Hv(Qv,this)}));var n=new Vf({stroke:new Df({width:t.borderWidth,color:t.strokeColor}),fill:new Nf({color:t.fillColor})});this.style=n,Array.isArray(Hv(Jv,this))?(Hv(Jv,this).forEach(function(t){t.setStyle(n)}),this.layer=new pv(Hv(Jv,this))):(Hv(Jv,this).setStyle(n),this.layer=new pv([Hv(Jv,this)])),t.map&&this.setMap(t.map),t.extData&&(this.extData=t.extData)}},{key:"setExtData",value:function(t){this.extData=Vv(Vv({},this.extData),t)}},{key:"feature",get:function(){return Hv(Jv,this)}},{key:"getPath",value:function(){return this.layer.getSource().getFeatures()[0].getGeometry().getCoordinates()[0]}},{key:"setPath",value:function(t){if(!t)return!1;this.layer.getSource().getFeatures()[0].getGeometry().setCoordinates([t])}},{key:"isVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){Hv($v,this)&&Hv($v,this).removeFeature(this.layer),t?(t.addFeature(this.layer),Zv($v,this,t),Zv(e_,this,new Mv(this,Hv($v,this).map))):Hv($v,this)&&Hv($v,this).removeFeature(this.layer)}},{key:"map",get:function(){return Hv($v,this)}},{key:"eventList",get:function(){return Hv(e_,this).eventList}},{key:"on",value:function(t,e){return Hv(e_,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return Hv(e_,this).off(t,e,Fv)}},{key:"openEdit",value:function(t,e){Hv($v,this).editGeom(this,t,e)}},{key:"closeEdit",value:function(){return!!Hv($v,this).getEditGeom(this)&&Hv($v,this).closeEditGeom(this)}},{key:"getArea",value:function(){if(this.isGeomPolygon){var t,e=this.layer.getSource().getFeatures()[0].getGeometry().getCoordinates();return kv(e[0])-(null!==(t=e.slice(1))&&void 0!==t?t:[]).reduce(function(t,e){return t+kv(e)},0)}return kv(this.getPath())}},{key:"getLength",value:function(){return 1e3*bu(Ba(this.getPath()),{units:"kilometers"})}},{key:"getHighByCoordinate",value:function(t){var e=.017453292519943295,n=111319.49079327357,r=0;if(t.length<3)return 0;for(var i=0;i<t.length-1;i++){var o=Gv(t[i].map(parseFloat),2),s=o[0],a=o[1],u=Gv(t[i+1].map(parseFloat),2),l=u[0],c=u[1],h=a*n;r+=s*n*Math.cos(a*e)*c*n-l*n*Math.cos(c*e)*h}var f=Gv(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=Gv(t[0].map(parseFloat),2),y=g[0],v=g[1],_=d*n;return r+=p*n*Math.cos(d*e)*v*n-y*n*Math.cos(v*e)*_,.5*Math.abs(r)}},{key:"setActive",value:function(t){"boolean"!==jv(t).toLocaleString()&&(t=!!t),this.active=t,t?Kv(n_,this,o_).call(this,this.activeStyle):Kv(n_,this,o_).call(this,this.style)}},{key:"isActive",value:function(){return!!this.active}},{key:"setActiveStyle",value:function(t){Zv(t_,this,t)}},{key:"activeStyle",get:function(){return Hv(t_,this)}},{key:"setSourceStyle",value:function(t){this.style=t}},{key:"destroy",value:function(){return!!Hv($v,this)&&(Hv($v,this).removeFeature(this.layer),!0)}}],e&&Wv(t.prototype,e),n&&Wv(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function i_(t){return t.path?(t.borderWidth||(t.borderWidth=3),t.strokeColor||(t.strokeColor="#3366ff66"),t.fillColor||(t.fillColor="#1199ffaa"),t):(console.error("path is error."),!1)}function o_(t){var e,n,r,i;e instanceof Vf?e=t:(null!=t&&t.borderWidth||null!=t&&t.strokeColor||null!=t&&t.fillColor||(e=this.style),e=new Vf({stroke:new Df({width:null!==(n=t.borderWidth)&&void 0!==n?n:2,color:null!==(r=t.strokeColor)&&void 0!==r?r:"#3366ff66"}),fill:new Nf({color:null!==(i=t.fillColor)&&void 0!==i?i:"#1199ffaa"})}));Array.isArray(Hv(Jv,this))?Hv(Jv,this).forEach(function(e){e.setStyle(t)}):Hv(Jv,this).setStyle(t)}function s_(t){return s_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s_(t)}function a_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u_(r.key),r)}}function u_(t){var e=function(t,e){if("object"!=s_(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=s_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==s_(e)?e:e+""}function l_(t,e,n){c_(t,e),e.set(t,n)}function c_(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h_(t,e){return t.get(p_(t,e))}function f_(t,e,n){return t.set(p_(t,e),n),n}function p_(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var d_={},g_=new WeakMap,y_=new WeakMap,v_=new WeakMap,__=new WeakMap,m_=new WeakSet,x_=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),c_(n=this,r=m_),r.add(n),l_(this,g_,void 0),l_(this,y_,void 0),l_(this,v_,void 0),l_(this,__,void 0),this.init(p_(m_,this,b_).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;f_(v_,this,Rv()),f_(g_,this,new Na({type:"polyline",geometry:new rg(t.path),name:h_(v_,this)}));var e=[];if(t.borderWidth&&e.push(new Vf({stroke:new Df({width:2*parseFloat(t.borderWidth)+parseFloat(t.width),color:t.borderColor})})),e.push(new Vf({stroke:new Df({width:t.width,color:t.color})})),this.style=e,h_(g_,this).setStyle(e),t.group)if(this.group=t.group,d_[t.group])this.layer=d_[t.group],this.layer.addFeature(h_(g_,this));else{var n=new pv([h_(g_,this)]);d_[t.group]=n,this.layer=n}else this.layer=new pv([h_(g_,this)]);t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return h_(g_,this)}},{key:"getPath",value:function(){return this.layer.getSource().getFeatures()[0].getGeometry().getCoordinates()}},{key:"isVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){h_(y_,this)&&h_(y_,this).removeFeature(this.layer),t?(t.addFeature(this.layer),f_(y_,this,t),f_(__,this,new Mv(this,h_(y_,this).map))):h_(y_,this)&&h_(y_,this).removeFeature(this.layer)}},{key:"map",get:function(){return h_(y_,this)}},{key:"eventList",get:function(){return h_(__,this).eventList}},{key:"on",value:function(t,e){return h_(__,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return h_(__,this).off(t,e,Fv)}},{key:"openEdit",value:function(){h_(y_,this).editGeom(this)}},{key:"closeEdit",value:function(){return!!h_(y_,this).getEditGeom(this)&&h_(y_,this).closeEditGeom(this)}},{key:"destroy",value:function(){return!!h_(y_,this)&&(h_(y_,this).removeFeature(this.layer),!0)}}],e&&a_(t.prototype,e),n&&a_(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function b_(t){var e,n,r,i;return t.path?(t.borderWidth=null!==(e=t.borderWidth)&&void 0!==e?e:1,t.borderColor=null!==(n=t.borderColor)&&void 0!==n?n:"#fff",t.width=null!==(r=t.width)&&void 0!==r?r:3,t.color=null!==(i=t.color)&&void 0!==i?i:"#1199ff",t):(console.error("path is error."),!1)}var w_=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Qo(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Nf({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:fp,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getJustify=function(){return this.justify_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Qo(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setJustify=function(t){this.justify_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),E_=w_,C_=n(2543),S_=n.n(C_);function P_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function I_(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?P_(Object(n),!0).forEach(function(e){L_(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P_(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function M_(t){return M_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M_(t)}function O_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,R_(r.key),r)}}function L_(t,e,n){return(e=R_(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R_(t){var e=function(t,e){if("object"!=M_(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=M_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==M_(e)?e:e+""}function k_(t,e,n){T_(t,e),e.set(t,n)}function T_(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function N_(t,e){return t.get(D_(t,e))}function A_(t,e,n){return t.set(D_(t,e),n),n}function D_(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var F_={font:'14px "Fira Sans", sans-serif',textAlign:"center",justify:void 0,textBaseline:"middle",fill:"#333",stroke:"#0000",borderWidth:0,backgroundFill:void 0,backgroundStroke:void 0,backgroundBorder:void 0,padding:void 0,rotation:void 0,draggable:!1,fitZoom:14,scaleFactor:void 0},j_={},G_=new WeakMap,B_=new WeakMap,z_=new WeakMap,V_=new WeakMap,U_=new WeakMap,W_=new WeakMap,X_=new WeakMap,q_=new WeakMap,Y_=new WeakSet,H_=function(){return t=function t(e){var n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),T_(n=this,r=Y_),r.add(n),k_(this,G_,void 0),k_(this,B_,void 0),k_(this,z_,void 0),k_(this,V_,14),k_(this,U_,""),k_(this,W_,void 0),k_(this,X_,void 0),k_(this,q_,void 0),L_(this,"draggable",!1),L_(this,"modify",void 0),L_(this,"scaleFactorCallback",function(){var t=N_(B_,i).getZoom();if("function"!==M_(N_(W_,i)).toLocaleLowerCase()){var e=t-i.getFitZoom(),n=Math.pow(N_(W_,i),Math.abs(e)),r=document.createElement("div");r.style.font=N_(U_,i),r.style.fontSize=r.style.fontSize.replace(/\d+/,function(t){return e>0?Math.round(parseFloat(t)/n).toString():Math.round(parseFloat(t)*n).toString()});var o="".concat(r.style.fontSize," ").concat(r.style.fontFamily);i.style.getText().setFont(o),N_(G_,i).changed()}else N_(W_,i).call(i,t)}),this.init(D_(Y_,this,Z_).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;A_(z_,this,Rv()),A_(G_,this,new Na({geometry:new Io(t.position),name:N_(z_,this)})),t.offset||(t.offset=[0,0]);var e={text:t.content,font:"".concat(t.fontSize," ").concat(t.fontFamily||"sans-serif"),offsetX:t.offset[0],offsetY:t.offset[1],textAlign:t.textAlign,justify:t.justify,textBaseline:t.textBaseline,fill:new Nf({color:t.fill}),stroke:new Df({color:t.stroke,width:t.borderWidth}),padding:t.padding,placement:"point",rotation:t.rotation},n=new Vf({text:new E_(e)});if(this.style=n,N_(G_,this).setStyle(n),t.group)if(this.group=t.group,j_[t.group])this.layer=j_[t.group],this.layer.addFeature(N_(G_,this));else{var r=new pv({features:[N_(G_,this)],zIndex:(t.zIndex||0)+1e4});j_[t.group]=r,this.layer=r}else this.layer=new pv({features:[N_(G_,this)],zIndex:(t.zIndex||0)+1e4});t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable),t.scaleFactor&&(A_(W_,this,t.scaleFactor),A_(V_,this,t.fitZoom||14),A_(U_,this,"".concat(t.fontSize||14," ").concat(t.fontFamily||"sans-serif")),this.setScaleFactor(t.scaleFactor),this.scaleFactorCallback())}},{key:"feature",get:function(){return N_(G_,this)}},{key:"getFitZoom",value:function(){return N_(V_,this)}},{key:"getScaleFactor",value:function(){return N_(W_,this)}},{key:"getVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){N_(B_,this)&&(N_(B_,this).removeFeature(this.layer),this.getScaleFactor()&&N_(B_,this).map.getView().un("change:resolution",this.scaleFactorCallback)),t?(t.addFeature(this.layer),A_(B_,this,t),A_(q_,this,new Mv(this,N_(B_,this).map)),this.getScaleFactor()&&N_(B_,this).map.getView().on("change:resolution",this.scaleFactorCallback)):N_(B_,this)&&N_(B_,this).removeFeature(this.layer)}},{key:"map",get:function(){return N_(B_,this)}},{key:"setPosition",value:function(t){N_(G_,this).getGeometry().setCoordinates(t)}},{key:"position",get:function(){return N_(G_,this).getGeometry().getCoordinates()}},{key:"setText",value:function(t){N_(G_,this).getStyle().getText().setText(t),N_(G_,this).changed()}},{key:"setRotation",value:function(t){N_(G_,this).getStyle().getText().setRotation(t),N_(G_,this).changed()}},{key:"eventList",get:function(){return N_(q_,this).eventList}},{key:"on",value:function(t,e){return N_(q_,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return N_(q_,this).off(t,e,Fv)}},{key:"setDraggable",value:function(t){if(this.draggable=t,t)this.modify||(this.modify=new Wd({hitDetection:this.layer,source:this.layer.getSource()})),N_(B_,this).map.addInteraction(this.modify);else{if(!this.modify)return;N_(B_,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"setScaleFactor",value:function(t){console.log("开启跟随缩放"),N_(X_,this)?(N_(B_,this).map.getView().un("change:resolution",N_(X_,this)),A_(X_,this,void 0)):A_(X_,this,S_().throttle(this.scaleFactorCallback,600)),t?N_(B_,this)&&N_(B_,this).map.getView().on("change:resolution",N_(X_,this)):N_(X_,this)&&(N_(B_,this).map.getView().un("change:resolution",N_(X_,this)),A_(X_,this,void 0))}},{key:"destroy",value:function(){return!!N_(B_,this)&&(N_(B_,this).removeFeature(this.layer),!0)}}],e&&O_(t.prototype,e),n&&O_(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Z_(t){return t.position?t.content?(t.rotation||(t.rotation=0),I_(I_({},F_),t)):(console.error("content is error."),!1):(console.error("position is error."),!1)}function K_(t){return function(t){if(Array.isArray(t))return J_(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return J_(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J_(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J_(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function $_(t){return $_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$_(t)}function Q_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function tm(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Q_(Object(n),!0).forEach(function(e){nm(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Q_(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function em(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rm(r.key),r)}}function nm(t,e,n){return(e=rm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rm(t){var e=function(t,e){if("object"!=$_(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=$_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$_(e)?e:e+""}function im(t,e,n){om(t,e),e.set(t,n)}function om(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sm(t,e){return t.get(um(t,e))}function am(t,e,n){return t.set(um(t,e),n),n}function um(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var lm=[new Vf({fill:new Nf({color:[255,255,255,.5]})}),new Vf({stroke:new Df({color:[255,255,255,1],width:5})}),new Vf({stroke:new Df({color:[0,153,255,1],width:3})})],cm=new WeakMap,hm=new WeakMap,fm=new WeakMap,pm=new WeakMap,dm=new WeakMap,gm=new WeakMap,ym=new WeakMap,vm=new WeakMap,_m=new WeakMap,mm=new WeakMap,xm=new WeakSet,bm=function(){return t=function t(e){var n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),om(n=this,r=xm),r.add(n),im(this,cm,{}),im(this,hm,void 0),im(this,fm,void 0),im(this,pm,void 0),im(this,dm,void 0),im(this,gm,new Map),im(this,ym,void 0),im(this,vm,void 0),im(this,_m,new WeakMap),im(this,mm,0),nm(this,"_instance",void 0),nm(this,"isShowLength",!1),nm(this,"drawStartCB",function(t){t.feature.getGeometry().on("change",function(t){if(!i.isShowLength)return!1;var e=t.target,n=[];e.getCoordinates()[0].reduce(function(t,e){if(!t)return e;var r=[(t[0]+e[0])/2,(t[1]+e[1])/2],i=bu(Ba([t,e]));i=i<1?Math.round(1e3*i*100)/100+" m":Math.round(100*i)/100+" km";var o=Math.atan2(t[0]-e[0],t[1]-e[1])+Math.PI/2;return n.push({position:r,content:i,rotation:o}),e},!1),n.forEach(function(t,e){var n=sm(ym,i).textList[e];n?(n.setRotation(t.rotation),n.setText(t.content),n.setPosition(t.position)):(n=new H_(tm(tm({},t),{},{textBaseline:"bottom",fill:"#ffffff",stroke:"#2b2b2b",borderWidth:4,padding:[2,2,2,2],fontSize:"16px",map:i})),sm(ym,i).textList[e]=n)})})}),nm(this,"measureTooltipElement",void 0),nm(this,"measureTooltip",void 0),nm(this,"measureTooltipList",[]),nm(this,"count",0),nm(this,"measureSingleclickCB",function(t){i.measureTooltip.setPosition(t.coordinate),0===i.count&&(i.measureTooltipElement.innerHTML="");var e=new Io(t.coordinate);return i.gageLengthLayer.getSource().addFeature(new Na(e)),i.measureTooltipElement.className="measure tooltip tooltip-static",um(xm,i,Sm).call(i),i.count++,!0}),nm(this,"gageLengthLayer",void 0),nm(this,"isMeasure",!1),e.undoCB&&(this.undoCB=e.undoCB),e.undoDrawCB&&(this.undoDrawCB=e.undoDrawCB);try{if(e._instance&&e._instance.map)return this._instance=e._instance,am(hm,this,e._instance.map._instance._map),this}catch(n){console.error("instance error in options")}this.baseOptions=e,am(cm,this,um(xm,this,Cm).call(this,e)),this.init(sm(cm,this)),am(pm,this,new Mv(this,sm(hm,this)))},e=[{key:"init",value:function(t){var e=this;t.zoom=2,console.log("init map",t),am(hm,this,new Ra(tm({interactions:Ma({shiftDragZoom:!1}).extend([new Xs({condition:Ds})])},t))),this._instance=sm(hm,this),setTimeout(function(){console.log("Map zoom:",e.getZoom())},2220)}},{key:"getZoom",value:function(){return sm(hm,this).getView().getZoom()}},{key:"getRotation",value:function(){return sm(hm,this).getView().getRotation()}},{key:"map",get:function(){return sm(hm,this)}},{key:"addFeature",value:function(t){if(sm(hm,this).getAllLayers().indexOf(t)>=0)return!1;sm(hm,this).addLayer(t)}},{key:"removeFeature",value:function(t){sm(hm,this).removeLayer(t)}},{key:"addMarker",value:function(t){if(!t)return!1;t.setMap(this)}},{key:"addTileLayer",value:function(t){if(!t)return!1;t.setMap(this)}},{key:"addOverlay",value:function(t){if(!t)return!1;sm(hm,this).addOverlay(t)}},{key:"removeOverlay",value:function(t){sm(hm,this).removeOverlay(t)}},{key:"addInfoWindow",value:function(t){if(!t||!t.setMap)return!1;t.setMap(this)}},{key:"addControl",value:function(t){if(!t||!t.setMap)return!1;t.setMap(this)}},{key:"eventList",get:function(){return sm(pm,this).eventList}},{key:"on",value:function(t,e){if("drawend"!==t)return sm(pm,this).on(t,e,bv);am(vm,this,e)}},{key:"off",value:function(t,e){return sm(pm,this).off(t,e,bv)}},{key:"editGeom",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(sm(gm,this).get(t))return sm(gm,this).get(t);sm(_m,this).set(t,[]),this.undoCB&&this.undoCB(sm(_m,this).get(t).length,t);var o={source:t.layer.getSource(),condition:i};n&&(o.style=n),am(dm,this,{geom:t,sourceStyle:t.style,modify:new Wd(o),snap:new Zd({source:t.layer.getSource()})}),sm(gm,this).set(t,sm(dm,this)),this.modify=sm(dm,this).modify,this.modify.on("modifystart",function(e){i(e);var n=e.features.item(0),o=new Na;o.setGeometry(n.getGeometry().clone()),o.setGeometryName(n.getGeometryName()),o.setStyle(n.getStyle()),o.ol_uid=n.ol_uid;var s=sm(_m,r).get(t);s.push(o),sm(_m,r).set(t,s),r.undoCB&&r.undoCB(sm(_m,r).get(t).length,t)}),this.modify.on("modifyend",function(t){i(t)}),this.snap=sm(dm,this).snap,this.snap.on("change:active",function(t){console.log("change:active",t)}),sm(hm,this).addInteraction(sm(dm,this).modify),sm(hm,this).addInteraction(sm(dm,this).snap),Array.isArray(t.feature)?t.feature.forEach(function(t){e?t.setStyle(e):t.setStyle(lm)}):e?t.feature.setStyle(e):t.feature.setStyle(lm)}},{key:"getEditGeom",value:function(t){return sm(gm,this).get(t)}},{key:"getAllEditGeom",value:function(){return sm(gm,this)}},{key:"getUndoStack",value:function(){return sm(_m,this)}},{key:"getUndoCountForGeom",value:function(t){return t?sm(_m,this).get(t).length:0}},{key:"undoEditForGeom",value:function(t){var e=sm(_m,this).get(t).pop();this.undoCB&&this.undoCB(sm(_m,this).get(t).length,t),console.log(e.ol_uid);var n=t.layer.getSource(),r=n.getFeatureByUid(e.ol_uid);n.removeFeature(r),n.addFeature(e)}},{key:"deletePointForGeom",value:function(t){if(!t)return!1;sm(gm,this).get(t).modify.removePoint()}},{key:"closeEditGeom",value:function(t){var e=sm(gm,this).get(t);return e&&(sm(gm,this).delete(t),sm(_m,this).delete(t),this.undoCB&&this.undoCB(0,t),this.closeEdit(e)),null==e?void 0:e.geom}},{key:"closeAllEditGeom",value:function(){var t=this;sm(gm,this).forEach(function(e){t.closeEdit(e)}),sm(gm,this).clear()}},{key:"closeEdit",value:function(t){sm(hm,this).removeInteraction(t.modify),sm(hm,this).removeInteraction(t.snap);var e=t.geom.layer.getSource().getFeatures();Array.isArray(e)?e.forEach(function(e){e.setStyle(t.sourceStyle)}):e.setStyle(t.sourceStyle)}},{key:"startDraw",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},r=arguments.length>3?arguments[3]:void 0;if(sm(ym,this))return!1;var i=this;"function"===$_(e).toLocaleLowerCase()&&am(vm,this,e);var o={polygon:"Polygon",polyline:"LineString",smartPolygon:"Polygon",riskArea:"Polygon"},s=new pv([]),a=s.getSource(),u={type:o[t],source:a,snapTolerance:1,condition:function(t){var e;return am(mm,i,(e=sm(mm,i),++e)),i.undoDrawCB&&i.undoDrawCB(sm(mm,i)),n(t)}};r&&(u.style=r);var l=new Eg(u),c=new Zd({source:a});return am(ym,this,{vectorLayer:s,draw:l,snap:c,type:t,textList:[]}),sm(hm,this).addLayer(s),sm(hm,this).addInteraction(l),sm(hm,this).addInteraction(c),sm(hm,this).getTargetElement().style.cursor="crosshair","Polygon"===o[t]&&l.on("drawstart",this.drawStartCB),l.once("drawend",function(e){i.stopDraw(e.feature.getGeometry().getCoordinates()),"Polygon"===o[t]&&l.un("drawstart",i.drawStartCB)}),s}},{key:"hideLength",value:function(){var t;this.isShowLength=!1,(null===(t=sm(ym,this))||void 0===t?void 0:t.textList.length)>0&&sm(ym,this).textList.forEach(function(t){return t.destroy()})}},{key:"showLength",value:function(){this.isShowLength=!0}},{key:"undoDraw",value:function(){var t;sm(ym,this)&&(sm(ym,this).draw.removeLastPoint(),am(mm,this,(t=sm(mm,this),--t)),this.undoDrawCB&&this.undoDrawCB(sm(mm,this)))}},{key:"drawGeom",get:function(){return sm(ym,this)}},{key:"endDraw",value:function(){sm(ym,this)&&sm(ym,this).draw.finishDrawing()}},{key:"cancelDraw",value:function(){if(sm(ym,this)){sm(ym,this).draw.abortDrawing(),sm(hm,this).getTargetElement().style.cursor="auto";var t=sm(ym,this),e=t.vectorLayer,n=t.draw,r=t.snap;sm(ym,this).textList.length>0&&(sm(ym,this).textList.forEach(function(t){return t.destroy()}),sm(ym,this).textList=[]),am(ym,this,void 0);var i=this;setTimeout(function(){sm(hm,i).removeLayer(e),sm(hm,i).removeInteraction(n),sm(hm,i).removeInteraction(r)},0)}}},{key:"stopDraw",value:function(t){if(!sm(ym,this))return!1;sm(hm,this).getTargetElement().style.cursor="auto";var e,n,r=sm(ym,this),i=r.vectorLayer,o=r.draw,s=r.snap,a=r.type;if(sm(ym,this).textList.length>0&&sm(ym,this).textList.forEach(function(t){return t.destroy()}),am(ym,this,void 0),t)switch(a){case"polygon":n=new r_({path:t[0],map:this}),e={path:t[0],geom:n};break;case"polyline":e={path:t,geom:n=new x_({path:t,map:this})};break;case"riskArea":case"smartPolygon":e={path:t,geom:n=new r_({path:t,map:this,borderWidth:1,strokeColor:"#ffffff",fillColor:"#ffffff80"})};break;default:console.error("type is error.")}var u=this;setTimeout(function(){sm(hm,u).removeLayer(i),sm(hm,u).removeInteraction(o),sm(hm,u).removeInteraction(s)},0),"function"===$_(sm(vm,this)).toLocaleLowerCase()&&sm(vm,this).call(this,e)}},{key:"updateSize",value:function(){sm(hm,this).updateSize()}},{key:"setFitView",value:function(t,e){var n,r,i;Array.isArray(t)?t.forEach(function(t){var e;try{e=t.feature.getGeometry().getExtent()}catch(t){return}i||(i=e.map(function(t){return t})),i=Q(i,e)}):i=t.feature.getGeometry().getExtent();var o={padding:null!==(n=e.avoid)&&void 0!==n?n:[0,0,0,0],duration:null!==(r=e.duration)&&void 0!==r?r:.3};sm(fm,this).fit(i,o)}},{key:"setFitForGeom",value:function(t,e){var n,r,i={padding:null!==(n=e.avoid)&&void 0!==n?n:[0,0,0,0],duration:null!==(r=e.duration)&&void 0!==r?r:.3};sm(fm,this).fit(t,i)}},{key:"openMeasure",value:function(t){if(this.isMeasure)return console.error("Measurement is currently turned on."),!1;if(this.isMeasure=!0,"length"!==(t=null!=t?t:"length")&&"area"!==t)return!1;this.measureType=t,this.gageLengthLayer=new pv([]),sm(hm,this).addLayer(this.gageLengthLayer);var e=new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#fff",width:2}),image:new kf({fill:new Nf({color:"#e59810"}),stroke:new Df({color:"#ffffff",width:1}),radius:5})});this.gageLengthLayer.setStyle(e),this.gageLengthLayer.setZIndex(1e4);var n=this.gageLengthLayer.getSource(),r={type:"length"===t?"LineString":"Polygon",source:n,freehandCondition:function(){return!1},style:new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#fff",width:2}),image:new kf({fill:new Nf({color:"#e59810"}),stroke:new Df({color:"#ffffff",width:1}),radius:5})})};r.finishCondition="length"===t?function(){return!1}:function(t){var e,n=t.coordinate,r=null===(e=o.measureDraw)||void 0===e?void 0:e.sketchLineCoords_;if(r){var i=r.at(-3);if(i&&i[0]===n[0]&&i[1]===n[1])return!1}return!0};var i=new Eg(r);this.measureDraw=i,sm(hm,this).addInteraction(i),um(xm,this,Sm).call(this);var o=this;this.count=0,i.on("drawabort",function(t){console.log("drawabort",t)}),i.on("drawstart",function(e){o.sketch=e.feature;var r=e.coordinate;o.listener=o.sketch.getGeometry().on("change",function(e){var n,i=e.target;if("length"===t){var s=bu(Ba(i.getCoordinates()));n=s<1?Math.round(1e3*s*100)/100+" m":Math.round(100*s)/100+" km",r=i.getLastCoordinate()}else{var a=i.getCoordinates()[0],u=bu(Ba(a.slice(0,-1)));n=u<1?Math.round(1e3*u*100)/100+" m":Math.round(100*u)/100+" km";var l=kv(i.getCoordinates()[0])/2e3*3;o.measureCentroidText=l>1e4?Math.round(l/1e4*100)/100+" 万亩":Math.round(100*l)/100+" 亩",o.measureCentroid=i.getInteriorPoint().getCoordinates(),r=a.slice(-2)[0]}o.measureTooltipElement.innerHTML=n,o.measureTooltip.setPosition(r)}),"length"!==t?(sm(hm,o).on("click",o.measureSingleclickCB),sm(hm,o).once("dblclick",function(t){var e=new Io(t.coordinate);n.addFeature(new Na(e))})):(sm(hm,o).on("click",o.measureSingleclickCB),sm(hm,o).once("dblclick",function(t){i.finishDrawing()}))},this),i.on("drawend",function(t){if(console.log("drawend"),"length"===o.measureType)return!1;"area"===o.measureType&&(um(xm,o,Sm).call(o),o.measureTooltipElement.innerHTML=o.measureCentroidText,o.measureTooltip.setPosition(o.measureCentroid)),o.measureTooltipElement.className="measure tooltip tooltip-static",o.sketch=null,o.measureTooltipElement=null,o.count=0,ge(o.listener),sm(hm,o).un("click",o.measureSingleclickCB),um(xm,o,Sm).call(o)},this)}},{key:"closeMeasure",value:function(){var t,e=this;this.isMeasure=!1,null===(t=this.gageLengthLayer)||void 0===t||t.getSource().clear(),sm(hm,this).removeLayer(this.gageLengthLayer),this.measureTooltipList.forEach(function(t){sm(hm,e).removeOverlay(t)}),this.measureTooltipList=[],sm(hm,this).removeInteraction(this.measureDraw),sm(hm,this).un("singleclick",this.measureSingleclickCB),sm(hm,this).un("dbclick",this.measureSingleclickCB),sm(hm,this).un("click",this.measureSingleclickCB)}},{key:"destroy",value:function(){try{var t=document.querySelector("#".concat(sm(cm,this).target)),e=t.cloneNode(),n=t.parentNode,r=document.createElement("div");n.insertBefore(r,t),n.removeChild(t),r.parentNode.insertBefore(e,r),n.removeChild(r)}catch(t){console.error("target error in options.")}am(hm,this,null),this._instance=null}}],e&&em(t.prototype,e),n&&em(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function wm(){return{target:"mapbox",zoom:15,zooms:[1,18],center:[116.4,39.9],layers:um(xm,this,Em).call(this)}}function Em(){var t,e,n,r;this.baseOptions.zooms?n=this.baseOptions.zooms[1]:n=null!==(r=this.baseOptions.maxZoom)&&void 0!==r?r:18;return[new ey({name:"default_DT",zIndex:100,source:new Ny({minZoom:1,maxZoom:null!==(t=this.baseOptions.tileMax)&&void 0!==t?t:n,crossOrigin:"anonymous",url:"https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"})}),new ey({name:"default_BZ",zIndex:100,source:new Ny({minZoom:1,maxZoom:null!==(e=this.baseOptions.tileMax)&&void 0!==e?e:n,crossOrigin:"anonymous",url:"https://webst04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"})})]}function Cm(){var t,e,n,r,i,o,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=um(xm,this,wm).call(this);s.target&&(a.target=s.target),s.layerConfig&&0!==s.layerConfig.layers.length&&(s.layerConfig.default||(a.layers=[]),a.layers=[].concat(K_(a.layers),K_(s.layerConfig.layers))),this.layers=a.layers,a.controls=vs({attribution:null!==(t=null===(e=s.controls)||void 0===e?void 0:e.attribution)&&void 0!==t&&t,zoom:null!==(n=null===(r=s.controls)||void 0===r?void 0:r.zoom)&&void 0!==n&&n,rotate:null!==(i=null===(o=s.controls)||void 0===o?void 0:o.rotate)&&void 0!==i&&i});var u=tm({},gv);s.initViewConfig&&(u=tm(tm({},gv),s.initViewConfig)),s.zoom&&(u.zoom=s.zoom),Array.isArray(s.zooms)&&2===s.zooms.length&&(u.minZoom=s.zooms[0],u.maxZoom=s.zooms[1]),s.center&&(u.center=s.center);var l=new Jo(u);return am(fm,this,l),a.view=l,a}function Sm(){this.measureTooltipElement=document.createElement("div"),this.measureTooltipElement.className="measure tooltip tooltip-measure",this.measureTooltip&&this.measureTooltipList.push(this.measureTooltip),this.measureTooltip=new Vy({element:this.measureTooltipElement,offset:[0,-15],positioning:"bottom-center"}),sm(hm,this).addOverlay(this.measureTooltip)}function Pm(t){return Pm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pm(t)}function Im(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Om(r.key),r)}}function Mm(t,e,n){return(e=Om(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Om(t){var e=function(t,e){if("object"!=Pm(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Pm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Pm(e)?e:e+""}function Lm(t,e,n){Rm(t,e),e.set(t,n)}function Rm(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function km(t,e){return t.get(Nm(t,e))}function Tm(t,e,n){return t.set(Nm(t,e),n),n}function Nm(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Am={},Dm=new WeakMap,Fm=new WeakMap,jm=new WeakMap,Gm=new WeakMap,Bm=new WeakMap,zm=new WeakSet,Vm=new WeakMap,Um=new WeakMap,Wm=function(){return t=function t(e){var n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Rm(n=this,r=zm),r.add(n),Lm(this,Dm,void 0),Lm(this,Fm,void 0),Lm(this,jm,void 0),Lm(this,Gm,void 0),Lm(this,Bm,0),Mm(this,"draggable",!1),Mm(this,"modify",void 0),Lm(this,Vm,!1),Lm(this,Um,function(t){km(Vm,i)&&(i.moveBasePosition=i.startPosition,Tm(Vm,i,!1),Tm(Bm,i,0));var e=t.frameState.time,n=e-i.moveBaseTime;i.moveBaseTime=e;var r=parseFloat(i.moveMultiply||1);if(Tm(Bm,i,km(Bm,i)+i.moveSpeed*n/6e4*r),km(Bm,i)>i.moveLength)return i.pauseMove(),Tm(Vm,i,!0),i.moveFinishCB&&i.moveFinishCB(),!0;var o,s=km(Bm,i)/i.moveLength%2;if(i.ratio=s,i.movePathList){var a,u=null!==(a=i.movePathList.findIndex(function(t){return s>t[0]&&s<=t[1]}))&&void 0!==a?a:i.movePathList.length-1;-1===u&&(u=0);var l=i.movePathList[u],c=(s-l[0])/(l[1]-l[0]);o=i.movePath.getLineString(u).getCoordinateAt(c>1?2-c:c)}else o=i.movePath.getCoordinateAt(s>1?2-s:s);if(i.setPosition(o),i.options.autoRotation){var h=o[0]-i.moveBasePosition[0],f=o[1]-i.moveBasePosition[1],p=-Math.atan2(f,h);km(Dm,i).getStyle().getImage().setRotation(i.options.rotation+p)}i.moveBasePosition=o,i.movePlayingCB&&i.movePlayingCB(s)}),this.options=e,this.init(Nm(zm,this,Xm).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;var e;if(Tm(jm,this,Rv()),Tm(Dm,this,new Na({geometry:new Io(t.position),name:km(jm,this)})),t.src)t.activeSrc||(t.activeSrc=t.src),e=new Vf({image:new cd({anchor:t.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:t.src,offset:t.offset,rotation:t.rotation,scale:t.scale})});else{var n,r,i,o=new Nf({color:null!==(n=t.color)&&void 0!==n?n:"rgba(37, 165, 247,0.6)"}),s=new Df({color:null!==(r=t.borderColor)&&void 0!==r?r:"#ffeeff",width:null!==(i=t.borderWidth)&&void 0!==i?i:2});e=new Vf({image:new kf({fill:o,stroke:s,radius:5})})}if(t.text){var a=t.fontSize,u=void 0===a?14:a,l=t.scale,c=void 0===l?1:l;u*=c;var h={text:t.text,font:"".concat(u,"px ").concat(t.fontFamily||"sans-serif"),textAlign:"center",textBaseline:"top",offsetY:-62*c,fill:new Nf({color:"#fff"}),placement:"point"};e.setText(new E_(h))}if(this.style=e,this.options=t,km(Dm,this).setStyle(e),t.group)if(this.group=t.group,Am[t.group])this.layer=Am[t.group],this.layer.addFeature(km(Dm,this));else{var f=new pv({features:[km(Dm,this)],zIndex:(t.zIndex||0)+1e4});Am[t.group]=f,this.layer=f}else this.layer=new pv({features:[km(Dm,this)],zIndex:(t.zIndex||0)+1e4});t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable)}},{key:"feature",get:function(){return km(Dm,this)}},{key:"setGroup",value:function(t){if(!t)return!1;this.group&&Am[this.group].removeFeature(km(Dm,this)),Am[t]?(this.layer.removeFeature(km(Dm,this)),this.layer=Am[t],Am[t].addFeature(km(Dm,this))):Am[t]=this.layer}},{key:"getGroup",value:function(){return this.group}},{key:"getVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setScale",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(e=parseFloat(e),isNaN(e))return!1;null===(t=this.style.getImage())||void 0===t||t.setScale(e),km(Dm,this).changed()}},{key:"setTextFontSize",value:function(t){var e,n,r,i,o,s,a="".concat(t,"px ").concat(this.options.fontFamily||"sans-serif");switch(null===(e=this.style.getText())||void 0===e||e.setFont(a),t){case 14:null===(n=this.style.getText())||void 0===n||n.setOffsetY(-25);break;case 12:null===(r=this.style.getText())||void 0===r||r.setOffsetY(-22);break;case 9:null===(i=this.style.getText())||void 0===i||i.setOffsetY(-18);break;case 7:null===(o=this.style.getText())||void 0===o||o.setOffsetY(-14);break;default:null===(s=this.style.getText())||void 0===s||s.setOffsetY(-25)}}},{key:"setMap",value:function(t){km(Fm,this)&&km(Fm,this).removeFeature(this.layer),t?(t.addFeature(this.layer),Tm(Fm,this,t),Tm(Gm,this,new Mv(this,km(Fm,this).map))):km(Fm,this)&&km(Fm,this).removeFeature(this.layer)}},{key:"map",get:function(){return km(Fm,this)}},{key:"setPosition",value:function(t){km(Dm,this).getGeometry().setCoordinates(t),km(Dm,this).changed()}},{key:"position",get:function(){return km(Dm,this).getGeometry().getCoordinates()}},{key:"moveAlong",value:function(t){var e,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;if(!this.map)return!1;if(this.startPosition=t[0],this.moveBaseTime=Date.now(),this.moveBasePosition=this.startPosition,Array.isArray(t[0][0])){this.movePath=new sg(t),e=Va(t);var s=0;this.moveLength=bu(e,{units:"kilometers"}),this.movePathList=t.map(function(t){var e=bu(Ba(t),{units:"kilometers"}),r=s,i=e/n.moveLength;return[r,s+=i]})}else this.movePath=new rg(t),e=Ba(t),this.moveLength=bu(e,{units:"kilometers"});this.moveSpeed=r,this.layer.on("postrender",km(Um,this)),this.map.map.render(),"function"===Pm(i).toLocaleLowerCase()&&(this.moveFinishCB=i),"function"===Pm(o).toLocaleLowerCase()&&(this.movePlayingCB=o)}},{key:"setMoveRatio",value:function(t){if(this.ratio=t,Tm(Bm,this,this.moveLength*t),km(Bm,this)>this.moveLength)return this.pauseMove(),Tm(Vm,this,!0),this.moveFinishCB&&this.moveFinishCB(),!0;var e;if(this.movePathList){var n,r=null!==(n=this.movePathList.findIndex(function(e){return t>e[0]&&t<=e[1]}))&&void 0!==n?n:this.movePathList.length-1;-1===r&&(r=0);var i=this.movePathList[r],o=(t-i[0])/(i[1]-i[0]);e=this.movePath.getLineString(r).getCoordinateAt(o>1?2-o:o)}else e=this.movePath.getCoordinateAt(t>1?2-t:t);this.setPosition(e)}},{key:"setMoveMultiply",value:function(t){isNaN(parseFloat(t))&&(t=1),this.moveMultiply=t}},{key:"getMoveMultiply",value:function(){var t;return null!==(t=this.moveMultiply)&&void 0!==t?t:1}},{key:"pauseMove",value:function(){this.layer.un("postrender",km(Um,this))}},{key:"resumeMove",value:function(){this.map&&(this.moveBaseTime=Date.now(),this.layer.on("postrender",km(Um,this)),this.map.map.render())}},{key:"setSrc",value:function(t){var e;if(t)e=new Vf({image:new cd({anchor:this.options.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:t,offset:this.options.offset,rotation:this.options.rotation})});else{var n=new Nf({color:"rgba(37, 165, 247,0.6)"}),r=new Df({color:"#ffeeff",width:2});e=new Vf({image:new kf({fill:n,stroke:r,radius:5})})}this.style=e,km(Dm,this).setStyle(e)}},{key:"eventList",get:function(){return km(Gm,this).eventList}},{key:"on",value:function(t,e){if("dragstart"!==t){if("dragend"!==t)return km(Gm,this).featureOn(t,e,Fv);this.dragEndCallback=e}else this.dragStartCallback=e}},{key:"off",value:function(t,e){if("dragstart"!==t){if("dragend"!==t)return km(Gm,this).off(t,e,Fv);this.dragEndCallback=void 0}else this.dragStartCallback=void 0}},{key:"setDraggable",value:function(t){if(this.draggable=t,t){if(!this.modify){this.modify=new Wd({hitDetection:this.layer,source:this.layer.getSource()});var e=this;this.modify.on("modifystart",function(t){"function"===Pm(e.dragStartCallback).toLocaleLowerCase()&&e.dragStartCallback(t)}),this.modify.on("modifyend",function(t){"function"===Pm(e.dragEndCallback).toLocaleLowerCase()&&e.dragEndCallback(t)})}km(Fm,this).map.addInteraction(this.modify)}else{if(!this.modify)return;km(Fm,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"setActive",value:function(t){if(this.active=t,!this.options.activeSrc)return!1;t?this.setSrc(this.options.activeSrc):this.setSrc(this.options.src)}},{key:"isActive",value:function(){return!!this.active}},{key:"destroy",value:function(){return!!km(Fm,this)&&(km(Fm,this).removeFeature(this.layer),!0)}}],e&&Im(t.prototype,e),n&&Im(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Xm(t){var e;return t.position?(t.anchor||(t.anchor=[0,0]),t.offset||(t.offset=[0,0]),t.rotation||(t.rotation=0),t.scale=null!==(e=t.scale)&&void 0!==e?e:1,t):(console.error("position is error."),!1)}function qm(t){return qm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qm(t)}function Ym(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hm(r.key),r)}}function Hm(t){var e=function(t,e){if("object"!=qm(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=qm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==qm(e)?e:e+""}function Zm(t,e,n){Km(t,e),e.set(t,n)}function Km(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jm(t,e){return t.get(Qm(t,e))}function $m(t,e,n){return t.set(Qm(t,e),n),n}function Qm(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var tx=new WeakMap,ex=new WeakMap,nx=new WeakMap,rx=new WeakMap,ix=new WeakSet,ox=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Km(n=this,r=ix),r.add(n),Zm(this,tx,void 0),Zm(this,ex,void 0),Zm(this,nx,void 0),Zm(this,rx,void 0),this.init(Qm(ix,this,sx).call(this,e))},e=[{key:"init",value:function(t){if(console.log("options",t),!t)return!1;if(!t.dom)throw new Error("dom is error.");$m(nx,this,Rv());var e=t.dom;if("string"===qm(e).toLocaleLowerCase()&&(e=document.querySelector("#".concat(t.dom))),!(e instanceof Element))throw new Error("dom is error.");$m(tx,this,new Vy({position:t.position,element:e})),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return Jm(tx,this)}},{key:"setPosition",value:function(t){Jm(tx,this).setPosition(t)}},{key:"getPosition",value:function(){return Jm(tx,this).getPosition()}},{key:"isVisible",value:function(){return"none"!==this.feature.getElement().style.display}},{key:"show",value:function(){this.feature.getElement().style.display="block"}},{key:"hide",value:function(){this.feature.getElement().style.display="none"}},{key:"setMap",value:function(t){Jm(ex,this)&&Jm(ex,this).removeOverlay(Jm(tx,this)),t?(t.addOverlay(Jm(tx,this)),$m(ex,this,t),$m(rx,this,new Mv(this,Jm(ex,this).map))):Jm(ex,this)&&Jm(ex,this).removeOverlay(Jm(tx,this))}},{key:"map",get:function(){return Jm(ex,this)}},{key:"eventList",get:function(){return Jm(rx,this).eventList}},{key:"on",value:function(t,e){return Jm(rx,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return Jm(rx,this).off(t,e,Fv)}},{key:"destroy",value:function(){return!!Jm(ex,this)&&(Jm(ex,this).removeOverlay(Jm(tx,this)),!0)}}],e&&Ym(t.prototype,e),n&&Ym(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function sx(t){return t.position?(t.anchor||(t.anchor="bottom-center"),t.offset||(t.offset=[0,0]),t.fillColor||(t.fillColor="#1199ffaa"),t):(console.error("position is error."),!1)}function ax(t){return ax="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ax(t)}function ux(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function lx(t,e,n){return(e=hx(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hx(r.key),r)}}function hx(t){var e=function(t,e){if("object"!=ax(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=ax(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ax(e)?e:e+""}function fx(t,e,n){px(t,e),e.set(t,n)}function px(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dx(t,e){return t.get(yx(t,e))}function gx(t,e,n){return t.set(yx(t,e),n),n}function yx(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var vx={name:Rv(),minZoom:1,maxZoom:18,zIndex:101},_x=new WeakMap,mx=new WeakMap,xx=new WeakMap,bx=new WeakSet,wx=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),px(n=this,r=bx),r.add(n),fx(this,_x,void 0),fx(this,mx,void 0),fx(this,xx,void 0),gx(_x,this,yx(bx,this,Ex).call(this,e)),gx(mx,this,this.init(dx(_x,this))),dx(_x,this).map&&this.setMap(dx(_x,this).map)},e=[{key:"init",value:function(t){return!!t.tileUrl&&new ey({name:t.name,zIndex:t.zIndex,source:new Ny({minZoom:t.minZoom,maxZoom:t.maxZoom,url:t.tileUrl,crossOrigin:"anonymous"})})}},{key:"layer",get:function(){return dx(mx,this)}},{key:"getTileName",value:function(){return dx(_x,this).name}},{key:"setMap",value:function(t){dx(xx,this)&&dx(xx,this).removeFeature(dx(mx,this)),t?(t.addFeature(dx(mx,this)),gx(xx,this,t)):dx(xx,this)&&dx(xx,this).removeFeature(dx(mx,this))}}],e&&cx(t.prototype,e),n&&cx(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Ex(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ux(Object(n),!0).forEach(function(e){lx(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ux(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},vx);return t.zooms&&Array.isArray(t.zooms)&&(e.minZoom=t.zooms[0],e.maxZoom=t.zooms[1]),t.name&&(e.name=t.name),e.tileUrl=t.tileUrl,t.zIndex&&(e.zIndex=t.zIndex),e.map=t.map,e}var Cx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sx=function(t){function e(e,n,r,i,o){var s=this,a=void 0!==o?mf:bf;return(s=t.call(this,e,n,r,a)||this).loader_=void 0!==o?o:null,s.canvas_=i,s.error_=null,s}return Cx(e,t),e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=wf):this.state=bf,this.changed()},e.prototype.load=function(){this.state==mf&&(this.state=xf,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(nd),Px=Sx,Ix=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mx=function(t){function e(e,n,r,i,o,s,a){var u=this,l=e.getExtent(),c=n.getExtent(),h=c?ft(r,c):r,f=Ug(e,n,at(h),i),p=new Fg(e,n,h,l,.5*f,i),d=s(p.calculateSourceExtent(),f,o),g=d?mf:Ef,y=d?d.getPixelRatio():1;return(u=t.call(this,r,i,y,g)||this).targetProj_=n,u.maxSourceExtent_=l,u.triangulation_=p,u.targetResolution_=i,u.targetExtent_=r,u.sourceImage_=d,u.sourcePixelRatio_=y,u.interpolate_=a,u.canvas_=null,u.sourceListenerKey_=null,u}return Ix(e,t),e.prototype.disposeInternal=function(){this.state==xf&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==bf){var e=gt(this.targetExtent_)/this.targetResolution_,n=ht(this.targetExtent_)/this.targetResolution_;this.canvas_=Wg(e,n,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==mf){this.state=xf,this.changed();var t=this.sourceImage_.getState();t==bf||t==wf?this.reproject_():(this.sourceListenerKey_=ce(this.sourceImage_,Qt,function(t){var e=this.sourceImage_.getState();e!=bf&&e!=wf||(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){fe(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(nd),Ox=Mx,Lx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rx="imageloadstart",kx="imageloadend",Tx="imageloaderror",Nx=function(t){function e(e,n){var r=t.call(this,e)||this;return r.image=n,r}return Lx(e,t),e}(Wt),Ax=function(t){function e(e){var n=this,r=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(r=e.interpolate),(n=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state,interpolate:r})||this).on,n.once,n.un,n.resolutions_=void 0!==e.resolutions?e.resolutions:null,n.reprojectedImage_=null,n.reprojectedRevision_=0,n}return Lx(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=i(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,n,r){var i=this.getProjection();if(i&&r&&!yi(i,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&yi(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&$(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Ox(i,r,t,e,n,function(t,e,n){return this.getImageInternal(t,e,n,i)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(r=i),this.getImageInternal(t,e,n,r)},e.prototype.getImageInternal=function(t,e,n,r){return h()},e.prototype.handleImageChange=function(t){var e,n=t.target;switch(n.getState()){case xf:this.loading=!0,e=Rx;break;case bf:this.loading=!1,e=kx;break;case wf:this.loading=!1,e=Tx;break;default:return}this.hasListener(e)&&this.dispatchEvent(new Nx(e,n))},e}(Sd);var Dx=Ax,Fx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jx=function(t){function e(e){var n=this,r=e||{},i=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(i=r.interpolate),(n=t.call(this,{attributions:r.attributions,interpolate:i,projection:r.projection,resolutions:r.resolutions,state:r.state})||this).canvasFunction_=r.canvasFunction,n.canvas_=null,n.renderedRevision_=0,n.ratio_=void 0!==r.ratio?r.ratio:1.5,n}return Fx(e,t),e.prototype.getImageInternal=function(t,e,n,r){e=this.findNearestResolution(e);var i=this.canvas_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==n&&W(i.getExtent(),t))return i;_t(t=t.slice(),this.ratio_);var o=[gt(t)/e*n,ht(t)/e*n],s=this.canvasFunction_.call(this,t,e,n,o,r);return s&&(i=new Px(t,e,n,s)),this.canvas_=i,this.renderedRevision_=this.getRevision(),i},e}(Dx),Gx=jx,Bx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zx=function(t){function e(e){var n=e||{};return t.call(this,n)||this}return Bx(e,t),e}(ze),Vx=zx,Ux=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wx=function(t){function e(e){var n=t.call(this,e)||this;return n.image_=null,n}return Ux(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,r=t.viewState,i=r.resolution,o=this.getLayer().getSource(),s=t.viewHints,a=t.extent;if(void 0!==e.extent&&(a=ft(a,Oi(e.extent,r.projection))),!s[Ar]&&!s[Dr]&&!vt(a))if(o){var u=r.projection,l=o.getImage(a,i,n,u);l&&(this.loadImage(l)?this.image_=l:l.getState()===Ef&&(this.image_=null))}else this.image_=null;return!!this.image_},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),r=O(e.pixelToCoordinateTransform,t.slice()),i=n.getExtent();if(i&&!U(i,r))return null;var o=this.image_.getExtent(),s=this.image_.getImage(),a=gt(o),u=Math.floor(s.width*((r[0]-o[0])/a));if(u<0||u>=s.width)return null;var l=ht(o),c=Math.floor(s.height*((o[3]-r[1])/l));return c<0||c>=s.height?null:this.getImageData(s,u,c)},e.prototype.renderFrame=function(t,e){var n=this.image_,r=n.getExtent(),i=n.getResolution(),o=n.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,u=t.viewState,l=u.center,c=a*i/(u.resolution*o),h=t.extent,f=u.resolution,p=u.rotation,d=Math.round(gt(h)/f*a),g=Math.round(ht(h)/f*a);L(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,p,-d/2,-g/2),R(this.inversePixelTransform,this.pixelTransform);var y=k(this.pixelTransform);this.useContainer(e,y,this.getBackground(t));var v=this.context,_=v.canvas;_.width!=d||_.height!=g?(_.width=d,_.height=g):this.containerReused||v.clearRect(0,0,d,g);var m=!1,x=!0;if(s.extent){var b=Oi(s.extent,u.projection);(m=(x=yt(b,t.extent))&&!W(b,t.extent))&&this.clipUnrotated(v,t,b)}var w=n.getImage(),E=L(this.tempTransform,d/2,g/2,c,c,0,o*(r[0]-l[0])/i,o*(l[1]-r[3])/i);this.renderedResolution=i*a/o;var C=w.width*E[0],S=w.height*E[3];if(this.getLayer().getSource().getInterpolate()||qt(v,jg),this.preRender(v,t),x&&C>=.5&&S>=.5){var P=E[4],I=E[5],M=s.opacity,O=void 0;1!==M&&(O=v.globalAlpha,v.globalAlpha=M),v.drawImage(w,0,0,+w.width,+w.height,P,I,C,S),1!==M&&(v.globalAlpha=O)}return this.postRender(v,t),m&&v.restore(),qt(v,Gg),y!==_.style.transform&&(_.style.transform=y),this.container},e}(Ip),Xx=Wx,qx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yx=function(t){function e(e){return t.call(this,e)||this}return qx(e,t),e.prototype.createRenderer=function(){return new Xx(this)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(Vx);
|
|
36
|
+
***************************************************************************** */function t(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(e){return u([t,e])}}function u(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}var e=function(){function t(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return t}();function n(t,e){return t>e?1:t<e?-1:0}function r(t,n,r){for(var i=new e(null,null),o=i,s=i;;){var a=r(t,n.key);if(a<0){if(null===n.left)break;if(r(t,n.left.key)<0){var u=n.left;if(n.left=u.right,u.right=n,null===(n=u).left)break}s.left=n,s=n,n=n.left}else{if(!(a>0))break;if(null===n.right)break;if(r(t,n.right.key)>0&&(u=n.right,n.right=u.left,u.left=n,null===(n=u).right))break;o.right=n,o=n,n=n.right}}return o.right=n.left,s.left=n.right,n.left=i.right,n.right=i.left,n}function i(t,n,i,o){var s=new e(t,n);if(null===i)return s.left=s.right=null,s;var a=o(t,(i=r(t,i,o)).key);return a<0?(s.left=i.left,s.right=i,i.left=null):a>=0&&(s.right=i.right,s.left=i,i.right=null),s}function o(t,e,n){var i=null,o=null;if(e){var s=n((e=r(t,e,n)).key,t);0===s?(i=e.left,o=e.right):s<0?(o=e.right,e.right=null,i=e):(i=e.left,e.left=null,o=e)}return{left:i,right:o}}function s(t,e,n){return null===e?t:(null===t||((e=r(t.key,e,n)).left=t),e)}function a(t,e,n,r,i){if(t){r(e+(n?"└── ":"├── ")+i(t)+"\n");var o=e+(n?" ":"│ ");t.left&&a(t.left,o,!1,r,i),t.right&&a(t.right,o,!0,r,i)}}var u=function(){function u(t){void 0===t&&(t=n),this._root=null,this._size=0,this._comparator=t}return u.prototype.insert=function(t,e){return this._size++,this._root=i(t,e,this._root,this._comparator)},u.prototype.add=function(t,n){var i=new e(t,n);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,s=r(t,this._root,o),a=o(t,s.key);return 0===a?this._root=s:(a<0?(i.left=s.left,i.right=s,s.left=null):a>0&&(i.right=s.right,i.left=s,s.right=null),this._size++,this._root=i),this._root},u.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},u.prototype._remove=function(t,e,n){var i;return null===e?null:0===n(t,(e=r(t,e,n)).key)?(null===e.left?i=e.right:(i=r(t,e.left,n)).right=e.right,this._size--,i):e},u.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=r(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},u.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return e;e=r<0?e.left:e.right}return null},u.prototype.find=function(t){return this._root&&(this._root=r(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},u.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},u.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0;return this},u.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,s=this._root;0!==i.length||s;)if(s)i.push(s),s=s.left;else{if(o((s=i.pop()).key,e)>0)break;if(o(s.key,t)>=0&&n.call(r,s))return this;s=s.right}return this},u.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},u.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},u.prototype.min=function(){return this._root?this.minNode(this._root).key:null},u.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},u.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},u.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},u.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},u.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},u.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},u.prototype.clear=function(){return this._root=null,this._size=0,this},u.prototype.toList=function(){return h(this._root)},u.prototype.load=function(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=!1);var r=t.length,i=this._comparator;if(n&&d(t,e,0,r-1,i),null===this._root)this._root=l(t,e,0,r),this._size=r;else{var o=p(this.toList(),c(t,e),i);r=this._size+r,this._root=f({head:o},0,r)}return this},u.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(u.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),u.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return a(this._root,"",!0,function(t){return e.push(t)},t),e.join("")},u.prototype.update=function(t,e,n){var r=this._comparator,a=o(t,this._root,r),u=a.left,l=a.right;r(t,e)<0?l=i(e,n,l,r):u=i(e,n,u,r),this._root=s(u,l,r)},u.prototype.split=function(t){return o(t,this._root,this._comparator)},u.prototype[Symbol.iterator]=function(){var e,n,r;return t(this,function(t){switch(t.label){case 0:e=this._root,n=[],r=!1,t.label=1;case 1:return r?[3,6]:null===e?[3,2]:(n.push(e),e=e.left,[3,5]);case 2:return 0===n.length?[3,4]:[4,e=n.pop()];case 3:return t.sent(),e=e.right,[3,5];case 4:r=!0,t.label=5;case 5:return[3,1];case 6:return[2]}})},u}();function l(t,n,r,i){var o=i-r;if(o>0){var s=r+Math.floor(o/2),a=t[s],u=n[s],c=new e(a,u);return c.left=l(t,n,r,s),c.right=l(t,n,s+1,i),c}return null}function c(t,n){for(var r=new e(null,null),i=r,o=0;o<t.length;o++)i=i.next=new e(t[o],n[o]);return i.next=null,r.next}function h(t){for(var n=t,r=[],i=!1,o=new e(null,null),s=o;!i;)n?(r.push(n),n=n.left):r.length>0?n=(n=s=s.next=r.pop()).right:i=!0;return s.next=null,o.next}function f(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=f(t,e,i),s=t.head;return s.left=o,t.head=t.head.next,s.right=f(t,i+1,n),s}return null}function p(t,n,r){for(var i=new e(null,null),o=i,s=t,a=n;null!==s&&null!==a;)r(s.key,a.key)<0?(o.next=s,s=s.next):(o.next=a,a=a.next),o=o.next;return null!==s?o.next=s:null!==a&&(o.next=a),i.next}function d(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],s=n-1,a=r+1;;){do{s++}while(i(t[s],o)<0);do{a--}while(i(t[a],o)>0);if(s>=a)break;var u=t[s];t[s]=t[a],t[a]=u,u=e[s],e[s]=e[a],e[a]=u}d(t,e,n,a,i),d(t,e,a+1,r,i)}}const g=(t,e)=>t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y,y=(t,e)=>{if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;const n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,r=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:r,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}};let v=Number.EPSILON;void 0===v&&(v=Math.pow(2,-52));const _=v*v,m=(t,e)=>{if(-v<t&&t<v&&-v<e&&e<v)return 0;const n=t-e;return n*n<_*t*e?0:t<e?-1:1};class x{constructor(){this.reset()}reset(){this.xRounder=new b,this.yRounder=new b}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class b{constructor(){this.tree=new u,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(null!==n&&0===m(e.key,n.key))return this.tree.remove(t),n.key;const r=this.tree.next(e);return null!==r&&0===m(e.key,r.key)?(this.tree.remove(t),r.key):t}}const w=new x,E=11102230246251565e-32,C=134217729,S=(3+8*E)*E;function P(t,e,n,r,i){let o,s,a,u,l=e[0],c=r[0],h=0,f=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=r[++f]);let p=0;if(h<t&&f<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=e[++h]):(s=c+o,a=o-(s-c),c=r[++f]),o=s,0!==a&&(i[p++]=a);h<t&&f<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++f]),o=s,0!==a&&(i[p++]=a);for(;h<t;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h],o=s,0!==a&&(i[p++]=a);for(;f<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++f],o=s,0!==a&&(i[p++]=a);return 0===o&&0!==p||(i[p++]=o),p}function I(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function M(t){return new Float64Array(t)}const O=(3+16*E)*E,L=(2+12*E)*E,R=(9+64*E)*E*E,k=M(4),T=M(8),N=M(12),A=M(16),D=M(4);function F(t,e,n,r,i,o,s){let a,u,l,c,h,f,p,d,g,y,v,_,m,x,b,w,E,M;const O=t-i,F=n-i,j=e-o,G=r-o;x=O*G,f=C*O,p=f-(f-O),d=O-p,f=C*G,g=f-(f-G),y=G-g,b=d*y-(x-p*g-d*g-p*y),w=j*F,f=C*j,p=f-(f-j),d=j-p,f=C*F,g=f-(f-F),y=F-g,E=d*y-(w-p*g-d*g-p*y),v=b-E,h=b-v,k[0]=b-(v+h)+(h-E),_=x+v,h=_-x,m=x-(_-h)+(v-h),v=m-w,h=m-v,k[1]=m-(v+h)+(h-w),M=_+v,h=M-_,k[2]=_-(M-h)+(v-h),k[3]=M;let B=I(4,k),z=L*s;if(B>=z||-B>=z)return B;if(h=t-O,a=t-(O+h)+(h-i),h=n-F,l=n-(F+h)+(h-i),h=e-j,u=e-(j+h)+(h-o),h=r-G,c=r-(G+h)+(h-o),0===a&&0===u&&0===l&&0===c)return B;if(z=R*s+S*Math.abs(B),B+=O*c+G*a-(j*l+F*u),B>=z||-B>=z)return B;x=a*G,f=C*a,p=f-(f-a),d=a-p,f=C*G,g=f-(f-G),y=G-g,b=d*y-(x-p*g-d*g-p*y),w=u*F,f=C*u,p=f-(f-u),d=u-p,f=C*F,g=f-(f-F),y=F-g,E=d*y-(w-p*g-d*g-p*y),v=b-E,h=b-v,D[0]=b-(v+h)+(h-E),_=x+v,h=_-x,m=x-(_-h)+(v-h),v=m-w,h=m-v,D[1]=m-(v+h)+(h-w),M=_+v,h=M-_,D[2]=_-(M-h)+(v-h),D[3]=M;const V=P(4,k,4,D,T);x=O*c,f=C*O,p=f-(f-O),d=O-p,f=C*c,g=f-(f-c),y=c-g,b=d*y-(x-p*g-d*g-p*y),w=j*l,f=C*j,p=f-(f-j),d=j-p,f=C*l,g=f-(f-l),y=l-g,E=d*y-(w-p*g-d*g-p*y),v=b-E,h=b-v,D[0]=b-(v+h)+(h-E),_=x+v,h=_-x,m=x-(_-h)+(v-h),v=m-w,h=m-v,D[1]=m-(v+h)+(h-w),M=_+v,h=M-_,D[2]=_-(M-h)+(v-h),D[3]=M;const U=P(V,T,4,D,N);x=a*c,f=C*a,p=f-(f-a),d=a-p,f=C*c,g=f-(f-c),y=c-g,b=d*y-(x-p*g-d*g-p*y),w=u*l,f=C*u,p=f-(f-u),d=u-p,f=C*l,g=f-(f-l),y=l-g,E=d*y-(w-p*g-d*g-p*y),v=b-E,h=b-v,D[0]=b-(v+h)+(h-E),_=x+v,h=_-x,m=x-(_-h)+(v-h),v=m-w,h=m-v,D[1]=m-(v+h)+(h-w),M=_+v,h=M-_,D[2]=_-(M-h)+(v-h),D[3]=M;const W=P(U,N,4,D,A);return A[W-1]}function j(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),u=s-a,l=Math.abs(s+a);return Math.abs(u)>=O*l?u:-F(t,e,n,r,i,o,l)}const G=(t,e)=>t.x*e.y-t.y*e.x,B=(t,e)=>t.x*e.x+t.y*e.y,z=(t,e,n)=>{const r=j(t.x,t.y,e.x,e.y,n.x,n.y);return r>0?-1:r<0?1:0},V=t=>Math.sqrt(B(t,t)),U=(t,e,n)=>{const r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return G(i,r)/V(i)/V(r)},W=(t,e,n)=>{const r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return B(i,r)/V(i)/V(r)},X=(t,e,n)=>0===e.y?null:{x:t.x+e.x/e.y*(n-t.y),y:n},q=(t,e,n)=>0===e.x?null:{x:n,y:t.y+e.y/e.x*(n-t.x)},Y=(t,e,n,r)=>{if(0===e.x)return q(n,r,t.x);if(0===r.x)return q(t,e,n.x);if(0===e.y)return X(n,r,t.y);if(0===r.y)return X(t,e,n.y);const i=G(e,r);if(0==i)return null;const o={x:n.x-t.x,y:n.y-t.y},s=G(o,e)/i,a=G(o,r)/i;return{x:(t.x+a*e.x+(n.x+s*r.x))/2,y:(t.y+a*e.y+(n.y+s*r.y))/2}};class H{static compare(t,e){const n=H.comparePoints(t.point,e.point);return 0!==n?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:K.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){void 0===t.events?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let t=0,n=e.length;t<n;t++){const n=e[t];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(void 0===n.segment.consumedBy)for(let r=e+1;r<t;r++){const t=this.point.events[r];void 0===t.consumedBy&&n.otherSE.point.events===t.otherSE.point.events&&n.segment.consume(t.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}getLeftmostComparator(t){const e=new Map,n=n=>{const r=n.otherSE;e.set(n,{sine:U(this.point,t.point,r.point),cosine:W(this.point,t.point,r.point)})};return(t,r)=>{e.has(t)||n(t),e.has(r)||n(r);const{sine:i,cosine:o}=e.get(t),{sine:s,cosine:a}=e.get(r);return i>=0&&s>=0?o<a?1:o>a?-1:0:i<0&&s<0?o<a?-1:o>a?1:0:s<i?-1:s>i?1:0}}}let Z=0;class K{static compare(t,e){const n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(i<r)return-1;const s=t.leftSE.point.y,a=e.leftSE.point.y,u=t.rightSE.point.y,l=e.rightSE.point.y;if(n<r){if(a<s&&a<u)return 1;if(a>s&&a>u)return-1;const n=t.comparePoint(e.leftSE.point);if(n<0)return 1;if(n>0)return-1;const r=e.comparePoint(t.rightSE.point);return 0!==r?r:-1}if(n>r){if(s<a&&s<l)return-1;if(s>a&&s>l)return 1;const n=e.comparePoint(t.leftSE.point);if(0!==n)return n;const r=t.comparePoint(e.rightSE.point);return r<0?1:r>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(i<o){const n=e.comparePoint(t.rightSE.point);if(0!==n)return n}if(i>o){const n=t.comparePoint(e.rightSE.point);if(n<0)return 1;if(n>0)return-1}if(i!==o){const t=u-s,e=i-n,c=l-a,h=o-r;if(t>e&&c<h)return 1;if(t<e&&c>h)return-1}return i>o?1:i<o||u<l?-1:u>l?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,r){this.id=++Z,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=r}static fromRing(t,e,n){let r,i,o;const s=H.comparePoints(t,e);if(s<0)r=t,i=e,o=1;else{if(!(s>0))throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);r=e,i=t,o=-1}const a=new H(r,!0),u=new H(i,!1);return new K(a,u,[n],[o])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const i=(t.y-e.y)/r.y,o=e.x+i*r.x;if(t.x===o)return 0;const s=(t.x-e.x)/r.x,a=e.y+s*r.y;return t.y===a?0:t.y<a?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),r=y(e,n);if(null===r)return null;const i=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,u=g(e,s)&&0===this.comparePoint(s),l=g(n,i)&&0===t.comparePoint(i),c=g(e,a)&&0===this.comparePoint(a),h=g(n,o)&&0===t.comparePoint(o);if(l&&u)return h&&!c?o:!h&&c?a:null;if(l)return c&&i.x===a.x&&i.y===a.y?null:i;if(u)return h&&o.x===s.x&&o.y===s.y?null:s;if(h&&c)return null;if(h)return o;if(c)return a;const f=Y(i,this.vector(),s,t.vector());return null===f?null:g(r,f)?w.round(f.x,f.y):null}split(t){const e=[],n=void 0!==t.events,r=new H(t,!0),i=new H(t,!1),o=this.rightSE;this.replaceRightSE(i),e.push(i),e.push(r);const s=new K(r,o,this.rings.slice(),this.windings.slice());return H.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),H.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),i.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,e=this.windings.length;t<e;t++)this.windings[t]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=K.compare(e,n);if(0!==r){if(r>0){const t=e;e=n,n=t}if(e.prev===n){const t=e;e=n,n=t}for(let t=0,r=n.rings.length;t<r;t++){const r=n.rings[t],i=n.windings[t],o=e.rings.indexOf(r);-1===o?(e.rings.push(r),e.windings.push(i)):e.windings[o]+=i}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let t=0,r=this.rings.length;t<r;t++){const r=this.rings[t],i=this.windings[t],o=e.indexOf(r);-1===o?(e.push(r),n.push(i)):n[o]+=i}const i=[],o=[];for(let t=0,r=e.length;t<r;t++){if(0===n[t])continue;const r=e[t],s=r.poly;if(-1===o.indexOf(s))if(r.isExterior)i.push(s);else{-1===o.indexOf(s)&&o.push(s);const t=i.indexOf(r.poly);-1!==t&&i.splice(t,1)}}for(let t=0,e=i.length;t<e;t++){const e=i[t].multiPoly;-1===r.indexOf(e)&&r.push(e)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(at.type){case"union":{const n=0===t.length,r=0===e.length;this._isInResult=n!==r;break}case"intersection":{let n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===at.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2==1;break}case"difference":{const n=t=>1===t.length&&t[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${at.type}`)}return this._isInResult}}class J{constructor(t,e,n){if(!Array.isArray(t)||0===t.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],"number"!=typeof t[0][0]||"number"!=typeof t[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=w.round(t[0][0],t[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let i=r;for(let e=1,n=t.length;e<n;e++){if("number"!=typeof t[e][0]||"number"!=typeof t[e][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let n=w.round(t[e][0],t[e][1]);n.x===i.x&&n.y===i.y||(this.segments.push(K.fromRing(i,n,this)),n.x<this.bbox.ll.x&&(this.bbox.ll.x=n.x),n.y<this.bbox.ll.y&&(this.bbox.ll.y=n.y),n.x>this.bbox.ur.x&&(this.bbox.ur.x=n.x),n.y>this.bbox.ur.y&&(this.bbox.ur.y=n.y),i=n)}r.x===i.x&&r.y===i.y||this.segments.push(K.fromRing(i,r,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}class ${constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new J(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let e=1,n=t.length;e<n;e++){const n=new J(t[e],this,!1);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.interiorRings.push(n)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const n=this.interiorRings[e].getSweepEvents();for(let e=0,r=n.length;e<r;e++)t.push(n[e])}return t}}class Q{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof t[0][0][0]&&(t=[t])}catch(t){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let e=0,n=t.length;e<n;e++){const n=new $(t[e],this);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.polys.push(n)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const n=this.polys[e].getSweepEvents();for(let e=0,r=n.length;e<r;e++)t.push(n[e])}return t}}class tt{static factory(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];if(!r.isInResult()||r.ringOut)continue;let i=null,o=r.leftSE,s=r.rightSE;const a=[o],u=o.point,l=[];for(;i=o,o=s,a.push(o),o.point!==u;)for(;;){const t=o.getAvailableLinkedEvents();if(0===t.length){const t=a[0].point,e=a[a.length-1].point;throw new Error(`Unable to complete output ring starting at [${t.x}, ${t.y}]. Last matching segment found ends at [${e.x}, ${e.y}].`)}if(1===t.length){s=t[0].otherSE;break}let n=null;for(let t=0,e=l.length;t<e;t++)if(l[t].point===o.point){n=t;break}if(null!==n){const t=l.splice(n)[0],r=a.splice(t.index);r.unshift(r[0].otherSE),e.push(new tt(r.reverse()));continue}l.push({index:a.length,point:o.point});const r=o.getLeftmostComparator(i);s=t.sort(r)[0].otherSE;break}e.push(new tt(a))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let n=1,r=this.events.length-1;n<r;n++){const r=this.events[n].point,i=this.events[n+1].point;0!==z(r,t,i)&&(e.push(r),t=r)}if(1===e.length)return null;const n=e[0],r=e[1];0===z(n,t,r)&&e.shift(),e.push(e[0]);const i=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,a=[];for(let t=o;t!=s;t+=i)a.push([e[t].x,e[t].y]);return a}isExteriorRing(){if(void 0===this._isExteriorRing){const t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let e=1,n=this.events.length;e<n;e++){const n=this.events[e];H.compare(t,n)>0&&(t=n)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class et{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}class nt{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}_composePolys(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];if(!r.poly)if(r.isExteriorRing())e.push(new et(r));else{const t=r.enclosingRing();t.poly||e.push(new et(t)),t.poly.addInterior(r)}}return e}}class rt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K.compare;this.queue=t,this.tree=new u(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const r=t.isLeft?this.tree.add(e):this.tree.find(e);if(!r)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let i,o,s=r,a=r;for(;void 0===i;)s=this.tree.prev(s),null===s?i=null:void 0===s.key.consumedBy&&(i=s.key);for(;void 0===o;)a=this.tree.next(a),null===a?o=null:void 0===a.key.consumedBy&&(o=a.key);if(t.isLeft){let r=null;if(i){const t=i.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(r=t),!i.isAnEndpoint(t))){const e=this._splitSafely(i,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}let s=null;if(o){const t=o.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(s=t),!o.isAnEndpoint(t))){const e=this._splitSafely(o,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}if(null!==r||null!==s){let t=null;t=null===r?s:null===s||H.comparePoints(r,s)<=0?r:s,this.queue.remove(e.rightSE),n.push(e.rightSE);const i=e.split(t);for(let t=0,e=i.length;t<e;t++)n.push(i[t])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=i)}else{if(i&&o){const t=i.getIntersection(o);if(null!==t){if(!i.isAnEndpoint(t)){const e=this._splitSafely(i,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}if(!o.isAnEndpoint(t)){const e=this._splitSafely(o,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const r=t.split(e);return r.push(n),void 0===t.consumedBy&&this.tree.add(t),r}}const it="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,ot="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class st{run(t,e,n){at.type=t,w.reset();const r=[new Q(e,!0)];for(let t=0,e=n.length;t<e;t++)r.push(new Q(n[t],!1));if(at.numMultiPolys=r.length,"difference"===at.type){const t=r[0];let e=1;for(;e<r.length;)null!==y(r[e].bbox,t.bbox)?e++:r.splice(e,1)}if("intersection"===at.type)for(let t=0,e=r.length;t<e;t++){const e=r[t];for(let n=t+1,i=r.length;n<i;n++)if(null===y(e.bbox,r[n].bbox))return[]}const i=new u(H.compare);for(let t=0,e=r.length;t<e;t++){const e=r[t].getSweepEvents();for(let t=0,n=e.length;t<n;t++)if(i.insert(e[t]),i.size>it)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new rt(i);let s=i.size,a=i.pop();for(;a;){const t=a.key;if(i.size===s){const e=t.segment;throw new Error(`Unable to pop() ${t.isLeft?"left":"right"} SweepEvent [${t.point.x}, ${t.point.y}] from segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] from queue.`)}if(i.size>it)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>ot)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const e=o.process(t);for(let t=0,n=e.length;t<n;t++){const n=e[t];void 0===n.consumedBy&&i.insert(n)}s=i.size,a=i.pop()}w.reset();const l=tt.factory(o.segments);return new nt(l).getGeom()}}const at=new st,ut=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return at.run("union",t,n)},lt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return at.run("intersection",t,n)},ct=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return at.run("xor",t,n)},ht=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return at.run("difference",t,n)};return{union:ut,intersection:lt,xor:ct,difference:ht}}()},9399:function(t){t.exports=function(){"use strict";function t(t,n,i,o,s){e(t,n,i||0,o||t.length-1,s||r)}function e(t,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,u=r-i+1,l=Math.log(a),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(a-c)/a)*(u-a/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-u*c/a+h)),Math.min(o,Math.floor(r+(a-u)*c/a+h)),s)}var f=t[r],p=i,d=o;for(n(t,i,r),s(t[o],f)>0&&n(t,i,o);p<d;){for(n(t,p,d),p++,d--;s(t[p],f)<0;)p++;for(;s(t[d],f)>0;)d--}0===s(t[i],f)?n(t,i,d):n(t,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}return t}()},2519:function(t,e,n){"use strict";t.exports=i,t.exports.default=i;var r=n(9399);function i(t,e){if(!(this instanceof i))return new i(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function s(t,e){a(t,0,t.children.length,e,t)}function a(t,e,n,r,i){i||(i=v(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],u(i,t.leaf?r(o):o);return i}function u(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 l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(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 d(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function y(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _(t,e,n,i,o){for(var s,a=[e,n];a.length;)(n=a.pop())-(e=a.pop())<=i||(s=e+Math.ceil((n-e)/i/2)*i,r(t,s,e,n,o),a.push(e,s,s,n))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!y(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],y(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):g(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!y(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],y(t,s=e.leaf?n(o):o)){if(e.leaf||g(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=v([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,s,a=this.data,u=this.toBBox(t),l=[],c=[];a||l.length;){if(a||(a=l.pop(),r=l[l.length-1],n=c.pop(),s=!0),a.leaf&&-1!==(i=o(t,a.children,e)))return a.children.splice(i,1),l.push(a),this._condense(l),this;s||a.leaf||!g(a,u)?r?(n++,a=r.children[n],s=!1):a=null:(l.push(a),c.push(n),n=0,r=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:c,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,a=this._maxEntries;if(o<=a)return s(i=v(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,r-1))),(i=v([])).leaf=!1,i.height=r;var u,l,c,h,f=Math.ceil(o/a),p=f*Math.ceil(Math.sqrt(a));for(_(t,e,n,p,this.compareMinX),u=e;u<=n;u+=p)for(_(t,u,c=Math.min(u+p-1,n),f,this.compareMinY),l=u;l<=c;l+=f)h=Math.min(l+f-1,c),i.children.push(this._build(t,l,h,r-1));return s(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,u,l,c,f;r.push(e),!e.leaf&&r.length-1!==n;){for(c=f=1/0,i=0,o=e.children.length;i<o;i++)u=h(s=e.children[i]),(l=p(t,s)-u)<f?(f=l,c=u<c?u:c,a=s):l===f&&u<c&&(c=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),u(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),a=v(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,s(n,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,u,l,c,f;for(l=c=1/0,r=e;r<=n-e;r++)s=d(i=a(t,0,r,this.toBBox),o=a(t,r,n,this.toBBox)),u=h(i)+h(o),s<l?(l=s,f=r,c=u<c?u:c):s===l&&u<c&&(c=u,f=r);return f},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,s=this.toBBox,l=a(t,0,e,s),c=a(t,n-e,n,s),h=f(l)+f(c);for(i=e;i<n-e;i++)o=t.children[i],u(l,t.leaf?s(o):o),h+=f(l);for(i=n-e-1;i>=e;i--)o=t.children[i],u(c,t.leaf?s(o):o),h+=f(c);return h},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():s(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},7675:function(t,e,n){"use strict";var r=n(3206),i=n(9675),o=Object;t.exports=r(function(){if(null==this||this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)},1589:function(t,e,n){"use strict";var r=n(8452),i=n(487),o=n(7675),s=n(5330),a=n(3984),u=i(s());r(u,{getPolyfill:s,implementation:o,shim:a}),t.exports=u},5330:function(t,e,n){"use strict";var r=n(7675),i=n(8452).supportsDescriptors,o=Object.getOwnPropertyDescriptor;t.exports=function(){if(i&&"gim"===/a/gim.flags){var t=o(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(n,"sticky",{get:function(){e+="y"}}),t.get.call(n),"dy"===e)return t.get}}return r}},3984:function(t,e,n){"use strict";var r=n(8452).supportsDescriptors,i=n(5330),o=n(5795),s=Object.defineProperty,a=n(9383),u=n(3628),l=/a/;t.exports=function(){if(!r||!u)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=i(),e=u(l),n=o(e,"flags");return n&&n.get===t||s(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},6897:function(t,e,n){"use strict";var r=n(453),i=n(41),o=n(592)(),s=n(5795),a=n(9675),u=r("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||u(e)!==e)throw new a("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],r=!0,l=!0;if("length"in t&&s){var c=s(t,"length");c&&!c.configurable&&(r=!1),c&&!c.writable&&(l=!1)}return(r||l||!n)&&(o?i(t,"length",e,!0,!0):i(t,"length",e)),t}},3206:function(t,e,n){"use strict";var r=n(41),i=n(592)(),o=n(4462).functionsHaveConfigurableNames(),s=n(9675);t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!o||(i?r(t,"name",e,!0,!0):r(t,"name",e)),t}},6766:function(t){"use strict";t.exports={eudist:function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++){var s=(t[o]||0)-(e[o]||0);i+=s*s}return n?Math.sqrt(i):i},mandist:function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++)i+=Math.abs((t[o]||0)-(e[o]||0));return n?Math.sqrt(i):i},dist:function(t,e,n){var r=Math.abs(t-e);return n?r:r*r}}},5810:function(t,e,n){"use strict";var r=n(6766),i=r.eudist,o=r.dist;t.exports={kmrand:function(t,e){for(var n={},r=[],i=e<<2,o=t.length,s=t[0].length>0;r.length<e&&i-- >0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,r.push(a))}if(r.length<e)throw new Error("Error initializating clusters");return r},kmpp:function(t,e){var n=t[0].length?i:o,r=[],s=t.length,a=t[0].length>0,u=t[Math.floor(Math.random()*s)];a&&u.join("_");for(r.push(u);r.length<e;){for(var l=[],c=r.length,h=0,f=[],p=0;p<s;p++){for(var d=1/0,g=0;g<c;g++){var y=n(t[p],r[g]);y<=d&&(d=y)}l[p]=d}for(var v=0;v<s;v++)h+=l[v];for(var _=0;_<s;_++)f[_]={i:_,v:t[_],pr:l[_]/h,cs:0};f.sort(function(t,e){return t.pr-e.pr}),f[0].cs=f[0].pr;for(var m=1;m<s;m++)f[m].cs=f[m-1].cs+f[m].pr;for(var x=Math.random(),b=0;b<s-1&&f[b++].cs<x;);r.push(f[b-1].v)}return r}}},1756:function(t,e,n){"use strict";var r=n(6766),i=n(5810),o=r.eudist,s=(r.mandist,r.dist,i.kmrand),a=i.kmpp;function u(t,e,n){n=n||[];for(var r=0;r<t;r++)n[r]=e;return n}t.exports=function(t,e,n,r){var i=[],l=[],c=[],h=[],f=!1,p=r||1e4,d=t.length,g=t[0].length,y=g>0,v=[];if(n)i="kmrand"==n?s(t,e):"kmpp"==n?a(t,e):n;else for(var _={};i.length<e;){var m=Math.floor(Math.random()*d);_[m]||(_[m]=!0,i.push(t[m]))}do{u(e,0,v);for(var x=0;x<d;x++){for(var b=1/0,w=0,E=0;E<e;E++){(h=y?o(t[x],i[E]):Math.abs(t[x]-i[E]))<=b&&(b=h,w=E)}c[x]=w,v[w]++}for(var C=[],S=(l=[],0);S<e;S++)C[S]=y?u(g,0,C[S]):0,l[S]=i[S];if(y){for(var P=0;P<e;P++)i[P]=[];for(var I=0;I<d;I++)for(var M=C[c[I]],O=t[I],L=0;L<g;L++)M[L]+=O[L];f=!0;for(var R=0;R<e;R++){for(var k=i[R],T=C[R],N=l[R],A=v[R],D=0;D<g;D++)k[D]=T[D]/A||0;if(f)for(var F=0;F<g;F++)if(N[F]!=k[F]){f=!1;break}}}else{for(var j=0;j<d;j++){C[c[j]]+=t[j]}for(var G=0;G<e;G++)i[G]=C[G]/v[G]||0;f=!0;for(var B=0;B<e;B++)if(l[B]!=i[B]){f=!1;break}}f=f||--p<=0}while(!f);return{it:1e4-p,k:e,idxs:c,centroids:i}}},5072:function(t){"use strict";var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var o={},s=[],a=0;a<t.length;a++){var u=t[a],l=r.base?u[0]+r.base:u[0],c=o[l]||0,h="".concat(l," ").concat(c);o[l]=c+1;var f=n(h),p={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==f)e[f].references++,e[f].updater(p);else{var d=i(p,r);r.byIndex=a,e.splice(a,0,{identifier:h,updater:d,references:1})}s.push(h)}return s}function i(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,i){var o=r(t=t||[],i=i||{});return function(t){t=t||[];for(var s=0;s<o.length;s++){var a=n(o[s]);e[a].references--}for(var u=r(t,i),l=0;l<o.length;l++){var c=n(o[l]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}o=u}}},7659:function(t){"use strict";var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:function(t){"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},5056:function(t,e,n){"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7825:function(t){"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},1113:function(t){"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},39:function(t,e){!function(t){"use strict";function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function s(t){return null===t?Nt:t.color}function a(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function l(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function h(){this.root_=null,this.size_=0}function f(){}function p(){this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}function d(){}function g(t){this.message=t||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var v=function(){};v.prototype.interfaces_=function(){return[]},v.prototype.getClass=function(){return v},v.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var _=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),m=function(){},x={MAX_VALUE:{configurable:!0}};m.isNaN=function(t){return Number.isNaN(t)},m.doubleToLongBits=function(t){return t},m.longBitsToDouble=function(t){return t},m.isInfinite=function(t){return!Number.isFinite(t)},x.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(m,x);var b=function(){},w=function(){},E=function(){},C=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},S={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};C.prototype.setOrdinate=function(t,e){switch(t){case C.X:this.x=e;break;case C.Y:this.y=e;break;case C.Z:this.z=e;break;default:throw new _("Invalid ordinate index: "+t)}},C.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!v.equalsWithTolerance(this.x,e.x,n)&&!!v.equalsWithTolerance(this.y,e.y,n)}},C.prototype.getOrdinate=function(t){switch(t){case C.X:return this.x;case C.Y:return this.y;case C.Z:return this.z}throw new _("Invalid ordinate index: "+t)},C.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||m.isNaN(this.z))&&m.isNaN(t.z)},C.prototype.equals=function(t){return t instanceof C&&this.equals2D(t)},C.prototype.equalInZ=function(t,e){return v.equalsWithTolerance(this.z,t.z,e)},C.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},C.prototype.clone=function(){},C.prototype.copy=function(){return new C(this)},C.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},C.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},C.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},C.prototype.hashCode=function(){var t=17;return 37*(t=37*t+C.hashCode(this.x))+C.hashCode(this.y)},C.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},C.prototype.interfaces_=function(){return[b,w,e]},C.prototype.getClass=function(){return C},C.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=m.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},S.DimensionalComparator.get=function(){return P},S.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},S.NULL_ORDINATE.get=function(){return m.NaN},S.X.get=function(){return 0},S.Y.get=function(){return 1},S.Z.get=function(){return 2},Object.defineProperties(C,S);var P=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new _("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};P.prototype.compare=function(t,e){var n=t,r=e,i=P.compare(n.x,r.x);if(0!==i)return i;var o=P.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:P.compare(n.z,r.z)},P.prototype.interfaces_=function(){return[E]},P.prototype.getClass=function(){return P},P.compare=function(t,e){return t<e?-1:t>e?1:m.isNaN(t)?m.isNaN(e)?0:-1:m.isNaN(e)?1:0};var I=function(){};I.prototype.create=function(){},I.prototype.interfaces_=function(){return[]},I.prototype.getClass=function(){return I};var M=function(){},O={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M},M.toLocationSymbol=function(t){switch(t){case M.EXTERIOR:return"e";case M.BOUNDARY:return"b";case M.INTERIOR:return"i";case M.NONE:return"-"}throw new _("Unknown location value: "+t)},O.INTERIOR.get=function(){return 0},O.BOUNDARY.get=function(){return 1},O.EXTERIOR.get=function(){return 2},O.NONE.get=function(){return-1},Object.defineProperties(M,O);var L=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},R=function(){},k={LOG_10:{configurable:!0}};R.prototype.interfaces_=function(){return[]},R.prototype.getClass=function(){return R},R.log10=function(t){var e=Math.log(t);return m.isInfinite(e)||m.isNaN(e)?e:e/R.LOG_10},R.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},R.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return r<i?i:r>o?o:r}},R.wrap=function(t,e){return t<0?e- -t%e:t%e},R.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],o=arguments[3],s=arguments[0];return r>s&&(s=r),i>s&&(s=i),o>s&&(s=o),s}},R.average=function(t,e){return(t+e)/2},k.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(R,k);var T=function(t){this.str=t};T.prototype.append=function(t){this.str+=t},T.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},T.prototype.toString=function(t){return this.str};var N=function(t){this.value=t};N.prototype.intValue=function(){return this.value},N.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},N.isNaN=function(t){return Number.isNaN(t)};var A=function(){};A.isWhitespace=function(t){return t<=32&&t>=0||127===t},A.toUpperCase=function(t){return t.toUpperCase()};var D=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r,i)}},F={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};D.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},D.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=D.magnitude(n._hi),i=D.TEN.pow(r);(n=n.divide(i)).gt(D.TEN)?(n=n.divide(D.TEN),r+=1):n.lt(D.ONE)&&(n=n.multiply(D.TEN),r-=1);for(var o=r+1,s=new T,a=D.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var l=Math.trunc(n._hi);if(l<0)break;var c=!1,h=0;l>9?(c=!0,h="9"):h="0"+l,s.append(h),n=n.subtract(D.valueOf(l)).multiply(D.TEN),c&&n.selfAdd(D.TEN);var f=!0,p=D.magnitude(n._hi);if(p<0&&Math.abs(p)>=a-u&&(f=!1),!f)break}return e[0]=r,s.toString()},D.prototype.sqr=function(){return this.multiply(this)},D.prototype.doubleValue=function(){return this._hi+this._lo},D.prototype.subtract=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},D.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},D.prototype.isZero=function(){return 0===this._hi&&0===this._lo},D.prototype.selfSubtract=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},D.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},D.prototype.min=function(t){return this.le(t)?this:t},D.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,l=null,c=null,h=null;return u=this._hi/n,h=(i=(l=D.SPLIT*u)-(i=l-u))*(s=(h=D.SPLIT*n)-(s=h-n))-(c=u*n)+i*(a=n-s)+(o=u-i)*s+o*a,h=u+(l=(this._hi-c-h+this._lo-u*r)/n),this._hi=h,this._lo=u-h+l,this}},D.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},D.prototype.divide=function(){if(arguments[0]instanceof D){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,s=null,a=null,u=null;return n=(o=this._hi/t._hi)-(e=(s=D.SPLIT*o)-(e=s-o)),u=e*(r=(u=D.SPLIT*t._hi)-(r=u-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,s=(this._hi-a-u+this._lo-o*t._lo)/t._hi,new D(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var l=arguments[0];return m.isNaN(l)?D.createNaN():D.copy(this).selfDivide(l,0)}},D.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},D.prototype.pow=function(t){if(0===t)return D.valueOf(1);var e=new D(this),n=D.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},D.prototype.ceil=function(){if(this.isNaN())return D.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new D(t,e)},D.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},D.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},D.prototype.setValue=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},D.prototype.max=function(t){return this.ge(t)?this:t},D.prototype.sqrt=function(){if(this.isZero())return D.valueOf(0);if(this.isNegative())return D.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=D.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},D.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null;return o=(i=this._hi+e)-(s=i-this._hi),r=(a=(o=e-s+(this._hi-o))+this._lo)+(i-(n=i+a)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var u=arguments[0],l=arguments[1],c=null,h=null,f=null,p=null,d=null,g=null,y=null;p=this._hi+u,h=this._lo+l,d=p-(g=p-this._hi),f=h-(y=h-this._lo);var v=(c=p+(g=(d=u-g+(this._hi-d))+h))+(g=(f=l-y+(this._lo-f))+(g+(p-c))),_=g+(c-v);return this._hi=v,this._lo=_,this}},D.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,l=null;i=(u=D.SPLIT*this._hi)-this._hi,l=D.SPLIT*n,i=u-i,o=this._hi-i,s=l-n;var c=(u=this._hi*n)+(l=i*(s=l-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),h=l+(i=u-c);return this._hi=c,this._lo=h,this}},D.prototype.selfSqr=function(){return this.selfMultiply(this)},D.prototype.floor=function(){if(this.isNaN())return D.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new D(t,e)},D.prototype.negate=function(){return this.isNaN()?this:new D(-this._hi,-this._lo)},D.prototype.clone=function(){},D.prototype.multiply=function(){if(arguments[0]instanceof D){var t=arguments[0];return t.isNaN()?D.createNaN():D.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return m.isNaN(e)?D.createNaN():D.copy(this).selfMultiply(e,0)}},D.prototype.isNaN=function(){return m.isNaN(this._hi)},D.prototype.intValue=function(){return Math.trunc(this._hi)},D.prototype.toString=function(){var t=D.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},D.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+D.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+D.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},D.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,i=null,o=null,s=null,a=null;e=(i=1/this._hi)-(t=(o=D.SPLIT*i)-(t=o-i)),n=(a=D.SPLIT*this._hi)-this._hi;var u=i+(o=(1-(s=i*this._hi)-(a=t*(n=a-n)-s+t*(r=this._hi-n)+e*n+e*r)-i*this._lo)/this._hi);return new D(u,i-u+o)},D.prototype.toSciNotation=function(){if(this.isZero())return D.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=D.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},D.prototype.abs=function(){return this.isNaN()?D.NaN:this.isNegative()?this.negate():new D(this)},D.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},D.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},D.prototype.add=function(){if(arguments[0]instanceof D){var t=arguments[0];return D.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return D.copy(this).selfAdd(e)}},D.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof D){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},D.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},D.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},D.prototype.trunc=function(){return this.isNaN()?D.NaN:this.isPositive()?this.floor():this.ceil()},D.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},D.prototype.interfaces_=function(){return[e,b,w]},D.prototype.getClass=function(){return D},D.sqr=function(t){return D.valueOf(t).selfMultiply(t)},D.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return D.parse(t)}if("number"==typeof arguments[0])return new D(arguments[0])},D.sqrt=function(t){return D.valueOf(t).sqrt()},D.parse=function(t){for(var e=0,n=t.length;A.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new D,s=0,a=0,u=0;!(e>=n);){var l=t.charAt(e);if(e++,A.isDigit(l)){var c=l-"0";o.selfMultiply(D.TEN),o.selfAdd(c),s++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=N.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+l+"' at position "+e+" in string "+t)}a=s}}var f=o,p=s-a-u;if(0===p)f=o;else if(p>0){var d=D.TEN.pow(p);f=o.divide(d)}else if(p<0){var g=D.TEN.pow(-p);f=o.multiply(g)}return r?f.negate():f},D.createNaN=function(){return new D(m.NaN,m.NaN)},D.copy=function(t){return new D(t)},D.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},D.stringOfChar=function(t,e){for(var n=new T,r=0;r<e;r++)n.append(t);return n.toString()},F.PI.get=function(){return new D(3.141592653589793,12246467991473532e-32)},F.TWO_PI.get=function(){return new D(6.283185307179586,24492935982947064e-32)},F.PI_2.get=function(){return new D(1.5707963267948966,6123233995736766e-32)},F.E.get=function(){return new D(2.718281828459045,14456468917292502e-32)},F.NaN.get=function(){return new D(m.NaN,m.NaN)},F.EPS.get=function(){return 123259516440783e-46},F.SPLIT.get=function(){return 134217729},F.MAX_PRINT_DIGITS.get=function(){return 32},F.TEN.get=function(){return D.valueOf(10)},F.ONE.get=function(){return D.valueOf(1)},F.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},F.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(D,F);var j=function(){},G={DP_SAFE_EPSILON:{configurable:!0}};j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j},j.orientationIndex=function(t,e,n){var r=j.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=D.valueOf(e.x).selfAdd(-t.x),o=D.valueOf(e.y).selfAdd(-t.y),s=D.valueOf(n.x).selfAdd(-e.x),a=D.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},j.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},j.intersection=function(t,e,n,r){var i=D.valueOf(r.y).selfSubtract(n.y).selfMultiply(D.valueOf(e.x).selfSubtract(t.x)),o=D.valueOf(r.x).selfSubtract(n.x).selfMultiply(D.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=D.valueOf(r.x).selfSubtract(n.x).selfMultiply(D.valueOf(t.y).selfSubtract(n.y)),u=D.valueOf(r.y).selfSubtract(n.y).selfMultiply(D.valueOf(t.x).selfSubtract(n.x)),l=a.subtract(u).selfDivide(s).doubleValue(),c=D.valueOf(t.x).selfAdd(D.valueOf(e.x).selfSubtract(t.x).selfMultiply(l)).doubleValue(),h=D.valueOf(e.x).selfSubtract(t.x).selfMultiply(D.valueOf(t.y).selfSubtract(n.y)),f=D.valueOf(e.y).selfSubtract(t.y).selfMultiply(D.valueOf(t.x).selfSubtract(n.x)),p=h.subtract(f).selfDivide(s).doubleValue(),d=D.valueOf(n.y).selfAdd(D.valueOf(r.y).selfSubtract(n.y).selfMultiply(p)).doubleValue();return new C(c,d)},j.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=i-o;if(i>0){if(o<=0)return j.signum(s);r=i+o}else{if(!(i<0))return j.signum(s);if(o>=0)return j.signum(s);r=-i-o}var a=j.DP_SAFE_EPSILON*r;return s>=a||-s>=a?j.signum(s):2},j.signum=function(t){return t>0?1:t<0?-1:0},G.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(j,G);var B=function(){},z={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};z.X.get=function(){return 0},z.Y.get=function(){return 1},z.Z.get=function(){return 2},z.M.get=function(){return 3},B.prototype.setOrdinate=function(t,e,n){},B.prototype.size=function(){},B.prototype.getOrdinate=function(t,e){},B.prototype.getCoordinate=function(){},B.prototype.getCoordinateCopy=function(t){},B.prototype.getDimension=function(){},B.prototype.getX=function(t){},B.prototype.clone=function(){},B.prototype.expandEnvelope=function(t){},B.prototype.copy=function(){},B.prototype.getY=function(t){},B.prototype.toCoordinateArray=function(){},B.prototype.interfaces_=function(){return[w]},B.prototype.getClass=function(){return B},Object.defineProperties(B,z);var V=function(){},U=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(V),W=function(){};W.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},W.getProperty=function(t){return{"line.separator":"\n"}[t]};var X=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof C&&arguments[1]instanceof C){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(4===arguments.length){var h=arguments[0],f=arguments[1],p=arguments[2],d=arguments[3],g=h.y-f.y,y=f.x-h.x,v=h.x*f.y-f.x*h.y,_=p.y-d.y,m=d.x-p.x,x=p.x*d.y-d.x*p.y;this.x=y*x-m*v,this.y=_*v-g*x,this.w=g*m-_*y}};X.prototype.getY=function(){var t=this.y/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new U;return t},X.prototype.getX=function(){var t=this.x/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new U;return t},X.prototype.getCoordinate=function(){var t=new C;return t.x=this.getX(),t.y=this.getY(),t},X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X},X.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-r.y,u=r.x-n.x,l=n.x*r.y-r.x*n.y,c=i*u-a*o,h=(o*l-u*s)/c,f=(a*s-i*l)/c;if(m.isNaN(h)||m.isInfinite(h)||m.isNaN(f)||m.isInfinite(f))throw new U;return new C(h,f)};var q=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof C){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},Y={serialVersionUID:{configurable:!0}};q.prototype.getArea=function(){return this.getWidth()*this.getHeight()},q.prototype.equals=function(t){if(!(t instanceof q))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},q.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new q;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new q(e,r,n,i)},q.prototype.isNull=function(){return this._maxx<this._minx},q.prototype.getMaxX=function(){return this._maxx},q.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof q){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},q.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof q){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof C){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},q.prototype.getMinY=function(){return this._miny},q.prototype.getMinX=function(){return this._minx},q.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof q){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},q.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},q.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},q.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},q.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},q.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},q.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},q.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},q.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},q.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},q.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof q){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof C){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},q.prototype.centre=function(){return this.isNull()?null:new C((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},q.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof q){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},q.prototype.getMaxY=function(){return this._maxy},q.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},q.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+C.hashCode(this._minx))+C.hashCode(this._maxx))+C.hashCode(this._miny))+C.hashCode(this._maxy)},q.prototype.interfaces_=function(){return[b,e]},q.prototype.getClass=function(){return q},q.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),l=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(l>u||c<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(r.y,i.y),c=Math.max(r.y,i.y),l>u||c<a))}},Y.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(q,Y);var H={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Z=function(t){this.geometryFactory=t||new ve};Z.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=H.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=H.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],J[n]&&(e=J[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},Z.prototype.write=function(t){return this.extractGeometry(t)},Z.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!K[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+K[e].apply(this,[t])+")"};var K={coordinate:function(t){return t.x+" "+t.y},point:function(t){return K.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+K.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(K.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(K.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+K.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+K.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+K.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+K.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},J={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(H.spaces);return this.geometryFactory.createPoint(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push(J.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(H.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push(J.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,o=t.trim().split(H.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(H.trimParens,"$1"),n=J.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===a?i=r:s.push(r);return this.geometryFactory.createPolygon(i,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(H.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push(J.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},$=function(t){this.parser=new Z(t)};$.prototype.write=function(t){return this.parser.write(t)},$.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Q=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),tt=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Q),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],et.isTrue(t,null);else if(2===arguments.length&&(e=arguments[1],!(t=arguments[0])))throw null===e?new tt:new tt(e)},et.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],et.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new C,this._intPt[1]=new C,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new T;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},nt.prototype.getIntersectionNum=function(){return this._result},nt.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return $.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+$.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new q(this._inputLines[0][0],this._inputLines[0][1]),n=new q(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,q.intersects(n,r,e)&&0===at.orientationIndex(n,r,e)&&0===at.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=X.intersection(t,n,r,i)}catch(s){if(!(s instanceof U))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new C(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=j.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);W.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&W.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new C(t),o=new C(e),s=new C(n),a=new C(r),u=new C;this.normalizeToEnvCentre(i,o,s,a,u);var l=this.safeHCoordinateIntersection(i,o,s,a);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=q.intersects(e,n,r),s=q.intersects(e,n,i),a=q.intersects(r,i,e),u=q.intersects(r,i,n);return o&&s?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=n.x<r.x?n.x:r.x,c=n.y<r.y?n.y:r.y,h=n.x>r.x?n.x:r.x,f=n.y>r.y?n.y:r.y,p=((o>l?o:l)+(a<h?a:h))/2,d=((s>c?s:c)+(u<f?u:f))/2;i.x=p,i.y=d,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!q.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=at.orientationIndex(e,n,r),s=at.orientationIndex(e,n,i);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=at.orientationIndex(r,i,e),u=at.orientationIndex(r,i,n);return a>0&&u>0||a<0&&u<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===u?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new C(r):0===s?this._intPt[0]=new C(i):0===a?this._intPt[0]=new C(e):0===u&&(this._intPt[0]=new C(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=at.distancePointLine(t,n,r),s=at.distancePointLine(e,n,r);return s<o&&(o=s,i=e),(s=at.distancePointLine(n,t,e))<o&&(o=s,i=n),(s=at.distancePointLine(r,t,e))<o&&(o=s,i=r),i},e}(nt),ot=function(){};ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return ot.signOfDet2x2(r,i,o,s)},ot.signOfDet2x2=function(t,e,n,r){var i=null,o=null,s=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(s=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=s*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(s=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=s*n)+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var st=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};st.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=ot.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}},st.prototype.isPointInPolygon=function(){return this.getLocation()!==M.EXTERIOR},st.prototype.getLocation=function(){return this._isPointOnSegment?M.BOUNDARY:this._crossingCount%2==1?M.INTERIOR:M.EXTERIOR},st.prototype.isOnSegment=function(){return this._isPointOnSegment},st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.locatePointInRing=function(){if(arguments[0]instanceof C&&L(arguments[1],B)){for(var t=arguments[1],e=new st(arguments[0]),n=new C,r=new C,i=1;i<t.size();i++)if(t.getCoordinate(i,n),t.getCoordinate(i-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof C&&arguments[1]instanceof Array){for(var o=arguments[1],s=new st(arguments[0]),a=1;a<o.length;a++){var u=o[a],l=o[a-1];if(s.countSegment(u,l),s.isOnSegment())return s.getLocation()}return s.getLocation()}};var at=function(){},ut={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.orientationIndex=function(t,e,n){return j.orientationIndex(t,e,n)},at.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(L(arguments[0],B)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new C,l=new C,c=new C;s.getCoordinate(0,l),s.getCoordinate(1,c);var h=l.x;c.x-=h;for(var f=0,p=1;p<a-1;p++)u.y=l.y,l.x=c.x,l.y=c.y,s.getCoordinate(p+1,c),c.x-=h,f+=l.x*(u.y-c.y);return f/2}},at.distanceLineLine=function(t,e,n,r){if(t.equals(e))return at.distancePointLine(t,n,r);if(n.equals(r))return at.distancePointLine(r,t,e);var i=!1;if(q.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var s=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),a=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,u=s/o;(u<0||u>1||a<0||a>1)&&(i=!0)}}else i=!0;return i?R.min(at.distancePointLine(t,n,r),at.distancePointLine(e,n,r),at.distancePointLine(n,t,e),at.distancePointLine(r,t,e)):0},at.isPointInRing=function(t,e){return at.locatePointInRing(t,e)!==M.EXTERIOR},at.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new C;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;s<e;s++){t.getCoordinate(s,r);var a=r.x,u=r.y,l=a-i,c=u-o;n+=Math.sqrt(l*l+c*c),i=a,o=u}return n},at.isCCW=function(t){var e=t.length-1;if(e<3)throw new _("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var o=t[i];o.y>n.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==r);var u=t[s],l=t[a];if(u.equals2D(n)||l.equals2D(n)||u.equals2D(l))return!1;var c=at.computeOrientation(u,n,l);return 0===c?u.x>l.x:c>0},at.locatePointInRing=function(t,e){return st.locatePointInRing(t,e)},at.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},at.computeOrientation=function(t,e,n){return at.orientationIndex(t,e,n)},at.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new _("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=at.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var u=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),l=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(l<=0)return o.distance(s);if(l>=1)return o.distance(a);var c=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(c)*Math.sqrt(u)}},at.isOnLine=function(t,e){for(var n=new it,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},ut.CLOCKWISE.get=function(){return-1},ut.RIGHT.get=function(){return at.CLOCKWISE},ut.COUNTERCLOCKWISE.get=function(){return 1},ut.LEFT.get=function(){return at.COUNTERCLOCKWISE},ut.COLLINEAR.get=function(){return 0},ut.STRAIGHT.get=function(){return at.COLLINEAR},Object.defineProperties(at,ut);var lt=function(){};lt.prototype.filter=function(t){},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return lt};var ct=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},ht={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION},ct.prototype.getFactory=function(){return this._factory},ct.prototype.getGeometryN=function(t){return this},ct.prototype.getArea=function(){return 0},ct.prototype.isRectangle=function(){return!1},ct.prototype.equals=function(){if(arguments[0]instanceof ct){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ct))return!1;var n=e;return this.equalsExact(n)}},ct.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ct.prototype.geometryChanged=function(){this.apply(ct.geometryChangedFilter)},ct.prototype.geometryChangedAction=function(){this._envelope=null},ct.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ct.prototype.getLength=function(){return 0},ct.prototype.getNumGeometries=function(){return 1},ct.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},ct.prototype.getUserData=function(){return this._userData},ct.prototype.getSRID=function(){return this._SRID},ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ct.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")},ct.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ct.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ct.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new q(this._envelope)},ct.prototype.setSRID=function(t){this._SRID=t},ct.prototype.setUserData=function(t){this._userData=t},ct.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),s=i.compareTo(o);if(0!==s)return s}return n.hasNext()?1:r.hasNext()?-1:0},ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ct.SORTINDEX_MULTIPOLYGON},ct.prototype.interfaces_=function(){return[w,b,e]},ct.prototype.getClass=function(){return ct},ct.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ct.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},ht.serialVersionUID.get=function(){return 0x799ea46522854c00},ht.SORTINDEX_POINT.get=function(){return 0},ht.SORTINDEX_MULTIPOINT.get=function(){return 1},ht.SORTINDEX_LINESTRING.get=function(){return 2},ht.SORTINDEX_LINEARRING.get=function(){return 3},ht.SORTINDEX_MULTILINESTRING.get=function(){return 4},ht.SORTINDEX_POLYGON.get=function(){return 5},ht.SORTINDEX_MULTIPOLYGON.get=function(){return 6},ht.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},ht.geometryChangedFilter.get=function(){return ft},Object.defineProperties(ct,ht);var ft=function(){};ft.interfaces_=function(){return[lt]},ft.filter=function(t){t.geometryChangedAction()};var pt=function(){};pt.prototype.filter=function(t){},pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt};var dt=function(){},gt={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};dt.prototype.isInBoundary=function(t){},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt},gt.Mod2BoundaryNodeRule.get=function(){return yt},gt.EndPointBoundaryNodeRule.get=function(){return vt},gt.MultiValentEndPointBoundaryNodeRule.get=function(){return _t},gt.MonoValentEndPointBoundaryNodeRule.get=function(){return mt},gt.MOD2_BOUNDARY_RULE.get=function(){return new yt},gt.ENDPOINT_BOUNDARY_RULE.get=function(){return new vt},gt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},gt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},gt.OGC_SFS_BOUNDARY_RULE.get=function(){return dt.MOD2_BOUNDARY_RULE},Object.defineProperties(dt,gt);var yt=function(){};yt.prototype.isInBoundary=function(t){return t%2==1},yt.prototype.interfaces_=function(){return[dt]},yt.prototype.getClass=function(){return yt};var vt=function(){};vt.prototype.isInBoundary=function(t){return t>0},vt.prototype.interfaces_=function(){return[dt]},vt.prototype.getClass=function(){return vt};var _t=function(){};_t.prototype.isInBoundary=function(t){return t>1},_t.prototype.interfaces_=function(){return[dt]},_t.prototype.getClass=function(){return _t};var mt=function(){};mt.prototype.isInBoundary=function(t){return 1===t},mt.prototype.interfaces_=function(){return[dt]},mt.prototype.getClass=function(){return mt};var xt=function(){};xt.prototype.add=function(){},xt.prototype.addAll=function(){},xt.prototype.isEmpty=function(){},xt.prototype.iterator=function(){},xt.prototype.size=function(){},xt.prototype.toArray=function(){},xt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var bt=function(){};bt.prototype.hasNext=function(){},bt.prototype.next=function(){},bt.prototype.remove=function(){};var wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(xt);(r.prototype=new Error).name="NoSuchElementException";var Et=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,xt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new Ct(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(wt),Ct=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new r;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(bt),St=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[1],n=!1,r=arguments[0].iterator();r.hasNext();)this.add(r.next(),e),n=!0;return n}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof C&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],u=arguments[1];if(arguments[2])for(var l=0;l<a.length;l++)this.add(a[l],u);else for(var c=a.length-1;c>=0;c--)this.add(a[c],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof C){var h=arguments[0],f=arguments[1];if(!arguments[2]){var p=this.size();if(p>0){if(h>0&&this.get(h-1).equals2D(f))return null;if(h<p&&this.get(h).equals2D(f))return null}}t.prototype.add.call(this,h,f)}}else if(4===arguments.length){var d=arguments[0],g=arguments[1],y=arguments[2],v=arguments[3],_=1;y>v&&(_=-1);for(var m=y;m!==v;m+=_)this.add(d[m],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new C(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(Et),Pt=function(){},It={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};It.ForwardComparator.get=function(){return Mt},It.BidirectionalComparator.get=function(){return Ot},It.coordArrayType.get=function(){return new Array(0).fill(null)},Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt},Pt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Pt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Pt.indexOf(r,e)<0)return r}return null},Pt.scroll=function(t,e){var n=Pt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);W.arraycopy(t,n,r,0,t.length-n),W.arraycopy(t,0,r,t.length-n,n),W.arraycopy(r,0,t,0,t.length)},Pt.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var s=0;s<r.length;s++)if(0!==o.compare(r[s],i[s]))return!1;return!0}},Pt.intersection=function(t,e){for(var n=new St,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Pt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Pt.removeRepeatedPoints=function(t){return Pt.hasRepeatedPoints(t)?new St(t,!1).toCoordinateArray():t},Pt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},Pt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},Pt.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new C(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=0;u<a;u++)o[s+u]=new C(r[i+u])},Pt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},Pt.envelope=function(t){for(var e=new q,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Pt.toCoordinateArray=function(t){return t.toArray(Pt.coordArrayType)},Pt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Pt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Pt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},Pt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},Pt.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},Pt.extract=function(t,e,n){e=R.clamp(e,0,t.length);var r=(n=R.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,s=e;s<=n;s++)i[o++]=t[s];return i},Object.defineProperties(Pt,It);var Mt=function(){};Mt.prototype.compare=function(t,e){return Pt.compare(t,e)},Mt.prototype.interfaces_=function(){return[E]},Mt.prototype.getClass=function(){return Mt};var Ot=function(){};Ot.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var i=Pt.compare(n,r);return Pt.isEqualReversed(n,r)?0:i},Ot.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var i=Pt.increasingDirection(n),o=Pt.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var l=n[s].compareTo(r[a]);if(0!==l)return l;s+=i,a+=o}return 0},Ot.prototype.interfaces_=function(){return[E]},Ot.prototype.getClass=function(){return Ot};var Lt=function(){};Lt.prototype.get=function(){},Lt.prototype.put=function(){},Lt.prototype.size=function(){},Lt.prototype.values=function(){},Lt.prototype.entrySet=function(){};var Rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Lt);(i.prototype=new Error).name="OperationNotSupported",(o.prototype=new xt).contains=function(){};var kt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Tt(this)},e}(o),Tt=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new i},e}(bt),Nt=0;(h.prototype=new Rt).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},h.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Nt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var s={key:t,left:null,right:null,value:e,parent:n,color:Nt,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},h.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(a(t)===l(a(a(t)))){var e=c(a(a(t)));1===s(e)?(u(a(t),Nt),u(e,Nt),u(a(a(t)),1),t=a(a(t))):(t===c(a(t))&&(t=a(t),this.rotateLeft(t)),u(a(t),Nt),u(a(a(t)),1),this.rotateRight(a(a(t))))}else{var n=l(a(a(t)));1===s(n)?(u(a(t),Nt),u(n,Nt),u(a(a(t)),1),t=a(a(t))):(t===l(a(t))&&(t=a(t),this.rotateRight(t)),u(a(t),Nt),u(a(a(t)),1),this.rotateLeft(a(a(t))))}this.root_.color=Nt},h.prototype.values=function(){var t=new Et,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=h.successor(e));)t.add(e.value);return t},h.prototype.entrySet=function(){var t=new kt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=h.successor(e));)t.add(e);return t},h.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},h.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},h.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},h.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},h.prototype.size=function(){return this.size_};var At=function(){};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},f.prototype=new o,(p.prototype=new f).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},p.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},p.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},p.prototype.remove=function(t){throw new i},p.prototype.size=function(){return this.array_.length},p.prototype.isEmpty=function(){return 0===this.array_.length},p.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},p.prototype.iterator=function(){return new Dt(this)};var Dt=function(t){this.treeSet_=t,this.position_=0};Dt.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},Dt.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Dt.prototype.remove=function(){throw new i};var Ft=function(){};Ft.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},Ft.asList=function(t){for(var e=new Et,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var jt=function(){},Gt={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Gt.P.get=function(){return 0},Gt.L.get=function(){return 1},Gt.A.get=function(){return 2},Gt.FALSE.get=function(){return-1},Gt.TRUE.get=function(){return-2},Gt.DONTCARE.get=function(){return-3},Gt.SYM_FALSE.get=function(){return"F"},Gt.SYM_TRUE.get=function(){return"T"},Gt.SYM_DONTCARE.get=function(){return"*"},Gt.SYM_P.get=function(){return"0"},Gt.SYM_L.get=function(){return"1"},Gt.SYM_A.get=function(){return"2"},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.toDimensionSymbol=function(t){switch(t){case jt.FALSE:return jt.SYM_FALSE;case jt.TRUE:return jt.SYM_TRUE;case jt.DONTCARE:return jt.SYM_DONTCARE;case jt.P:return jt.SYM_P;case jt.L:return jt.SYM_L;case jt.A:return jt.SYM_A}throw new _("Unknown dimension value: "+t)},jt.toDimensionValue=function(t){switch(A.toUpperCase(t)){case jt.SYM_FALSE:return jt.FALSE;case jt.SYM_TRUE:return jt.TRUE;case jt.SYM_DONTCARE:return jt.DONTCARE;case jt.SYM_P:return jt.P;case jt.SYM_L:return jt.L;case jt.SYM_A:return jt.A}throw new _("Unknown dimension symbol: "+t)},Object.defineProperties(jt,Gt);var Bt=function(){};Bt.prototype.filter=function(t){},Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt};var zt=function(){};zt.prototype.filter=function(t,e){},zt.prototype.isDone=function(){},zt.prototype.isGeometryChanged=function(){},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt};var Vt=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new _("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new q,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();Ft.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=jt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=jt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new p(Ft.asList(this._geometries)),n=new p(Ft.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],i=arguments[0],o=this.getNumGeometries(),s=i.getNumGeometries(),a=0;a<o&&a<s;){var u=this.getGeometryN(a),l=i.getGeometryN(a),c=u.compareToSameClass(l,r);if(0!==c)return c;a++}return a<o?1:a<s?-1:0}},e.prototype.apply=function(){if(L(arguments[0],pt))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(L(arguments[0],zt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(L(arguments[0],Bt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(L(arguments[0],lt)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),et.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(ct),Ut=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?jt.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new Wt(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[At]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(Vt),Wt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=dt.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};Wt.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Wt.prototype.getBoundary=function(){return this._geom instanceof Zt?this.boundaryLineString(this._geom):this._geom instanceof Ut?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Wt.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Wt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Wt.prototype.computeBoundaryCoordinates=function(t){var e=new Et;this._endpointMap=new h;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return Pt.toCoordinateArray(e)},Wt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Xt,this._endpointMap.put(t,e)),e.count++},Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.getBoundary=function(){return 1===arguments.length?new Wt(arguments[0]).getBoundary():2===arguments.length?new Wt(arguments[0],arguments[1]).getBoundary():void 0};var Xt=function(){this.count=null};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt};var qt=function(){},Yt={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},qt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o="",s=new function(){}(new function(){}(qt.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+qt.NEWLINE}catch(t){if(!(t instanceof d))throw t;et.shouldNeverReachHere()}return o}},qt.split=function(t,e){for(var n=e.length,r=new Et,i=""+t,o=i.indexOf(e);o>=0;){var s=i.substring(0,o);r.add(s),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),u=0;u<a.length;u++)a[u]=r.get(u);return a},qt.toString=function(){if(1===arguments.length){var t=arguments[0];return qt.SIMPLE_ORDINATE_FORMAT.format(t)}},qt.spaces=function(t){return qt.chars(" ",t)},Yt.NEWLINE.get=function(){return W.getProperty("line.separator")},Yt.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(qt,Yt);var Ht=function(){};Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Ht.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,B.X)===t.getOrdinate(e-1,B.X)&&t.getOrdinate(0,B.Y)===t.getOrdinate(e-1,B.Y)},Ht.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var s=t.getOrdinate(i,o),a=e.getOrdinate(i,o);if(!(t.getOrdinate(i,o)===e.getOrdinate(i,o)||m.isNaN(s)&&m.isNaN(a)))return!1}return!0},Ht.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Ht.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Ht.copy(e,i-1,r,o,1);return r},Ht.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Ht.swap(t,r,e-r)},Ht.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Ht.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Ht.copyCoord(t,e+o,n,r+o)},Ht.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new T;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(qt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Ht.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Ht.createClosedRing(t,e,4):e.getOrdinate(0,B.X)===e.getOrdinate(n-1,B.X)&&e.getOrdinate(0,B.Y)===e.getOrdinate(n-1,B.Y)?e:Ht.createClosedRing(t,e,n+1)},Ht.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Ht.copy(e,0,r,0,i);for(var o=i;o<n;o++)Ht.copy(e,0,r,o,1);return r};var Zt=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new q:this._points.expandEnvelope(new q)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Ht.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?jt.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return at.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Ht.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(L(arguments[0],pt))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(L(arguments[0],zt)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Bt)||L(arguments[0],lt))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Wt(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new _("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[At]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ct),Kt=function(){};Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt};var Jt=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new q;var t=new q;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return jt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(L(arguments[0],pt)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(L(arguments[0],zt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Bt)||L(arguments[0],lt))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ct),$t=function(){};$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var Qt=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new _("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new _("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(at.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(at.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),a=1;a<=4;a++){var u=t.getX(a),l=t.getY(a);if(u!==o==(l!==s))return!1;o=u,s=l}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,o=r._shell;if(!i.equalsExact(o,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var s=0;s<this._holes.length;s++)if(!this._holes[s].equalsExact(r._holes[s],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);Ft.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);W.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Pt.minCoordinate(e.getCoordinates());Pt.scroll(r,i),W.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],at.isCCW(e.getCoordinates())===n&&Pt.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[1],i=arguments[0],o=this._shell,s=i._shell,a=o.compareToSameClass(s,r);if(0!==a)return a;for(var u=this.getNumInteriorRing(),l=i.getNumInteriorRing(),c=0;c<u&&c<l;){var h=this.getInteriorRingN(c),f=i.getInteriorRingN(c),p=h.compareToSameClass(f,r);if(0!==p)return p;c++}return c<u?1:c<l?-1:0}},e.prototype.apply=function(t){if(L(t,pt)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(L(t,zt)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(L(t,Bt))t.filter(this);else if(L(t,lt)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ct),te=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return jt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(Vt),ee=function(t){function e(e,n){e instanceof C&&n instanceof ve&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return jt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Ht.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new _("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new _("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Zt),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new Et,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(Vt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof Vt?this.editGeometryCollection(t,e):t instanceof Qt?this.editPolygon(t,e):t instanceof Jt||t instanceof Zt?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new Et,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Ut?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new Et,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||i.add(s)}return this._factory.createPolygon(r,i.toArray([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},ie.NoOpGeometryOperation.get=function(){return oe},ie.CoordinateOperation.get=function(){return se},ie.CoordinateSequenceOperation.get=function(){return ae},Object.defineProperties(re,ie);var oe=function(){};oe.prototype.edit=function(t,e){return t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var se=function(){};se.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof Zt?e.createLineString(n):t instanceof Jt?n.length>0?e.createPoint(n[0]):e.createPoint():t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=function(){};ae.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Zt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Jt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var ue=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new C}else if(L(arguments[0],B)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=new Array(s).fill(null),this._dimension=a;for(var u=0;u<s;u++)this._coordinates[u]=new C}},le={serialVersionUID:{configurable:!0}};ue.prototype.setOrdinate=function(t,e,n){switch(e){case B.X:this._coordinates[t].x=n;break;case B.Y:this._coordinates[t].y=n;break;case B.Z:this._coordinates[t].z=n;break;default:throw new _("invalid ordinateIndex")}},ue.prototype.size=function(){return this._coordinates.length},ue.prototype.getOrdinate=function(t,e){switch(e){case B.X:return this._coordinates[t].x;case B.Y:return this._coordinates[t].y;case B.Z:return this._coordinates[t].z}return m.NaN},ue.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},ue.prototype.getCoordinateCopy=function(t){return new C(this._coordinates[t])},ue.prototype.getDimension=function(){return this._dimension},ue.prototype.getX=function(t){return this._coordinates[t].x},ue.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new ue(t,this._dimension)},ue.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ue.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new ue(t,this._dimension)},ue.prototype.toString=function(){if(this._coordinates.length>0){var t=new T(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},ue.prototype.getY=function(t){return this._coordinates[t].y},ue.prototype.toCoordinateArray=function(){return this._coordinates},ue.prototype.interfaces_=function(){return[B,e]},ue.prototype.getClass=function(){return ue},le.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ue,le);var ce=function(){},he={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ce.prototype.readResolve=function(){return ce.instance()},ce.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new ue(arguments[0]);if(L(arguments[0],B))return new ue(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new ue(t):new ue(t,e)}},ce.prototype.interfaces_=function(){return[I,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new ce},Object.defineProperties(ce,he);var fe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new Et,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new kt;return this.map_.entries().forEach(function(e){return t.add(e)}),t},e.prototype.size=function(){return this.map_.size()},e}(Lt),pe=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ge){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},de={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};pe.prototype.equals=function(t){if(!(t instanceof pe))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},pe.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new N(n).compareTo(new N(r))},pe.prototype.getScale=function(){return this._scale},pe.prototype.isFloating=function(){return this._modelType===pe.FLOATING||this._modelType===pe.FLOATING_SINGLE},pe.prototype.getType=function(){return this._modelType},pe.prototype.toString=function(){var t="UNKNOWN";return this._modelType===pe.FLOATING?t="Floating":this._modelType===pe.FLOATING_SINGLE?t="Floating-Single":this._modelType===pe.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},pe.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return m.isNaN(t)||this._modelType===pe.FLOATING_SINGLE?t:this._modelType===pe.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof C){var e=arguments[0];if(this._modelType===pe.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},pe.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===pe.FLOATING?t=16:this._modelType===pe.FLOATING_SINGLE?t=6:this._modelType===pe.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},pe.prototype.setScale=function(t){this._scale=Math.abs(t)},pe.prototype.interfaces_=function(){return[e,b]},pe.prototype.getClass=function(){return pe},pe.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},de.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},de.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(pe,de);var ge=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ge.prototype.readResolve=function(){return ge.nameToTypeMap.get(this._name)},ge.prototype.toString=function(){return this._name},ge.prototype.interfaces_=function(){return[e]},ge.prototype.getClass=function(){return ge},ye.serialVersionUID.get=function(){return-552860263173159e4},ye.nameToTypeMap.get=function(){return new fe},Object.defineProperties(ge,ye),pe.Type=ge,pe.FIXED=new ge("FIXED"),pe.FLOATING=new ge("FLOATING"),pe.FLOATING_SINGLE=new ge("FLOATING SINGLE");var ve=function t(){this._precisionModel=new pe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?L(arguments[0],I)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof pe&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},_e={serialVersionUID:{configurable:!0}};ve.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new C(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new C(t.getMinX(),t.getMinY()),new C(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new C(t.getMinX(),t.getMinY()),new C(t.getMinX(),t.getMaxY()),new C(t.getMaxX(),t.getMaxY()),new C(t.getMaxX(),t.getMinY()),new C(t.getMinX(),t.getMinY())]),null)},ve.prototype.createLineString=function(t){return t?t instanceof Array?new Zt(this.getCoordinateSequenceFactory().create(t),this):L(t,B)?new Zt(t,this):void 0:new Zt(this.getCoordinateSequenceFactory().create([]),this)},ve.prototype.createMultiLineString=function(){return 0===arguments.length?new Ut(null,this):1===arguments.length?new Ut(arguments[0],this):void 0},ve.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(ve.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Qt)return this.createMultiPolygon(ve.toPolygonArray(t));if(a instanceof Zt)return this.createMultiLineString(ve.toLineStringArray(t));if(a instanceof Jt)return this.createMultiPoint(ve.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},ve.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},ve.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(L(arguments[0],B))return new Jt(arguments[0],this)}},ve.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ve.prototype.createPolygon=function(){if(0===arguments.length)return new Qt(null,null,this);if(1===arguments.length){if(L(arguments[0],B)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Qt(arguments[0],arguments[1],this)},ve.prototype.getSRID=function(){return this._SRID},ve.prototype.createGeometryCollection=function(){return 0===arguments.length?new Vt(null,this):1===arguments.length?new Vt(arguments[0],this):void 0},ve.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},ve.prototype.getPrecisionModel=function(){return this._precisionModel},ve.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],B))return new ee(arguments[0],this)}},ve.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},ve.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],B)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),r=0;r<e.size();r++){var i=this.getCoordinateSequenceFactory().create(1,e.getDimension());Ht.copy(e,r,i,0,1),n[r]=this.createPoint(i)}return this.createMultiPoint(n)}}},ve.prototype.interfaces_=function(){return[e]},ve.prototype.getClass=function(){return ve},ve.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.getDefaultCoordinateSequenceFactory=function(){return ce.instance()},ve.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ve.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},_e.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(ve,_e);var me=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],xe=function(t){this.geometryFactory=t||new ve};xe.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!be[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==me.indexOf(n)?be[n].apply(this,[e.coordinates]):"GeometryCollection"===n?be[n].apply(this,[e.geometries]):be[n].apply(this,[e])},xe.prototype.write=function(t){var e=t.getGeometryType();if(!we[e])throw new Error("Geometry is not supported");return we[e].apply(this,[t])};var be={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!be[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=be.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new C(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new C(t[0],t[1]),new C(t[2],t[1]),new C(t[2],t[3]),new C(t[0],t[3]),new C(t[0],t[1])])},Point:function(t){var e=new C(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(be.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=be.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(be.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=be.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=be.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);r.push(a)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(be.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},we={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:we.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(we.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=we.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=we.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(we[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},Ee=function(t){this.geometryFactory=t||new ve,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new xe(this.geometryFactory)};Ee.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===pe.FIXED&&this.reducePrecision(e),e},Ee.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var Ce=function(){this.parser=new xe(this.geometryFactory)};Ce.prototype.write=function(t){return this.parser.write(t)};var Se=function(){},Pe={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se},Se.opposite=function(t){return t===Se.LEFT?Se.RIGHT:t===Se.RIGHT?Se.LEFT:t},Pe.ON.get=function(){return 0},Pe.LEFT.get=function(){return 1},Pe.RIGHT.get=function(){return 2},Object.defineProperties(Se,Pe),(g.prototype=new Error).name="EmptyStackException",(y.prototype=new wt).add=function(t){return this.array_.push(t),!0},y.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},y.prototype.push=function(t){return this.array_.push(t),t},y.prototype.pop=function(t){if(0===this.array_.length)throw new g;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new g;return this.array_[this.array_.length-1]},y.prototype.empty=function(){return 0===this.array_.length},y.prototype.isEmpty=function(){return this.empty()},y.prototype.search=function(t){return this.array_.indexOf(t)},y.prototype.size=function(){return this.array_.length},y.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Ie=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Ie.prototype.getCoordinate=function(){return this._minCoord},Ie.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Ie.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=at.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===at.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===at.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Ie.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Se.LEFT;return n[e].y<n[e+1].y&&(r=Se.RIGHT),r},Ie.prototype.getEdge=function(){return this._orientedDe},Ie.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Ie.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Ie.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Se.LEFT&&(this._orientedDe=this._minDe.getSym())},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie};var Me=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new C(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Q),Oe=function(){this.array_=[]};Oe.prototype.addLast=function(t){this.array_.push(t)},Oe.prototype.removeFirst=function(){return this.array_.shift()},Oe.prototype.isEmpty=function(){return 0===this.array_.length};var Le=function(){this._finder=null,this._dirEdgeList=new Et,this._nodes=new Et,this._rightMostCoord=null,this._env=null,this._finder=new Ie};Le.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Le.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Le.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Me("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Le.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Se.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Le.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Le.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Se.RIGHT)>=1&&e.getDepth(Se.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Le.prototype.computeDepths=function(t){var e=new kt,n=new Oe,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},Le.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Le.prototype.getEnvelope=function(){if(null===this._env){for(var t=new q,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Le.prototype.addReachable=function(t){var e=new y;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Le.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Se.LEFT,t.getDepth(Se.RIGHT)),e.setDepth(Se.RIGHT,t.getDepth(Se.LEFT))},Le.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Le.prototype.getNodes=function(){return this._nodes},Le.prototype.getDirectedEdges=function(){return this._dirEdgeList},Le.prototype.interfaces_=function(){return[b]},Le.prototype.getClass=function(){return Le};var Re=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[Se.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.init(3),this.location[Se.ON]=o,this.location[Se.LEFT]=s,this.location[Se.RIGHT]=a}};Re.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Re.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==M.NONE)return!1;return!0},Re.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===M.NONE&&(this.location[e]=t)},Re.prototype.isLine=function(){return 1===this.location.length},Re.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Se.ON]=this.location[Se.ON],e[Se.LEFT]=M.NONE,e[Se.RIGHT]=M.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===M.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Re.prototype.getLocations=function(){return this.location},Re.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Se.LEFT];this.location[Se.LEFT]=this.location[Se.RIGHT],this.location[Se.RIGHT]=t},Re.prototype.toString=function(){var t=new T;return this.location.length>1&&t.append(M.toLocationSymbol(this.location[Se.LEFT])),t.append(M.toLocationSymbol(this.location[Se.ON])),this.location.length>1&&t.append(M.toLocationSymbol(this.location[Se.RIGHT])),t.toString()},Re.prototype.setLocations=function(t,e,n){this.location[Se.ON]=t,this.location[Se.LEFT]=e,this.location[Se.RIGHT]=n},Re.prototype.get=function(t){return t<this.location.length?this.location[t]:M.NONE},Re.prototype.isArea=function(){return this.location.length>1},Re.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===M.NONE)return!0;return!1},Re.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Se.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Re.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(M.NONE)},Re.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Re.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re};var ke=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Re(e),this.elt[1]=new Re(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Re(n.elt[0]),this.elt[1]=new Re(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Re(M.NONE),this.elt[1]=new Re(M.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new Re(o,s,a),this.elt[1]=new Re(o,s,a)}else if(4===arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new Re(M.NONE,M.NONE,M.NONE),this.elt[1]=new Re(M.NONE,M.NONE,M.NONE),this.elt[u].setLocations(l,c,h)}};ke.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},ke.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},ke.prototype.isNull=function(t){return this.elt[t].isNull()},ke.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},ke.prototype.isLine=function(t){return this.elt[t].isLine()},ke.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Re(t.elt[e]):this.elt[e].merge(t.elt[e])},ke.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},ke.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Se.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},ke.prototype.toString=function(){var t=new T;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},ke.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},ke.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},ke.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Se.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},ke.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},ke.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},ke.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Re(this.elt[t].location[0]))},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},ke.toLineLabel=function(t){for(var e=new ke(M.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Te=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Et,this._pts=new Et,this._label=new ke(M.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Et,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Te.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=at.isCCW(this._ring.getCoordinates())},Te.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Te.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Me("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Me("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Te.prototype.getLinearRing=function(){return this._ring},Te.prototype.getCoordinate=function(t){return this._pts.get(t)},Te.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Te.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var s=r.length-2;n&&(s=r.length-1);for(var a=s;a>=0;a--)this._pts.add(r[a])}},Te.prototype.isHole=function(){return this._isHole},Te.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Te.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!at.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Te.prototype.addHole=function(t){this._holes.add(t)},Te.prototype.isShell=function(){return null===this._shell},Te.prototype.getLabel=function(){return this._label},Te.prototype.getEdges=function(){return this._edges},Te.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Te.prototype.getShell=function(){return this._shell},Te.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,Se.RIGHT);if(n===M.NONE)return null;if(this._label.getLocation(e)===M.NONE)return this._label.setLocation(e,n),null}},Te.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Te.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var Ne=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Te),Ae=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new Et,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Ne(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Te),De=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};De.prototype.setVisited=function(t){this._isVisited=t},De.prototype.setInResult=function(t){this._isInResult=t},De.prototype.isCovered=function(){return this._isCovered},De.prototype.isCoveredSet=function(){return this._isCoveredSet},De.prototype.setLabel=function(t){this._label=t},De.prototype.getLabel=function(){return this._label},De.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},De.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},De.prototype.isInResult=function(){return this._isInResult},De.prototype.isVisited=function(){return this._isVisited},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De};var Fe=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new ke(0,M.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=M.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==M.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new ke(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof ke)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===M.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=M.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case M.BOUNDARY:n=M.INTERIOR;break;case M.INTERIOR:default:n=M.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(De),je=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};je.prototype.find=function(t){return this.nodeMap.get(t)},je.prototype.addNode=function(){if(arguments[0]instanceof C){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Fe){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},je.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},je.prototype.iterator=function(){return this.nodeMap.values().iterator()},je.prototype.values=function(){return this.nodeMap.values()},je.prototype.getBoundaryNodes=function(t){for(var e=new Et,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===M.BOUNDARY&&e.add(r)}return e},je.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var Ge=function(){},Be={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.isNorthern=function(t){return t===Ge.NE||t===Ge.NW},Ge.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Ge.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Ge.isInHalfPlane=function(t,e){return e===Ge.SE?t===Ge.SE||t===Ge.SW:t===e||t===e+1},Ge.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ge.NE:Ge.SE:e>=0?Ge.NW:Ge.SW}if(arguments[0]instanceof C&&arguments[1]instanceof C){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new _("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ge.NE:Ge.SE:r.y>=n.y?Ge.NW:Ge.SW}},Be.NE.get=function(){return 0},Be.NW.get=function(){return 1},Be.SW.get=function(){return 2},Be.SE.get=function(){return 3},Object.defineProperties(Ge,Be);var ze=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=i,this.init(o,s),this._label=a}};ze.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:at.computeOrientation(t._p0,t._p1,this._p1)},ze.prototype.getDy=function(){return this._dy},ze.prototype.getCoordinate=function(){return this._p0},ze.prototype.setNode=function(t){this._node=t},ze.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},ze.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},ze.prototype.getDirectedCoordinate=function(){return this._p1},ze.prototype.getDx=function(){return this._dx},ze.prototype.getLabel=function(){return this._label},ze.prototype.getEdge=function(){return this._edge},ze.prototype.getQuadrant=function(){return this._quadrant},ze.prototype.getNode=function(){return this._node},ze.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},ze.prototype.computeLabel=function(t){},ze.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Ge.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},ze.prototype.interfaces_=function(){return[b]},ze.prototype.getClass=function(){return ze};var Ve=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new ke(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Me("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Se.LEFT)===M.INTERIOR&&this._label.getLocation(e,Se.RIGHT)===M.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Se.LEFT]+"/"+this._depth[Se.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,M.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,M.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Se.LEFT&&(r=-1);var i=Se.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===M.EXTERIOR&&e===M.INTERIOR?1:t===M.INTERIOR&&e===M.EXTERIOR?-1:0},e}(ze),Ue=function(){};Ue.prototype.createNode=function(t){return new Fe(t,null)},Ue.prototype.interfaces_=function(){return[]},Ue.prototype.getClass=function(){return Ue};var We=function(){if(this._edges=new Et,this._nodes=null,this._edgeEndList=new Et,0===arguments.length)this._nodes=new je(new Ue);else if(1===arguments.length){var t=arguments[0];this._nodes=new je(t)}};We.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},We.prototype.find=function(t){return this._nodes.find(t)},We.prototype.addNode=function(){if(arguments[0]instanceof Fe){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof C){var e=arguments[0];return this._nodes.addNode(e)}},We.prototype.getNodeIterator=function(){return this._nodes.iterator()},We.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},We.prototype.debugPrintln=function(t){W.out.println(t)},We.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===M.BOUNDARY},We.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},We.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&at.computeOrientation(t,e,r)===at.COLLINEAR&&Ge.quadrant(t,e)===Ge.quadrant(n,r)},We.prototype.getEdgeEnds=function(){return this._edgeEndList},We.prototype.debugPrint=function(t){W.out.print(t)},We.prototype.getEdgeIterator=function(){return this._edges.iterator()},We.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},We.prototype.insertEdge=function(t){this._edges.add(t)},We.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},We.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new Ve(n,!0),i=new Ve(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},We.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},We.prototype.getNodes=function(){return this._nodes.values()},We.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},We.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Xe=function(){this._geometryFactory=null,this._shellList=new Et;var t=arguments[0];this._geometryFactory=t};Xe.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Xe.prototype.computePolygons=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Xe.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Me("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Xe.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new Et,i=t.iterator();i.hasNext();){var o=i.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else r.add(o)}return r},Xe.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Xe.prototype.buildMaximalEdgeRings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Ae(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Xe.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Xe.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Xe.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(r)&&at.isPointInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=u)}return o},Xe.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Xe.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];We.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new Et,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var qe=function(){};qe.prototype.getBounds=function(){},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe};var Ye=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Ye.prototype.getItem=function(){return this._item},Ye.prototype.getBounds=function(){return this._bounds},Ye.prototype.interfaces_=function(){return[qe,e]},Ye.prototype.getClass=function(){return Ye};var He=function(){this._size=null,this._items=null,this._size=0,this._items=new Et,this._items.add(null)};He.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},He.prototype.size=function(){return this._size},He.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},He.prototype.clear=function(){this._size=0,this._items.clear()},He.prototype.isEmpty=function(){return 0===this._size},He.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var Ze=function(){};Ze.prototype.visitItem=function(t){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var Ke=function(){};Ke.prototype.insert=function(t,e){},Ke.prototype.remove=function(t,e){},Ke.prototype.query=function(){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Je=function(){if(this._childBoundables=new Et,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},$e={serialVersionUID:{configurable:!0}};Je.prototype.getLevel=function(){return this._level},Je.prototype.size=function(){return this._childBoundables.size()},Je.prototype.getChildBoundables=function(){return this._childBoundables},Je.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Je.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Je.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Je.prototype.interfaces_=function(){return[qe,e]},Je.prototype.getClass=function(){return Je},$e.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Je,$e);var Qe=function(){};Qe.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Qe.min=function(t){return Qe.sort(t),t.get(0)},Qe.sort=function(t,e){var n=t.toArray();e?Ft.sort(n,e):Ft.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},Qe.singletonList=function(t){var e=new Et;return e.add(t),e};var tn=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new _("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new tn(o,e,this._itemDistance);s.getDistance()<r&&n.add(s)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[b]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof Je};var en=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new Et,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Je?t+=this.size(n):n instanceof Ye&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof Ye&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new Et:t}if(1===arguments.length){for(var e=arguments[0],n=new Et,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Je){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof Ye?n.add(i.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ye(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Je?this.boundablesAtLevel(n,s,i):(et.isTrue(s instanceof Ye),-1===n&&i.add(s))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new Et;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(L(arguments[2],Ze)&&arguments[0]instanceof Object&&arguments[1]instanceof Je)for(var i=arguments[0],o=arguments[2],s=arguments[1].getChildBoundables(),a=0;a<s.size();a++){var u=s.get(a);this.getIntersectsOp().intersects(u.getBounds(),i)&&(u instanceof Je?this.query(i,u,o):u instanceof Ye?o.visitItem(u.getItem()):et.shouldNeverReachHere())}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Je)for(var l=arguments[0],c=arguments[2],h=arguments[1].getChildBoundables(),f=0;f<h.size();f++){var p=h.get(f);this.getIntersectsOp().intersects(p.getBounds(),l)&&(p instanceof Je?this.query(l,p,c):p instanceof Ye?c.add(p.getItem()):et.shouldNeverReachHere())}},en.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},en.prototype.getRoot=function(){return this.build(),this._root},en.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var s=null,a=r.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Je&&(o=this.remove(n,u,i))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Je){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new Et;n.add(this.createNode(e));var r=new Et(t);Qe.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},on=function(){};on.prototype.distance=function(t,e){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on};var sn=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new Et,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new an(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o<e;o++){r[o]=new Et;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}return r},n.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(L(arguments[2],Ze)&&arguments[0]instanceof Object&&arguments[1]instanceof Je){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Je){var a=arguments[0],u=arguments[1],l=arguments[2];t.prototype.query.call(this,a,u,l)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new Et(t);Qe.sort(i,n.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(L(arguments[0],on)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,m.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&L(arguments[1],on)){var i=arguments[0],o=arguments[1],s=new tn(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var a=arguments[0],u=arguments[1],l=null,c=new He;for(c.add(a);!c.isEmpty()&&u>0;){var h=c.poll(),f=h.getDistance();if(f>=u)break;h.isLeaves()?(u=f,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var p=arguments[2],d=new Ye(arguments[0],arguments[1]),g=new tn(this.getRoot(),d,p);return this.nearestNeighbour(g)[0]}},n.prototype.interfaces_=function(){return[Ke,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return an},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),an=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new q(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Je),un=function(){};un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.relativeSign=function(t,e){return t<e?-1:t>e?1:0},un.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=un.relativeSign(e.x,n.x),i=un.relativeSign(e.y,n.y);switch(t){case 0:return un.compareValue(r,i);case 1:return un.compareValue(i,r);case 2:return un.compareValue(i,-r);case 3:return un.compareValue(-r,i);case 4:return un.compareValue(-r,-i);case 5:return un.compareValue(-i,-r);case 6:return un.compareValue(-i,r);case 7:return un.compareValue(r,-i)}return et.shouldNeverReachHere("invalid octant value"),0},un.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ln=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new C(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};ln.prototype.getCoordinate=function(){return this.coord},ln.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ln.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:un.compare(this._segmentOctant,this.coord,e.coord)},ln.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ln.prototype.isInterior=function(){return this._isInterior},ln.prototype.interfaces_=function(){return[b]},ln.prototype.getClass=function(){return ln};var cn=function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t};cn.prototype.getSplitCoordinates=function(){var t=new St;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},cn.prototype.addCollapsedNodes=function(){var t=new Et;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new N(e+1))}},cn.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new C(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new C(e.coord))},cn.prototype.iterator=function(){return this._nodeMap.values().iterator()},cn.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},cn.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},cn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new N(e[0])),r=i}},cn.prototype.getEdge=function(){return this._edge},cn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new C(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new C(e.coord)),new dn(o,this._edge.getData())},cn.prototype.add=function(t,e){var n=new ln(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},cn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Q("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new Q("bad split edge end point at "+i)},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var hn=function(){};hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn},hn.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof C&&arguments[1]instanceof C){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new _("Cannot compute the octant for two identical points "+i);return hn.octant(s,a)}};var fn=function(){};fn.prototype.getCoordinates=function(){},fn.prototype.size=function(){},fn.prototype.getCoordinate=function(t){},fn.prototype.isClosed=function(){},fn.prototype.setData=function(t){},fn.prototype.getData=function(){},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var pn=function(){};pn.prototype.addIntersection=function(t,e){},pn.prototype.interfaces_=function(){return[fn]},pn.prototype.getClass=function(){return pn};var dn=function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};dn.prototype.getCoordinates=function(){return this._pts},dn.prototype.size=function(){return this._pts.length},dn.prototype.getCoordinate=function(t){return this._pts[t]},dn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},dn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},dn.prototype.setData=function(t){this._data=t},dn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:hn.octant(t,e)},dn.prototype.getData=function(){return this._data},dn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i=new C(arguments[0].getIntersection(r));this.addIntersection(i,n)}},dn.prototype.toString=function(){return $.toLineString(new ue(this._pts))},dn.prototype.getNodeList=function(){return this._nodeList},dn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},dn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},dn.prototype.interfaces_=function(){return[pn]},dn.prototype.getClass=function(){return dn},dn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return dn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(n)};var gn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new C,this.p1=new C;else if(1===arguments.length){var t=arguments[0];this.p0=new C(t.p0),this.p1=new C(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new C(e,n),this.p1=new C(r,i)}},yn={serialVersionUID:{configurable:!0}};gn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},gn.prototype.orientationIndex=function(){if(arguments[0]instanceof gn){var t=arguments[0],e=at.orientationIndex(this.p0,this.p1,t.p0),n=at.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof C){var r=arguments[0];return at.orientationIndex(this.p0,this.p1,r)}},gn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gn.prototype.isVertical=function(){return this.p0.x===this.p1.x},gn.prototype.equals=function(t){if(!(t instanceof gn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gn.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gn.prototype.project=function(){if(arguments[0]instanceof C){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new C(t);var e=this.projectionFactor(t),n=new C;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof gn){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new gn(s,a)}},gn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},gn.prototype.distancePerpendicular=function(t){return at.distancePointLinePerpendicular(t,this.p0,this.p1)},gn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gn.prototype.midPoint=function(){return gn.midPoint(this.p0,this.p1)},gn.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?m.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},gn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=m.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))<r&&(r=i,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);(i=a.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=a);var u=t.closestPoint(this.p1);return(i=u.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=u),n},gn.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},gn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},gn.prototype.getLength=function(){return this.p0.distance(this.p1)},gn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},gn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},gn.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},gn.prototype.lineIntersection=function(t){try{return X.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof U))throw t}return null},gn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},gn.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(i*i+o*o),a=0,u=0;if(0!==e){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");a=e*i/s,u=e*o/s}return new C(n-u,r+a)},gn.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},gn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||m.isNaN(e))&&(e=1),e},gn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gn.prototype.distance=function(){if(arguments[0]instanceof gn){var t=arguments[0];return at.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof C){var e=arguments[0];return at.distancePointLine(e,this.p0,this.p1)}},gn.prototype.pointAlong=function(t){var e=new C;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},gn.prototype.hashCode=function(){var t=m.doubleToLongBits(this.p0.x);t^=31*m.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=m.doubleToLongBits(this.p1.x);return n^=31*m.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},gn.prototype.interfaces_=function(){return[b,e]},gn.prototype.getClass=function(){return gn},gn.midPoint=function(t,e){return new C((t.x+e.x)/2,(t.y+e.y)/2)},yn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gn,yn);var vn=function(){this.tempEnv1=new q,this.tempEnv2=new q,this._overlapSeg1=new gn,this._overlapSeg2=new gn};vn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var _n=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};_n.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_n.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,r),s<n&&this.computeSelect(t,s,n,r)},_n.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},_n.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_n.prototype.setId=function(t){this._id=t},_n.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_n.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new q(t,e)}return this._env},_n.prototype.getEndIndex=function(){return this._end},_n.prototype.getStartIndex=function(){return this._start},_n.prototype.getContext=function(){return this._context},_n.prototype.getId=function(){return this._id},_n.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var s=this._pts[t],a=this._pts[e],u=n._pts[r],l=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,l),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((r+i)/2);t<c&&(r<h&&this.computeOverlapsInternal(t,c,n,r,h,o),h<i&&this.computeOverlapsInternal(t,c,n,h,i,o)),c<e&&(r<h&&this.computeOverlapsInternal(c,e,n,r,h,o),h<i&&this.computeOverlapsInternal(c,e,n,h,i,o))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n};var mn=function(){};mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.getChainStartIndices=function(t){var e=0,n=new Et;n.add(new N(e));do{var r=mn.findChainEnd(t,e);n.add(new N(r)),e=r}while(e<t.length-1);return mn.toIntArray(n)},mn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Ge.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Ge.quadrant(t[i-1],t[i])===r);)i++;return i-1},mn.getChains=function(){if(1===arguments.length){var t=arguments[0];return mn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new Et,i=mn.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new _n(e,i[o],i[o+1],n);r.add(s)}return r}},mn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var xn=function(){};xn.prototype.computeNodes=function(t){},xn.prototype.getNodedSubstrings=function(){},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn};var bn=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};bn.prototype.setSegmentIntersector=function(t){this._segInt=t},bn.prototype.interfaces_=function(){return[xn]},bn.prototype.getClass=function(){return bn};var wn=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new Et,this._index=new sn,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return dn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=mn.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new En(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return En},Object.defineProperties(e,n),e}(bn),En=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],n=arguments[2],r=arguments[3],i=arguments[0].getContext(),o=n.getContext();this._si.processIntersections(i,e,o,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(vn),Cn=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},Sn={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Cn.prototype.getEndCapStyle=function(){return this._endCapStyle},Cn.prototype.isSingleSided=function(){return this._isSingleSided},Cn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Cn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Cn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Cn.JOIN_ROUND&&(this._quadrantSegments=Cn.DEFAULT_QUADRANT_SEGMENTS)},Cn.prototype.getJoinStyle=function(){return this._joinStyle},Cn.prototype.setJoinStyle=function(t){this._joinStyle=t},Cn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Cn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Cn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Cn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Cn.prototype.getMitreLimit=function(){return this._mitreLimit},Cn.prototype.setMitreLimit=function(t){this._mitreLimit=t},Cn.prototype.setSingleSided=function(t){this._isSingleSided=t},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Sn.CAP_ROUND.get=function(){return 1},Sn.CAP_FLAT.get=function(){return 2},Sn.CAP_SQUARE.get=function(){return 3},Sn.JOIN_ROUND.get=function(){return 1},Sn.JOIN_MITRE.get=function(){return 2},Sn.JOIN_BEVEL.get=function(){return 3},Sn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Sn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Sn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Cn,Sn);var Pn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=at.COUNTERCLOCKWISE,this._inputLine=t||null},In={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Pn.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r)},Pn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Pn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Pn.prototype.isShallowConcavity=function(t,e,n,r){return at.computeOrientation(t,e,n)===this._angleOrientation&&at.distancePointLine(e,t,n)<r},Pn.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Pn.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<r;s+=o)if(!this.isShallow(t,e,this._inputLine[s],i))return!1;return!0},Pn.prototype.isConcave=function(t,e,n){return at.computeOrientation(t,e,n)===this._angleOrientation},Pn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=at.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},Pn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Pn.DELETE;)e++;return e},Pn.prototype.isShallow=function(t,e,n,r){return at.distancePointLine(e,t,n)<r},Pn.prototype.collapseLine=function(){for(var t=new St,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Pn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Pn.simplify=function(t,e){return new Pn(t).simplify(e)},In.INIT.get=function(){return 0},In.DELETE.get=function(){return 1},In.KEEP.get=function(){return 1},In.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Pn,In);var Mn=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Et},On={COORDINATE_ARRAY_TYPE:{configurable:!0}};Mn.prototype.getCoordinates=function(){return this._ptList.toArray(Mn.COORDINATE_ARRAY_TYPE)},Mn.prototype.setPrecisionModel=function(t){this._precisionModel=t},Mn.prototype.addPt=function(t){var e=new C(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Mn.prototype.revere=function(){},Mn.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},Mn.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},Mn.prototype.toString=function(){return(new ve).createLineString(this.getCoordinates()).toString()},Mn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new C(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Mn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},On.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Mn,On);var Ln=function(){},Rn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.toDegrees=function(t){return 180*t/Math.PI},Ln.normalize=function(t){for(;t>Math.PI;)t-=Ln.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ln.PI_TIMES_2;return t},Ln.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Ln.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},Ln.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},Ln.interiorAngle=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Math.abs(i-r)},Ln.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ln.PI_TIMES_2;t>=Ln.PI_TIMES_2&&(t=0)}else{for(;t>=Ln.PI_TIMES_2;)t-=Ln.PI_TIMES_2;t<0&&(t=0)}return t},Ln.angleBetween=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Ln.diff(r,i)},Ln.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Ln.toRadians=function(t){return t*Math.PI/180},Ln.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ln.COUNTERCLOCKWISE:n<0?Ln.CLOCKWISE:Ln.NONE},Ln.angleBetweenOriented=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n)-r;return i<=-Math.PI?i+Ln.PI_TIMES_2:i>Math.PI?i-Ln.PI_TIMES_2:i},Rn.PI_TIMES_2.get=function(){return 2*Math.PI},Rn.PI_OVER_2.get=function(){return Math.PI/2},Rn.PI_OVER_4.get=function(){return Math.PI/4},Rn.COUNTERCLOCKWISE.get=function(){return at.COUNTERCLOCKWISE},Rn.CLOCKWISE.get=function(){return at.CLOCKWISE},Rn.NONE.get=function(){return at.COLLINEAR},Object.defineProperties(Ln,Rn);var kn=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new gn,this._seg1=new gn,this._offset0=new gn,this._offset1=new gn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new it,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Cn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Tn={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};kn.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=at.computeOrientation(this._s0,this._s1,this._s2),r=n===at.CLOCKWISE&&this._side===Se.LEFT||n===at.COUNTERCLOCKWISE&&this._side===Se.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},kn.prototype.addLineEndCap=function(t,e){var n=new gn(t,e),r=new gn;this.computeOffsetSegment(n,Se.LEFT,this._distance,r);var i=new gn;this.computeOffsetSegment(n,Se.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case Cn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,at.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Cn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Cn.CAP_SQUARE:var u=new C;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var l=new C(r.p1.x+u.x,r.p1.y+u.y),c=new C(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},kn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},kn.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=X.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof U))throw t;o=new C(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},kn.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,u);r===at.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,r,i),this._segList.addPt(n)},kn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*kn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Cn.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Cn.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},kn.prototype.createSquare=function(t){this._segList.addPt(new C(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new C(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new C(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new C(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},kn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},kn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},kn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},kn.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},kn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=Ln.angle(i,this._seg0.p0),s=Ln.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=Ln.normalize(o+s),u=Ln.normalize(a+Math.PI),l=r*n,c=n-l*Math.abs(Math.sin(s)),h=i.x+l*Math.cos(u),f=i.y+l*Math.sin(u),p=new C(h,f),d=new gn(i,p),g=d.pointAlongOffset(1,c),y=d.pointAlongOffset(1,-c);this._side===Se.LEFT?(this._segList.addPt(g),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(g))},kn.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Se.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),u=i*n*o/a,l=i*n*s/a;r.p0.x=t.p0.x-l,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-l,r.p1.y=t.p1.y+u},kn.prototype.addFilletArc=function(t,e,n,r,i){var o=r===at.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;for(var u=s/a,l=0,c=new C;l<s;){var h=e+o*l;c.x=t.x+i*Math.cos(h),c.y=t.y+i*Math.sin(h),this._segList.addPt(c),l+=u}},kn.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*kn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new C((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new C((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},kn.prototype.createCircle=function(t){var e=new C(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},kn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},kn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Mn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*kn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},kn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Cn.JOIN_BEVEL||this._bufParams.getJoinStyle()===Cn.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,at.CLOCKWISE,this._distance))},kn.prototype.closeRing=function(){this._segList.closeRing()},kn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},Tn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Tn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Tn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Tn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(kn,Tn);var Nn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Nn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Pt.reverse(o),o},Nn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Pn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Se.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Pn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Se.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment(),n.closeRing()},Nn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Se.RIGHT&&(r=-r);var i=Pn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()},Nn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Pn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Se.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Pn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Se.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},Nn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Cn.CAP_ROUND:e.createCircle(t);break;case Cn.CAP_SQUARE:e.createSquare(t)}},Nn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},Nn.prototype.getBufferParameters=function(){return this._bufParams},Nn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Nn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Nn.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Nn.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Pn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Se.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Pn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Se.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment()},Nn.prototype.getSegGen=function(t){return new kn(this._precisionModel,this._bufParams,t)},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn},Nn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new C(t[n]);return e};var An=function(){this._subgraphs=null,this._seg=new gn,this._cga=new at;var t=arguments[0];this._subgraphs=t},Dn={DepthSegment:{configurable:!0}};An.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new Et,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(L(arguments[2],wt)&&arguments[0]instanceof C&&arguments[1]instanceof Ve){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),l=0;l<u.length-1;l++)if(this._seg.p0=u[l],this._seg.p1=u[l+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x||this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||at.computeOrientation(this._seg.p0,this._seg.p1,o)===at.RIGHT)){var c=s.getDepth(Se.LEFT);this._seg.p0.equals(u[l])||(c=s.getDepth(Se.RIGHT));var h=new Fn(this._seg,c);a.add(h)}}else if(L(arguments[2],wt)&&arguments[0]instanceof C&&L(arguments[1],wt))for(var f=arguments[0],p=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&this.findStabbedSegments(f,g,p)}},An.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Qe.min(e)._leftDepth},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},Dn.DepthSegment.get=function(){return Fn},Object.defineProperties(An,Dn);var Fn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gn(t),this._leftDepth=e};Fn.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Fn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Fn.prototype.toString=function(){return this._upwardSeg.toString()},Fn.prototype.interfaces_=function(){return[b]},Fn.prototype.getClass=function(){return Fn};var jn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};jn.prototype.area=function(){return jn.area(this.p0,this.p1,this.p2)},jn.prototype.signedArea=function(){return jn.signedArea(this.p0,this.p1,this.p2)},jn.prototype.interpolateZ=function(t){if(null===t)throw new _("Supplied point is null.");return jn.interpolateZ(t,this.p0,this.p1,this.p2)},jn.prototype.longestSideLength=function(){return jn.longestSideLength(this.p0,this.p1,this.p2)},jn.prototype.isAcute=function(){return jn.isAcute(this.p0,this.p1,this.p2)},jn.prototype.circumcentre=function(){return jn.circumcentre(this.p0,this.p1,this.p2)},jn.prototype.area3D=function(){return jn.area3D(this.p0,this.p1,this.p2)},jn.prototype.centroid=function(){return jn.centroid(this.p0,this.p1,this.p2)},jn.prototype.inCentre=function(){return jn.inCentre(this.p0,this.p1,this.p2)},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},jn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},jn.det=function(t,e,n,r){return t*r-e*n},jn.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,l=r.y-o,c=s*l-a*u,h=t.x-i,f=t.y-o,p=(l*h-a*f)/c,d=(-u*h+s*f)/c;return e.z+p*(n.z-e.z)+d*(r.z-e.z)},jn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s},jn.isAcute=function(t,e,n){return!!Ln.isAcute(t,e,n)&&!!Ln.isAcute(e,n,t)&&!!Ln.isAcute(n,t,e)},jn.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,u=e.y-i,l=2*jn.det(o,s,a,u),c=jn.det(s,o*o+s*s,u,a*a+u*u),h=jn.det(o,o*o+s*s,a,a*a+u*u);return new C(r-c/l,i+h/l)},jn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new X(t.x+n/2,t.y+r/2,1),o=new X(t.x-r+n/2,t.y+n+r/2,1);return new X(i,o)},jn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new C(t.x+i*o,t.y+i*s)},jn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,l=i*u-o*a,c=o*s-r*u,h=r*a-i*s,f=l*l+c*c+h*h;return Math.sqrt(f)/2},jn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new C(r,i)},jn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,u=(r*t.y+i*e.y+o*n.y)/s;return new C(a,u)};var Gn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Et;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,M.EXTERIOR,M.INTERIOR)},Gn.prototype.addPolygon=function(t){var e=this._distance,n=Se.LEFT;this._distance<0&&(e=-this._distance,n=Se.RIGHT);var r=t.getExteriorRing(),i=Pt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,M.EXTERIOR,M.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=Pt.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Se.opposite(n),M.INTERIOR,M.EXTERIOR)}},Gn.prototype.isTriangleErodedCompletely=function(t,e){var n=new jn(t[0],t[1],t[2]),r=n.inCentre();return at.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Gn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Pt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,M.EXTERIOR,M.INTERIOR)},Gn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new dn(t,new ke(0,M.BOUNDARY,e,n));this._curveList.add(r)},Gn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Gn.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=ee.MINIMUM_VALID_SIZE&&at.isCCW(t)&&(o=i,s=r,n=Se.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Qt?this.addPolygon(t):t instanceof Zt?this.addLineString(t):t instanceof Jt?this.addPoint(t):(t instanceof te||t instanceof Ut||t instanceof ne||t instanceof Vt)&&this.addCollection(t)},Gn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},Gn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var Bn=function(){};Bn.prototype.locate=function(t){},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn};var zn=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};zn.prototype.next=function(){if(this._atStart)return this._atStart=!1,zn.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof Vt?(this._subcollectionIterator=new zn(t),this._subcollectionIterator.next()):t},zn.prototype.remove=function(){throw new Error(this.getClass().getName())},zn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},zn.prototype.interfaces_=function(){return[bt]},zn.prototype.getClass=function(){return zn},zn.isAtomic=function(t){return!(t instanceof Vt)};var Vn=function(){this._geom=null;var t=arguments[0];this._geom=t};Vn.prototype.locate=function(t){return Vn.locate(t,this._geom)},Vn.prototype.interfaces_=function(){return[Bn]},Vn.prototype.getClass=function(){return Vn},Vn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&at.isPointInRing(t,e.getCoordinates())},Vn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Vn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(Vn.isPointInRing(t,i))return!1}return!0},Vn.containsPoint=function(t,e){if(e instanceof Qt)return Vn.containsPointInPolygon(t,e);if(e instanceof Vt)for(var n=new zn(e);n.hasNext();){var r=n.next();if(r!==e&&Vn.containsPoint(t,r))return!0}return!1},Vn.locate=function(t,e){return e.isEmpty()?M.EXTERIOR:Vn.containsPoint(t,e)?M.INTERIOR:M.EXTERIOR};var Un=function(){this._edgeMap=new h,this._edgeList=null,this._ptInAreaLocation=[M.NONE,M.NONE]};Un.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Un.prototype.propagateSideLabels=function(t){for(var e=M.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Se.LEFT)!==M.NONE&&(e=r.getLocation(t,Se.LEFT))}if(e===M.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,Se.ON)===M.NONE&&a.setLocation(t,Se.ON,i),a.isArea(t)){var u=a.getLocation(t,Se.LEFT),l=a.getLocation(t,Se.RIGHT);if(l!==M.NONE){if(l!==i)throw new Me("side location conflict",s.getCoordinate());u===M.NONE&&et.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else et.isTrue(a.getLocation(t,Se.LEFT)===M.NONE,"found single null side"),a.setLocation(t,Se.RIGHT,i),a.setLocation(t,Se.LEFT,i)}}},Un.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Un.prototype.print=function(t){W.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},Un.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Un.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Se.LEFT);et.isTrue(r!==M.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();et.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,Se.LEFT),u=s.getLocation(t,Se.RIGHT);if(a===u)return!1;if(u!==i)return!1;i=a}return!0},Un.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},Un.prototype.iterator=function(){return this.getEdges().iterator()},Un.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new Et(this._edgeMap.values())),this._edgeList},Un.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===M.NONE&&(this._ptInAreaLocation[t]=Vn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Un.prototype.toString=function(){var t=new T;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},Un.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},Un.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===M.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel(),u=0;u<2;u++)if(a.isAnyNull(u)){var l=M.NONE;if(e[u])l=M.EXTERIOR;else{var c=s.getCoordinate();l=this.getLocation(u,c,t)}a.setAllLocationsIfNull(u,l)}},Un.prototype.getDegree=function(){return this._edgeMap.size()},Un.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var Wn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Me("no outgoing dirEdge found",this.getCoordinate());et.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),i=n.getQuadrant(),o=r.getQuadrant();return Ge.isNorthern(i)&&Ge.isNorthern(o)?n:Ge.isNorthern(i)||Ge.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){W.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Et;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Se.LEFT),r=t.getDepth(Se.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Me("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a<o;a++){var u=this._edgeList.get(a);u.setEdgeDepths(Se.RIGHT,s),s=u.getDepth(Se.LEFT)}return s}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=this._resultAreaEdgeList.get(i),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=M.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=M.INTERIOR;break}if(r.isInResult()){t=M.EXTERIOR;break}}}if(t===M.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===M.INTERIOR):(s.isInResult()&&(i=M.EXTERIOR),a.isInResult()&&(i=M.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new ke(M.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==M.INTERIOR&&o!==M.BOUNDARY||this._label.setLocation(i,M.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Un),Xn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Fe(t,new Wn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ue),qn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};qn.prototype.compareTo=function(t){var e=t;return qn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},qn.prototype.interfaces_=function(){return[b]},qn.prototype.getClass=function(){return qn},qn.orientation=function(t){return 1===Pt.increasingDirection(t)},qn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,l=r?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(0!==c)return c;var h=(u+=i)===s,f=(l+=o)===a;if(h&&!f)return-1;if(!h&&f)return 1;if(h&&f)return 0}};var Yn=function(){this._edges=new Et,this._ocaMap=new h};Yn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Yn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Yn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Yn.prototype.iterator=function(){return this._edges.iterator()},Yn.prototype.getEdges=function(){return this._edges},Yn.prototype.get=function(t){return this._edges.get(t)},Yn.prototype.findEqualEdge=function(t){var e=new qn(t.getCoordinates());return this._ocaMap.get(e)},Yn.prototype.add=function(t){this._edges.add(t);var e=new qn(t.getCoordinates());this._ocaMap.put(e,t)},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var Hn=function(){};Hn.prototype.processIntersections=function(t,e,n,r){},Hn.prototype.isDone=function(){},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Zn=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Zn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Zn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Zn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Zn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Zn.prototype.getLineIntersector=function(){return this._li},Zn.prototype.hasProperIntersection=function(){return this._hasProper},Zn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Zn.prototype.hasIntersection=function(){return this._hasIntersection},Zn.prototype.isDone=function(){return!1},Zn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Zn.prototype.interfaces_=function(){return[Hn]},Zn.prototype.getClass=function(){return Zn},Zn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Kn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new C(t),this.segmentIndex=e,this.dist=n};Kn.prototype.getSegmentIndex=function(){return this.segmentIndex},Kn.prototype.getCoordinate=function(){return this.coord},Kn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Kn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Kn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Kn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Kn.prototype.getDistance=function(){return this.dist},Kn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Kn.prototype.interfaces_=function(){return[b]},Kn.prototype.getClass=function(){return Kn};var Jn=function(){this._nodeMap=new h,this.edge=null;var t=arguments[0];this.edge=t};Jn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Jn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Jn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},Jn.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Jn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new C(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new nr(o,new ke(this.edge._label))},Jn.prototype.add=function(t,e,n){var r=new Kn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Jn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn};var $n=function(){};$n.prototype.getChainStartIndices=function(t){var e=0,n=new Et;n.add(new N(e));do{var r=this.findChainEnd(t,e);n.add(new N(r)),e=r}while(e<t.length-1);return $n.toIntArray(n)},$n.prototype.findChainEnd=function(t,e){for(var n=Ge.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Ge.quadrant(t[r-1],t[r])===n;)r++;return r-1},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n},$n.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Qn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new q,this.env2=new q;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new $n;this.startIndex=e.getChainStartIndices(this.pts)};Qn.prototype.getCoordinates=function(){return this.pts},Qn.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Qn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Qn.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=arguments[5],c=this.pts[i],h=this.pts[o],f=s.pts[a],p=s.pts[u];if(o-i==1&&u-a==1)return l.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(c,h),this.env2.init(f,p),!this.env1.intersects(this.env2))return null;var d=Math.trunc((i+o)/2),g=Math.trunc((a+u)/2);i<d&&(a<g&&this.computeIntersectsForChain(i,d,s,a,g,l),g<u&&this.computeIntersectsForChain(i,d,s,g,u,l)),d<o&&(a<g&&this.computeIntersectsForChain(d,o,s,a,g,l),g<u&&this.computeIntersectsForChain(d,o,s,g,u,l))}},Qn.prototype.getStartIndexes=function(){return this.startIndex},Qn.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn};var tr=function t(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===tr.NULL_VALUE}},tr.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Se.RIGHT]-this._depth[t][Se.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?M.EXTERIOR:M.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==M.EXTERIOR&&r!==M.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===M.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===M.EXTERIOR?0:t===M.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Jn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,ke.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,s=0;s<this.pts.length;s++)if(this.pts[s].equals2D(n.pts[s])||(r=!1),this.pts[s].equals2D(n.pts[--o])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Qn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new q;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new C(t.getIntersection(r)),o=e,s=t.getEdgeDistance(n,r),a=o+1;if(a<this.pts.length){var u=this.pts[a];i.equals2D(u)&&(o=a,s=0)}this.eiList.add(i,o,s)},e.prototype.toString=function(){var t=new T;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Se.ON),e.getLocation(1,Se.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Se.LEFT),e.getLocation(1,Se.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Se.RIGHT),e.getLocation(1,Se.RIGHT),2))},e}(De),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Yn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new ke(t.getLabel())).flip(),n.merge(r);var i=rr.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new Et,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new An(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new Et,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Le;i.create(r),e.add(i)}}return Qe.sort(e,Qe.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new wn,n=new it;return n.setPrecisionModel(t),e.setSegmentIntersector(new Zn(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Nn(n,this._bufParams),i=new Gn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new We(new Xn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Xe(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=i.getData(),a=new nr(i.getCoordinates(),new ke(s));this.insertUniqueEdge(a)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Se.LEFT),n=t.getLocation(0,Se.RIGHT);return e===M.INTERIOR&&n===M.EXTERIOR?1:e===M.EXTERIOR&&n===M.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new ve,n=new Et;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var ir=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};ir.prototype.rescale=function(){if(L(arguments[0],xt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&W.out.println(n)}},ir.prototype.scale=function(){if(L(arguments[0],xt)){for(var t=arguments[0],e=new Et,n=t.iterator();n.hasNext();){var r=n.next();e.add(new dn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new C(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return Pt.removeRepeatedPoints(o)}},ir.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ir.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ir.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ir.prototype.interfaces_=function(){return[xn]},ir.prototype.getClass=function(){return ir};var or=function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t},sr={fact:{configurable:!0}};or.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new Q("found endpt/interior pt intersection at index "+o+" :pt "+n)},or.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],o=arguments[1],s=i.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var l=0;l<a.length-1;l++)this.checkInteriorIntersections(i,u,o,l);else if(4===arguments.length){var c=arguments[0],h=arguments[1],f=arguments[2],p=arguments[3];if(c===f&&h===p)return null;var d=c.getCoordinates()[h],g=c.getCoordinates()[h+1],y=f.getCoordinates()[p],v=f.getCoordinates()[p+1];if(this._li.computeIntersection(d,g,y,v),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,g)||this.hasInteriorIntersection(this._li,y,v)))throw new Q("found non-noded intersection at "+d+"-"+g+" and "+y+"-"+v)}},or.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},or.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},or.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},or.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Q("found non-noded collapse at "+or.fact.createLineString([t,e,n]))},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},sr.fact.get=function(){return new ve},Object.defineProperties(or,sr);var ar=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new _("Scale factor must be non-zero");1!==e&&(this._pt=new C(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new C,this._p1Scaled=new C),this.initCorners(this._pt)},ur={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ar.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return et.isTrue(!(s&&a),"Found bad envelope test"),a},ar.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new C(this._maxx,this._maxy),this._corner[1]=new C(this._minx,this._maxy),this._corner[2]=new C(this._minx,this._miny),this._corner[3]=new C(this._maxx,this._miny)},ar.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},ar.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ar.prototype.getCoordinate=function(){return this._originalPt},ar.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ar.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=ar.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new q(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},ar.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},ar.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},ar.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},ar.prototype.interfaces_=function(){return[]},ar.prototype.getClass=function(){return ar},ur.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(ar,ur);var lr=function(){this.tempEnv1=new q,this.selectedSegment=new gn};lr.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr};var cr=function(){this._index=null;var t=arguments[0];this._index=t},hr={HotPixelSnapAction:{configurable:!0}};cr.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new fr(e,n,r);return this._index.query(i,{interfaces_:function(){return[Ze]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},hr.HotPixelSnapAction.get=function(){return fr},Object.defineProperties(cr,hr);var fr=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(lr),pr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Et};pr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},pr.prototype.isDone=function(){return!1},pr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},pr.prototype.interfaces_=function(){return[Hn]},pr.prototype.getClass=function(){return pr};var dr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new it,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};dr.prototype.checkCorrectness=function(t){var e=dn.getNodedSubstrings(t),n=new or(e);try{n.checkValid()}catch(t){if(!(t instanceof V))throw t;t.printStackTrace()}},dr.prototype.getNodedSubstrings=function(){return dn.getNodedSubstrings(this._nodedSegStrings)},dr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},dr.prototype.findInteriorIntersections=function(t,e){var n=new pr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},dr.prototype.computeVertexSnaps=function(){if(L(arguments[0],xt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof dn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new ar(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},dr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new wn,this._pointSnapper=new cr(this._noder.getIndex()),this.snapRound(t,this._li)},dr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new ar(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},dr.prototype.interfaces_=function(){return[xn]},dr.prototype.getClass=function(){return dr};var gr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Cn,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},yr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};gr.prototype.bufferFixedPrecision=function(t){var e=new ir(new dr(new pe(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},gr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=gr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Me))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=gr.precisionScaleFactor(this._argGeom,this._distance,n),i=new pe(r);this.bufferFixedPrecision(i)}},gr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===pe.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Q))throw t;this._saveException=t}},gr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr},gr.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new gr(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new gr(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof Cn&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var i=arguments[1];return new gr(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var o=arguments[1],s=arguments[2],a=arguments[3],u=new gr(arguments[0]);return u.setQuadrantSegments(s),u.setEndCapStyle(a),u.getResultGeometry(o)}},gr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=R.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},yr.CAP_ROUND.get=function(){return Cn.CAP_ROUND},yr.CAP_BUTT.get=function(){return Cn.CAP_FLAT},yr.CAP_FLAT.get=function(){return Cn.CAP_FLAT},yr.CAP_SQUARE.get=function(){return Cn.CAP_SQUARE},yr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gr,yr);var vr=function(){this._pt=[new C,new C],this._distance=m.NaN,this._isNull=!0};vr.prototype.getCoordinates=function(){return this._pt},vr.prototype.getCoordinate=function(t){return this._pt[t]},vr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},vr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},vr.prototype.getDistance=function(){return this._distance},vr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr};var _r=function(){};_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.computeDistance=function(){if(arguments[2]instanceof vr&&arguments[0]instanceof Zt&&arguments[1]instanceof C)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new gn,i=0;i<n.length-1;i++){r.setCoordinates(n[i],n[i+1]);var o=r.closestPoint(t);e.setMinimum(o,t)}else if(arguments[2]instanceof vr&&arguments[0]instanceof Qt&&arguments[1]instanceof C){var s=arguments[0],a=arguments[1],u=arguments[2];_r.computeDistance(s.getExteriorRing(),a,u);for(var l=0;l<s.getNumInteriorRing();l++)_r.computeDistance(s.getInteriorRingN(l),a,u)}else if(arguments[2]instanceof vr&&arguments[0]instanceof ct&&arguments[1]instanceof C){var c=arguments[0],h=arguments[1],f=arguments[2];if(c instanceof Zt)_r.computeDistance(c,h,f);else if(c instanceof Qt)_r.computeDistance(c,h,f);else if(c instanceof Vt)for(var p=c,d=0;d<p.getNumGeometries();d++){var g=p.getGeometryN(d);_r.computeDistance(g,h,f)}else f.setMinimum(c.getCoordinate(),h)}else if(arguments[2]instanceof vr&&arguments[0]instanceof gn&&arguments[1]instanceof C){var y=arguments[1],v=arguments[2],_=arguments[0].closestPoint(y);v.setMinimum(_,y)}};var mr=function(t){this._maxPtDist=new vr,this._inputGeom=t||null},xr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};mr.prototype.computeMaxMidpointDistance=function(t){var e=new wr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.computeMaxVertexDistance=function(t){var e=new br(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},mr.prototype.getDistancePoints=function(){return this._maxPtDist},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},xr.MaxPointDistanceFilter.get=function(){return br},xr.MaxMidpointDistanceFilter.get=function(){return wr},Object.defineProperties(mr,xr);var br=function(t){this._maxPtDist=new vr,this._minPtDist=new vr,this._geom=t||null};br.prototype.filter=function(t){this._minPtDist.initialize(),_r.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},br.prototype.getMaxPointDistance=function(){return this._maxPtDist},br.prototype.interfaces_=function(){return[pt]},br.prototype.getClass=function(){return br};var wr=function(t){this._maxPtDist=new vr,this._minPtDist=new vr,this._geom=t||null};wr.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new C((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),_r.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},wr.prototype.isDone=function(){return!1},wr.prototype.isGeometryChanged=function(){return!1},wr.prototype.getMaxPointDistance=function(){return this._maxPtDist},wr.prototype.interfaces_=function(){return[zt]},wr.prototype.getClass=function(){return wr};var Er=function(t){this._comps=t||null};Er.prototype.filter=function(t){t instanceof Qt&&this._comps.add(t)},Er.prototype.interfaces_=function(){return[Bt]},Er.prototype.getClass=function(){return Er},Er.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return Er.getPolygons(t,new Et)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Qt?n.add(e):e instanceof Vt&&e.apply(new Er(n)),n}};var Cr=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Cr.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Zt&&this._lines.add(t)},Cr.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Cr.prototype.interfaces_=function(){return[lt]},Cr.prototype.getClass=function(){return Cr},Cr.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Cr.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Cr.getLines(e,n))}},Cr.getLines=function(){if(1===arguments.length){var t=arguments[0];return Cr.getLines(t,!1)}if(2===arguments.length){if(L(arguments[0],xt)&&L(arguments[1],xt)){for(var e=arguments[1],n=arguments[0].iterator();n.hasNext();){var r=n.next();Cr.getLines(r,e)}return e}if(arguments[0]instanceof ct&&"boolean"==typeof arguments[1]){var i=arguments[0],o=arguments[1],s=new Et;return i.apply(new Cr(s,o)),s}if(arguments[0]instanceof ct&&L(arguments[1],xt)){var a=arguments[0],u=arguments[1];return a instanceof Zt?u.add(a):a.apply(new Cr(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&L(arguments[0],xt)&&L(arguments[1],xt)){for(var l=arguments[1],c=arguments[2],h=arguments[0].iterator();h.hasNext();){var f=h.next();Cr.getLines(f,l,c)}return l}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ct&&L(arguments[1],xt)){var p=arguments[1],d=arguments[2];return arguments[0].apply(new Cr(p,d)),p}}};var Sr=function(){if(this._boundaryRule=dt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new _("Rule must be non-null");this._boundaryRule=t}};Sr.prototype.locateInternal=function(){if(arguments[0]instanceof C&&arguments[1]instanceof Qt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return M.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===M.EXTERIOR)return M.EXTERIOR;if(r===M.BOUNDARY)return M.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===M.INTERIOR)return M.EXTERIOR;if(s===M.BOUNDARY)return M.BOUNDARY}return M.INTERIOR}if(arguments[0]instanceof C&&arguments[1]instanceof Zt){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return M.EXTERIOR;var l=u.getCoordinates();return u.isClosed()||!a.equals(l[0])&&!a.equals(l[l.length-1])?at.isOnLine(a,l)?M.INTERIOR:M.EXTERIOR:M.BOUNDARY}if(arguments[0]instanceof C&&arguments[1]instanceof Jt){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?M.INTERIOR:M.EXTERIOR}},Sr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?at.locatePointInRing(t,e.getCoordinates()):M.EXTERIOR},Sr.prototype.intersects=function(t,e){return this.locate(t,e)!==M.EXTERIOR},Sr.prototype.updateLocationInfo=function(t){t===M.INTERIOR&&(this._isIn=!0),t===M.BOUNDARY&&this._numBoundaries++},Sr.prototype.computeLocation=function(t,e){if(e instanceof Jt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Zt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Qt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ut)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof ne)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);this.updateLocationInfo(this.locateInternal(t,a))}else if(e instanceof Vt)for(var u=new zn(e);u.hasNext();){var l=u.next();l!==e&&this.computeLocation(t,l)}},Sr.prototype.locate=function(t,e){return e.isEmpty()?M.EXTERIOR:e instanceof Zt||e instanceof Qt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?M.BOUNDARY:this._numBoundaries>0||this._isIn?M.INTERIOR:M.EXTERIOR)},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr};var Pr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._component=e,this._segIndex=n,this._pt=r}},Ir={INSIDE_AREA:{configurable:!0}};Pr.prototype.isInsideArea=function(){return this._segIndex===Pr.INSIDE_AREA},Pr.prototype.getCoordinate=function(){return this._pt},Pr.prototype.getGeometryComponent=function(){return this._component},Pr.prototype.getSegmentIndex=function(){return this._segIndex},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},Ir.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Pr,Ir);var Mr=function(t){this._pts=t||null};Mr.prototype.filter=function(t){t instanceof Jt&&this._pts.add(t)},Mr.prototype.interfaces_=function(){return[Bt]},Mr.prototype.getClass=function(){return Mr},Mr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Jt?Qe.singletonList(t):Mr.getPoints(t,new Et)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Jt?n.add(e):e instanceof Vt&&e.apply(new Mr(n)),n}};var Or=function(){this._locations=null;var t=arguments[0];this._locations=t};Or.prototype.filter=function(t){(t instanceof Jt||t instanceof Zt||t instanceof Qt)&&this._locations.add(new Pr(t,0,t.getCoordinate()))},Or.prototype.interfaces_=function(){return[Bt]},Or.prototype.getClass=function(){return Or},Or.getLocations=function(t){var e=new Et;return t.apply(new Or(e)),e};var Lr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Sr,this._minDistanceLocation=null,this._minDistance=m.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Lr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=Er.getPolygons(this._geom[e]);if(i.size()>0){var o=Or.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&L(arguments[0],wt)&&L(arguments[1],wt)){for(var s=arguments[0],a=arguments[1],u=arguments[2],l=0;l<s.size();l++)for(var c=s.get(l),h=0;h<a.size();h++)if(this.computeContainmentDistance(c,a.get(h),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Pr&&arguments[1]instanceof Qt){var f=arguments[0],p=arguments[1],d=arguments[2],g=f.getCoordinate();if(M.EXTERIOR!==this._ptLocator.locate(g,p))return this._minDistance=0,d[0]=f,d[1]=new Pr(p,g),null}},Lr.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Cr.getLines(this._geom[0]),n=Cr.getLines(this._geom[1]),r=Mr.getPoints(this._geom[0]),i=Mr.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Lr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Lr.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Lr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Lr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Zt&&arguments[1]instanceof Jt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var s=at.distancePointLine(i,r[o],r[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new gn(r[o],r[o+1]).closestPoint(i);n[0]=new Pr(t,o,a),n[1]=new Pr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Zt&&arguments[1]instanceof Zt){var u=arguments[0],l=arguments[1],c=arguments[2];if(u.getEnvelopeInternal().distance(l.getEnvelopeInternal())>this._minDistance)return null;for(var h=u.getCoordinates(),f=l.getCoordinates(),p=0;p<h.length-1;p++)for(var d=0;d<f.length-1;d++){var g=at.distanceLineLine(h[p],h[p+1],f[d],f[d+1]);if(g<this._minDistance){this._minDistance=g;var y=new gn(h[p],h[p+1]),v=new gn(f[d],f[d+1]),_=y.closestPoints(v);c[0]=new Pr(u,p,_[0]),c[1]=new Pr(l,d,_[1])}if(this._minDistance<=this._terminateDistance)return null}}},Lr.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new Pr(i,0,i.getCoordinate()),n[1]=new Pr(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Lr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.distance=function(t,e){return new Lr(t,e).distance()},Lr.isWithinDistance=function(t,e,n){return new Lr(t,e,n).distance()<=n},Lr.nearestPoints=function(t,e){return new Lr(t,e).nearestPoints()};var Rr=function(){this._pt=[new C,new C],this._distance=m.NaN,this._isNull=!0};Rr.prototype.getCoordinates=function(){return this._pt},Rr.prototype.getCoordinate=function(t){return this._pt[t]},Rr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Rr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Rr.prototype.toString=function(){return $.toLineString(this._pt[0],this._pt[1])},Rr.prototype.getDistance=function(){return this._distance},Rr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr};var kr=function(){};kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr},kr.computeDistance=function(){if(arguments[2]instanceof Rr&&arguments[0]instanceof Zt&&arguments[1]instanceof C)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new gn,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof Qt&&arguments[1]instanceof C){var a=arguments[0],u=arguments[1],l=arguments[2];kr.computeDistance(a.getExteriorRing(),u,l);for(var c=0;c<a.getNumInteriorRing();c++)kr.computeDistance(a.getInteriorRingN(c),u,l)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof ct&&arguments[1]instanceof C){var h=arguments[0],f=arguments[1],p=arguments[2];if(h instanceof Zt)kr.computeDistance(h,f,p);else if(h instanceof Qt)kr.computeDistance(h,f,p);else if(h instanceof Vt)for(var d=h,g=0;g<d.getNumGeometries();g++){var y=d.getGeometryN(g);kr.computeDistance(y,f,p)}else p.setMinimum(h.getCoordinate(),f)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof gn&&arguments[1]instanceof C){var v=arguments[1],_=arguments[2],m=arguments[0].closestPoint(v);_.setMinimum(m,v)}};var Tr=function(){this._g0=null,this._g1=null,this._ptDist=new Rr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Nr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Tr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Tr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Tr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Tr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Tr.prototype.computeOrientedDistance=function(t,e,n){var r=new Ar(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Dr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Tr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.distance=function(){if(2===arguments.length)return new Tr(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Tr(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Nr.MaxPointDistanceFilter.get=function(){return Ar},Nr.MaxDensifiedByFractionDistanceFilter.get=function(){return Dr},Object.defineProperties(Tr,Nr);var Ar=function(){this._maxPtDist=new Rr,this._minPtDist=new Rr,this._euclideanDist=new kr,this._geom=null;var t=arguments[0];this._geom=t};Ar.prototype.filter=function(t){this._minPtDist.initialize(),kr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ar.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ar.prototype.interfaces_=function(){return[pt]},Ar.prototype.getClass=function(){return Ar};var Dr=function(){this._maxPtDist=new Rr,this._minPtDist=new Rr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Dr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=n.x+s*i,u=n.y+s*o,l=new C(a,u);this._minPtDist.initialize(),kr.computeDistance(this._geom,l,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Dr.prototype.isDone=function(){return!1},Dr.prototype.isGeometryChanged=function(){return!1},Dr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Dr.prototype.interfaces_=function(){return[zt]},Dr.prototype.getClass=function(){return Dr};var Fr=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},jr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Fr.prototype.checkMaximumDistance=function(t,e,n){var r=new Tr(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+$.toLineString(i[0],i[1])+")"}},Fr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Fr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Fr.VERBOSE&&W.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Fr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Qt||this._input instanceof ne||this._input instanceof Vt))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Fr.prototype.getErrorIndicator=function(){return this._errorIndicator},Fr.prototype.checkMinimumDistance=function(t,e,n){var r=new Lr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+$.toLineString(i[0],i[1])+" )"}},Fr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Fr.prototype.getErrorLocation=function(){return this._errorLocation},Fr.prototype.getPolygonLines=function(t){for(var e=new Et,n=new Cr(e),r=Er.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},Fr.prototype.getErrorMessage=function(){return this._errMsg},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr},jr.VERBOSE.get=function(){return!1},jr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Fr,jr);var Gr=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Br={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gr.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Gr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new q(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new q(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Gr.prototype.checkDistance=function(){var t=new Fr(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Gr.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Gr.prototype.checkPolygonal=function(){this._result instanceof Qt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gr.prototype.getErrorIndicator=function(){return this._errorIndicator},Gr.prototype.getErrorLocation=function(){return this._errorLocation},Gr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gr.prototype.report=function(t){if(!Gr.VERBOSE)return null;W.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gr.prototype.getErrorMessage=function(){return this._errorMsg},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.isValidMsg=function(t,e,n){var r=new Gr(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gr.isValid=function(t,e,n){return!!new Gr(t,e,n).isValid()},Br.VERBOSE.get=function(){return!1},Br.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,Br);var zr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};zr.prototype.getCoordinates=function(){return this._pts},zr.prototype.size=function(){return this._pts.length},zr.prototype.getCoordinate=function(t){return this._pts[t]},zr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},zr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:hn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},zr.prototype.setData=function(t){this._data=t},zr.prototype.getData=function(){return this._data},zr.prototype.toString=function(){return $.toLineString(new ue(this._pts))},zr.prototype.interfaces_=function(){return[fn]},zr.prototype.getClass=function(){return zr};var Vr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Et,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Vr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Vr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Vr.prototype.getIntersectionSegments=function(){return this._intSegments},Vr.prototype.count=function(){return this._intersectionCount},Vr.prototype.getIntersections=function(){return this._intersections},Vr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Vr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Vr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Vr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Vr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Vr.prototype.interfaces_=function(){return[Hn]},Vr.prototype.getClass=function(){return Vr},Vr.createAllIntersectionsFinder=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e},Vr.createAnyIntersectionFinder=function(t){return new Vr(t)},Vr.createIntersectionCounter=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Ur=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Ur.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Ur.prototype.getIntersections=function(){return this._segInt.getIntersections()},Ur.prototype.isValid=function(){return this.execute(),this._isValid},Ur.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ur.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Vr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new wn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Ur.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Me(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Ur.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+$.toLineString(t[0],t[1])+" and "+$.toLineString(t[2],t[3])},Ur.prototype.interfaces_=function(){return[]},Ur.prototype.getClass=function(){return Ur},Ur.computeIntersections=function(t){var e=new Ur(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Wr=function t(){this._nv=null;var e=arguments[0];this._nv=new Ur(t.toSegmentStrings(e))};Wr.prototype.checkValid=function(){this._nv.checkValid()},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Wr.toSegmentStrings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next();e.add(new zr(r.getCoordinates(),r))}return e},Wr.checkValid=function(t){new Wr(t).checkValid()};var Xr=function(t){this._mapOp=t};Xr.prototype.map=function(t){for(var e=new Et,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(ve.toGeometryArray(e))},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(t,e){return new Xr(e).map(t)};var qr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Et,this._resultLineList=new Et;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};qr.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},qr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},qr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},qr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Pi.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},qr.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},qr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},qr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},qr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Pi.isResultOfOp(r,e)&&e===Pi.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr};var Yr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Et;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Yr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Yr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==Pi.INTERSECTION)){var r=n.getLabel();Pi.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Yr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr};var Hr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Hr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var i=new Et,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof ee||(n=!1),i.add(s))}if(n)return this._factory.createPolygon(r,i.toArray([]));var a=new Et;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Hr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Hr.prototype.getInputGeometry=function(){return this._inputGeom},Hr.prototype.transformMultiLineString=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Hr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformMultiPoint=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformMultiPolygon=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.copy=function(t){return t.copy()},Hr.prototype.transformGeometryCollection=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(ve.toGeometryArray(n)):this._factory.buildGeometry(n)},Hr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Jt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof Zt)return this.transformLineString(t,null);if(t instanceof Ut)return this.transformMultiLineString(t,null);if(t instanceof Qt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof Vt)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},Hr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Zr=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Zt&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=r}};Zr.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new C(o)),0===r&&this._isClosed&&t.set(t.size()-1,new C(o)))}},Zr.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},Zr.prototype.snapTo=function(t){var e=new St(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Zr.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new C(i),!1)}},Zr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=m.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Zr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Kr=function(t){this._srcGeom=t||null},Jr={SNAP_PRECISION_FACTOR:{configurable:!0}};Kr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new $r(e,n).transform(this._srcGeom)},Kr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new $r(t,n,!0).transform(this._srcGeom),i=r;return e&&L(i,$t)&&(i=r.buffer(0)),i},Kr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Kr.prototype.extractTargetCoordinates=function(t){for(var e=new p,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Kr.prototype.computeMinimumSegmentLength=function(t){for(var e=m.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Kr(t);r[0]=i.snapTo(e,n);var o=new Kr(e);return r[1]=o.snapTo(r[0],n),r},Kr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Kr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===pe.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Kr.computeOverlaySnapTolerance(i),Kr.computeOverlaySnapTolerance(o))}},Kr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Kr.SNAP_PRECISION_FACTOR},Kr.snapToSelf=function(t,e,n){return new Kr(t).snapToSelf(e,n)},Jr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Kr,Jr);var $r=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Zr(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Hr),Qr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Qr.prototype.getCommon=function(){return m.longBitsToDouble(this._commonBits)},Qr.prototype.add=function(t){var e=m.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Qr.signExpBits(this._commonBits),this._isFirst=!1,null):Qr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Qr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Qr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Qr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=m.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+m.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr},Qr.getBit=function(t,e){return t&1<<e?1:0},Qr.signExpBits=function(t){return t>>52},Qr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Qr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Qr.getBit(t,r)!==Qr.getBit(e,r))return n;n++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ni},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ri(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new C(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ri(e);return t.apply(n),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ni},ei.Translater.get=function(){return ri},Object.defineProperties(ti,ei);var ni=function(){this._commonBitsX=new Qr,this._commonBitsY=new Qr};ni.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ni.prototype.getCommonCoordinate=function(){return new C(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ni.prototype.interfaces_=function(){return[pt]},ni.prototype.getClass=function(){return ni};var ri=function(){this.trans=null;var t=arguments[0];this.trans=t};ri.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},ri.prototype.isDone=function(){return!1},ri.prototype.isGeometryChanged=function(){return!0},ri.prototype.interfaces_=function(){return[zt]},ri.prototype.getClass=function(){return ri};var ii=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};ii.prototype.selfSnap=function(t){return new Kr(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Pi.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||W.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=Kr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return Kr.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,n){return new ii(t,e).getResultGeometry(n)},ii.union=function(t,e){return ii.overlayOp(t,e,Pi.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Pi.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Pi.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Pi.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Pi.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Q))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Q?r:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,n){return new oi(t,e).getResultGeometry(n)},oi.union=function(t,e){return oi.overlayOp(t,e,Pi.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Pi.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Pi.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Pi.DIFFERENCE)};var si=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};si.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si};var ai=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};ai.prototype.isDelete=function(){return this._eventType===ai.DELETE},ai.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},ai.prototype.getObject=function(){return this._obj},ai.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},ai.prototype.getInsertEvent=function(){return this._insertEvent},ai.prototype.isInsert=function(){return this._eventType===ai.INSERT},ai.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},ai.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},ai.prototype.interfaces_=function(){return[b]},ai.prototype.getClass=function(){return ai},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(ai,ui);var li=function(){};li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li};var ci=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};ci.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(ci.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},ci.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ci.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ci.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ci.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},ci.prototype.hasProperIntersection=function(){return this._hasProper},ci.prototype.hasIntersection=function(){return this._hasIntersection},ci.prototype.isDone=function(){return this._isDone},ci.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},ci.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ci.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var hi=function(t){function e(){t.call(this),this.events=new Et,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Qe.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof ci&&L(arguments[0],wt)&&L(arguments[1],wt)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&L(arguments[0],wt)&&arguments[1]instanceof ci){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new si(n,i),s=new ai(e,n.getMinX(i),o);this.events.add(s),this.events.add(new ai(n.getMaxX(i),s))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(i.computeIntersections(a,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();){var i=r.next();this.addEdge(i,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(li),fi=function(){this._min=m.POSITIVE_INFINITY,this._max=m.NEGATIVE_INFINITY},pi={NodeComparator:{configurable:!0}};fi.prototype.getMin=function(){return this._min},fi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},fi.prototype.getMax=function(){return this._max},fi.prototype.toString=function(){return $.toLineString(new C(this._min,0),new C(this._max,0))},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},pi.NodeComparator.get=function(){return di},Object.defineProperties(fi,pi);var di=function(){};di.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},di.prototype.interfaces_=function(){return[E]},di.prototype.getClass=function(){return di};var gi=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fi),yi=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fi),vi=function(){this._leaves=new Et,this._root=null,this._level=0};vi.prototype.buildTree=function(){Qe.sort(this._leaves,new fi.NodeComparator);for(var t=this._leaves,e=null,n=new Et;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},vi.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new gi(t,e,n))},vi.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},vi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},vi.prototype.printNode=function(t){W.out.println($.toLineString(new C(t._min,this._level),new C(t._max,this._level)))},vi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},vi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new yi(t.get(n),t.get(n+1));e.add(i)}}},vi.prototype.interfaces_=function(){return[]},vi.prototype.getClass=function(){return vi};var _i=function(){this._items=new Et};_i.prototype.visitItem=function(t){this._items.add(t)},_i.prototype.getItems=function(){return this._items},_i.prototype.interfaces_=function(){return[Ze]},_i.prototype.getClass=function(){return _i};var mi=function(){this._index=null;var t=arguments[0];if(!L(t,$t))throw new _("Argument must be Polygonal");this._index=new wi(t)},xi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};mi.prototype.locate=function(t){var e=new st(t),n=new bi(e);return this._index.query(t.y,t.y,n),e.getLocation()},mi.prototype.interfaces_=function(){return[Bn]},mi.prototype.getClass=function(){return mi},xi.SegmentVisitor.get=function(){return bi},xi.IntervalIndexedGeometry.get=function(){return wi},Object.defineProperties(mi,xi);var bi=function(){this._counter=null;var t=arguments[0];this._counter=t};bi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},bi.prototype.interfaces_=function(){return[Ze]},bi.prototype.getClass=function(){return bi};var wi=function(){this._index=new vi;var t=arguments[0];this.init(t)};wi.prototype.init=function(t){for(var e=Cr.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},wi.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new gn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},wi.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new _i;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var Ei=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new fe,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Sr,2===arguments.length){var e=arguments[0],n=arguments[1],r=dt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;M.NONE,r.getLocation(t,Se.ON)===M.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[1],r=arguments[2],i=new ci(arguments[0],!0,!1);i.setIsDoneIfProperInt(r);var o=this.createEdgeSetIntersector(),s=this._parentGeom instanceof ee||this._parentGeom instanceof Qt||this._parentGeom instanceof ne,a=n||!s;return o.computeIntersections(this._edges,i,a),this.addSelfIntersectionNodes(this._argIndex),i}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new ci(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Jt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,M.INTERIOR)}else if(arguments[0]instanceof C){var e=arguments[0];this.insertPoint(this._argIndex,e,M.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),M.EXTERIOR,M.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,M.INTERIOR,M.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],M.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],M.BOUNDARY)},e.prototype.addLineString=function(t){var e=Pt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new ke(this._argIndex,M.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===M.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=Pt.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;at.isCCW(r)&&(i=n,o=e);var s=new nr(r,new ke(this._argIndex,M.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],M.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new ke(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new hi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Qt)this.addPolygon(e);else if(e instanceof Zt)this.addLineString(e);else if(e instanceof Jt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Ut)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof Vt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return L(this._parentGeom,$t)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new mi(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?M.BOUNDARY:M.INTERIOR},e}(We),Ci=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ei(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=dt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,e,r),this._arg[1]=new Ei(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,i,s),this._arg[1]=new Ei(1,o,s)}};Ci.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ci.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Si=function(){};Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},Si.map=function(){if(arguments[0]instanceof ct&&L(arguments[1],Si.MapOp)){for(var t=arguments[0],e=arguments[1],n=new Et,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(L(arguments[0],xt)&&L(arguments[1],Si.MapOp)){for(var o=arguments[0],s=arguments[1],a=new Et,u=o.iterator();u.hasNext();){var l=u.next(),c=s.map(l);null!==c&&a.add(c)}return a}},Si.MapOp=function(){};var Pi=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Sr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Yn,this._resultPolyList=new Et,this._resultLineList=new Et,this._resultPointList=new Et,this._graph=new We(new Xn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new ke(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new Et;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==M.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new Et,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new Et;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Wr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Xe(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new qr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Yr(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Se.RIGHT),i.getLocation(1,Se.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(et.isTrue(!r.isNull(i,Se.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Se.LEFT,r.getLocation(i,Se.LEFT)),et.isTrue(!r.isNull(i,Se.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Se.RIGHT,r.getLocation(i,Se.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ci);Pi.overlayOp=function(t,e,n){return new Pi(t,e).getResultGeometry(n)},Pi.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Pi.createEmptyResult(Pi.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Xr.map(t,{interfaces_:function(){return[Si.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Pi.INTERSECTION)},Pi.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Pi.createEmptyResult(Pi.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Pi.SYMDIFFERENCE)},Pi.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Pi.INTERSECTION:o=Math.min(r,i);break;case Pi.UNION:o=Math.max(r,i);break;case Pi.DIFFERENCE:o=r;break;case Pi.SYMDIFFERENCE:o=Math.max(r,i)}return o},Pi.createEmptyResult=function(t,e,n,r){var i=null;switch(Pi.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Pi.difference=function(t,e){return t.isEmpty()?Pi.createEmptyResult(Pi.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Pi.DIFFERENCE))},Pi.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Pi.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===M.BOUNDARY&&(i=M.INTERIOR),o===M.BOUNDARY&&(o=M.INTERIOR),s){case Pi.INTERSECTION:return i===M.INTERIOR&&o===M.INTERIOR;case Pi.UNION:return i===M.INTERIOR||o===M.INTERIOR;case Pi.DIFFERENCE:return i===M.INTERIOR&&o!==M.INTERIOR;case Pi.SYMDIFFERENCE:return i===M.INTERIOR&&o!==M.INTERIOR||i!==M.INTERIOR&&o===M.INTERIOR}return!1}},Pi.INTERSECTION=1,Pi.UNION=2,Pi.DIFFERENCE=3,Pi.SYMDIFFERENCE=4;var Ii=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Sr,this._seg=new gn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Ii.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Ii.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?M.BOUNDARY:this._ptLocator.locate(t,this._g)},Ii.prototype.extractLinework=function(t){var e=new Mi;t.apply(e);var n=e.getLinework(),r=ve.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var Mi=function(){this._linework=null,this._linework=new Et};Mi.prototype.getLinework=function(){return this._linework},Mi.prototype.filter=function(t){if(t instanceof Qt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Mi.prototype.interfaces_=function(){return[Bt]},Mi.prototype.getClass=function(){return Mi};var Oi=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Oi.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Oi.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Oi.prototype.getPoints=function(t){for(var e=new Et,n=Cr.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Oi.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,u=n*o/s,l=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var h=new C(l-u,c+a);r.add(h)}if(this._doRight){var f=new C(l+u,c-a);r.add(f)}},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi};var Li=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new Et;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Ii(this._geom[0],this._boundaryDistanceTolerance),new Ii(this._geom[1],this._boundaryDistanceTolerance),new Ii(this._geom[2],this._boundaryDistanceTolerance)]},Ri={TOLERANCE:{configurable:!0}};Li.prototype.reportResult=function(t,e,n){W.out.println("Overlay result invalid - A:"+M.toLocationSymbol(e[0])+" B:"+M.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+M.toLocationSymbol(e[2]))},Li.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Li.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Li.hasLocation(this._location,M.BOUNDARY)||this.isValidResult(r,this._location)}},Li.prototype.addTestPts=function(t){var e=new Oi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Li.prototype.isValidResult=function(t,e){var n=Pi.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===M.INTERIOR);return r||this.reportResult(t,e,n),r},Li.prototype.getInvalidLocation=function(){return this._invalidLocation},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Li.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Kr.computeSizeBasedSnapTolerance(t),Kr.computeSizeBasedSnapTolerance(e))},Li.isValid=function(t,e,n,r){return new Li(t,e,r).isValid(n)},Ri.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Li,Ri);var ki=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};ki.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},ki.prototype.combine=function(){for(var t=new Et,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki},ki.combine=function(){if(1===arguments.length)return new ki(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new ki(ki.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];return new ki(ki.createList(n,r,i)).combine()}},ki.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},ki.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Et;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new Et;return s.add(r),s.add(i),s.add(o),s}};var Ti=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new Et)},Ni={STRTREE_NODE_CAPACITY:{configurable:!0}};Ti.prototype.reduceToGeometries=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next(),i=null;L(r,wt)?i=this.unionTree(r):r instanceof ct&&(i=r),e.add(i)}return e},Ti.prototype.extractByEnvelope=function(t,e,n){for(var r=new Et,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Ti.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return ki.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Ti.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new sn(Ti.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},Ti.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Ti.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Ti.getGeometry(e,n),Ti.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}},Ti.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Ti.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Ti.prototype.unionActual=function(t,e){return Ti.restrictToPolygons(t.union(e))},Ti.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Ti.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new Et,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),ki.combine(r)},Ti.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.restrictToPolygons=function(t){if(L(t,$t))return t;var e=Er.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(ve.toPolygonArray(e))},Ti.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Ti.union=function(t){return new Ti(t).union()},Ni.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ti,Ni);var Ai=function(){};Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Pi.createEmptyResult(Pi.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Pi.UNION)},t.GeoJSONReader=Ee,t.GeoJSONWriter=Ce,t.OverlayOp=Pi,t.UnionOp=Ai,t.BufferOp=gr,Object.defineProperty(t,"__esModule",{value:!0})}(e)},3123:function(t,e,n){"use strict";t.exports=n.p+"assets/92c3faa3acd2054d984b.png"},891:function(t,e,n){"use strict";t.exports=n.p+"assets/213070deae5738d6509b.png"},2494:function(t,e,n){"use strict";var r=n(3027);function i(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const n=[1/0,1/0,-1/0,-1/0];return r.coordEach.call(void 0,t,t=>{n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]<t[0]&&(n[2]=t[0]),n[3]<t[1]&&(n[3]=t[1])}),n}var o=i;e.Ay=o},8905:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=6371008.8,r={centimeters:637100880,centimetres:637100880,degrees:360/(2*Math.PI),feet:20902260.511392,inches:39.37*n,kilometers:6371.0088,kilometres:6371.0088,meters:n,metres:n,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:n/1852,radians:1,yards:6967335.223679999},i={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:2.9155334959812285e-7,millimeters:1e6,millimetres:1e6,yards:1.195990046};function o(t,e,n={}){const r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function s(t,e,n={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!y(t[0])||!y(t[1]))throw new Error("coordinates must contain numbers");return o({type:"Point",coordinates:t},e,n)}function a(t,e,n={}){for(const e of t){if(e.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(e[e.length-1].length!==e[0].length)throw new Error("First and last Position are not equivalent.");for(let t=0;t<e[e.length-1].length;t++)if(e[e.length-1][t]!==e[0][t])throw new Error("First and last Position are not equivalent.")}return o({type:"Polygon",coordinates:t},e,n)}function u(t,e,n={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return o({type:"LineString",coordinates:t},e,n)}function l(t,e={}){const n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function c(t,e,n={}){return o({type:"MultiLineString",coordinates:t},e,n)}function h(t,e,n={}){return o({type:"MultiPoint",coordinates:t},e,n)}function f(t,e,n={}){return o({type:"MultiPolygon",coordinates:t},e,n)}function p(t,e="kilometers"){const n=r[e];if(!n)throw new Error(e+" units is invalid");return t*n}function d(t,e="kilometers"){const n=r[e];if(!n)throw new Error(e+" units is invalid");return t/n}function g(t){return 180*(t%(2*Math.PI))/Math.PI}function y(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}e.areaFactors=i,e.azimuthToBearing=function(t){return(t%=360)>180?t-360:t<-180?t+360:t},e.bearingToAzimuth=function(t){let e=t%360;return e<0&&(e+=360),e},e.convertArea=function(t,e="meters",n="kilometers"){if(!(t>=0))throw new Error("area must be a positive number");const r=i[e];if(!r)throw new Error("invalid original units");const o=i[n];if(!o)throw new Error("invalid final units");return t/r*o},e.convertLength=function(t,e="kilometers",n="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return p(d(t,e),n)},e.degreesToRadians=function(t){return t%360*Math.PI/180},e.earthRadius=n,e.factors=r,e.feature=o,e.featureCollection=l,e.geometry=function(t,e,n={}){switch(t){case"Point":return s(e).geometry;case"LineString":return u(e).geometry;case"Polygon":return a(e).geometry;case"MultiPoint":return h(e).geometry;case"MultiLineString":return c(e).geometry;case"MultiPolygon":return f(e).geometry;default:throw new Error(t+" is invalid")}},e.geometryCollection=function(t,e,n={}){return o({type:"GeometryCollection",geometries:t},e,n)},e.isNumber=y,e.isObject=function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)},e.lengthToDegrees=function(t,e){return g(d(t,e))},e.lengthToRadians=d,e.lineString=u,e.lineStrings=function(t,e,n={}){return l(t.map(t=>u(t,e)),n)},e.multiLineString=c,e.multiPoint=h,e.multiPolygon=f,e.point=s,e.points=function(t,e,n={}){return l(t.map(t=>s(t,e)),n)},e.polygon=a,e.polygons=function(t,e,n={}){return l(t.map(t=>a(t,e)),n)},e.radiansToDegrees=g,e.radiansToLength=p,e.round=function(t,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const n=Math.pow(10,e||0);return Math.round(t*n)/n},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(t=>{if(!y(t))throw new Error("bbox must only contain numbers")})},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},3027:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8905);function i(t,e,n){if(null!==t)for(var r,o,s,a,u,l,c,h,f=0,p=0,d=t.type,g="FeatureCollection"===d,y="Feature"===d,v=g?t.features.length:1,_=0;_<v;_++){u=(h=!!(c=g?t.features[_].geometry:y?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var m=0;m<u;m++){var x=0,b=0;if(null!==(a=h?c.geometries[m]:c)){l=a.coordinates;var w=a.type;switch(f=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(l,p,_,x,b))return!1;p++,x++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===e(l[r],p,_,x,b))return!1;p++,"MultiPoint"===w&&x++}"LineString"===w&&x++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(o=0;o<l[r].length-f;o++){if(!1===e(l[r][o],p,_,x,b))return!1;p++}"MultiLineString"===w&&x++,"Polygon"===w&&b++}"Polygon"===w&&x++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,o=0;o<l[r].length;o++){for(s=0;s<l[r][o].length-f;s++){if(!1===e(l[r][o][s],p,_,x,b))return!1;p++}b++}x++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===i(a.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function s(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function a(t,e){var n,r,i,o,s,a,u,l,c,h,f=0,p="FeatureCollection"===t.type,d="Feature"===t.type,g=p?t.features.length:1;for(n=0;n<g;n++){for(a=p?t.features[n].geometry:d?t.geometry:t,l=p?t.features[n].properties:d?t.properties:{},c=p?t.features[n].bbox:d?t.bbox:void 0,h=p?t.features[n].id:d?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,f,l,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],f,l,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,l,c,h))return!1;f++}}function u(t,e){a(t,function(t,n,i,o,s){var a,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==e(r.feature.call(void 0,t,i,{bbox:o,id:s}),n,0)&&void 0}switch(u){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<t.coordinates.length;l++){var c={type:a,coordinates:t.coordinates[l]};if(!1===e(r.feature.call(void 0,c,i),n,l))return!1}})}function l(t,e){u(t,function(t,n,o){var s=0;if(t.geometry){var a=t.geometry.type;if("Point"!==a&&"MultiPoint"!==a){var u,l=0,c=0,h=0;return!1!==i(t,function(i,a,f,p,d){if(void 0===u||n>l||p>c||d>h)return u=i,l=n,c=p,h=d,void(s=0);var g=r.lineString.call(void 0,[u,i],t.properties);if(!1===e(g,n,o,d,s))return!1;s++,u=i})&&void 0}}})}function c(t,e){if(!t)throw new Error("geojson is required");u(t,function(t,n,i){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,n,i,0,0))return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(!1===e(r.lineString.call(void 0,s[a],t.properties),n,i,a))return!1}}})}e.coordAll=function(t){var e=[];return i(t,function(t){e.push(t)}),e},e.coordEach=i,e.coordReduce=function(t,e,n,r){var o=n;return i(t,function(t,r,i,s,a){o=0===r&&void 0===n?t:e(o,t,r,i,s,a)},r),o},e.featureEach=s,e.featureReduce=function(t,e,n){var r=n;return s(t,function(t,i){r=0===i&&void 0===n?t:e(r,t,i)}),r},e.findPoint=function(t,e){if(e=e||{},!r.isObject.call(void 0,e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.coordIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":return r.point.call(void 0,l,u,e);case"MultiPoint":return o<0&&(o=l.length+o),r.point.call(void 0,l[o],u,e);case"LineString":return a<0&&(a=l.length+a),r.point.call(void 0,l[a],u,e);case"Polygon":return s<0&&(s=l.length+s),a<0&&(a=l[s].length+a),r.point.call(void 0,l[s][a],u,e);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),r.point.call(void 0,l[o][a],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),a<0&&(a=l[o][s].length-a),r.point.call(void 0,l[o][s][a],u,e)}throw new Error("geojson is invalid")},e.findSegment=function(t,e){if(e=e||{},!r.isObject.call(void 0,e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.segmentIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=l.length+a-1),r.lineString.call(void 0,[l[a],l[a+1]],u,e);case"Polygon":return s<0&&(s=l.length+s),a<0&&(a=l[s].length+a-1),r.lineString.call(void 0,[l[s][a],l[s][a+1]],u,e);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a-1),r.lineString.call(void 0,[l[o][a],l[o][a+1]],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),a<0&&(a=l[o][s].length-a-1),r.lineString.call(void 0,[l[o][s][a],l[o][s][a+1]],u,e)}throw new Error("geojson is invalid")},e.flattenEach=u,e.flattenReduce=function(t,e,n){var r=n;return u(t,function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)}),r},e.geomEach=a,e.geomReduce=function(t,e,n){var r=n;return a(t,function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)}),r},e.lineEach=c,e.lineReduce=function(t,e,n){var r=n;return c(t,function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)}),r},e.propEach=o,e.propReduce=function(t,e,n){var r=n;return o(t,function(t,i){r=0===i&&void 0===n?t:e(r,t,i)}),r},e.segmentEach=l,e.segmentReduce=function(t,e,n){var r=n,i=!1;return l(t,function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0}),r}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=t,n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t},function(){var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&(!t||!/^http(s?):/.test(t));)t=r[i--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t}(),n.b="undefined"!=typeof document&&document.baseURI||self.location.href,n.nc=void 0;var r={};return function(){"use strict";n.d(r,{default:function(){return TS}});var t=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function e(t,e){return t>e?1:t<e?-1:0}function i(t,e,n){var r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;var i=void 0;if(n>0){for(i=1;i<r;++i)if(t[i]<e)return i-1}else if(n<0){for(i=1;i<r;++i)if(t[i]<=e)return i}else for(i=1;i<r;++i){if(t[i]==e)return i;if(t[i]<e)return"function"==typeof n?n(e,t[i-1],t[i])>0?i-1:i:t[i-1]-e<e-t[i]?i-1:i}return r-1}function o(t,e,n){for(;e<n;){var r=t[e];t[e]=t[n],t[n]=r,++e,--n}}function s(t,e){for(var n=Array.isArray(e)?e:[e],r=n.length,i=0;i<r;i++)t[t.length]=n[i]}function a(t,e){var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function u(){return!0}function l(){return!1}function c(){}function h(){return function(){throw new Error("Unimplemented abstract method.")}()}var f=0;function p(t){return t.ol_uid||(t.ol_uid=String(++f))}var d,g="6.15.1",y="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",v=-1!==y.indexOf("firefox"),_=(-1!==y.indexOf("safari")&&-1==y.indexOf("chrom")&&(y.indexOf("version/15.4")>=0||y.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==y.indexOf("webkit")&&-1==y.indexOf("edge")),m=-1!==y.indexOf("macintosh"),x="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,b="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,w="undefined"!=typeof Image&&Image.prototype.decode,E=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}(),C=(d=function(t,e){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},d(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),S=function(t){function e(e){var n=this,r="Assertion failed. See https://openlayers.org/en/"+("v"+g.split("-")[0])+"/doc/errors/#"+e+" for details.";return(n=t.call(this,r)||this).code=e,n.name="AssertionError",n.message=r,n}return C(e,t),e}(Error);function P(t,e){if(!t)throw new S(e)}var I;new Array(6);function M(t,e,n,r,i,o,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t}function O(t,e){var n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function L(t,e,n,r,i,o,s,a){var u=Math.sin(o),l=Math.cos(o);return t[0]=r*l,t[1]=i*u,t[2]=-r*u,t[3]=i*l,t[4]=s*r*l-a*r*u+e,t[5]=s*i*u+a*i*l+n,t}function R(t,e){var n,r=(n=e)[0]*n[3]-n[1]*n[2];P(0!==r,32);var i=e[0],o=e[1],s=e[2],a=e[3],u=e[4],l=e[5];return t[0]=a/r,t[1]=-o/r,t[2]=-s/r,t[3]=i/r,t[4]=(s*l-a*u)/r,t[5]=-(i*l-o*u)/r,t}function k(t){var e="matrix("+t.join(", ")+")";if(b)return e;var n=I||(I=document.createElement("div"));return n.style.transform=e,n.style.transform}var T=0,N=1,A=2,D=4,F=8,j=16;function G(t){for(var e=Y(),n=0,r=t.length;n<r;++n)tt(e,t[n]);return e}function B(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function z(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function V(t,e,n){var r,i;return(r=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*r+(i=n<t[1]?t[1]-n:t[3]<n?n-t[3]:0)*i}function U(t,e){return X(t,e[0],e[1])}function W(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function X(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function q(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],s=e[0],a=e[1],u=T;return s<n?u|=j:s>i&&(u|=D),a<r?u|=F:a>o&&(u|=A),u===T&&(u=N),u}function Y(){return[1/0,1/0,-1/0,-1/0]}function H(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function Z(t){return H(1/0,1/0,-1/0,-1/0,t)}function K(t,e){var n=t[0],r=t[1];return H(n,r,n,r,e)}function J(t,e,n,r,i){return et(Z(i),t,e,n,r)}function $(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Q(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function tt(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function et(t,e,n,r,i){for(;n<r;n+=i)nt(t,e[n],e[n+1]);return t}function nt(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function rt(t,e){var n;return(n=e(ot(t)))||(n=e(st(t)))||(n=e(dt(t)))?n:(n=e(pt(t)))||!1}function it(t){var e=0;return vt(t)||(e=gt(t)*ht(t)),e}function ot(t){return[t[0],t[1]]}function st(t){return[t[2],t[1]]}function at(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function ut(t,e){var n;return"bottom-left"===e?n=ot(t):"bottom-right"===e?n=st(t):"top-left"===e?n=pt(t):"top-right"===e?n=dt(t):P(!1,13),n}function lt(t,e,n,r,i){var o=ct(t,e,n,r),s=o[0],a=o[1],u=o[2],l=o[3],c=o[4],h=o[5],f=o[6],p=o[7];return H(Math.min(s,u,c,f),Math.min(a,l,h,p),Math.max(s,u,c,f),Math.max(a,l,h,p),i)}function ct(t,e,n,r){var i=e*r[0]/2,o=e*r[1]/2,s=Math.cos(n),a=Math.sin(n),u=i*s,l=i*a,c=o*s,h=o*a,f=t[0],p=t[1];return[f-u+h,p-l-c,f-u-h,p-l+c,f+u-h,p+l+c,f+u+h,p+l-c,f-u+h,p-l-c]}function ht(t){return t[3]-t[1]}function ft(t,e,n){var r=n||[1/0,1/0,-1/0,-1/0];return yt(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):Z(r),r}function pt(t){return[t[0],t[3]]}function dt(t){return[t[2],t[3]]}function gt(t){return t[2]-t[0]}function yt(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function vt(t){return t[2]<t[0]||t[3]<t[1]}function _t(t,e){var n=(t[2]-t[0])/2*(e-1),r=(t[3]-t[1])/2*(e-1);t[0]-=n,t[2]+=n,t[1]-=r,t[3]+=r}function mt(t,e,n,r){var i=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a<r;++a)i.push(t[0]+o*a/r,t[1],t[2],t[1]+s*a/r,t[2]-o*a/r,t[3],t[0],t[3]-s*a/r);else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);for(var u=[],l=[],c=(a=0,i.length);a<c;a+=2)u.push(i[a]),l.push(i[a+1]);return function(t,e,n){return H(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),n)}(u,l,n)}function xt(t,e){var n=e.getExtent(),r=at(t);if(e.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){var i=gt(n),o=Math.floor((r[0]-n[0])/i)*i;t[0]-=o,t[2]-=o}return t}function bt(t,e,n){return Math.min(Math.max(t,e),n)}var wt="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Et="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Ct(t,e,n,r,i,o){var s=i-n,a=o-r;if(0!==s||0!==a){var u=((t-n)*s+(e-r)*a)/(s*s+a*a);u>1?(n=i,r=o):u>0&&(n+=s*u,r+=a*u)}return St(t,e,n,r)}function St(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function Pt(t){return t*Math.PI/180}function It(t,e){var n=t%e;return n*e<0?n+e:n}function Mt(t,e,n){return t+n*(e-t)}function Ot(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function Lt(t,e){return Math.floor(Ot(t,e))}function Rt(t,e){return Math.ceil(Ot(t,e))}var kt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Tt=/^([a-z]*)$|^hsla?\(.*\)$/i;function Nt(t){return"string"==typeof t?t:Gt(t)}function At(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}return""}var Dt=function(){var t={},e=0;return function(n){var r;if(t.hasOwnProperty(n))r=t[n];else{if(e>=1024){var i=0;for(var o in t)3&i++||(delete t[o],--e)}r=function(t){var e,n,r,i,o;Tt.exec(t)&&(t=At(t));if(kt.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var u=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),n=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),i=u?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,n=(n<<4)+n,r=(r<<4)+r,u&&(i=(i<<4)+i)),o=[e,n,r,i/255]}else 0==t.indexOf("rgba(")?jt(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),jt(o)):P(!1,14);return o}(n),t[n]=r,++e}return r}}();function Ft(t){return Array.isArray(t)?t:Dt(t)}function jt(t){return t[0]=bt(t[0]+.5|0,0,255),t[1]=bt(t[1]+.5|0,0,255),t[2]=bt(t[2]+.5|0,0,255),t[3]=bt(t[3],0,1),t}function Gt(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+e+","+n+","+r+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}var Bt=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var n=this.cache_[e];3&t++||n.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,n){var r=zt(t,e,n);return r in this.cache_?this.cache_[r]:null},t.prototype.set=function(t,e,n,r){var i=zt(t,e,n);this.cache_[i]=r,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function zt(t,e,n){return e+":"+t+":"+(n?Nt(n):"null")}var Vt=new Bt;function Ut(t){t.stopPropagation()}var Wt=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),Xt="propertychange",qt="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,i=arguments.length;r<i;++r){var o=arguments[r];if(null!=o)for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])}return n};function Yt(t){for(var e in t)delete t[e]}var Ht="function"==typeof Object.values?Object.values:function(t){var e=[];for(var n in t)e.push(t[n]);return e};function Zt(t){var e;for(e in t)return!1;return!e}var Kt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jt=function(t){function e(e){var n=t.call(this)||this;return n.eventTarget_=e,n.pendingRemovals_=null,n.dispatching_=null,n.listeners_=null,n}return Kt(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var n=this.listeners_||(this.listeners_={}),r=n[t]||(n[t]=[]);-1===r.indexOf(e)&&r.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t,n=e?t:t.type,r=this.listeners_&&this.listeners_[n];if(r){var i=e?new Wt(t):t;i.target||(i.target=this.eventTarget_||this);var o,s=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in s||(s[n]=0,a[n]=0),++s[n];for(var u=0,l=r.length;u<l;++u)if(!1===(o="handleEvent"in r[u]?r[u].handleEvent(i):r[u].call(this,i))||i.propagationStopped){o=!1;break}if(0===--s[n]){var h=a[n];for(delete a[n];h--;)this.removeEventListener(n,c);delete s[n]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&Yt(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var r=n.indexOf(e);-1!==r&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[r]=c,++this.pendingRemovals_[t]):(n.splice(r,1),0===n.length&&delete this.listeners_[t]))}},e}(t),$t=Jt,Qt="change",te="error",ee="contextmenu",ne="click",re="dblclick",ie="keydown",oe="keypress",se="load",ae="resize",ue="touchmove",le="wheel";function ce(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function he(t,e,n,r){return ce(t,e,n,r,!0)}function fe(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Yt(t))}var pe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),de=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return pe(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Qt)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=ce(this,t[i],e);return r}return ce(this,t,e)},e.prototype.onceInternal=function(t,e){var n;if(Array.isArray(t)){var r=t.length;n=new Array(r);for(var i=0;i<r;++i)n[i]=he(this,t[i],e)}else n=he(this,t,e);return e.ol_key=n,n},e.prototype.unInternal=function(t,e){var n=e.ol_key;if(n)ge(n);else if(Array.isArray(t))for(var r=0,i=t.length;r<i;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)},e}($t);function ge(t){if(Array.isArray(t))for(var e=0,n=t.length;e<n;++e)fe(t[e]);else fe(t)}de.prototype.on,de.prototype.once,de.prototype.un;var ye=de,ve=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_e=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.key=n,i.oldValue=r,i}return ve(e,t),e}(Wt),me=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,p(n),n.values_=null,void 0!==e&&n.setProperties(e),n}return ve(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&qt({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var n;n="change:".concat(t),this.hasListener(n)&&this.dispatchEvent(new _e(n,t,e)),n=Xt,this.hasListener(n)&&this.dispatchEvent(new _e(n,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:".concat(t),e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:".concat(t),e)},e.prototype.set=function(t,e,n){var r=this.values_||(this.values_={});if(n)r[t]=e;else{var i=r[t];r[t]=e,i!==e&&this.notify(t,i)}},e.prototype.setProperties=function(t,e){for(var n in t)this.set(n,t[n],e)},e.prototype.applyProperties=function(t){t.values_&&qt(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var n=this.values_[t];delete this.values_[t],Zt(this.values_)&&(this.values_=null),e||this.notify(t,n)}},e}(ye),xe="opacity",be="visible",we="extent",Ee="zIndex",Ce="maxResolution",Se="minResolution",Pe="maxZoom",Ie="minZoom",Me="source",Oe="map",Le=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Re=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un,n.background_=e.background;var r=qt({},e);return"object"==typeof e.properties&&(delete r.properties,qt(r,e.properties)),r[xe]=void 0!==e.opacity?e.opacity:1,P("number"==typeof r[xe],64),r[be]=void 0===e.visible||e.visible,r[Ee]=e.zIndex,r[Ce]=void 0!==e.maxResolution?e.maxResolution:1/0,r[Se]=void 0!==e.minResolution?e.minResolution:0,r[Ie]=void 0!==e.minZoom?e.minZoom:-1/0,r[Pe]=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==r.className?r.className:"ol-layer",delete r.className,n.setProperties(r),n.state_=null,n}return Le(e,t),e.prototype.getBackground=function(){return this.background_},e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=bt(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==n||e.managed?n:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return h()},e.prototype.getLayerStatesArray=function(t){return h()},e.prototype.getExtent=function(){return this.get(we)},e.prototype.getMaxResolution=function(){return this.get(Ce)},e.prototype.getMinResolution=function(){return this.get(Se)},e.prototype.getMinZoom=function(){return this.get(Ie)},e.prototype.getMaxZoom=function(){return this.get(Pe)},e.prototype.getOpacity=function(){return this.get(xe)},e.prototype.getSourceState=function(){return h()},e.prototype.getVisible=function(){return this.get(be)},e.prototype.getZIndex=function(){return this.get(Ee)},e.prototype.setBackground=function(t){this.background_=t,this.changed()},e.prototype.setExtent=function(t){this.set(we,t)},e.prototype.setMaxResolution=function(t){this.set(Ce,t)},e.prototype.setMinResolution=function(t){this.set(Se,t)},e.prototype.setMaxZoom=function(t){this.set(Pe,t)},e.prototype.setMinZoom=function(t){this.set(Ie,t)},e.prototype.setOpacity=function(t){P("number"==typeof t,64),this.set(xe,t)},e.prototype.setVisible=function(t){this.set(be,t)},e.prototype.setZIndex=function(t){this.set(Ee,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(me),ke=Re,Te="prerender",Ne="postrender",Ae="precompose",De="postcompose",Fe="rendercomplete",je=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ge=function(t){function e(e){var n=this,r=qt({},e);delete r.source,(n=t.call(this,r)||this).on,n.once,n.un,n.mapPrecomposeKey_=null,n.mapRenderKey_=null,n.sourceChangeKey_=null,n.renderer_=null,n.rendered=!1,e.render&&(n.render=e.render),e.map&&n.setMap(e.map),n.addChangeListener(Me,n.handleSourcePropertyChange_);var i=e.source?e.source:null;return n.setSource(i),n}return je(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Me)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(fe(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=ce(t,Qt,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise(function(t){return t([])})},e.prototype.getData=function(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null},e.prototype.render=function(t,e){var n=this.getRenderer();if(n.prepareFrame(t))return this.rendered=!0,n.renderFrame(t,e)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(Oe,t)},e.prototype.getMapInternal=function(){return this.get(Oe)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(fe(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(fe(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ce(t,Ae,function(t){var e=t.frameState.layerStatesArray,n=this.getLayerState(!1);P(!e.some(function(t){return t.layer===n.layer}),67),e.push(n)},this),this.mapRenderKey_=ce(this,Qt,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Me,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(ke);function Be(t,e){if(!t.visible)return!1;var n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}var ze=Ge;function Ve(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Ue(t,e){var n=e.getRadius(),r=e.getCenter(),i=r[0],o=r[1],s=t[0]-i,a=t[1]-o;0===s&&0===a&&(s=1);var u=Math.sqrt(s*s+a*a);return[i+n*s/u,o+n*a/u]}function We(t,e){var n,r,i=t[0],o=t[1],s=e[0],a=e[1],u=s[0],l=s[1],c=a[0],h=a[1],f=c-u,p=h-l,d=0===f&&0===p?0:(f*(i-u)+p*(o-l))/(f*f+p*p||0);return d<=0?(n=u,r=l):d>=1?(n=c,r=h):(n=u+d*f,r=l+d*p),[n,r]}function Xe(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function qe(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function Ye(t,e){return t[0]*=e,t[1]*=e,t}function He(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Ze(t,e){return Math.sqrt(He(t,e))}function Ke(t,e){if(e.canWrapX()){var n=gt(e.getExtent()),r=function(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]<r[0]||t[0]>r[2])){var o=n||gt(r);i=Math.floor((t[0]-r[0])/o)}return i}(t,e,n);r&&(t[0]-=r*n)}return t}var Je=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$e=function(t){function e(e){var n=t.call(this)||this;return n.map_=e,n}return Je(e,t),e.prototype.dispatchRenderEvent=function(t,e){h()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,n=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;L(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),R(r,n)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i,o,s,a){var u,l=e.viewState;function c(t,e,n,r){return i.call(o,e,t?n:null,r)}var h=l.projection,f=Ke(t.slice(),h),p=[[0,0]];if(h.canWrapX()&&r){var d=gt(h.getExtent());p.push([-d,0],[d,0])}for(var g=e.layerStatesArray,y=g.length,v=[],_=[],m=0;m<p.length;m++)for(var x=y-1;x>=0;--x){var b=g[x],w=b.layer;if(w.hasRenderer()&&Be(b,l)&&s.call(a,w)){var E=w.getRenderer(),C=w.getSource();if(E&&C){var S=C.getWrapX()?f:t,P=c.bind(null,b.managed);_[0]=S[0]+p[m][0],_[1]=S[1]+p[m][1],u=E.forEachFeatureAtCoordinate(_,e,n,P,v)}if(u)return u}}if(0!==v.length){var I=1/v.length;return v.forEach(function(t,e){return t.distanceSq+=e*I}),v.sort(function(t,e){return t.distanceSq-e.distanceSq}),v.some(function(t){return u=t.callback(t.feature,t.layer,t.geometry)}),u}},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){return h()},e.prototype.hasFeatureAtCoordinate=function(t,e,n,r,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,r,u,this,i,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){h()},e.prototype.scheduleExpireIconCache=function(t){Vt.canExpireCache()&&t.postRenderFunctions.push(Qe)},e}(t);function Qe(t,e){Vt.expire()}var tn=$e,en=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nn=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.inversePixelTransform=n,o.frameState=r,o.context=i,o}return en(e,t),e}(Wt),rn="ol-hidden",on="ol-unselectable",sn="ol-control",an="ol-collapsed",un=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),ln=["style","variant","weight","size","lineHeight","family"],cn=function(t){var e=t.match(un);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=ln.length;r<i;++r){var o=e[r+1];void 0!==o&&(n[ln[r]]=o)}return n.families=n.family.split(/,\s?/),n};function hn(t,e,n,r){var i;return i=n&&n.length?n.shift():b?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function fn(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function pn(t){var e=t.offsetWidth,n=getComputedStyle(t);return e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10)}function dn(t){var e=t.offsetHeight,n=getComputedStyle(t);return e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10)}function gn(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function yn(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function vn(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var _n="10px sans-serif",mn="#000",xn="round",bn=[],wn="round",En="#000",Cn="center",Sn="middle",Pn=[0,0,0,0],In=new me;(new $t).setSize=function(){console.warn("labelCache is deprecated.")};var Mn,On,Ln=null,Rn={},kn=function(){var t,e,n="32px ",r=["monospace","serif"],i=r.length,o="wmytzilWMYTZIL@#/&?$%10";function s(t,s,a){for(var u=!0,l=0;l<i;++l){var c=r[l];if(e=An(t+" "+s+" "+n+c,o),a!=c){var h=An(t+" "+s+" "+n+a+","+c,o);u=u&&h!=e}}return!!u}function a(){for(var e=!0,n=In.getKeys(),r=0,i=n.length;r<i;++r){var o=n[r];In.get(o)<100&&(s.apply(this,o.split("\n"))?(Yt(Rn),Ln=null,Mn=void 0,In.set(o,100)):(In.set(o,In.get(o)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var n=cn(e);if(n)for(var r=n.families,i=0,o=r.length;i<o;++i){var u=r[i],l=n.style+"\n"+n.weight+"\n"+u;void 0===In.get(l)&&(In.set(l,100,!0),s(n.style,n.weight,u)||(In.set(l,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),Tn=function(t){var e=Rn[t];if(null==e){if(b){var n=cn(t),r=Nn(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else On||((On=document.createElement("div")).innerHTML="M",On.style.minHeight="0",On.style.maxHeight="none",On.style.height="auto",On.style.padding="0",On.style.border="none",On.style.position="absolute",On.style.display="block",On.style.left="-99999px"),On.style.font=t,document.body.appendChild(On),e=On.offsetHeight,document.body.removeChild(On);Rn[t]=e}return e};function Nn(t,e){return Ln||(Ln=hn(1,1)),t!=Mn&&(Ln.font=t,Mn=Ln.font),Ln.measureText(e)}function An(t,e){return Nn(t,e).width}function Dn(t,e,n){if(e in n)return n[e];var r=e.split("\n").reduce(function(e,n){return Math.max(e,An(t,n))},0);return n[e]=r,r}function Fn(t,e,n,r,i,o,s,a,u,l,c){t.save(),1!==n&&(t.globalAlpha*=n),e&&t.setTransform.apply(t,e),r.contextInstructions?(t.translate(u,l),t.scale(c[0],c[1]),function(t,e){for(var n=t.contextInstructions,r=0,i=n.length;r<i;r+=2)Array.isArray(n[r+1])?e[n[r]].apply(e,n[r+1]):e[n[r]]=n[r+1]}(r,t)):c[0]<0||c[1]<0?(t.translate(u,l),t.scale(c[0],c[1]),t.drawImage(r,i,o,s,a,0,0,s,a)):t.drawImage(r,i,o,s,a,u,l,s*c[0],a*c[1]),t.restore()}var jn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gn=function(t){function e(e){var n=t.call(this,e)||this;n.fontChangeListenerKey_=ce(In,Xt,e.redrawText.bind(e)),n.element_=document.createElement("div");var r=n.element_.style;r.position="absolute",r.width="100%",r.height="100%",r.zIndex="0",n.element_.className=on+" ol-layers";var i=e.getViewport();return i.insertBefore(n.element_,i.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return jn(e,t),e.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var r=new nn(t,void 0,e);n.dispatchEvent(r)}},e.prototype.disposeInternal=function(){fe(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(Ae,t);var e=t.layerStatesArray.sort(function(t,e){return t.zIndex-e.zIndex}),n=t.viewState;this.children_.length=0;for(var r=[],i=null,o=0,s=e.length;o<s;++o){var a=e[o];t.layerIndex=o;var u=a.layer,l=u.getSourceState();if(!Be(a,n)||"ready"!=l&&"undefined"!=l)u.unrender();else{var c=u.render(t,i);c&&(c!==i&&(this.children_.push(c),i=c),"getDeclutter"in u&&r.push(u))}}for(o=r.length-1;o>=0;--o)r[o].renderDeclutter(t);!function(t,e){for(var n=t.childNodes,r=0;;++r){var i=n[r],o=e[r];if(!i&&!o)break;i!==o&&(i?o?t.insertBefore(o,i):(t.removeChild(i),--r):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(De,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){for(var o=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var u=s[a],l=u.layer;if(l.hasRenderer()&&Be(u,o)&&i(l)){var c=l.getRenderer().getDataAtPixel(t,e,n);if(c){var h=r(l,c);if(h)return h}}}},e}(tn),Bn=Gn,zn="add",Vn="remove",Un=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wn="length",Xn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.element=n,i.index=r,i}return Un(e,t),e}(Wt),qn=function(t){function e(e,n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};if(r.unique_=!!i.unique,r.array_=e||[],r.unique_)for(var o=0,s=r.array_.length;o<s;++o)r.assertUnique_(r.array_[o],o);return r.updateLength_(),r}return Un(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,n=t.length;e<n;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,n=0,r=e.length;n<r;++n)t(e[n],n,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(Wn)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Xn(zn,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,n=0,r=e.length;n<r;++n)if(e[n]===t)return this.removeAt(n)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Xn(Vn,e,t)),e},e.prototype.setAt=function(t,e){var n=this.getLength();if(t<n){this.unique_&&this.assertUnique_(e,t);var r=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Xn(Vn,r,t)),this.dispatchEvent(new Xn(zn,e,t))}else{for(var i=n;i<t;++i)this.insertAt(i,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(Wn,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var n=0,r=this.array_.length;n<r;++n)if(this.array_[n]===t&&n!==e)throw new S(58)},e}(me),Yn=qn,Hn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.layer=n,r}return Hn(e,t),e}(Wt),Kn="layers",Jn=function(t){function e(e){var n=this,r=e||{},i=qt({},r);delete i.layers;var o=r.layers;return(n=t.call(this,i)||this).on,n.once,n.un,n.layersListenerKeys_=[],n.listenerKeys_={},n.addChangeListener(Kn,n.handleLayersChanged_),o?Array.isArray(o)?o=new Yn(o.slice(),{unique:!0}):P("function"==typeof o.getArray,43):o=new Yn(void 0,{unique:!0}),n.setLayers(o),n}return Hn(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(fe),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(ce(t,zn,this.handleLayersAdd_,this),ce(t,Vn,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(fe);Yt(this.listenerKeys_);for(var n=t.getArray(),r=0,i=n.length;r<i;r++){var o=n[r];this.registerLayerListeners_(o),this.dispatchEvent(new Zn("addlayer",o))}this.changed()},e.prototype.registerLayerListeners_=function(t){var n=[ce(t,Xt,this.handleLayerChange_,this),ce(t,Qt,this.handleLayerChange_,this)];t instanceof e&&n.push(ce(t,"addlayer",this.handleLayerGroupAdd_,this),ce(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[p(t)]=n},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new Zn("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new Zn("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Zn("addlayer",e)),this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,n=p(e);this.listenerKeys_[n].forEach(fe),delete this.listenerKeys_[n],this.dispatchEvent(new Zn("removelayer",e)),this.changed()},e.prototype.getLayers=function(){return this.get(Kn)},e.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var n=e.getArray(),r=0,i=n.length;r<i;++r)this.dispatchEvent(new Zn("removelayer",n[r]));this.set(Kn,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach(function(t){t.getLayersArray(e)}),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],n=e.length;this.getLayers().forEach(function(t){t.getLayerStatesArray(e)});var r=this.getLayerState(),i=r.zIndex;t||void 0!==r.zIndex||(i=0);for(var o=n,s=e.length;o<s;o++){var a=e[o];a.opacity*=r.opacity,a.visible=a.visible&&r.visible,a.maxResolution=Math.min(a.maxResolution,r.maxResolution),a.minResolution=Math.max(a.minResolution,r.minResolution),a.minZoom=Math.max(a.minZoom,r.minZoom),a.maxZoom=Math.min(a.maxZoom,r.maxZoom),void 0!==r.extent&&(void 0!==a.extent?a.extent=ft(a.extent,r.extent):a.extent=r.extent),void 0===a.zIndex&&(a.zIndex=i)}return e},e.prototype.getSourceState=function(){return"ready"},e}(ke),$n=Jn,Qn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),tr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.map=n,i.frameState=void 0!==r?r:null,i}return Qn(e,t),e}(Wt),er=tr,nr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rr=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,o)||this;return a.originalEvent=r,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==i&&i,a.activePointers=s,a}return nr(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(er),ir=rr,or={SINGLECLICK:"singleclick",CLICK:ne,DBLCLICK:re,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},sr="pointermove",ar="pointerdown",ur="pointerup",lr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cr=function(t){function e(e,n){var r=t.call(this,e)||this;r.map_=e,r.clickTimeoutId_,r.emulateClicks_=!1,r.dragging_=!1,r.dragListenerKeys_=[],r.moveTolerance_=void 0===n?1:n,r.down_=null;var i=r.map_.getViewport();return r.activePointers_=[],r.trackedTouches_={},r.element_=i,r.pointerdownListenerKey_=ce(i,ar,r.handlePointerDown_,r),r.originalPointerMoveEvent_,r.relayedListenerKey_=ce(i,sr,r.relayMoveEvent_,r),r.boundHandleTouchMove_=r.handleTouchMove_.bind(r),r.element_.addEventListener(ue,r.boundHandleTouchMove_,!!E&&{passive:!1}),r}return lr(e,t),e.prototype.emulateClick_=function(t){var e=new ir(or.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new ir(or.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new ir(or.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t,n=e.pointerId;if(e.type==or.POINTERUP||e.type==or.POINTERCANCEL){for(var r in delete this.trackedTouches_[n],this.trackedTouches_)if(this.trackedTouches_[r].target!==e.target){delete this.trackedTouches_[r];break}}else e.type!=or.POINTERDOWN&&e.type!=or.POINTERMOVE||(this.trackedTouches_[n]=e);this.activePointers_=Ht(this.trackedTouches_)},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new ir(or.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(fe),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);var e=new ir(or.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);for(var n in this.dispatchEvent(e),this.down_={},t){var r=t[n];this.down_[n]="function"==typeof r?c:r}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(ce(i,or.POINTERMOVE,this.handlePointerMove_,this),ce(i,or.POINTERUP,this.handlePointerUp_,this),ce(this.element_,or.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(ce(this.element_.getRootNode(),or.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;var e=new ir(or.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}},e.prototype.relayMoveEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new ir(or.POINTERMOVE,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(fe(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(ue,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(fe(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(fe),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}($t),hr=cr,fr="postrender",pr="movestart",dr="moveend",gr="loadstart",yr="loadend",vr="layergroup",_r="size",mr="target",xr="view",br=1/0,wr=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Yt(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,n=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var r=this.keyFunction_(n);return delete this.queuedElements_[r],n},t.prototype.enqueue=function(t){P(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=br&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,n=this.priorities_,r=e.length,i=e[t],o=n[t],s=t;t<r>>1;){var a=this.getLeftChildIndex_(t),u=this.getRightChildIndex_(t),l=u<r&&n[u]<n[a]?u:a;e[t]=e[l],n[t]=n[l],t=l}e[t]=i,n[t]=o,this.siftDown_(s,t)},t.prototype.siftDown_=function(t,e){for(var n=this.elements_,r=this.priorities_,i=n[e],o=r[e];e>t;){var s=this.getParentIndex_(e);if(!(r[s]>o))break;n[e]=n[s],r[e]=r[s],e=s}n[e]=i,r[e]=o},t.prototype.reprioritize=function(){var t,e,n,r=this.priorityFunction_,i=this.elements_,o=this.priorities_,s=0,a=i.length;for(e=0;e<a;++e)(n=r(t=i[e]))==br?delete this.queuedElements_[this.keyFunction_(t)]:(o[s]=n,i[s++]=t);i.length=s,o.length=s,this.heapify_()},t}(),Er=wr,Cr=0,Sr=1,Pr=2,Ir=3,Mr=4,Or=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lr=function(t){function e(e,n){var r=t.call(this,function(t){return e.apply(null,t)},function(t){return t[0].getKey()})||this;return r.boundHandleTileChange_=r.handleTileChange.bind(r),r.tileChangeCallback_=n,r.tilesLoading_=0,r.tilesLoadingKeys_={},r}return Or(e,t),e.prototype.enqueue=function(e){var n=t.prototype.enqueue.call(this,e);n&&e[0].addEventListener(Qt,this.boundHandleTileChange_);return n},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,n=e.getState();if(n===Pr||n===Ir||n===Mr){e.removeEventListener(Qt,this.boundHandleTileChange_);var r=e.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var n,r,i=0;this.tilesLoading_<t&&i<e&&this.getCount()>0;)r=(n=this.dequeue()[0]).getKey(),n.getState()!==Cr||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++i,n.load())},e}(Er),Rr=Lr;var kr={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"};var Tr={};Tr[kr.RADIANS]=6370997/(2*Math.PI),Tr[kr.DEGREES]=2*Math.PI*6370997/360,Tr[kr.FEET]=.3048,Tr[kr.METERS]=1,Tr[kr.USFEET]=1200/3937;var Nr=kr,Ar=0,Dr=1,Fr={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},jr=256,Gr=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Tr[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),Br=Gr,zr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vr=6378137,Ur=Math.PI*Vr,Wr=[-Ur,-Ur,Ur,Ur],Xr=[-180,-85,180,85],qr=Vr*Math.log(Math.tan(Math.PI/2)),Yr=function(t){function e(e){return t.call(this,{code:e,units:Nr.METERS,extent:Wr,global:!0,worldExtent:Xr,getPointResolution:function(t,e){return t/wt(e[1]/Vr)}})||this}return zr(e,t),e}(Br),Hr=[new Yr("EPSG:3857"),new Yr("EPSG:102100"),new Yr("EPSG:102113"),new Yr("EPSG:900913"),new Yr("http://www.opengis.net/def/crs/EPSG/0/3857"),new Yr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Zr(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var s=0;s<r;s+=i){o[s]=Ur*t[s]/180;var a=Vr*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>qr?a=qr:a<-qr&&(a=-qr),o[s+1]=a}return o}function Kr(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var s=0;s<r;s+=i)o[s]=180*t[s]/Ur,o[s+1]=360*Math.atan(Math.exp(t[s+1]/Vr))/Math.PI-90;return o}var Jr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$r=[-180,-90,180,90],Qr=6378137*Math.PI/180,ti=function(t){function e(e,n){return t.call(this,{code:e,units:Nr.DEGREES,extent:$r,axisOrientation:n,global:!0,metersPerUnit:Qr,worldExtent:$r})||this}return Jr(e,t),e}(Br),ei=[new ti("CRS:84"),new ti("EPSG:4326","neu"),new ti("urn:ogc:def:crs:OGC:1.3:CRS84"),new ti("urn:ogc:def:crs:OGC:2:84"),new ti("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new ti("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ti("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],ni={};var ri={};function ii(t,e,n){var r=t.getCode(),i=e.getCode();r in ri||(ri[r]={}),ri[r][i]=n}var oi=6371008.8;function si(t,e,n){var r=n||oi,i=Pt(t[1]),o=Pt(e[1]),s=(o-i)/2,a=Pt(e[0]-t[0])/2,u=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))}var ai=!0;function ui(t){ai=!(void 0===t||t)}function li(t,e,n){var r;if(void 0!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];r=e}else r=t.slice();return r}function ci(t,e,n){if(void 0!==e&&t!==e){for(var r=0,i=t.length;r<i;++r)e[r]=t[r];t=e}return t}function hi(t){!function(t,e){ni[t]=e}(t.getCode(),t),ii(t,t,li)}function fi(t){return"string"==typeof t?ni[e=t]||ni[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function pi(t,e,n,r){var i,o=(t=fi(t)).getPointResolutionFunc();if(o){if(i=o(e,n),r&&r!==t.getUnits())(a=t.getMetersPerUnit())&&(i=i*a/Tr[r])}else{var s=t.getUnits();if(s==Nr.DEGREES&&!r||r==Nr.DEGREES)i=e;else{var a,u=vi(t,fi("EPSG:4326"));if(u===ci&&s!==Nr.DEGREES)i=e*t.getMetersPerUnit();else{var l=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];i=(si((l=u(l,l,2)).slice(0,2),l.slice(2,4))+si(l.slice(4,6),l.slice(6,8)))/2}void 0!==(a=r?Tr[r]:t.getMetersPerUnit())&&(i/=a)}}return i}function di(t){!function(t){t.forEach(hi)}(t),t.forEach(function(e){t.forEach(function(t){e!==t&&ii(e,t,li)})})}function gi(t,e){return t?"string"==typeof t?fi(t):t:fi(e)}function yi(t,e){if(t===e)return!0;var n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||vi(t,e)===li)&&n}function vi(t,e){var n=function(t,e){var n;return t in ri&&e in ri[t]&&(n=ri[t][e]),n}(t.getCode(),e.getCode());return n||(n=ci),n}function _i(t,e){return vi(fi(t),fi(e))}function mi(t,e,n){return _i(e,n)(t,void 0,t.length)}function xi(t,e,n,r){return mt(t,_i(e,n),void 0,r)}var bi,wi,Ei,Ci=null;function Si(){return Ci}function Pi(t,e){return Ci?mi(t,e,Ci):t}function Ii(t,e){return Ci?mi(t,Ci,e):(ai&&!Xe(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(ai=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function Mi(t,e){return Ci?xi(t,e,Ci):t}function Oi(t,e){return Ci?xi(t,Ci,e):t}function Li(t,e){if(!Ci)return t;var n=fi(e).getUnits(),r=Ci.getUnits();return n&&r?t*Tr[n]/Tr[r]:t}function Ri(t,e,n){return function(r,i,o,s,a){if(r){if(!i&&!e)return r;var u=e?0:o[0]*i,l=e?0:o[1]*i,c=a?a[0]:0,h=a?a[1]:0,f=t[0]+u/2+c,p=t[2]-u/2+c,d=t[1]+l/2+h,g=t[3]-l/2+h;f>p&&(p=f=(p+f)/2),d>g&&(g=d=(g+d)/2);var y=bt(r[0],f,p),v=bt(r[1],d,g);if(s&&n&&i){var _=30*i;y+=-_*Math.log(1+Math.max(0,f-r[0])/_)+_*Math.log(1+Math.max(0,r[0]-p)/_),v+=-_*Math.log(1+Math.max(0,d-r[1])/_)+_*Math.log(1+Math.max(0,r[1]-g)/_)}return[y,v]}}}function ki(t){return t}function Ti(t,e,n,r){var i=gt(e)/n[0],o=ht(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function Ni(t,e,n){var r=Math.min(t,e);return r*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/t-1))/50+1),bt(r,n/2,2*e)}function Ai(t,e,n,r,i){return function(o,s,a,u){if(void 0!==o){var l=r?Ti(t,r,a,i):t;return(void 0===n||n)&&u?Ni(o,l,e):bt(o,e,l)}}}function Di(t){return void 0!==t?0:void 0}function Fi(t){return void 0!==t?t:void 0}function ji(t){return Math.pow(t,3)}function Gi(t){return 1-ji(1-t)}function Bi(t){return 3*t*t-2*t*t*t}function zi(t){return t}di(Hr),di(ei),bi=Hr,wi=Zr,Ei=Kr,ei.forEach(function(t){bi.forEach(function(e){ii(t,e,wi),ii(e,t,Ei)})});var Vi="XY",Ui="XYZ",Wi="XYM",Xi="XYZM";function qi(t,e,n,r,i,o){for(var s=o||[],a=0,u=e;u<n;u+=r){var l=t[u],c=t[u+1];s[a++]=i[0]*l+i[2]*c+i[4],s[a++]=i[1]*l+i[3]*c+i[5]}return o&&s.length!=a&&(s.length=a),s}function Yi(t,e,n,r,i,o,s){for(var a=s||[],u=Math.cos(i),l=Math.sin(i),c=o[0],h=o[1],f=0,p=e;p<n;p+=r){var d=t[p]-c,g=t[p+1]-h;a[f++]=c+d*u-g*l,a[f++]=h+d*l+g*u;for(var y=p+2;y<p+r;++y)a[f++]=t[y]}return s&&a.length!=f&&(a.length=f),a}function Hi(t,e,n,r,i,o,s){for(var a=s||[],u=0,l=e;l<n;l+=r){a[u++]=t[l]+i,a[u++]=t[l+1]+o;for(var c=l+2;c<l+r;++c)a[u++]=t[c]}return s&&a.length!=u&&(a.length=u),a}var Zi=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ki=[1,0,0,1,0,0],Ji=function(t){function e(){var e,n,r,i,o,s=t.call(this)||this;return s.extent_=[1/0,1/0,-1/0,-1/0],s.extentRevision_=-1,s.simplifiedGeometryMaxMinSquaredTolerance=0,s.simplifiedGeometryRevision=0,s.simplifyTransformedInternal=(e=function(t,e,n){if(!n)return this.getSimplifiedGeometry(e);var r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===i&&a(t,r)||(o=!0,i=this,r=t,n=e.apply(this,arguments)),n}),s}return Zi(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return h()},e.prototype.closestPointXY=function(t,e,n,r){return h()},e.prototype.containsXY=function(t,e){var n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e},e.prototype.getClosestPoint=function(t,e){var n=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],n,1/0),n},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return h()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Z(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){h()},e.prototype.scale=function(t,e,n){h()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return h()},e.prototype.getType=function(){return h()},e.prototype.applyTransform=function(t){h()},e.prototype.intersectsExtent=function(t){return h()},e.prototype.translate=function(t,e){h()},e.prototype.transform=function(t,e){var n=fi(t),r=n.getUnits()==Nr.TILE_PIXELS?function(t,r,i){var o=n.getExtent(),s=n.getWorldExtent(),a=ht(s)/ht(o);return L(Ki,s[0],s[3],a,-a,0,0,0),qi(t,0,t.length,i,Ki,r),_i(n,e)(t,r,i)}:_i(n,e);return this.applyTransform(r),this},e}(me),$i=Ji,Qi=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),to=function(t){function e(){var e=t.call(this)||this;return e.layout=Vi,e.stride=2,e.flatCoordinates=null,e}return Qi(e,t),e.prototype.computeExtent=function(t){return J(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return h()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=eo(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){h()},e.prototype.setLayout=function(t,e,n){var r;if(t)r=eo(t);else{for(var i=0;i<n;++i){if(0===e.length)return this.layout=Vi,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Vi:3==t?e=Ui:4==t&&(e=Xi);return e}(r=e.length)}this.layout=t,this.stride=r},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var n=this.getFlatCoordinates();if(n){var r=this.getStride();Yi(n,0,n.length,r,t,e,n),this.changed()}},e.prototype.scale=function(t,e,n){var r=e;void 0===r&&(r=t);var i=n;i||(i=at(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();!function(t,e,n,r,i,o,s,a){for(var u=a||[],l=s[0],c=s[1],h=0,f=e;f<n;f+=r){var p=t[f]-l,d=t[f+1]-c;u[h++]=l+i*p,u[h++]=c+o*d;for(var g=f+2;g<f+r;++g)u[h++]=t[g]}a&&u.length!=h&&(u.length=h)}(o,0,o.length,s,t,r,i,o),this.changed()}},e.prototype.translate=function(t,e){var n=this.getFlatCoordinates();if(n){var r=this.getStride();Hi(n,0,n.length,r,t,e,n),this.changed()}},e}($i);function eo(t){var e;return t==Vi?e=2:t==Ui||t==Wi?e=3:t==Xi&&(e=4),e}var no=to;function ro(t,e,n,r,i,o,s){var a,u=t[e],l=t[e+1],c=t[n]-u,h=t[n+1]-l;if(0===c&&0===h)a=e;else{var f=((i-u)*c+(o-l)*h)/(c*c+h*h);if(f>1)a=n;else{if(f>0){for(var p=0;p<r;++p)s[p]=Mt(t[e+p],t[n+p],f);return void(s.length=r)}a=e}}for(p=0;p<r;++p)s[p]=t[a+p];s.length=r}function io(t,e,n,r,i){var o=t[e],s=t[e+1];for(e+=r;e<n;e+=r){var a=t[e],u=t[e+1],l=St(o,s,a,u);l>i&&(i=l),o=a,s=u}return i}function oo(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];i=io(t,e,a,r,i),e=a}return i}function so(t,e,n,r,i,o,s,a,u,l,c){if(e==n)return l;var h,f;if(0===i){if((f=St(s,a,t[e],t[e+1]))<l){for(h=0;h<r;++h)u[h]=t[e+h];return u.length=r,f}return l}for(var p=c||[NaN,NaN],d=e+r;d<n;)if(ro(t,d-r,d,r,s,a,p),(f=St(s,a,p[0],p[1]))<l){for(l=f,h=0;h<r;++h)u[h]=p[h];u.length=r,d+=r}else d+=r*Math.max((Math.sqrt(f)-Math.sqrt(l))/i|0,1);if(o&&(ro(t,n-r,e,r,s,a,p),(f=St(s,a,p[0],p[1]))<l)){for(l=f,h=0;h<r;++h)u[h]=p[h];u.length=r}return l}function ao(t,e,n,r,i,o,s,a,u,l,c){for(var h=c||[NaN,NaN],f=0,p=n.length;f<p;++f){var d=n[f];l=so(t,e,d,r,i,o,s,a,u,l,h),e=d}return l}function uo(t,e,n,r){for(var i=0,o=n.length;i<o;++i)t[e++]=n[i];return e}function lo(t,e,n,r){for(var i=0,o=n.length;i<o;++i)for(var s=n[i],a=0;a<r;++a)t[e++]=s[a];return e}function co(t,e,n,r,i){for(var o=i||[],s=0,a=0,u=n.length;a<u;++a){var l=lo(t,e,n[a],r);o[s++]=l,e=l}return o.length=s,o}function ho(t,e,n,r,i,o,s){var a=(n-e)/r;if(a<3){for(;e<n;e+=r)o[s++]=t[e],o[s++]=t[e+1];return s}var u=new Array(a);u[0]=1,u[a-1]=1;for(var l=[e,n-r],c=0;l.length>0;){for(var h=l.pop(),f=l.pop(),p=0,d=t[f],g=t[f+1],y=t[h],v=t[h+1],_=f+r;_<h;_+=r){var m=Ct(t[_],t[_+1],d,g,y,v);m>p&&(c=_,p=m)}p>i&&(u[(c-e)/r]=1,f+r<c&&l.push(f,c),c+r<h&&l.push(c,h))}for(_=0;_<a;++_)u[_]&&(o[s++]=t[e+_*r],o[s++]=t[e+_*r+1]);return s}function fo(t,e,n,r,i,o,s,a){for(var u=0,l=n.length;u<l;++u){var c=n[u];s=ho(t,e,c,r,i,o,s),a.push(s),e=c}return s}function po(t,e){return e*Math.round(t/e)}function go(t,e,n,r,i,o,s){if(e==n)return s;var a,u,l=po(t[e],i),c=po(t[e+1],i);e+=r,o[s++]=l,o[s++]=c;do{if(a=po(t[e],i),u=po(t[e+1],i),(e+=r)==n)return o[s++]=a,o[s++]=u,s}while(a==l&&u==c);for(;e<n;){var h=po(t[e],i),f=po(t[e+1],i);if(e+=r,h!=a||f!=u){var p=a-l,d=u-c,g=h-l,y=f-c;p*y==d*g&&(p<0&&g<p||p==g||p>0&&g>p)&&(d<0&&y<d||d==y||d>0&&y>d)?(a=h,u=f):(o[s++]=a,o[s++]=u,l=a,c=u,a=h,u=f)}}return o[s++]=a,o[s++]=u,s}function yo(t,e,n,r,i,o,s,a){for(var u=0,l=n.length;u<l;++u){var c=n[u];s=go(t,e,c,r,i,o,s),a.push(s),e=c}return s}function vo(t,e,n,r,i){for(var o=void 0!==i?i:[],s=0,a=e;a<n;a+=r)o[s++]=t.slice(a,a+r);return o.length=s,o}function _o(t,e,n,r,i){for(var o=void 0!==i?i:[],s=0,a=0,u=n.length;a<u;++a){var l=n[a];o[s++]=vo(t,e,l,r,o[s]),e=l}return o.length=s,o}function mo(t,e,n,r,i){for(var o=void 0!==i?i:[],s=0,a=0,u=n.length;a<u;++a){var l=n[a];o[s++]=_o(t,e,l,r,o[s]),e=l[l.length-1]}return o.length=s,o}function xo(t,e,n,r){for(var i=0,o=t[n-r],s=t[n-r+1];e<n;e+=r){var a=t[e],u=t[e+1];i+=s*a-o*u,o=a,s=u}return i/2}function bo(t,e,n,r){for(var i=0,o=0,s=n.length;o<s;++o){var a=n[o];i+=xo(t,e,a,r),e=a}return i}var wo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Eo=function(t){function e(e,n){var r=t.call(this)||this;return r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return wo(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,r){return r<V(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),so(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.getArea=function(){return xo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return vo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=ho(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,Vi)},e.prototype.getType=function(){return"LinearRing"},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=lo(this.flatCoordinates,0,t,this.stride),this.changed()},e}(no),Co=Eo,So=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Po=function(t){function e(e,n){var r=t.call(this)||this;return r.setCoordinates(e,n),r}return So(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){var i=this.flatCoordinates,o=St(t,e,i[0],i[1]);if(o<r){for(var s=this.stride,a=0;a<s;++a)n[a]=i[a];return n.length=s,o}return r},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return K(this.flatCoordinates,t)},e.prototype.getType=function(){return"Point"},e.prototype.intersectsExtent=function(t){return X(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=uo(this.flatCoordinates,0,t,this.stride),this.changed()},e}(no),Io=Po;function Mo(t,e,n,r,i){return!rt(i,function(i){return!Oo(t,e,n,r,i[0],i[1])})}function Oo(t,e,n,r,i,o){for(var s=0,a=t[n-r],u=t[n-r+1];e<n;e+=r){var l=t[e],c=t[e+1];u<=o?c>o&&(l-a)*(o-u)-(i-a)*(c-u)>0&&s++:c<=o&&(l-a)*(o-u)-(i-a)*(c-u)<0&&s--,a=l,u=c}return 0!==s}function Lo(t,e,n,r,i,o){if(0===n.length)return!1;if(!Oo(t,e,n[0],r,i,o))return!1;for(var s=1,a=n.length;s<a;++s)if(Oo(t,n[s-1],n[s],r,i,o))return!1;return!0}function Ro(t,n,r,i,o,s,a){for(var u,l,c,h,f,p,d,g=o[s+1],y=[],v=0,_=r.length;v<_;++v){var m=r[v];for(h=t[m-i],p=t[m-i+1],u=n;u<m;u+=i)f=t[u],d=t[u+1],(g<=p&&d<=g||p<=g&&g<=d)&&(c=(g-p)/(d-p)*(f-h)+h,y.push(c)),h=f,p=d}var x=NaN,b=-1/0;for(y.sort(e),h=y[0],u=1,l=y.length;u<l;++u){f=y[u];var w=Math.abs(f-h);w>b&&Lo(t,n,r,i,c=(h+f)/2,g)&&(x=c,b=w),h=f}return isNaN(x)&&(x=o[s]),a?(a.push(x,g,b),a):[x,g,b]}function ko(t,e,n,r,i){var o;for(e+=r;e<n;e+=r)if(o=i(t.slice(e-r,e),t.slice(e,e+r)))return o;return!1}function To(t,e,n,r,i){var o=et([1/0,1/0,-1/0,-1/0],t,e,n,r);return!!yt(i,o)&&(!!W(i,o)||(o[0]>=i[0]&&o[2]<=i[2]||(o[1]>=i[1]&&o[3]<=i[3]||ko(t,e,n,r,function(t,e){return function(t,e,n){var r=!1,i=q(t,e),o=q(t,n);if(i===N||o===N)r=!0;else{var s=t[0],a=t[1],u=t[2],l=t[3],c=e[0],h=e[1],f=n[0],p=n[1],d=(p-h)/(f-c),g=void 0,y=void 0;o&A&&!(i&A)&&(r=(g=f-(p-l)/d)>=s&&g<=u),r||!(o&D)||i&D||(r=(y=p-(f-u)*d)>=a&&y<=l),r||!(o&F)||i&F||(r=(g=f-(p-a)/d)>=s&&g<=u),r||!(o&j)||i&j||(r=(y=p-(f-s)*d)>=a&&y<=l)}return r}(i,t,e)}))))}function No(t,e,n,r,i){return!!To(t,e,n,r,i)||(!!Oo(t,e,n,r,i[0],i[1])||(!!Oo(t,e,n,r,i[0],i[3])||(!!Oo(t,e,n,r,i[2],i[1])||!!Oo(t,e,n,r,i[2],i[3]))))}function Ao(t,e,n,r,i){if(!No(t,e,n[0],r,i))return!1;if(1===n.length)return!0;for(var o=1,s=n.length;o<s;++o)if(Mo(t,n[o-1],n[o],r,i)&&!To(t,n[o-1],n[o],r,i))return!1;return!0}function Do(t,e,n,r){for(;e<n-r;){for(var i=0;i<r;++i){var o=t[e+i];t[e+i]=t[n-r+i],t[n-r+i]=o}e+=r,n-=r}}function Fo(t,e,n,r){for(var i=0,o=t[n-r],s=t[n-r+1];e<n;e+=r){var a=t[e],u=t[e+1];i+=(a-o)*(u+s),o=a,s=u}return 0===i?void 0:i>0}function jo(t,e,n,r,i){for(var o=void 0!==i&&i,s=0,a=n.length;s<a;++s){var u=n[s],l=Fo(t,e,u,r);if(0===s){if(o&&l||!o&&!l)return!1}else if(o&&!l||!o&&l)return!1;e=u}return!0}function Go(t,e,n,r,i){for(var o=void 0!==i&&i,s=0,a=n.length;s<a;++s){var u=n[s],l=Fo(t,e,u,r);(0===s?o&&l||!o&&!l:o&&!l||!o&&l)&&Do(t,e,u,r),e=u}return e}function Bo(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o)e=Go(t,e,n[o],r,i);return e}var zo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vo=function(t){function e(e,n,r){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==n&&r?(i.setFlatCoordinates(n,e),i.ends_=r):i.setCoordinates(e,n),i}return zo(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?s(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<V(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(oo(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ao(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.containsXY=function(t,e){return Lo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return bo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Go(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,_o(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=at(this.getExtent());this.flatInteriorPoint_=Ro(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new Io(this.getFlatInteriorPoint(),Wi)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new Co(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.ends_,r=[],i=0,o=0,s=n.length;o<s;++o){var a=n[o],u=new Co(e.slice(i,a),t);r.push(u),i=a}return r},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;jo(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Go(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=yo(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,r),new e(n,Vi,r)},e.prototype.getType=function(){return"Polygon"},e.prototype.intersectsExtent=function(t){return Ao(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=co(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(no),Uo=Vo;function Wo(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=[e,n,e,i,r,i,r,n,e,n];return new Vo(o,Vi,[o.length])}function Xo(t,e,n){for(var r=e||32,i=t.getStride(),o=t.getLayout(),s=t.getCenter(),a=i*(r+1),u=new Array(a),l=0;l<a;l+=i){u[l]=0,u[l+1]=0;for(var c=2;c<i;c++)u[l+c]=s[c]}var h=[u.length],f=new Vo(u,o,h);return function(t,e,n,r){for(var i=t.getFlatCoordinates(),o=t.getStride(),s=i.length/o-1,a=r||0,u=0;u<=s;++u){var l=u*o,c=a+2*It(u,s)*Math.PI/s;i[l]=e[0]+n*Math.cos(c),i[l+1]=e[1]+n*Math.sin(c)}t.changed()}(f,s,t.getRadius(),n),f}var qo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yo=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=qt({},e);return n.hints_=[0,0],n.animations_=[],n.updateAnimationKey_,n.projection_=gi(r.projection,"EPSG:3857"),n.viewportSize_=[100,100],n.targetCenter_=null,n.targetResolution_,n.targetRotation_,n.nextCenter_=null,n.nextResolution_,n.nextRotation_,n.cancelAnchor_=void 0,r.projection&&ui(),r.center&&(r.center=Ii(r.center,n.projection_)),r.extent&&(r.extent=Oi(r.extent,n.projection_)),n.applyOptions_(r),n}return qo(e,t),e.prototype.applyOptions_=function(t){var e=qt({},t);for(var n in Fr)delete e[n];this.setProperties(e,!0);var r=function(t){var e,n,r,o=28,s=2,a=void 0!==t.minZoom?t.minZoom:0,u=void 0!==t.maxZoom?t.maxZoom:o,l=void 0!==t.zoomFactor?t.zoomFactor:s,c=void 0!==t.multiWorld&&t.multiWorld,h=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,f=void 0!==t.showFullExtent&&t.showFullExtent,p=gi(t.projection,"EPSG:3857"),d=p.getExtent(),g=t.constrainOnlyCenter,y=t.extent;c||y||!p.isGlobal()||(g=!1,y=d);if(void 0!==t.resolutions){var v=t.resolutions;n=v[a],r=void 0!==v[u]?v[u]:v[v.length-1],e=t.constrainResolution?function(t,e,n,r){return function(o,s,a,u){if(void 0!==o){var l=t[0],c=t[t.length-1],h=n?Ti(l,n,a,r):l;if(u)return void 0===e||e?Ni(o,h,c):bt(o,c,h);var f=Math.min(h,o),p=Math.floor(i(t,f,s));return t[p]>h&&p<t.length-1?t[p+1]:t[p]}}}(v,h,!g&&y,f):Ai(n,r,h,!g&&y,f)}else{var _=(d?Math.max(gt(d),ht(d)):360*Tr[Nr.DEGREES]/p.getMetersPerUnit())/jr/Math.pow(s,0),m=_/Math.pow(s,o-0);void 0!==(n=t.maxResolution)?a=0:n=_/Math.pow(l,a),void 0===(r=t.minResolution)&&(r=void 0!==t.maxZoom?void 0!==t.maxResolution?n/Math.pow(l,u):_/Math.pow(l,u):m),u=a+Math.floor(Math.log(n/r)/Math.log(l)),r=n/Math.pow(l,u-a),e=t.constrainResolution?function(t,e,n,r,i,o){return function(s,a,u,l){if(void 0!==s){var c=i?Ti(e,i,u,o):e,h=void 0!==n?n:0;if(l)return void 0===r||r?Ni(s,c,h):bt(s,h,c);var f=Math.ceil(Math.log(e/c)/Math.log(t)-1e-9),p=-a*(.5-1e-9)+.5,d=Math.min(c,s),g=Math.floor(Math.log(e/d)/Math.log(t)+p),y=Math.max(f,g);return bt(e/Math.pow(t,y),h,c)}}}(l,n,r,h,!g&&y,f):Ai(n,r,h,!g&&y,f)}return{constraint:e,maxResolution:n,minResolution:r,minZoom:a,zoomFactor:l}}(t);this.maxResolution_=r.maxResolution,this.minResolution_=r.minResolution,this.zoomFactor_=r.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=r.minZoom;var o=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Ri(t.extent,t.constrainOnlyCenter,e)}var n=gi(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&n.isGlobal()){var r=n.getExtent().slice();return r[0]=-1/0,r[2]=1/0,Ri(r,!1,!1)}return ki}(t),s=r.constraint,a=function(t){var e=void 0===t.enableRotation||t.enableRotation;if(e){var n=t.constrainRotation;return void 0===n||!0===n?(s=o||Pt(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=s?0:t:void 0}):!1===n?Fi:"number"==typeof n?(r=n,i=2*Math.PI/r,function(t,e){return e?t:void 0!==t?t=Math.floor(t/i+.5)*i:void 0}):Fi}return Di;var r,i;var o,s}(t);this.constraints_={center:o,resolution:s,rotation:a},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var n=this.getCenter();if(n){var r=t||[0,0,0,0];e=e||[0,0,0,0];var i=this.getResolution(),o=i/2*(r[3]-e[3]+e[1]-r[1]),s=i/2*(r[0]-e[0]+e[2]-r[2]);this.setCenterInternal([n[0]+o,n[1]-s])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),qt({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),n=0;n<e.length;++n){var r=arguments[n];r.center&&((r=qt({},r)).center=Ii(r.center,this.getProjection())),r.anchor&&((r=qt({},r)).anchor=Ii(r.anchor,this.getProjection())),e[n]=r}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,n=arguments.length;n>1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n);for(var r=0;r<n&&!this.isDef();++r){var i=arguments[r];i.center&&this.setCenterInternal(i.center),void 0!==i.zoom?this.setZoom(i.zoom):i.resolution&&this.setResolution(i.resolution),void 0!==i.rotation&&this.setRotation(i.rotation)}if(r!==n){for(var o=Date.now(),s=this.targetCenter_.slice(),a=this.targetResolution_,u=this.targetRotation_,l=[];r<n;++r){var c=arguments[r],h={start:o,complete:!1,anchor:c.anchor,duration:void 0!==c.duration?c.duration:1e3,easing:c.easing||Bi,callback:e};if(c.center&&(h.sourceCenter=s,h.targetCenter=c.center.slice(),s=h.targetCenter),void 0!==c.zoom?(h.sourceResolution=a,h.targetResolution=this.getResolutionForZoom(c.zoom),a=h.targetResolution):c.resolution&&(h.sourceResolution=a,h.targetResolution=c.resolution,a=h.targetResolution),void 0!==c.rotation){h.sourceRotation=u;var f=It(c.rotation-u+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=u+f,u=h.targetRotation}Zo(h)?h.complete=!0:o+=h.duration,l.push(h)}this.animations_.push(l),this.setHint(Ar,1),this.updateAnimations_()}else e&&Ho(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Ar]>0},e.prototype.getInteracting=function(){return this.hints_[Dr]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Ar,-this.hints_[Ar]);for(var e=0,n=this.animations_.length;e<n;++e){var r=this.animations_[e];if(r[0].callback&&Ho(r[0].callback,!1),!t)for(var i=0,o=r.length;i<o;++i){var s=r[i];if(!s.complete){t=s.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,n=this.animations_.length-1;n>=0;--n){for(var r=this.animations_[n],i=!0,o=0,s=r.length;o<s;++o){var a=r[o];if(!a.complete){var u=t-a.start,l=a.duration>0?u/a.duration:1;l>=1?(a.complete=!0,l=1):i=!1;var c=a.easing(l);if(a.sourceCenter){var h=a.sourceCenter[0],f=a.sourceCenter[1],p=a.targetCenter[0],d=a.targetCenter[1];this.nextCenter_=a.targetCenter;var g=h+c*(p-h),y=f+c*(d-f);this.targetCenter_=[g,y]}if(a.sourceResolution&&a.targetResolution){var v=1===c?a.targetResolution:a.sourceResolution+c*(a.targetResolution-a.sourceResolution);if(a.anchor){var _=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(v,0,_,!0);this.targetCenter_=this.calculateCenterZoom(m,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var x=1===c?It(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+c*(a.targetRotation-a.sourceRotation);if(a.anchor){var b=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(b,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(i){this.animations_[n]=null,this.setHint(Ar,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var w=r[0].callback;w&&Ho(w,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var n,r=this.getCenterInternal();return void 0!==r&&(qe(n=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),Ve(n,e)),n},e.prototype.calculateCenterZoom=function(t,e){var n,r=this.getCenterInternal(),i=this.getResolution();void 0!==r&&void 0!==i&&(n=[e[0]-t*(e[0]-r[0])/i,e[1]-t*(e[1]-r[1])/i]);return n},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],r=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(r*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Pi(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Fr.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Mi(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();P(n,1);var r=this.getResolution();P(void 0!==r,2);var i=this.getRotation();return P(void 0!==i,3),lt(n,r,i,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Fr.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Oi(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),r=gt(t)/n[0],i=ht(t)/n[1];return Math.max(r,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/Math.log(e);return function(t){return n/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(Fr.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/e;return function(t){return Math.log(n/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();r=Ko(r,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,n)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,n,r=this.minZoom_||0;if(this.resolutions_){var o=i(this.resolutions_,t,1);r=o,e=this.resolutions_[o],n=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,n=this.zoomFactor_;return r+Math.log(e/t)/Math.log(n)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=bt(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,bt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n;if(P(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))P(!vt(t),25),n=Wo(r=Oi(t,this.getProjection()));else if("Circle"===t.getType()){var r;(n=Wo(r=Oi(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),at(r))}else{var i=Si();n=i?t.clone().transform(i,this.getProjection()):t}this.fitInternal(n,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),r=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,u=-1/0,l=-1/0,c=0,h=i.length;c<h;c+=o){var f=i[c]*n-i[c+1]*r,p=i[c]*r+i[c+1]*n;s=Math.min(s,f),a=Math.min(a,p),u=Math.max(u,f),l=Math.max(l,p)}return[s,a,u,l]},e.prototype.fitInternal=function(t,e){var n=e||{},r=n.size;r||(r=this.getViewportSizeMinusPadding_());var i,o=void 0!==n.padding?n.padding:[0,0,0,0],s=void 0!==n.nearest&&n.nearest;i=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.getResolutionForZoom(n.maxZoom):0;var a=this.rotatedExtentForGeometry(t),u=this.getResolutionForExtentInternal(a,[r[0]-o[1]-o[3],r[1]-o[0]-o[2]]);u=isNaN(u)?i:Math.max(u,i),u=this.getConstrainedResolution(u,s?0:1);var l=this.getRotation(),h=Math.sin(l),f=Math.cos(l),p=at(a);p[0]+=(o[1]-o[3])/2*u,p[1]+=(o[0]-o[2])/2*u;var d=p[0]*f-p[1]*h,g=p[1]*f+p[0]*h,y=this.getConstrainedCenter([d,g],u),v=n.callback?n.callback:c;void 0!==n.duration?this.animateInternal({resolution:u,center:y,duration:n.duration,easing:n.easing},v):(this.targetResolution_=u,this.targetCenter_=y,this.applyTargetState_(!1,!0),Ho(v,!0))},e.prototype.centerOn=function(t,e,n){this.centerOnInternal(Ii(t,this.getProjection()),e,n)},e.prototype.centerOnInternal=function(t,e,n){this.setCenterInternal(Ko(t,e,n,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,n,r){var i,o=this.padding_;if(o&&t){var s=this.getViewportSizeMinusPadding_(-n),a=Ko(t,r,[s[0]/2+o[3],s[1]/2+o[0]],e,n);i=[t[0]-a[0],t[1]-a[1]]}return i},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=Pi(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var n=e&&Ii(e,this.getProjection());this.adjustResolutionInternal(t,n)},e.prototype.adjustResolutionInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,r,n);e&&(this.targetCenter_=this.calculateCenterZoom(i,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=Ii(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(r,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(t?Ii(t,this.getProjection()):t)},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var n=this.getAnimating()||this.getInteracting()||e,r=this.constraints_.rotation(this.targetRotation_,n),i=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,0,i,n),s=this.constraints_.center(this.targetCenter_,o,i,n,this.calculateCenterShift(this.targetCenter_,o,r,i));this.get(Fr.ROTATION)!==r&&this.set(Fr.ROTATION,r),this.get(Fr.RESOLUTION)!==o&&(this.set(Fr.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),s&&this.get(Fr.CENTER)&&Xe(this.get(Fr.CENTER),s)||this.set(Fr.CENTER,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,n){var r=void 0!==t?t:200,i=e||0,o=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(o),a=this.constraints_.resolution(this.targetResolution_,i,s),u=this.constraints_.center(this.targetCenter_,a,s,!1,this.calculateCenterShift(this.targetCenter_,a,o,s));if(0===r&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=o,this.targetCenter_=u,void this.applyTargetState_();var l=n||(0===r?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===o&&this.getCenterInternal()&&Xe(this.getCenterInternal(),u)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:u,resolution:a,duration:r,easing:Gi,anchor:l}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Dr,1)},e.prototype.endInteraction=function(t,e,n){var r=n&&Ii(n,this.getProjection());this.endInteractionInternal(t,e,r)},e.prototype.endInteractionInternal=function(t,e,n){this.setHint(Dr,-1),this.resolveConstraints(t,e,n)},e.prototype.getConstrainedCenter=function(t,e){var n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)},e.prototype.getConstrainedZoom=function(t,e){var n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))},e.prototype.getConstrainedResolution=function(t,e){var n=e||0,r=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,n,r)},e}(me);function Ho(t,e){setTimeout(function(){t(e)},0)}function Zo(t){return!(t.sourceCenter&&t.targetCenter&&!Xe(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ko(t,e,n,r,i){var o=Math.cos(-i),s=Math.sin(-i),a=t[0]*o-t[1]*s,u=t[1]*o+t[0]*s;return[(a+=(e[0]/2-n[0])*r)*o-(u+=(n[1]-e[1]/2)*r)*(s=-s),u*o+a*s]}var Jo=Yo;function $o(t){return t[0]>0&&t[1]>0}function Qo(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var ts=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function es(t){t instanceof ze?t.setMapInternal(null):t instanceof $n&&t.getLayers().forEach(es)}function ns(t,e){if(t instanceof ze)t.setMapInternal(e);else if(t instanceof $n)for(var n=t.getLayers().getArray(),r=0,i=n.length;r<i;++r)ns(n[r],e)}var rs=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n,r,i,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new $n({layers:t.layers});o[vr]=s,o[mr]=t.target,o[xr]=t.view instanceof Jo?t.view:new Jo,void 0!==t.controls&&(Array.isArray(t.controls)?n=new Yn(t.controls.slice()):(P("function"==typeof t.controls.getArray,47),n=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new Yn(t.interactions.slice()):(P("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new Yn(t.overlays.slice()):(P("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new Yn;return{controls:n,interactions:r,keyboardEventTarget:e,overlays:i,values:o}}(e);n.renderComplete_,n.loaded_=!0,n.boundHandleBrowserEvent_=n.handleBrowserEvent.bind(n),n.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,n.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:x,n.postRenderTimeoutHandle_,n.animationDelayKey_,n.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(n),n.coordinateToPixelTransform_=[1,0,0,1,0,0],n.pixelToCoordinateTransform_=[1,0,0,1,0,0],n.frameIndex_=0,n.frameState_=null,n.previousExtent_=null,n.viewPropertyListenerKey_=null,n.viewChangeListenerKey_=null,n.layerGroupPropertyListenerKeys_=null,n.viewport_=document.createElement("div"),n.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),n.viewport_.style.position="relative",n.viewport_.style.overflow="hidden",n.viewport_.style.width="100%",n.viewport_.style.height="100%",n.overlayContainer_=document.createElement("div"),n.overlayContainer_.style.position="absolute",n.overlayContainer_.style.zIndex="0",n.overlayContainer_.style.width="100%",n.overlayContainer_.style.height="100%",n.overlayContainer_.style.pointerEvents="none",n.overlayContainer_.className="ol-overlaycontainer",n.viewport_.appendChild(n.overlayContainer_),n.overlayContainerStopEvent_=document.createElement("div"),n.overlayContainerStopEvent_.style.position="absolute",n.overlayContainerStopEvent_.style.zIndex="0",n.overlayContainerStopEvent_.style.width="100%",n.overlayContainerStopEvent_.style.height="100%",n.overlayContainerStopEvent_.style.pointerEvents="none",n.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",n.viewport_.appendChild(n.overlayContainerStopEvent_),n.mapBrowserEventHandler_=null,n.moveTolerance_=e.moveTolerance,n.keyboardEventTarget_=r.keyboardEventTarget,n.targetChangeHandlerKeys_=null,n.controls=r.controls||new Yn,n.interactions=r.interactions||new Yn,n.overlays_=r.overlays,n.overlayIdIndex_={},n.renderer_=null,n.postRenderFunctions_=[],n.tileQueue_=new Rr(n.getTilePriority.bind(n),n.handleTileChange_.bind(n)),n.addChangeListener(vr,n.handleLayerGroupChanged_),n.addChangeListener(xr,n.handleViewChanged_),n.addChangeListener(_r,n.handleSizeChanged_),n.addChangeListener(mr,n.handleTargetChanged_),n.setProperties(r.values);var i=n;return!e.view||e.view instanceof Jo||e.view.then(function(t){i.setView(new Jo(t))}),n.controls.addEventListener(zn,function(t){t.element.setMap(this)}.bind(n)),n.controls.addEventListener(Vn,function(t){t.element.setMap(null)}.bind(n)),n.interactions.addEventListener(zn,function(t){t.element.setMap(this)}.bind(n)),n.interactions.addEventListener(Vn,function(t){t.element.setMap(null)}.bind(n)),n.overlays_.addEventListener(zn,function(t){this.addOverlayInternal_(t.element)}.bind(n)),n.overlays_.addEventListener(Vn,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(n)),n.controls.forEach(function(t){t.setMap(this)}.bind(n)),n.interactions.forEach(function(t){t.setMap(this)}.bind(n)),n.overlays_.forEach(n.addOverlayInternal_.bind(n)),n}return ts(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.handleLayerAdd_=function(t){ns(t.layer,this)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,n){if(this.frameState_&&this.renderer_){var r=this.getCoordinateFromPixelInternal(t),i=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,o=void 0!==n.layerFilter?n.layerFilter:u,s=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,s,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,function(t){n.push(t)},e),n},e.prototype.getAllLayers=function(){var t=[];return function e(n){n.forEach(function(n){n instanceof $n?e(n.getLayers()):t.push(n)})}(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,e,n){if(this.frameState_&&this.renderer_){var r=n||{},i=void 0!==r.hitTolerance?r.hitTolerance:0,o=r.layerFilter||u;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_||!this.renderer_)return!1;var n=this.getCoordinateFromPixelInternal(t),r=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:u,i=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,o,r,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),n="changedTouches"in t?t.changedTouches[0]:t;return[n.clientX-e.left,n.clientY-e.top]},e.prototype.getTarget=function(){return this.get(mr)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return Pi(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?O(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(vr)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof Yn)e.setLayers(t);else{var n=e.getLayers();n.clear(),n.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var r=t[e];if(r.visible){var i=r.layer.getRenderer();if(i&&!i.ready)return!0;var o=r.layer.getSource();if(o&&o.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=Ii(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?O(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(_r)},e.prototype.getView=function(){return this.get(xr)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,n,r){return function(t,e,n,r,i){if(!t||!(n in t.wantedTiles))return br;if(!t.wantedTiles[n][e.getKey()])return br;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}(this.frameState_,t,e,n,r)},e.prototype.handleBrowserEvent=function(t,e){var n=e||t.type,r=new ir(n,this,t);this.handleMapBrowserEvent(r)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,n=e.type;if(n===ar||n===le||n===ie){var r=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():r,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(i===r?r.documentElement:i).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var s=this.getInteractions().getArray().slice(),a=s.length-1;a>=0;a--){var u=s[a];if(u.getMap()===this&&u.getActive()&&this.getTargetElement())if(!u.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var n=this.maxTilesLoading_,r=n;if(t){var i=t.viewHints;if(i[Ar]||i[Dr]){var o=Date.now()-t.time>8;n=o?0:8,r=o?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,r))}t&&this.renderer_&&!t.animate&&(!0===this.renderComplete_?(this.hasListener(Fe)&&this.renderer_.dispatchRenderEvent(Fe,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new er(yr,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new er(gr,this,t))));for(var s=this.postRenderFunctions_,a=0,u=s.length;a<u;++a)s[a](this,t);s.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)fe(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(ee,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(le,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,yn(this.viewport_)}var n=this.getTargetElement();if(n){for(var r in n.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new hr(this,this.moveTolerance_),or)this.mapBrowserEventHandler_.addEventListener(or[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(ee,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(le,this.boundHandleBrowserEvent_,!!E&&{passive:!1});var i=this.getOwnerDocument().defaultView,o=this.keyboardEventTarget_?this.keyboardEventTarget_:n;this.targetChangeHandlerKeys_=[ce(o,ie,this.handleBrowserEvent,this),ce(o,oe,this.handleBrowserEvent,this),ce(i,ae,this.updateSize,this)]}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(fe(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(fe(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=ce(t,Xt,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=ce(t,Qt,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(fe),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Zn("addlayer",t)),this.layerGroupPropertyListenerKeys_=[ce(t,Xt,this.render,this),ce(t,Qt,this.render,this),ce(t,"addlayer",this.handleLayerAdd_,this),ce(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var r=t[e].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.handleLayerRemove_=function(t){es(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,n=this.getSize(),r=this.getView(),i=this.frameState_,o=null;if(void 0!==n&&$o(n)&&r&&r.isDef()){var s=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=r.getState();if(o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:lt(a.center,a.resolution,a.rotation,n),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:n,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{},mapId:p(this),renderTargets:{}},a.nextCenter&&a.nextResolution){var u=isNaN(a.nextRotation)?a.rotation:a.nextRotation;o.nextExtent=lt(a.nextCenter,a.nextResolution,u,n)}}if(this.frameState_=o,this.renderer_.renderFrame(o),o){if(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),i)(!this.previousExtent_||!vt(this.previousExtent_)&&!$(o.extent,this.previousExtent_))&&(this.dispatchEvent(new er(pr,this,i)),this.previousExtent_=Z(this.previousExtent_));this.previousExtent_&&!o.viewHints[Ar]&&!o.viewHints[Dr]&&!$(o.extent,this.previousExtent_)&&(this.dispatchEvent(new er(dr,this,o)),z(o.extent,this.previousExtent_))}this.dispatchEvent(new er(fr,this,o)),this.renderComplete_=this.hasListener(gr)||this.hasListener(yr)||this.hasListener(Fe)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()},0))},e.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new Zn("removelayer",e)),this.set(vr,t)},e.prototype.setSize=function(t){this.set(_r,t)},e.prototype.setTarget=function(t){this.set(mr,t)},e.prototype.setView=function(t){if(!t||t instanceof Jo)this.set(xr,t);else{this.set(xr,new Jo);var e=this;t.then(function(t){e.setView(new Jo(t))})}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var n=getComputedStyle(t),r=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),i=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);isNaN(r)||isNaN(i)||!$o(e=[r,i])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,n=getComputedStyle(this.viewport_);n.width&&n.height&&(e=[parseInt(n.width,10),parseInt(n.height,10)]),t.setViewportSize(e)}},e}(me);var is=rs,os=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ss=function(t){function e(e){var n=t.call(this)||this,r=e.element;return!r||e.target||r.style.pointerEvents||(r.style.pointerEvents="auto"),n.element=r||null,n.target_=null,n.map_=null,n.listenerKeys=[],e.render&&(n.render=e.render),e.target&&n.setTarget(e.target),n}return os(e,t),e.prototype.disposeInternal=function(){yn(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&yn(this.element);for(var e=0,n=this.listenerKeys.length;e<n;++e)fe(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,t)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==c&&this.listenerKeys.push(ce(t,fr,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(me),as=ss,us=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ls=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).ulElement_=document.createElement("ul"),n.collapsed_=void 0===r.collapsed||r.collapsed,n.userCollapsed_=n.collapsed_,n.overrideCollapsible_=void 0!==r.collapsible,n.collapsible_=void 0===r.collapsible||r.collapsible,n.collapsible_||(n.collapsed_=!1);var i=void 0!==r.className?r.className:"ol-attribution",o=void 0!==r.tipLabel?r.tipLabel:"Attributions",s=void 0!==r.expandClassName?r.expandClassName:i+"-expand",a=void 0!==r.collapseLabel?r.collapseLabel:"›",u=void 0!==r.collapseClassName?r.collapseClassName:i+"-collapse";"string"==typeof a?(n.collapseLabel_=document.createElement("span"),n.collapseLabel_.textContent=a,n.collapseLabel_.className=u):n.collapseLabel_=a;var l=void 0!==r.label?r.label:"i";"string"==typeof l?(n.label_=document.createElement("span"),n.label_.textContent=l,n.label_.className=s):n.label_=l;var c=n.collapsible_&&!n.collapsed_?n.collapseLabel_:n.label_;n.toggleButton_=document.createElement("button"),n.toggleButton_.setAttribute("type","button"),n.toggleButton_.setAttribute("aria-expanded",String(!n.collapsed_)),n.toggleButton_.title=o,n.toggleButton_.appendChild(c),n.toggleButton_.addEventListener(ne,n.handleClick_.bind(n),!1);var h=i+" "+on+" "+sn+(n.collapsed_&&n.collapsible_?" "+an:"")+(n.collapsible_?"":" ol-uncollapsible"),f=n.element;return f.className=h,f.appendChild(n.toggleButton_),f.appendChild(n.ulElement_),n.renderedAttributions_=[],n.renderedVisible_=!0,n}return us(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},n=[],r=!0,i=t.layerStatesArray,o=0,s=i.length;o<s;++o){var a=i[o];if(Be(a,t.viewState)){var u=a.layer.getSource();if(u){var l=u.getAttributions();if(l){var c=l(t);if(c)if(r=r&&!1!==u.getAttributionsCollapsible(),Array.isArray(c))for(var h=0,f=c.length;h<f;++h)c[h]in e||(n.push(c[h]),e[c[h]]=!0);else c in e||(n.push(c),e[c]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(r),n},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!a(e,this.renderedAttributions_)){vn(this.ulElement_);for(var r=0,i=e.length;r<i;++r){var o=document.createElement("li");o.innerHTML=e[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(an),this.collapsed_?gn(this.collapseLabel_,this.label_):gn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(as),cs=ls,hs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fs=function(t){function e(e){var n=this,r=e||{};n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this;var i=void 0!==r.className?r.className:"ol-rotate",o=void 0!==r.label?r.label:"⇧",s=void 0!==r.compassClassName?r.compassClassName:"ol-compass";n.label_=null,"string"==typeof o?(n.label_=document.createElement("span"),n.label_.className=s,n.label_.textContent=o):(n.label_=o,n.label_.classList.add(s));var a=r.tipLabel?r.tipLabel:"Reset rotation",u=document.createElement("button");u.className=i+"-reset",u.setAttribute("type","button"),u.title=a,u.appendChild(n.label_),u.addEventListener(ne,n.handleClick_.bind(n),!1);var l=i+" "+on+" "+sn,c=n.element;return c.className=l,c.appendChild(u),n.callResetNorth_=r.resetNorth?r.resetNorth:void 0,n.duration_=void 0!==r.duration?r.duration:250,n.autoHide_=void 0===r.autoHide||r.autoHide,n.rotation_=void 0,n.autoHide_&&n.element.classList.add(rn),n}return hs(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:Gi}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var n=e.viewState.rotation;if(n!=this.rotation_){var r="rotate("+n+"rad)";if(this.autoHide_){var i=this.element.classList.contains(rn);i||0!==n?i&&0!==n&&this.element.classList.remove(rn):this.element.classList.add(rn)}this.label_.style.transform=r}this.rotation_=n}},e}(as),ps=fs,ds=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gs=function(t){function e(e){var n=this,r=e||{};n=t.call(this,{element:document.createElement("div"),target:r.target})||this;var i=void 0!==r.className?r.className:"ol-zoom",o=void 0!==r.delta?r.delta:1,s=void 0!==r.zoomInClassName?r.zoomInClassName:i+"-in",a=void 0!==r.zoomOutClassName?r.zoomOutClassName:i+"-out",u=void 0!==r.zoomInLabel?r.zoomInLabel:"+",l=void 0!==r.zoomOutLabel?r.zoomOutLabel:"–",c=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",h=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",f=document.createElement("button");f.className=s,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof u?document.createTextNode(u):u),f.addEventListener(ne,n.handleClick_.bind(n,o),!1);var p=document.createElement("button");p.className=a,p.setAttribute("type","button"),p.title=h,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(ne,n.handleClick_.bind(n,-o),!1);var d=i+" "+on+" "+sn,g=n.element;return g.className=d,g.appendChild(f),g.appendChild(p),n.duration_=void 0!==r.duration?r.duration:250,n}return ds(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var n=e.getZoom();if(void 0!==n){var r=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:r,duration:this.duration_,easing:Gi})):e.setZoom(r)}}},e}(as),ys=gs;function vs(t){var e=t||{},n=new Yn;return(void 0===e.zoom||e.zoom)&&n.push(new ys(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&n.push(new ps(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&n.push(new cs(e.attributionOptions)),n}var _s="active",ms=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xs=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,e&&e.handleEvent&&(n.handleEvent=e.handleEvent),n.map_=null,n.setActive(!0),n}return ms(e,t),e.prototype.getActive=function(){return this.get(_s)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(_s,t)},e.prototype.setMap=function(t){this.map_=t},e}(me);function bs(t,e,n,r){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:n,duration:void 0!==r?r:250,easing:Gi})}}var ws=xs,Es=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cs=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:250,n}return Es(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==or.DBLCLICK){var n=t.originalEvent,r=t.map,i=t.coordinate,o=n.shiftKey?-this.delta_:this.delta_;bs(r.getView(),o,i,this.duration_),n.preventDefault(),e=!0}return!e},e}(ws),Ss=Cs,Ps=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Is=function(t){function e(e){var n=this,r=e||{};return n=t.call(this,r)||this,r.handleDownEvent&&(n.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(n.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(n.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(n.handleUpEvent=r.handleUpEvent),r.stopDown&&(n.stopDown=r.stopDown),n.handlingDownUpSequence=!1,n.targetPointers=[],n}return Ps(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==or.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==or.POINTERUP){var n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==or.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,e=this.stopDown(r)}else t.type==or.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){t.activePointers&&(this.targetPointers=t.activePointers)},e}(ws);function Ms(t){for(var e=t.length,n=0,r=0,i=0;i<e;i++)n+=t[i].clientX,r+=t[i].clientY;return[n/e,r/e]}var Os=Is;function Ls(t){var e=arguments;return function(t){for(var n=!0,r=0,i=e.length;r<i&&(n=n&&e[r](t));++r);return n}}var Rs=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ks=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){var e=t.map.getTargetElement(),n=t.map.getOwnerDocument().activeElement;return e.contains(n)}(t)},Ts=u,Ns=function(t){var e=t.originalEvent;return 0==e.button&&!(_&&m&&e.ctrlKey)},As=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Ds=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Fs=function(t){var e=t.originalEvent,n=e.target.tagName;return"INPUT"!==n&&"SELECT"!==n&&"TEXTAREA"!==n&&!e.target.isContentEditable},js=function(t){var e=t.originalEvent;return P(void 0!==e,56),"mouse"==e.pointerType},Gs=function(t){var e=t.originalEvent;return P(void 0!==e,56),e.isPrimary&&0===e.button},Bs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zs=function(t){function e(e){var n=t.call(this,{stopDown:l})||this,r=e||{};n.kinetic_=r.kinetic,n.lastCentroid=null,n.lastPointersCount_,n.panning_=!1;var i=r.condition?r.condition:Ls(As,Gs);return n.condition_=r.onFocusOnly?Ls(ks,i):i,n.noKinetic_=!1,n}return Bs(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,n=Ms(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],i=t.map.getView();Ye(r,i.getResolution()),qe(r,i.getRotation()),i.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,n=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var r=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),o=n.getCenterInternal(),s=e.getPixelFromCoordinateInternal(o),a=e.getCoordinateFromPixelInternal([s[0]-r*Math.cos(i),s[1]-r*Math.sin(i)]);n.animateInternal({center:n.getConstrainedCenter(a),duration:500,easing:Gi})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Os),Vs=zs,Us=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ws=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{stopDown:l})||this).condition_=r.condition?r.condition:Rs,n.lastAngle_=void 0,n.duration_=void 0!==r.duration?r.duration:250,n}return Us(e,t),e.prototype.handleDragEvent=function(t){if(js(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==Di){var r=e.getSize(),i=t.pixel,o=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;n.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!js(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!js(t)&&(!(!Ns(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Os),Xs=Ws,qs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ys=function(t){function e(e){var n=t.call(this)||this;return n.geometry_=null,n.element_=document.createElement("div"),n.element_.style.position="absolute",n.element_.style.pointerEvents="auto",n.element_.className="ol-box "+e,n.map_=null,n.startPixel_=null,n.endPixel_=null,n}return qs(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,n="px",r=this.element_.style;r.left=Math.min(t[0],e[0])+n,r.top=Math.min(t[1],e[1])+n,r.width=Math.abs(e[0]-t[0])+n,r.height=Math.abs(e[1]-t[1])+n},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new Uo([n])},e.prototype.getGeometry=function(){return this.geometry_},e}(t),Hs=Ys,Zs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ks="boxstart",Js="boxdrag",$s="boxend",Qs="boxcancel",ta=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.coordinate=n,i.mapBrowserEvent=r,i}return Zs(e,t),e}(Wt),ea=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=e||{};return n.box_=new Hs(r.className||"ol-dragbox"),n.minArea_=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(n.onBoxEnd=r.onBoxEnd),n.startPixel_=null,n.condition_=r.condition?r.condition:Ns,n.boxEndCondition_=r.boxEndCondition?r.boxEndCondition:n.defaultBoxEndCondition,n}return Zs(e,t),e.prototype.defaultBoxEndCondition=function(t,e,n){var r=n[0]-e[0],i=n[1]-e[1];return r*r+i*i>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new ta(Js,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new ta(e?$s:Qs,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new ta(Ks,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Os),na=ea,ra=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ia=function(t){function e(e){var n=this,r=e||{},i=r.condition?r.condition:Ds;return(n=t.call(this,{condition:i,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).duration_=void 0!==r.duration?r.duration:200,n.out_=void 0!==r.out&&r.out,n}return ra(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),n=this.getGeometry();if(this.out_){var r=e.rotatedExtentForGeometry(n),i=e.getResolutionForExtentInternal(r),o=e.getResolution()/i;(n=n.clone()).scale(o*o)}e.fitInternal(n,{duration:this.duration_,easing:Gi})},e}(na),oa=ia,sa=37,aa=38,ua=39,la=40,ca=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ha=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.defaultCondition_=function(t){return As(t)&&Fs(t)},n.condition_=void 0!==r.condition?r.condition:n.defaultCondition_,n.duration_=void 0!==r.duration?r.duration:100,n.pixelDelta_=void 0!==r.pixelDelta?r.pixelDelta:128,n}return ca(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ie){var n=t.originalEvent,r=n.keyCode;if(this.condition_(t)&&(r==la||r==sa||r==ua||r==aa)){var i=t.map.getView(),o=i.getResolution()*this.pixelDelta_,s=0,a=0;r==la?a=-o:r==sa?s=-o:r==ua?s=o:a=o;var u=[s,a];qe(u,i.getRotation()),function(t,e,n){var r=t.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];t.animateInternal({duration:void 0!==n?n:250,easing:zi,center:t.getConstrainedCenter(i)})}}(i,u,this.duration_),n.preventDefault(),e=!0}}return!e},e}(ws),fa=ha,pa=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),da=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.condition_=r.condition?r.condition:Fs,n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:100,n}return pa(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ie||t.type==oe){var n=t.originalEvent,r=n.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=t.map,o=r=="+".charCodeAt(0)?this.delta_:-this.delta_;bs(i.getView(),o,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},e}(ws),ga=da,ya=function(){function t(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var n=e-3;n>0&&this.points_[n+2]>t;)n-=3;var r=this.points_[e+2]-this.points_[n+2];if(r<1e3/60)return!1;var i=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/r,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),va=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_a="trackpad",ma="wheel",xa=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,r)||this).totalDelta_=0,n.lastDelta_=0,n.maxDelta_=void 0!==r.maxDelta?r.maxDelta:1,n.duration_=void 0!==r.duration?r.duration:250,n.timeout_=void 0!==r.timeout?r.timeout:80,n.useAnchor_=void 0===r.useAnchor||r.useAnchor,n.constrainResolution_=void 0!==r.constrainResolution&&r.constrainResolution;var i=r.condition?r.condition:Ts;return n.condition_=r.onFocusOnly?Ls(ks,i):i,n.lastAnchor_=null,n.startTime_=void 0,n.timeoutId_,n.mode_=void 0,n.trackpadEventGap_=400,n.trackpadTimeoutId_,n.deltaPerZoom_=300,n}return va(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap();t&&t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==le)return!0;var e,n=t.map,r=t.originalEvent;if(r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==le&&(e=r.deltaY,v&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=x),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?_a:ma);var o=n.getView();if(this.mode_===_a&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-bt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),bs(e,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(ws),ba=xa,wa=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ea=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=l),(n=t.call(this,i)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==r.threshold?r.threshold:.3,n.duration_=void 0!==r.duration?r.duration:250,n}return wa(e,t),e.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Di){var u=s.getViewport().getBoundingClientRect(),l=Ms(this.targetPointers);l[0]-=u.left,l[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(l),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Os),Ca=Ea,Sa=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pa=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=l),(n=t.call(this,i)||this).anchor_=null,n.duration_=void 0!==r.duration?r.duration:400,n.lastDistance_=void 0,n.lastScaleDelta_=1,n}return Sa(e,t),e.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,o=n.clientY-r.clientY,s=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,u=a.getView();1!=e&&(this.lastScaleDelta_=e);var l=a.getViewport().getBoundingClientRect(),c=Ms(this.targetPointers);c[0]-=l.left,c[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(c),a.render(),u.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Os),Ia=Pa;function Ma(t){var e=t||{},n=new Yn,r=new ya(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&n.push(new Xs),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&n.push(new Ss({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&n.push(new Vs({onFocusOnly:e.onFocusOnly,kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&n.push(new Ca),(void 0===e.pinchZoom||e.pinchZoom)&&n.push(new Ia({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(n.push(new fa),n.push(new ga({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&n.push(new ba({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&n.push(new oa({duration:e.zoomDuration})),n}var Oa=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),La=function(t){function e(e){return(e=qt({},e)).controls||(e.controls=vs()),e.interactions||(e.interactions=Ma({onFocusOnly:!0})),t.call(this,e)||this}return Oa(e,t),e.prototype.createRenderer=function(){return new Bn(this)},e}(is),Ra=La,ka=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ta=function(t){function e(e){var n=t.call(this)||this;if(n.on,n.once,n.un,n.id_=void 0,n.geometryName_="geometry",n.style_=null,n.styleFunction_=void 0,n.geometryChangeKey_=null,n.addChangeListener(n.geometryName_,n.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var r=e;n.setGeometry(r)}else{var i=e;n.setProperties(i)}return n}return ka(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var n=this.getGeometry();n&&t.setGeometry(n.clone());var r=this.getStyle();return r&&t.setStyle(r),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(fe(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=ce(t,Qt,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(P("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(me);var Na=Ta,Aa=6371008.8,Da={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*Aa,kilometers:6371.0088,kilometres:6371.0088,meters:Aa,metres:Aa,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:Aa/1852,radians:1,yards:6967335.223679999};function Fa(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function ja(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ha(t[0])||!Ha(t[1]))throw new Error("coordinates must contain numbers");return Fa({type:"Point",coordinates:t},e,n)}function Ga(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return Fa({type:"Polygon",coordinates:t},e,n)}function Ba(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return Fa({type:"LineString",coordinates:t},e,n)}function za(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function Va(t,e,n){return void 0===n&&(n={}),Fa({type:"MultiLineString",coordinates:t},e,n)}function Ua(t,e,n){return void 0===n&&(n={}),Fa({type:"MultiPoint",coordinates:t},e,n)}function Wa(t,e){void 0===e&&(e="kilometers");var n=Da[e];if(!n)throw new Error(e+" units is invalid");return t*n}function Xa(t,e){void 0===e&&(e="kilometers");var n=Da[e];if(!n)throw new Error(e+" units is invalid");return t/n}function qa(t){return 180*(t%(2*Math.PI))/Math.PI}function Ya(t){return t%360*Math.PI/180}function Ha(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function Za(t,e,n){if(null!==t)for(var r,i,o,s,a,u,l,c,h=0,f=0,p=t.type,d="FeatureCollection"===p,g="Feature"===p,y=d?t.features.length:1,v=0;v<y;v++){a=(c=!!(l=d?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===l.type)?l.geometries.length:1;for(var _=0;_<a;_++){var m=0,x=0;if(null!==(s=c?l.geometries[_]:l)){u=s.coordinates;var b=s.type;switch(h=!n||"Polygon"!==b&&"MultiPolygon"!==b?0:1,b){case null:break;case"Point":if(!1===e(u,f,v,m,x))return!1;f++,m++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(!1===e(u[r],f,v,m,x))return!1;f++,"MultiPoint"===b&&m++}"LineString"===b&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-h;i++){if(!1===e(u[r][i],f,v,m,x))return!1;f++}"MultiLineString"===b&&m++,"Polygon"===b&&x++}"Polygon"===b&&m++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(x=0,i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-h;o++){if(!1===e(u[r][i][o],f,v,m,x))return!1;f++}x++}m++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===Za(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ka(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function Ja(t,e){var n,r,i,o,s,a,u,l,c,h,f=0,p="FeatureCollection"===t.type,d="Feature"===t.type,g=p?t.features.length:1;for(n=0;n<g;n++){for(a=p?t.features[n].geometry:d?t.geometry:t,l=p?t.features[n].properties:d?t.properties:{},c=p?t.features[n].bbox:d?t.bbox:void 0,h=p?t.features[n].id:d?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,f,l,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],f,l,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,l,c,h))return!1;f++}}function $a(t,e){Ja(t,function(t,n,r,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(Fa(t,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var l=t.coordinates[u];if(!1===e(Fa({type:s,coordinates:l},r),n,u))return!1}})}function Qa(t,e){$a(t,function(t,n,r){var i=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,u=0,l=0;return!1!==Za(t,function(o,c,h,f,p){if(void 0===s||n>a||f>u||p>l)return s=o,a=n,u=f,l=p,void(i=0);var d=Ba([s,o],t.properties);if(!1===e(d,n,r,p,i))return!1;i++,s=o})&&void 0}}})}function tu(t){var e=[1/0,1/0,-1/0,-1/0];return Za(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}tu.default=tu;var eu=tu;function nu(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function ru(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function iu(t){return"Feature"===t.type?t.geometry:t}n(5228);n(1476);function ou(t){return new Float64Array(t)}ou(4),ou(8),ou(12),ou(16),ou(4);ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(8),ou(8),ou(8),ou(4),ou(8),ou(8),ou(16),ou(12);ou(192),ou(192);ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(8),ou(8),ou(8),ou(8),ou(8),ou(8),ou(8),ou(8),ou(8),ou(4),ou(4),ou(4),ou(8),ou(16),ou(16),ou(16),ou(32),ou(32),ou(48),ou(64);ou(1152),ou(1152);ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(4),ou(24),ou(24),ou(24),ou(24),ou(24),ou(24),ou(24),ou(24),ou(24),ou(24),ou(1152),ou(1152),ou(1152),ou(1152),ou(1152),ou(2304),ou(2304),ou(3456),ou(5760),ou(8),ou(8),ou(8),ou(16),ou(24),ou(48),ou(48),ou(96),ou(192),ou(384),ou(384),ou(384),ou(768);ou(96),ou(96),ou(96),ou(1152);function su(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=nu(t),i=iu(e),o=i.type,s=e.bbox,a=i.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(r,s))return!1;"Polygon"===o&&(a=[a]);for(var u=!1,l=0;l<a.length&&!u;l++)if(au(r,a[l][0],n.ignoreBoundary)){for(var c=!1,h=1;h<a[l].length&&!c;)au(r,a[l][h],!n.ignoreBoundary)&&(c=!0),h++;c||(u=!0)}return u}function au(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;i<e.length;o=i++){var s=e[i][0],a=e[i][1],u=e[o][0],l=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+l*(t[0]-s)===0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(l-t[1])<=0)return!n;a>t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(r=!r)}return r}var uu=function(t,e,n){void 0===n&&(n={});var r=nu(t),i=nu(e),o=Ya(i[1]-r[1]),s=Ya(i[0]-r[0]),a=Ya(r[1]),u=Ya(i[1]),l=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(u);return Wa(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),n.units)};Object.prototype.hasOwnProperty;var lu=new ArrayBuffer(16);new Float64Array(lu),new Uint32Array(lu);n(2519);!function(){function t(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(e=0;e<this.length-1;e++){var n=this.points[e],r=this.points[e+1];this.centers.push({x:(n.x+r.x)/2,y:(n.y+r.y)/2,z:(n.z+r.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(e=0;e<this.centers.length-1;e++){var i=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,o=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,s=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+s)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}t.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var r=0;r<this.duration;r+=10){var i=this.pos(r);Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y)+(i.z-n.z)*(i.z-n.z))>t&&(e.push(r),n=i)}return e},t.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},t.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t,n=e*t;return[n,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t),s={x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]};return s}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])}}();var cu=function(t){return function(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[n,r];return Ga([[s,[i,r],[i,o],[n,o],s]],e.properties,{bbox:t,id:e.id})}(eu(t))};function hu(t,e,n,r){void 0===r&&(r={});var i=nu(t),o=Ya(i[0]),s=Ya(i[1]),a=Ya(n),u=Xa(e,r.units),l=Math.asin(Math.sin(s)*Math.cos(u)+Math.cos(s)*Math.sin(u)*Math.cos(a));return ja([qa(o+Math.atan2(Math.sin(a)*Math.sin(u)*Math.cos(s),Math.cos(u)-Math.sin(s)*Math.sin(l))),qa(l)],r.properties)}function fu(t,e,n){if(void 0===n&&(n={}),!0===n.final)return function(t,e){var n=fu(e,t);return n=(n+180)%360}(t,e);var r=nu(t),i=nu(e),o=Ya(r[0]),s=Ya(i[0]),a=Ya(r[1]),u=Ya(i[1]),l=Math.sin(s-o)*Math.cos(u),c=Math.cos(a)*Math.sin(u)-Math.sin(a)*Math.cos(u)*Math.cos(s-o);return qa(Math.atan2(l,c))}var pu=function(t,e){void 0===e&&(e={});var n=eu(t);return ja([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)};n(6570);var du=function(t){if(!t)throw new Error("geojson is required");var e=[];return $a(t,function(t){!function(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":n=ru(r);break;case"LineString":n=[ru(r)]}n.forEach(function(n){var r=function(t,e){var n=[];return t.reduce(function(t,r){var i=Ba([t,r],e);return i.bbox=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],s=n<i?n:i,a=r<o?r:o,u=n>i?n:i,l=r>o?r:o;return[s,a,u,l]}(t,r),n.push(i),r}),n}(n,t.properties);r.forEach(function(t){t.id=e.length,e.push(t)})})}}(t,e)}),za(e)},gu=n(4945);function yu(t,e){var n=ru(t),r=ru(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],u=r[0][0],l=r[0][1],c=r[1][0],h=r[1][1],f=(h-l)*(s-i)-(c-u)*(a-o),p=(c-u)*(o-l)-(h-l)*(i-u),d=(s-i)*(o-l)-(a-o)*(i-u);if(0===f)return null;var g=p/f,y=d/f;return g>=0&&g<=1&&y>=0&&y<=1?ja([i+g*(s-i),o+g*(a-o)]):null}var vu=function(t,e){var n={},r=[];if("LineString"===t.type&&(t=Fa(t)),"LineString"===e.type&&(e=Fa(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var i=yu(t,e);return i&&r.push(i),za(r)}var o=gu();return o.load(du(e)),Ka(du(t),function(t){Ka(o.search(t),function(e){var i=yu(t,e);if(i){var o=ru(i).join(",");n[o]||(n[o]=!0,r.push(i))}})}),za(r)};var _u=function(t,e,n){void 0===n&&(n={});var r=ja([1/0,1/0],{dist:1/0}),i=0;return $a(t,function(t){for(var o=ru(t),s=0;s<o.length-1;s++){var a=ja(o[s]);a.properties.dist=uu(e,a,n);var u=ja(o[s+1]);u.properties.dist=uu(e,u,n);var l=uu(a,u,n),c=Math.max(a.properties.dist,u.properties.dist),h=fu(a,u),f=hu(e,c,h+90,n),p=hu(e,c,h-90,n),d=vu(Ba([f.geometry.coordinates,p.geometry.coordinates]),Ba([a.geometry.coordinates,u.geometry.coordinates])),g=null;d.features.length>0&&((g=d.features[0]).properties.dist=uu(e,g,n),g.properties.location=i+uu(a,g,n)),a.properties.dist<r.properties.dist&&((r=a).properties.index=s,r.properties.location=i),u.properties.dist<r.properties.dist&&((r=u).properties.index=s+1,r.properties.location=i+l),g&&g.properties.dist<r.properties.dist&&((r=g).properties.index=s),i+=l}}),r};function mu(t){var e,n,r={type:"FeatureCollection",features:[]};if("LineString"===(n="Feature"===t.type?t.geometry:t).type)e=[n.coordinates];else if("MultiLineString"===n.type)e=n.coordinates;else if("MultiPolygon"===n.type)e=[].concat.apply([],n.coordinates);else{if("Polygon"!==n.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=n.coordinates}return e.forEach(function(t){e.forEach(function(e){for(var n=0;n<t.length-1;n++)for(var i=n;i<e.length-1;i++){if(t===e){if(1===Math.abs(n-i))continue;if(0===n&&i===t.length-2&&t[n][0]===t[t.length-1][0]&&t[n][1]===t[t.length-1][1])continue}var o=xu(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[i][0],e[i][1],e[i+1][0],e[i+1][1]);o&&r.features.push(ja([o[0],o[1]]))}})}),r}function xu(t,e,n,r,i,o,s,a){var u,l,c,h,f={x:null,y:null,onLine1:!1,onLine2:!1};return 0===(u=(a-o)*(n-t)-(s-i)*(r-e))?null!==f.x&&null!==f.y&&f:(h=(n-t)*(l=e-o)-(r-e)*(c=t-i),l=((s-i)*l-(a-o)*c)/u,c=h/u,f.x=t+l*(n-t),f.y=e+l*(r-e),l>=0&&l<=1&&(f.onLine1=!0),c>=0&&c<=1&&(f.onLine2=!0),!(!f.onLine1||!f.onLine2)&&[f.x,f.y])}function bu(t,e){return void 0===e&&(e={}),function(t,e,n){var r=n,i=!1;return Qa(t,function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0}),r}(t,function(t,n){var r=n.geometry.coordinates;return t+uu(r[0],r[1],e)},0)}function wu(t,e,n,r,i){var o=n[0],s=n[1],a=t[0],u=t[1],l=e[0],c=e[1],h=l-a,f=c-u,p=(n[0]-a)*f-(n[1]-u)*h;if(null!==i){if(Math.abs(p)>i)return!1}else if(0!==p)return!1;return r?"start"===r?Math.abs(h)>=Math.abs(f)?h>0?a<o&&o<=l:l<=o&&o<a:f>0?u<s&&s<=c:c<=s&&s<u:"end"===r?Math.abs(h)>=Math.abs(f)?h>0?a<=o&&o<l:l<o&&o<=a:f>0?u<=s&&s<c:c<s&&s<=u:"both"===r&&(Math.abs(h)>=Math.abs(f)?h>0?a<o&&o<l:l<o&&o<a:f>0?u<s&&s<c:c<s&&s<u):Math.abs(h)>=Math.abs(f)?h>0?a<=o&&o<=l:l<=o&&o<=a:f>0?u<=s&&s<=c:c<=s&&s<=u}var Eu=function(t,e,n){void 0===n&&(n={});for(var r=nu(t),i=ru(e),o=0;o<i.length-1;o++){var s=!1;if(n.ignoreEndVertices&&(0===o&&(s="start"),o===i.length-2&&(s="end"),0===o&&o+1===i.length-1&&(s="both")),wu(i[o],i[o+1],r,s,void 0===n.epsilon?null:n.epsilon))return!0}return!1};var Cu=Math.PI/180,Su=180/Math.PI,Pu=function(t,e){this.lon=t,this.lat=e,this.x=Cu*t,this.y=Cu*e};Pu.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},Pu.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new Pu(e,t)};var Iu=function(){this.coords=[],this.length=0};Iu.prototype.move_to=function(t){this.length++,this.coords.push(t)};var Mu=function(t){this.properties=t||{},this.geometries=[]};Mu.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e<this.geometries.length;e++)t.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}},Mu.prototype.wkt=function(){for(var t="",e="LINESTRING(",n=function(t){e+=t[0]+" "+t[1]+","},r=0;r<this.geometries.length;r++){if(0===this.geometries[r].coords.length)return"LINESTRING(empty)";this.geometries[r].coords.forEach(n),t+=e.substring(0,e.length-1)+")"}return t};var Ou=function(t,e,n){if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new Pu(t.x,t.y),this.end=new Pu(e.x,e.y),this.properties=n||{};var r=this.start.x-this.end.x,i=this.start.y-this.end.y,o=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(r/2),2);if(this.g=2*Math.asin(Math.sqrt(o)),this.g===Math.PI)throw new Error("it appears "+t.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+t+" and "+e)};Ou.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),s=Su*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[Su*Math.atan2(i,r),s]},Ou.prototype.Arc=function(t,e){var n=[];if(!t||t<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else for(var r=1/(t-1),i=0;i<t;++i){var o=r*i,s=this.interpolate(o);n.push(s)}for(var a=!1,u=0,l=e&&e.offset?e.offset:10,c=180-l,h=-180+l,f=360-l,p=1;p<n.length;++p){var d=n[p-1][0],g=n[p][0],y=Math.abs(g-d);y>f&&(g>c&&d<h||d>c&&g<h)?a=!0:y>u&&(u=y)}var v=[];if(a&&u<l){var _=[];v.push(_);for(var m=0;m<n.length;++m){var x=parseFloat(n[m][0]);if(m>0&&Math.abs(x-n[m-1][0])>f){var b=parseFloat(n[m-1][0]),w=parseFloat(n[m-1][1]),E=parseFloat(n[m][0]),C=parseFloat(n[m][1]);if(b>-180&&b<h&&180===E&&m+1<n.length&&n[m-1][0]>-180&&n[m-1][0]<h){_.push([-180,n[m][1]]),m++,_.push([n[m][0],n[m][1]]);continue}if(b>c&&b<180&&-180===E&&m+1<n.length&&n[m-1][0]>c&&n[m-1][0]<180){_.push([180,n[m][1]]),m++,_.push([n[m][0],n[m][1]]);continue}if(b<h&&E>c){var S=b;b=E,E=S;var P=w;w=C,C=P}if(b>c&&E<h&&(E+=360),b<=180&&E>=180&&b<E){var I=(180-b)/(E-b),M=I*C+(1-I)*w;_.push([n[m-1][0]>c?180:-180,M]),(_=[]).push([n[m-1][0]>c?-180:180,M]),v.push(_)}else _=[],v.push(_);_.push([x,n[m][1]])}else _.push([n[m][0],n[m][1]])}}else{var O=[];v.push(O);for(var L=0;L<n.length;++L)O.push([n[L][0],n[L][1]])}for(var R=new Mu(this.properties),k=0;k<v.length;++k){var T=new Iu;R.geometries.push(T);for(var N=v[k],A=0;A<N.length;++A)T.move_to(N[A])}return R};var Lu=n(4982);function Ru(t,e){var n=ru(e),r=ru(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;return Lu(n[0],i)?s.unshift(n[1]):Lu(n[0],o)?s.push(n[1]):Lu(n[1],i)?s.unshift(n[0]):Lu(n[1],o)&&s.push(n[0]),t}var ku=function(t,e,n){if(void 0===n&&(n={}),!(r=n=n||{})||r.constructor!==Object)throw new Error("options is invalid");var r,i,o=n.tolerance||0,s=[],a=gu(),u=du(t);return a.load(u),Qa(e,function(t){var e=!1;t&&(Ka(a.search(t),function(n){if(!1===e){var r=ru(t).sort(),s=ru(n).sort();Lu(r,s)||(0===o?Eu(r[0],n)&&Eu(r[1],n):_u(n,r[0]).properties.dist<=o&&_u(n,r[1]).properties.dist<=o)?(e=!0,i=i?Ru(i,t):t):(0===o?Eu(s[0],t)&&Eu(s[1],t):_u(t,s[0]).properties.dist<=o&&_u(t,s[1]).properties.dist<=o)&&(i=i?Ru(i,n):n)}}),!1===e&&i&&(s.push(i),i=void 0))}),i&&s.push(i),za(s)};var Tu=[],Nu=[],Au=[],Du=[],Fu=[],ju=[],Gu=[],Bu=[],zu=[],Vu=[],Uu=[],Wu=[],Xu=[],qu=[],Yu=[],Hu=[],Zu=[],Ku=[],Ju=[],$u=[],Qu=[],tl=[],el=[],nl=[];Gu[85]=Vu[85]=-1,Bu[85]=Uu[85]=0,zu[85]=Wu[85]=1,Ju[85]=tl[85]=1,$u[85]=el[85]=0,Qu[85]=nl[85]=1,Tu[85]=Du[85]=0,Nu[85]=Fu[85]=-1,Au[85]=Yu[85]=0,Hu[85]=Xu[85]=0,Zu[85]=qu[85]=1,ju[85]=Ku[85]=1,tl[1]=tl[169]=0,el[1]=el[169]=-1,nl[1]=nl[169]=0,Xu[1]=Xu[169]=-1,qu[1]=qu[169]=0,Yu[1]=Yu[169]=0,Vu[4]=Vu[166]=0,Uu[4]=Uu[166]=-1,Wu[4]=Wu[166]=1,Hu[4]=Hu[166]=1,Zu[4]=Zu[166]=0,Ku[4]=Ku[166]=0,Gu[16]=Gu[154]=0,Bu[16]=Bu[154]=1,zu[16]=zu[154]=1,Du[16]=Du[154]=1,Fu[16]=Fu[154]=0,ju[16]=ju[154]=1,Ju[64]=Ju[106]=0,$u[64]=$u[106]=1,Qu[64]=Qu[106]=0,Tu[64]=Tu[106]=-1,Nu[64]=Nu[106]=0,Au[64]=Au[106]=1,Ju[2]=Ju[168]=0,$u[2]=$u[168]=-1,Qu[2]=Qu[168]=1,tl[2]=tl[168]=0,el[2]=el[168]=-1,nl[2]=nl[168]=0,Xu[2]=Xu[168]=-1,qu[2]=qu[168]=0,Yu[2]=Yu[168]=0,Hu[2]=Hu[168]=-1,Zu[2]=Zu[168]=0,Ku[2]=Ku[168]=1,Gu[8]=Gu[162]=0,Bu[8]=Bu[162]=-1,zu[8]=zu[162]=0,Vu[8]=Vu[162]=0,Uu[8]=Uu[162]=-1,Wu[8]=Wu[162]=1,Xu[8]=Xu[162]=1,qu[8]=qu[162]=0,Yu[8]=Yu[162]=1,Hu[8]=Hu[162]=1,Zu[8]=Zu[162]=0,Ku[8]=Ku[162]=0,Gu[32]=Gu[138]=0,Bu[32]=Bu[138]=1,zu[32]=zu[138]=1,Vu[32]=Vu[138]=0,Uu[32]=Uu[138]=1,Wu[32]=Wu[138]=0,Tu[32]=Tu[138]=1,Nu[32]=Nu[138]=0,Au[32]=Au[138]=0,Du[32]=Du[138]=1,Fu[32]=Fu[138]=0,ju[32]=ju[138]=1,tl[128]=tl[42]=0,el[128]=el[42]=1,nl[128]=nl[42]=1,Ju[128]=Ju[42]=0,$u[128]=$u[42]=1,Qu[128]=Qu[42]=0,Tu[128]=Tu[42]=-1,Nu[128]=Nu[42]=0,Au[128]=Au[42]=1,Du[128]=Du[42]=-1,Fu[128]=Fu[42]=0,ju[128]=ju[42]=0,Vu[5]=Vu[165]=-1,Uu[5]=Uu[165]=0,Wu[5]=Wu[165]=0,tl[5]=tl[165]=1,el[5]=el[165]=0,nl[5]=nl[165]=0,Hu[20]=Hu[150]=0,Zu[20]=Zu[150]=1,Ku[20]=Ku[150]=1,Du[20]=Du[150]=0,Fu[20]=Fu[150]=-1,ju[20]=ju[150]=1,Gu[80]=Gu[90]=-1,Bu[80]=Bu[90]=0,zu[80]=zu[90]=1,Ju[80]=Ju[90]=1,$u[80]=$u[90]=0,Qu[80]=Qu[90]=1,Xu[65]=Xu[105]=0,qu[65]=qu[105]=1,Yu[65]=Yu[105]=0,Tu[65]=Tu[105]=0,Nu[65]=Nu[105]=-1,Au[65]=Au[105]=0,Gu[160]=Gu[10]=-1,Bu[160]=Bu[10]=0,zu[160]=zu[10]=1,Vu[160]=Vu[10]=-1,Uu[160]=Uu[10]=0,Wu[160]=Wu[10]=0,tl[160]=tl[10]=1,el[160]=el[10]=0,nl[160]=nl[10]=0,Ju[160]=Ju[10]=1,$u[160]=$u[10]=0,Qu[160]=Qu[10]=1,Hu[130]=Hu[40]=0,Zu[130]=Zu[40]=1,Ku[130]=Ku[40]=1,Xu[130]=Xu[40]=0,qu[130]=qu[40]=1,Yu[130]=Yu[40]=0,Tu[130]=Tu[40]=0,Nu[130]=Nu[40]=-1,Au[130]=Au[40]=0,Du[130]=Du[40]=0,Fu[130]=Fu[40]=-1,ju[130]=ju[40]=1,Vu[37]=Vu[133]=0,Uu[37]=Uu[133]=1,Wu[37]=Wu[133]=1,tl[37]=tl[133]=0,el[37]=el[133]=1,nl[37]=nl[133]=0,Tu[37]=Tu[133]=-1,Nu[37]=Nu[133]=0,Au[37]=Au[133]=0,Du[37]=Du[133]=1,Fu[37]=Fu[133]=0,ju[37]=ju[133]=0,Hu[148]=Hu[22]=-1,Zu[148]=Zu[22]=0,Ku[148]=Ku[22]=0,tl[148]=tl[22]=0,el[148]=el[22]=-1,nl[148]=nl[22]=1,Ju[148]=Ju[22]=0,$u[148]=$u[22]=1,Qu[148]=Qu[22]=1,Du[148]=Du[22]=-1,Fu[148]=Fu[22]=0,ju[148]=ju[22]=1,Gu[82]=Gu[88]=0,Bu[82]=Bu[88]=-1,zu[82]=zu[88]=1,Hu[82]=Hu[88]=1,Zu[82]=Zu[88]=0,Ku[82]=Ku[88]=1,Xu[82]=Xu[88]=-1,qu[82]=qu[88]=0,Yu[82]=Yu[88]=1,Ju[82]=Ju[88]=0,$u[82]=$u[88]=-1,Qu[82]=Qu[88]=0,Gu[73]=Gu[97]=0,Bu[73]=Bu[97]=1,zu[73]=zu[97]=0,Vu[73]=Vu[97]=0,Uu[73]=Uu[97]=-1,Wu[73]=Wu[97]=0,Xu[73]=Xu[97]=1,qu[73]=qu[97]=0,Yu[73]=Yu[97]=0,Tu[73]=Tu[97]=1,Nu[73]=Nu[97]=0,Au[73]=Au[97]=1,Gu[145]=Gu[25]=0,Bu[145]=Bu[25]=-1,zu[145]=zu[25]=0,Xu[145]=Xu[25]=1,qu[145]=qu[25]=0,Yu[145]=Yu[25]=1,tl[145]=tl[25]=0,el[145]=el[25]=1,nl[145]=nl[25]=1,Du[145]=Du[25]=-1,Fu[145]=Fu[25]=0,ju[145]=ju[25]=0,Vu[70]=Vu[100]=0,Uu[70]=Uu[100]=1,Wu[70]=Wu[100]=0,Hu[70]=Hu[100]=-1,Zu[70]=Zu[100]=0,Ku[70]=Ku[100]=1,Ju[70]=Ju[100]=0,$u[70]=$u[100]=-1,Qu[70]=Qu[100]=1,Tu[70]=Tu[100]=1,Nu[70]=Nu[100]=0,Au[70]=Au[100]=0,Vu[101]=Vu[69]=0,Uu[101]=Uu[69]=1,Wu[101]=Wu[69]=0,Tu[101]=Tu[69]=1,Nu[101]=Nu[69]=0,Au[101]=Au[69]=0,tl[149]=tl[21]=0,el[149]=el[21]=1,nl[149]=nl[21]=1,Du[149]=Du[21]=-1,Fu[149]=Fu[21]=0,ju[149]=ju[21]=0,Hu[86]=Hu[84]=-1,Zu[86]=Zu[84]=0,Ku[86]=Ku[84]=1,Ju[86]=Ju[84]=0,$u[86]=$u[84]=-1,Qu[86]=Qu[84]=1,Gu[89]=Gu[81]=0,Bu[89]=Bu[81]=-1,zu[89]=zu[81]=0,Xu[89]=Xu[81]=1,qu[89]=qu[81]=0,Yu[89]=Yu[81]=1,Gu[96]=Gu[74]=0,Bu[96]=Bu[74]=1,zu[96]=zu[74]=0,Vu[96]=Vu[74]=-1,Uu[96]=Uu[74]=0,Wu[96]=Wu[74]=1,Ju[96]=Ju[74]=1,$u[96]=$u[74]=0,Qu[96]=Qu[74]=0,Tu[96]=Tu[74]=1,Nu[96]=Nu[74]=0,Au[96]=Au[74]=1,Gu[24]=Gu[146]=0,Bu[24]=Bu[146]=-1,zu[24]=zu[146]=1,Hu[24]=Hu[146]=1,Zu[24]=Zu[146]=0,Ku[24]=Ku[146]=1,Xu[24]=Xu[146]=0,qu[24]=qu[146]=1,Yu[24]=Yu[146]=1,Du[24]=Du[146]=0,Fu[24]=Fu[146]=-1,ju[24]=ju[146]=0,Vu[6]=Vu[164]=-1,Uu[6]=Uu[164]=0,Wu[6]=Wu[164]=1,Hu[6]=Hu[164]=-1,Zu[6]=Zu[164]=0,Ku[6]=Ku[164]=0,tl[6]=tl[164]=0,el[6]=el[164]=-1,nl[6]=nl[164]=1,Ju[6]=Ju[164]=1,$u[6]=$u[164]=0,Qu[6]=Qu[164]=0,Xu[129]=Xu[41]=0,qu[129]=qu[41]=1,Yu[129]=Yu[41]=1,tl[129]=tl[41]=0,el[129]=el[41]=1,nl[129]=nl[41]=0,Tu[129]=Tu[41]=-1,Nu[129]=Nu[41]=0,Au[129]=Au[41]=0,Du[129]=Du[41]=0,Fu[129]=Fu[41]=-1,ju[129]=ju[41]=0,Hu[66]=Hu[104]=0,Zu[66]=Zu[104]=1,Ku[66]=Ku[104]=0,Xu[66]=Xu[104]=-1,qu[66]=qu[104]=0,Yu[66]=Yu[104]=1,Ju[66]=Ju[104]=0,$u[66]=$u[104]=-1,Qu[66]=Qu[104]=0,Tu[66]=Tu[104]=0,Nu[66]=Nu[104]=-1,Au[66]=Au[104]=1,Gu[144]=Gu[26]=-1,Bu[144]=Bu[26]=0,zu[144]=zu[26]=0,tl[144]=tl[26]=1,el[144]=el[26]=0,nl[144]=nl[26]=1,Ju[144]=Ju[26]=0,$u[144]=$u[26]=1,Qu[144]=Qu[26]=1,Du[144]=Du[26]=-1,Fu[144]=Fu[26]=0,ju[144]=ju[26]=1,Vu[36]=Vu[134]=0,Uu[36]=Uu[134]=1,Wu[36]=Wu[134]=1,Hu[36]=Hu[134]=0,Zu[36]=Zu[134]=1,Ku[36]=Ku[134]=0,Tu[36]=Tu[134]=0,Nu[36]=Nu[134]=-1,Au[36]=Au[134]=1,Du[36]=Du[134]=1,Fu[36]=Fu[134]=0,ju[36]=ju[134]=0,Gu[9]=Gu[161]=-1,Bu[9]=Bu[161]=0,zu[9]=zu[161]=0,Vu[9]=Vu[161]=0,Uu[9]=Uu[161]=-1,Wu[9]=Wu[161]=0,Xu[9]=Xu[161]=1,qu[9]=qu[161]=0,Yu[9]=Yu[161]=0,tl[9]=tl[161]=1,el[9]=el[161]=0,nl[9]=nl[161]=1,Gu[136]=0,Bu[136]=1,zu[136]=1,Vu[136]=0,Uu[136]=1,Wu[136]=0,Hu[136]=-1,Zu[136]=0,Ku[136]=1,Xu[136]=-1,qu[136]=0,Yu[136]=0,tl[136]=0,el[136]=-1,nl[136]=0,Ju[136]=0,$u[136]=-1,Qu[136]=1,Tu[136]=1,Nu[136]=0,Au[136]=0,Du[136]=1,Fu[136]=0,ju[136]=1,Gu[34]=0,Bu[34]=-1,zu[34]=0,Vu[34]=0,Uu[34]=-1,Wu[34]=1,Hu[34]=1,Zu[34]=0,Ku[34]=0,Xu[34]=1,qu[34]=0,Yu[34]=1,tl[34]=0,el[34]=1,nl[34]=1,Ju[34]=0,$u[34]=1,Qu[34]=0,Tu[34]=-1,Nu[34]=0,Au[34]=1,Du[34]=-1,Fu[34]=0,ju[34]=0,Gu[35]=0,Bu[35]=1,zu[35]=1,Vu[35]=0,Uu[35]=-1,Wu[35]=1,Hu[35]=1,Zu[35]=0,Ku[35]=0,Xu[35]=-1,qu[35]=0,Yu[35]=0,tl[35]=0,el[35]=-1,nl[35]=0,Ju[35]=0,$u[35]=1,Qu[35]=0,Tu[35]=-1,Nu[35]=0,Au[35]=1,Du[35]=1,Fu[35]=0,ju[35]=1,Gu[153]=0,Bu[153]=1,zu[153]=1,Xu[153]=-1,qu[153]=0,Yu[153]=0,tl[153]=0,el[153]=-1,nl[153]=0,Du[153]=1,Fu[153]=0,ju[153]=1,Vu[102]=0,Uu[102]=-1,Wu[102]=1,Hu[102]=1,Zu[102]=0,Ku[102]=0,Ju[102]=0,$u[102]=1,Qu[102]=0,Tu[102]=-1,Nu[102]=0,Au[102]=1,Gu[155]=0,Bu[155]=-1,zu[155]=0,Xu[155]=1,qu[155]=0,Yu[155]=1,tl[155]=0,el[155]=1,nl[155]=1,Du[155]=-1,Fu[155]=0,ju[155]=0,Vu[103]=0,Uu[103]=1,Wu[103]=0,Hu[103]=-1,Zu[103]=0,Ku[103]=1,Ju[103]=0,$u[103]=-1,Qu[103]=1,Tu[103]=1,Nu[103]=0,Au[103]=0,Gu[152]=0,Bu[152]=1,zu[152]=1,Hu[152]=-1,Zu[152]=0,Ku[152]=1,Xu[152]=-1,qu[152]=0,Yu[152]=0,tl[152]=0,el[152]=-1,nl[152]=0,Ju[152]=0,$u[152]=-1,Qu[152]=1,Du[152]=1,Fu[152]=0,ju[152]=1,Gu[156]=0,Bu[156]=-1,zu[156]=1,Hu[156]=1,Zu[156]=0,Ku[156]=1,Xu[156]=-1,qu[156]=0,Yu[156]=0,tl[156]=0,el[156]=-1,nl[156]=0,Ju[156]=0,$u[156]=1,Qu[156]=1,Du[156]=-1,Fu[156]=0,ju[156]=1,Gu[137]=0,Bu[137]=1,zu[137]=1,Vu[137]=0,Uu[137]=1,Wu[137]=0,Xu[137]=-1,qu[137]=0,Yu[137]=0,tl[137]=0,el[137]=-1,nl[137]=0,Tu[137]=1,Nu[137]=0,Au[137]=0,Du[137]=1,Fu[137]=0,ju[137]=1,Gu[139]=0,Bu[139]=1,zu[139]=1,Vu[139]=0,Uu[139]=-1,Wu[139]=0,Xu[139]=1,qu[139]=0,Yu[139]=0,tl[139]=0,el[139]=1,nl[139]=0,Tu[139]=-1,Nu[139]=0,Au[139]=0,Du[139]=1,Fu[139]=0,ju[139]=1,Gu[98]=0,Bu[98]=-1,zu[98]=0,Vu[98]=0,Uu[98]=-1,Wu[98]=1,Hu[98]=1,Zu[98]=0,Ku[98]=0,Xu[98]=1,qu[98]=0,Yu[98]=1,Ju[98]=0,$u[98]=1,Qu[98]=0,Tu[98]=-1,Nu[98]=0,Au[98]=1,Gu[99]=0,Bu[99]=1,zu[99]=0,Vu[99]=0,Uu[99]=-1,Wu[99]=1,Hu[99]=1,Zu[99]=0,Ku[99]=0,Xu[99]=-1,qu[99]=0,Yu[99]=1,Ju[99]=0,$u[99]=-1,Qu[99]=0,Tu[99]=1,Nu[99]=0,Au[99]=1,Vu[38]=0,Uu[38]=-1,Wu[38]=1,Hu[38]=1,Zu[38]=0,Ku[38]=0,tl[38]=0,el[38]=1,nl[38]=1,Ju[38]=0,$u[38]=1,Qu[38]=0,Tu[38]=-1,Nu[38]=0,Au[38]=1,Du[38]=-1,Fu[38]=0,ju[38]=0,Vu[39]=0,Uu[39]=1,Wu[39]=1,Hu[39]=-1,Zu[39]=0,Ku[39]=0,tl[39]=0,el[39]=-1,nl[39]=1,Ju[39]=0,$u[39]=1,Qu[39]=0,Tu[39]=-1,Nu[39]=0,Au[39]=1,Du[39]=1,Fu[39]=0,ju[39]=0;var rl=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},il=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},ol=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},sl=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},al=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},ul=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},ll=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},cl=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},hl=[],fl=[],pl=[],dl=[],gl=[],yl=[],vl=[],_l=[];dl[1]=gl[1]=18,dl[169]=gl[169]=18,pl[4]=fl[4]=12,pl[166]=fl[166]=12,hl[16]=_l[16]=4,hl[154]=_l[154]=4,yl[64]=vl[64]=22,yl[106]=vl[106]=22,pl[2]=yl[2]=17,dl[2]=gl[2]=18,pl[168]=yl[168]=17,dl[168]=gl[168]=18,hl[8]=dl[8]=9,fl[8]=pl[8]=12,hl[162]=dl[162]=9,fl[162]=pl[162]=12,hl[32]=_l[32]=4,fl[32]=vl[32]=1,hl[138]=_l[138]=4,fl[138]=vl[138]=1,gl[128]=_l[128]=21,yl[128]=vl[128]=22,gl[42]=_l[42]=21,yl[42]=vl[42]=22,fl[5]=gl[5]=14,fl[165]=gl[165]=14,pl[20]=_l[20]=6,pl[150]=_l[150]=6,hl[80]=yl[80]=11,hl[90]=yl[90]=11,dl[65]=vl[65]=3,dl[105]=vl[105]=3,hl[160]=yl[160]=11,fl[160]=gl[160]=14,hl[10]=yl[10]=11,fl[10]=gl[10]=14,pl[130]=_l[130]=6,dl[130]=vl[130]=3,pl[40]=_l[40]=6,dl[40]=vl[40]=3,fl[101]=vl[101]=1,fl[69]=vl[69]=1,gl[149]=_l[149]=21,gl[21]=_l[21]=21,pl[86]=yl[86]=17,pl[84]=yl[84]=17,hl[89]=dl[89]=9,hl[81]=dl[81]=9,hl[96]=vl[96]=0,fl[96]=yl[96]=15,hl[74]=vl[74]=0,fl[74]=yl[74]=15,hl[24]=pl[24]=8,dl[24]=_l[24]=7,hl[146]=pl[146]=8,dl[146]=_l[146]=7,fl[6]=yl[6]=15,pl[6]=gl[6]=16,fl[164]=yl[164]=15,pl[164]=gl[164]=16,dl[129]=_l[129]=7,gl[129]=vl[129]=20,dl[41]=_l[41]=7,gl[41]=vl[41]=20,pl[66]=vl[66]=2,dl[66]=yl[66]=19,pl[104]=vl[104]=2,dl[104]=yl[104]=19,hl[144]=gl[144]=10,yl[144]=_l[144]=23,hl[26]=gl[26]=10,yl[26]=_l[26]=23,fl[36]=_l[36]=5,pl[36]=vl[36]=2,fl[134]=_l[134]=5,pl[134]=vl[134]=2,hl[9]=gl[9]=10,fl[9]=dl[9]=13,hl[161]=gl[161]=10,fl[161]=dl[161]=13,fl[37]=_l[37]=5,gl[37]=vl[37]=20,fl[133]=_l[133]=5,gl[133]=vl[133]=20,pl[148]=gl[148]=16,yl[148]=_l[148]=23,pl[22]=gl[22]=16,yl[22]=_l[22]=23,hl[82]=pl[82]=8,dl[82]=yl[82]=19,hl[88]=pl[88]=8,dl[88]=yl[88]=19,hl[73]=vl[73]=0,fl[73]=dl[73]=13,hl[97]=vl[97]=0,fl[97]=dl[97]=13,hl[145]=dl[145]=9,gl[145]=_l[145]=21,hl[25]=dl[25]=9,gl[25]=_l[25]=21,fl[70]=vl[70]=1,pl[70]=yl[70]=17,fl[100]=vl[100]=1,pl[100]=yl[100]=17,hl[34]=dl[34]=9,fl[34]=pl[34]=12,gl[34]=_l[34]=21,yl[34]=vl[34]=22,hl[136]=_l[136]=4,fl[136]=vl[136]=1,pl[136]=yl[136]=17,dl[136]=gl[136]=18,hl[35]=_l[35]=4,fl[35]=pl[35]=12,dl[35]=gl[35]=18,yl[35]=vl[35]=22,hl[153]=_l[153]=4,dl[153]=gl[153]=18,fl[102]=pl[102]=12,yl[102]=vl[102]=22,hl[155]=dl[155]=9,gl[155]=_l[155]=23,fl[103]=vl[103]=1,pl[103]=yl[103]=17,hl[152]=_l[152]=4,pl[152]=yl[152]=17,dl[152]=gl[152]=18,hl[156]=pl[156]=8,dl[156]=gl[156]=18,yl[156]=_l[156]=23,hl[137]=_l[137]=4,fl[137]=vl[137]=1,dl[137]=gl[137]=18,hl[139]=_l[139]=4,fl[139]=dl[139]=13,gl[139]=vl[139]=20,hl[98]=dl[98]=9,fl[98]=pl[98]=12,yl[98]=vl[98]=22,hl[99]=vl[99]=0,fl[99]=pl[99]=12,dl[99]=yl[99]=19,fl[38]=pl[38]=12,gl[38]=_l[38]=21,yl[38]=vl[38]=22,fl[39]=_l[39]=5,pl[39]=gl[39]=16,yl[39]=vl[39]=22;var ml=[];ml[1]=ml[169]=rl,ml[4]=ml[166]=il,ml[16]=ml[154]=ol,ml[64]=ml[106]=sl,ml[168]=ml[2]=al,ml[162]=ml[8]=ul,ml[138]=ml[32]=ll,ml[42]=ml[128]=cl,ml[5]=ml[165]=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},ml[20]=ml[150]=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},ml[80]=ml[90]=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},ml[65]=ml[105]=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},ml[160]=ml[10]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},ml[130]=ml[40]=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},ml[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},ml[101]=ml[69]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},ml[149]=ml[21]=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},ml[86]=ml[84]=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},ml[89]=ml[81]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},ml[96]=ml[74]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},ml[24]=ml[146]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},ml[6]=ml[164]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},ml[129]=ml[41]=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},ml[66]=ml[104]=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},ml[144]=ml[26]=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},ml[36]=ml[134]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},ml[9]=ml[161]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},ml[37]=ml[133]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},ml[148]=ml[22]=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},ml[82]=ml[88]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},ml[73]=ml[97]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},ml[145]=ml[25]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},ml[70]=ml[100]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},ml[34]=function(t){return[cl(t),ul(t)]},ml[35]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},ml[136]=function(t){return[ll(t),al(t)]},ml[153]=function(t){return[ol(t),rl(t)]},ml[102]=function(t){return[il(t),sl(t)]},ml[155]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},ml[103]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},ml[152]=function(t){return[ol(t),al(t)]},ml[156]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},ml[137]=function(t){return[ll(t),rl(t)]},ml[139]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},ml[98]=function(t){return[ul(t),sl(t)]},ml[99]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},ml[38]=function(t){return[il(t),cl(t)]},ml[39]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]};function xl(t,e,n){var r,i=e[0]-t[0],o=e[1]-t[1],s=n[0]-e[0],a=n[1]-e[1];return((r=i*a-s*o)>0)-(r<0)||+r}function bl(t,e){return e.geometry.coordinates[0].every(function(e){return su(ja(e),t)})}var wl=function(){function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return t.buildId=function(t){return t.join(",")},t.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},t.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},t.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},t.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]===0&&i.coordinates[0]-t.coordinates[0]===0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=xl(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)},t.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},t.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},t.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},t}(),El=wl,Cl=function(){function t(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return t.prototype.getSymetric=function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric},t.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},t.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},t.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},t.prototype.toLineString=function(){return Ba([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return xl(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}(),Sl=function(){function t(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return t.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},t.prototype.get=function(t){return this.edges[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.edges.forEach(t)},t.prototype.map=function(t){return this.edges.map(t)},t.prototype.some=function(t){return this.edges.some(t)},t.prototype.isValid=function(){return!0},t.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e},0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=xl(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},t.prototype.toMultiPoint=function(){return Ua(this.edges.map(function(t){return t.from.coordinates}))},t.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Ga([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=cu(this.toPolygon())},t.findEdgeRingContaining=function(t,e){var n,r,i=t.getEnvelope();return e.forEach(function(e){var o,s,a,u,l,c,h=e.getEnvelope();if((r&&(n=r.getEnvelope()),s=i,a=(o=h).geometry.coordinates[0].map(function(t){return t[0]}),u=o.geometry.coordinates[0].map(function(t){return t[1]}),l=s.geometry.coordinates[0].map(function(t){return t[0]}),c=s.geometry.coordinates[0].map(function(t){return t[1]}),Math.max.apply(null,a)!==Math.max.apply(null,l)||Math.max.apply(null,u)!==Math.max.apply(null,c)||Math.min.apply(null,a)!==Math.min.apply(null,l)||Math.min.apply(null,u)!==Math.min.apply(null,c))&&bl(h,i)){for(var f=t.map(function(t){return t.from.coordinates}),p=void 0,d=function(t){e.some(function(e){return n=t,r=e.from.coordinates,n[0]===r[0]&&n[1]===r[1];var n,r})||(p=t)},g=0,y=f;g<y.length;g++){d(y[g])}p&&e.inside(ja(p))&&(r&&!bl(n,h)||(r=e))}}),r},t.prototype.inside=function(t){return su(t,this.toPolygon())},t}(),Pl=Sl;!function(){function t(){this.edges=[],this.nodes={}}t.fromGeoJson=function(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(e);var n=new t;return $a(e,function(t){var e,r,i,o;!function(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}(t,"LineString","Graph::fromGeoJson"),e=function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e},o=r,Za(t,function(t,n,i,s,a){o=0===n&&void 0===r?t:e(o,t,n,i,s,a)},i)}),n},t.prototype.getNode=function(t){var e=El.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new El(t)),n},t.prototype.addEdge=function(t,e){var n=new Cl(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},t.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},t.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(t){return t.to});this.removeNode(t),n.forEach(function(t){return e._removeIfDangle(t)})}},t.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},t.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach(function(t){return e._computeNextCWEdges(e.nodes[t])}):t.getOuterEdges().forEach(function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e})},t.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,l=void 0;s.label===e&&(u=s),a.label===e&&(l=a),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},t.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}}),t},t.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n,e.label)})});var e=[];return this.edges.forEach(function(n){n.ring||e.push(t._findEdgeRing(n))}),e},t.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++r}),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e},t.prototype._findEdgeRing=function(t){var e=t,n=new Pl;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},t.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(t){return e.removeEdge(t)}),t.innerEdges.forEach(function(t){return e.removeEdge(t)}),delete this.nodes[t.id]},t.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()}}();function Il(t,e){var n=iu(t),r=iu(e),i=n.type,o=r.type,s=n.coordinates,a=r.coordinates;switch(i){case"Point":if("Point"===o)return Ol(s,a);throw new Error("feature2 "+o+" geometry not supported");case"MultiPoint":switch(o){case"Point":return function(t,e){var n,r=!1;for(n=0;n<t.coordinates.length;n++)if(Ol(t.coordinates[n],e.coordinates)){r=!0;break}return r}(n,r);case"MultiPoint":return function(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){for(var i=r[n],o=!1,s=0,a=t.coordinates;s<a.length;s++){if(Ol(i,a[s])){o=!0;break}}if(!o)return!1}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"Point":return Eu(r,n,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var n=!1,r=0,i=e.coordinates;r<i.length;r++){var o=i[r];if(Eu({type:"Point",coordinates:o},t,{ignoreEndVertices:!0})&&(n=!0),!Eu({type:"Point",coordinates:o},t,{ignoreEndVertices:!1}))return!1}return n}(n,r);case"MultiPoint":return function(t,e){for(var n=!1,r=0,i=e.coordinates;r<i.length;r++){var o=i[r];if(Eu(o,t,{ignoreEndVertices:!0})&&(n=!0),!Eu(o,t))return!1}if(n)return!0;return!1}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Point":return su(r,n,{ignoreBoundary:!0});case"LineString":return function(t,e){var n=!1,r=0,i=eu(t),o=eu(e);if(!Ml(i,o))return!1;for(;r<e.coordinates.length-1;r++){if(su({type:"Point",coordinates:Ll(e.coordinates[r],e.coordinates[r+1])},t,{ignoreBoundary:!0})){n=!0;break}}return n}(n,r);case"Polygon":return function(t,e){if("Feature"===t.type&&null===t.geometry)return!1;if("Feature"===e.type&&null===e.geometry)return!1;var n=eu(t),r=eu(e);if(!Ml(n,r))return!1;for(var i=iu(e).coordinates,o=0,s=i;o<s.length;o++)for(var a=0,u=s[o];a<u.length;a++){if(!su(u[a],t))return!1}return!0}(n,r);case"MultiPoint":return function(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){if(!su(r[n],t,{ignoreBoundary:!0}))return!1}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Ml(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function Ol(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ll(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}var Rl=n(8635);function kl(t,e){var n=iu(t),r=iu(e),i=n.type,o=r.type;if("MultiPoint"===i&&"MultiPoint"!==o||("LineString"===i||"MultiLineString"===i)&&"LineString"!==o&&"MultiLineString"!==o||("Polygon"===i||"MultiPolygon"===i)&&"Polygon"!==o&&"MultiPolygon"!==o)throw new Error("features must be of the same type");if("Point"===i)throw new Error("Point geometry not supported");if(new Rl({precision:6}).compare(t,e))return!1;var s=0;switch(i){case"MultiPoint":for(var a=0;a<n.coordinates.length;a++)for(var u=0;u<r.coordinates.length;u++){var l=n.coordinates[a],c=r.coordinates[u];if(l[0]===c[0]&&l[1]===c[1])return!0}return!1;case"LineString":case"MultiLineString":Qa(t,function(t){Qa(e,function(e){ku(t,e).features.length&&s++})});break;case"Polygon":case"MultiPolygon":Qa(t,function(t){Qa(e,function(e){vu(t,e).features.length&&s++})})}return s>0}n(6112);n(1756);function Tl(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}var Nl={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||Nl.heuristics.manhattan,o=r.closest||!1,s=new Fl(function(t){return t.f}),a=e;for(e.h=i(e,n),s.push(e);s.size()>0;){var u=s.pop();if(u===n)return Tl(u);u.closed=!0;for(var l=t.neighbors(u),c=0,h=l.length;c<h;++c){var f=l[c];if(!f.closed&&!f.isWall()){var p=u.g+f.getCost(u),d=f.visited;(!d||p<f.g)&&(f.visited=!0,f.parent=u,f.h=f.h||i(f,n),f.g=p,f.f=f.g+f.h,t.markDirty(f),o&&(f.h<a.h||f.h===a.h&&f.g<a.g)&&(a=f),d?s.rescoreElement(f):s.push(f))}}}return o?Tl(a):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=null}};function Al(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n<t.length;n++){this.grid[n]=[];for(var r=0,i=t[n];r<i.length;r++){var o=new Dl(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function Dl(t,e,n){this.x=t,this.y=e,this.weight=n}function Fl(t){this.content=[],this.scoreFunction=t}Al.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)Nl.cleanNode(this.nodes[t])},Al.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)Nl.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},Al.prototype.markDirty=function(t){this.dirtyNodes.push(t)},Al.prototype.neighbors=function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e},Al.prototype.toString=function(){for(var t,e,n,r,i=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,r=(e=o[s]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\n")},Dl.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},Dl.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},Dl.prototype.isWall=function(){return 0===this.weight},Fl.prototype={push:function(t){this.content.push(t),this.sinkDown(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(t){this.sinkDown(this.content.indexOf(t))},sinkDown:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},bubbleUp:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,s=o-1,a=null;if(s<e){var u=this.content[s];(i=this.scoreFunction(u))<r&&(a=s)}if(o<e){var l=this.content[o];this.scoreFunction(l)<(null===a?r:i)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}};function jl(){this._=null}function Gl(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Bl(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function zl(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Vl(t){for(;t.L;)t=t.L;return t}jl.prototype={constructor:jl,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Vl(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(Bl(this,n),n=(t=n).U),n.C=!1,r.C=!0,zl(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(zl(this,n),n=(t=n).U),n.C=!1,r.C=!0,Bl(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,s=t.R;if(n=o?s?Vl(s):o:s,i?i.L===t?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=s,s.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Bl(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,zl(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Bl(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,zl(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Bl(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,zl(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var Ul=jl;function Wl(t,e,n,r){var i=[null,null],o=dc.push(i)-1;return i.left=t,i.right=e,n&&ql(i,t,e,n),r&&ql(i,e,t,r),fc[t.index].halfedges.push(o),fc[e.index].halfedges.push(o),i}function Xl(t,e,n){var r=[e,n];return r.left=t,r}function ql(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function Yl(t,e,n,r,i){var o,s=t[0],a=t[1],u=s[0],l=s[1],c=0,h=1,f=a[0]-u,p=a[1]-l;if(o=e-u,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<h&&(h=o)}else if(f>0){if(o>h)return;o>c&&(c=o)}if(o=r-u,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<h&&(h=o)}if(o=n-l,p||!(o>0)){if(o/=p,p<0){if(o<c)return;o<h&&(h=o)}else if(p>0){if(o>h)return;o>c&&(c=o)}if(o=i-l,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o<c)return;o<h&&(h=o)}return!(c>0||h<1)||(c>0&&(t[0]=[u+c*f,l+c*p]),h<1&&(t[1]=[u+h*f,l+h*p]),!0)}}}}}function Hl(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],l=t.left,c=t.right,h=l[0],f=l[1],p=c[0],d=c[1],g=(h+p)/2,y=(f+d)/2;if(d===f){if(g<e||g>=r)return;if(h>p){if(u){if(u[1]>=i)return}else u=[g,n];o=[g,i]}else{if(u){if(u[1]<n)return}else u=[g,i];o=[g,n]}}else if(a=y-(s=(h-p)/(d-f))*g,s<-1||s>1)if(h>p){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]<n)return}else u=[(i-a)/s,i];o=[(n-a)/s,n]}else if(f<d){if(u){if(u[0]>=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]<e)return}else u=[r,s*r+a];o=[e,s*e+a]}return t[0]=u,t[1]=o,!0}function Zl(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function Kl(t,e){return e[+(e.left!==t.site)]}function Jl(t,e){return e[+(e.left===t.site)]}var $l,Ql=[];function tc(){Gl(this),this.x=this.y=this.arc=this.site=this.cy=null}function ec(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var s=i[0],a=i[1],u=r[0]-s,l=r[1]-a,c=o[0]-s,h=o[1]-a,f=2*(u*h-l*c);if(!(f>=-yc)){var p=u*u+l*l,d=c*c+h*h,g=(h*p-l*d)/f,y=(u*d-c*p)/f,v=Ql.pop()||new tc;v.arc=t,v.site=i,v.x=g+s,v.y=(v.cy=y+a)+Math.sqrt(g*g+y*y),t.circle=v;for(var _=null,m=pc._;m;)if(v.y<m.y||v.y===m.y&&v.x<=m.x){if(!m.L){_=m.P;break}m=m.L}else{if(!m.R){_=m;break}m=m.R}pc.insert(_,v),_||($l=v)}}}}function nc(t){var e=t.circle;e&&(e.P||($l=e.N),pc.remove(e),Ql.push(e),Gl(e),t.circle=null)}var rc=[];function ic(){Gl(this),this.edge=this.site=this.circle=null}function oc(t){var e=rc.pop()||new ic;return e.site=t,e}function sc(t){nc(t),hc.remove(t),rc.push(t),Gl(t)}function ac(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];sc(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)<gc&&Math.abs(r-u.circle.cy)<gc;)o=u.P,a.unshift(u),sc(u),u=o;a.unshift(u),nc(u);for(var l=s;l.circle&&Math.abs(n-l.circle.x)<gc&&Math.abs(r-l.circle.cy)<gc;)s=l.N,a.push(l),sc(l),l=s;a.push(l),nc(l);var c,h=a.length;for(c=1;c<h;++c)l=a[c],u=a[c-1],ql(l.edge,u.site,l.site,i);u=a[0],(l=a[h-1]).edge=Wl(u.site,l.site,null,i),ec(u),ec(l)}function uc(t){for(var e,n,r,i,o=t[0],s=t[1],a=hc._;a;)if((r=lc(a,s)-o)>gc)a=a.L;else{if(!((i=o-cc(a,s))>gc)){r>-gc?(e=a.P,n=a):i>-gc?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){fc[t.index]={site:t,halfedges:[]}}(t);var u=oc(t);if(hc.insert(e,u),e||n){if(e===n)return nc(e),n=oc(e.site),hc.insert(u,n),u.edge=n.edge=Wl(e.site,u.site),ec(e),void ec(n);if(n){nc(e),nc(n);var l=e.site,c=l[0],h=l[1],f=t[0]-c,p=t[1]-h,d=n.site,g=d[0]-c,y=d[1]-h,v=2*(f*y-p*g),_=f*f+p*p,m=g*g+y*y,x=[(y*_-p*m)/v+c,(f*m-g*_)/v+h];ql(n.edge,l,d,x),u.edge=Wl(l,t,null,x),n.edge=Wl(t,d,null,x),ec(e),ec(n)}else u.edge=Wl(e.site,u.site)}}function lc(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],l=u-e;if(!l)return a;var c=a-r,h=1/o-1/l,f=c/l;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*l)-u+l/2+i-o/2)))/h+r:(r+a)/2}function cc(t,e){var n=t.N;if(n)return lc(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var hc,fc,pc,dc,gc=1e-6,yc=1e-12;function vc(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function _c(t,e){return e[1]-t[1]||e[0]-t[0]}function mc(t,e){var n,r,i,o=t.sort(_c).pop();for(dc=[],fc=new Array(t.length),hc=new Ul,pc=new Ul;;)if(i=$l,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===n&&o[1]===r||(uc(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;ac(i.arc)}if(function(){for(var t,e,n,r,i=0,o=fc.length;i<o;++i)if((t=fc[i])&&(r=(e=t.halfedges).length)){var s=new Array(r),a=new Array(r);for(n=0;n<r;++n)s[n]=n,a[n]=Zl(t,dc[e[n]]);for(s.sort(function(t,e){return a[e]-a[t]}),n=0;n<r;++n)a[n]=e[s[n]];for(n=0;n<r;++n)e[n]=a[n]}}(),e){var s=+e[0][0],a=+e[0][1],u=+e[1][0],l=+e[1][1];!function(t,e,n,r){for(var i,o=dc.length;o--;)Hl(i=dc[o],t,e,n,r)&&Yl(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>gc||Math.abs(i[0][1]-i[1][1])>gc)||delete dc[o]}(s,a,u,l),function(t,e,n,r){var i,o,s,a,u,l,c,h,f,p,d,g,y=fc.length,v=!0;for(i=0;i<y;++i)if(o=fc[i]){for(s=o.site,a=(u=o.halfedges).length;a--;)dc[u[a]]||u.splice(a,1);for(a=0,l=u.length;a<l;)d=(p=Jl(o,dc[u[a]]))[0],g=p[1],h=(c=Kl(o,dc[u[++a%l]]))[0],f=c[1],(Math.abs(d-h)>gc||Math.abs(g-f)>gc)&&(u.splice(a,0,dc.push(Xl(s,p,Math.abs(d-t)<gc&&r-g>gc?[t,Math.abs(h-t)<gc?f:r]:Math.abs(g-r)<gc&&n-d>gc?[Math.abs(f-r)<gc?h:n,r]:Math.abs(d-n)<gc&&g-e>gc?[n,Math.abs(h-n)<gc?f:e]:Math.abs(g-e)<gc&&d-t>gc?[Math.abs(f-e)<gc?h:t,e]:null))-1),++l);l&&(v=!1)}if(v){var _,m,x,b=1/0;for(i=0,v=null;i<y;++i)(o=fc[i])&&(x=(_=(s=o.site)[0]-t)*_+(m=s[1]-e)*m)<b&&(b=x,v=o);if(v){var w=[t,e],E=[t,r],C=[n,r],S=[n,e];v.halfedges.push(dc.push(Xl(s=v.site,w,E))-1,dc.push(Xl(s,E,C))-1,dc.push(Xl(s,C,S))-1,dc.push(Xl(s,S,w))-1)}}for(i=0;i<y;++i)(o=fc[i])&&(o.halfedges.length||delete fc[i])}(s,a,u,l)}this.edges=dc,this.cells=fc,hc=pc=dc=fc=null}mc.prototype={constructor:mc,polygons:function(){var t=this.edges;return this.cells.map(function(e){var n=e.halfedges.map(function(n){return Kl(e,t[n])});return n.data=e.site.data,n})},triangles:function(){var t=[],e=this.edges;return this.cells.forEach(function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a=n.site,u=-1,l=e[i[o-1]],c=l.left===a?l.right:l.left;++u<o;)s=c,c=(l=e[i[u]]).left===a?l.right:l.left,s&&c&&r<s.index&&r<c.index&&vc(a,s,c)<0&&t.push([a.data,s.data,c.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})},find:function(t,e,n){for(var r,i,o=this,s=o._found||0,a=o.cells.length;!(i=o.cells[s]);)if(++s>=a)return null;var u=t-i.site[0],l=e-i.site[1],c=u*u+l*l;do{i=o.cells[r=s],s=null,i.halfedges.forEach(function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],l=e-a[1],h=u*u+l*l;h<c&&(c=h,s=a.index)}})}while(null!==s);return o._found=r,null==n||c<=n*n?i.site:null}};n(9004);var xc=n(39);function bc(){return new wc}function wc(){this.reset()}wc.prototype={constructor:wc,reset:function(){this.s=this.t=0},add:function(t){Cc(Ec,t,this.t),Cc(this,Ec.s,this.s),this.s?this.t+=Ec.t:this.s=Ec.t},valueOf:function(){return this.s}};var Ec=new wc;function Cc(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var Sc=1e-6,Pc=Math.PI,Ic=Pc/2,Mc=Pc/4,Oc=2*Pc,Lc=180/Pc,Rc=Pc/180,kc=Math.abs,Tc=Math.atan,Nc=Math.atan2,Ac=Math.cos,Dc=(Math.ceil,Math.exp),Fc=(Math.floor,Math.log),jc=(Math.pow,Math.sin),Gc=(Math.sign,Math.sqrt),Bc=Math.tan;function zc(t){return t>1?0:t<-1?Pc:Math.acos(t)}function Vc(t){return t>1?Ic:t<-1?-Ic:Math.asin(t)}function Uc(){}function Wc(t,e){t&&qc.hasOwnProperty(t.type)&&qc[t.type](t,e)}var Xc={Feature:function(t,e){Wc(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Wc(n[r].geometry,e)}},qc={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Yc(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Yc(n[r],e,0)},Polygon:function(t,e){Hc(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Hc(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Wc(n[r],e)}};function Yc(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function Hc(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Yc(t[n],e,1);e.polygonEnd()}function Zc(t,e){t&&Xc.hasOwnProperty(t.type)?Xc[t.type](t,e):Wc(t,e)}bc(),bc();function Kc(t){return[Nc(t[1],t[0]),Vc(t[2])]}function Jc(t){var e=t[0],n=t[1],r=Ac(n);return[r*Ac(e),r*jc(e),jc(n)]}function $c(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Qc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function th(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function eh(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function nh(t){var e=Gc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}bc();function rh(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function ih(t,e){return[t>Pc?t-Oc:t<-Pc?t+Oc:t,e]}function oh(t,e,n){return(t%=Oc)?e||n?rh(ah(t),uh(e,n)):ah(t):e||n?uh(e,n):ih}function sh(t){return function(e,n){return[(e+=t)>Pc?e-Oc:e<-Pc?e+Oc:e,n]}}function ah(t){var e=sh(t);return e.invert=sh(-t),e}function uh(t,e){var n=Ac(t),r=jc(t),i=Ac(e),o=jc(e);function s(t,e){var s=Ac(e),a=Ac(t)*s,u=jc(t)*s,l=jc(e),c=l*n+a*r;return[Nc(u*i-c*o,a*n-l*r),Vc(c*i+u*o)]}return s.invert=function(t,e){var s=Ac(e),a=Ac(t)*s,u=jc(t)*s,l=jc(e),c=l*i-u*o;return[Nc(u*i+l*o,a*n+c*r),Vc(c*n-a*r)]},s}function lh(t,e,n,r,i,o){if(n){var s=Ac(e),a=jc(e),u=r*n;null==i?(i=e+r*Oc,o=e-u/2):(i=ch(s,i),o=ch(s,o),(r>0?i<o:i>o)&&(i+=r*Oc));for(var l,c=i;r>0?c>o:c<o;c-=u)l=Kc([s,-a*Ac(c),-a*jc(c)]),t.point(l[0],l[1])}}function ch(t,e){(e=Jc(e))[0]-=t,nh(e);var n=zc(-e[1]);return((-e[2]<0?-n:n)+Oc-Sc)%Oc}function hh(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Uc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function fh(t,e){return kc(t[0]-e[0])<Sc&&kc(t[1]-e[1])<Sc}function ph(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function dh(t,e,n,r,i){var o,s,a=[],u=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(fh(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else a.push(n=new ph(r,t,null,!0)),u.push(n.o=new ph(r,null,n,!1)),a.push(n=new ph(s,t,null,!1)),u.push(n.o=new ph(s,null,n,!0))}}),a.length){for(u.sort(e),gh(a),gh(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var l,c,h=a[0];;){for(var f=h,p=!0;f.v;)if((f=f.n)===h)return;l=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(o=0,s=l.length;o<s;++o)i.point((c=l[o])[0],c[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(p)for(l=f.p.z,o=l.length-1;o>=0;--o)i.point((c=l[o])[0],c[1]);else r(f.x,f.p.x,-1,i);f=f.p}l=(f=f.o).z,p=!p}while(!f.v);i.lineEnd()}}}function gh(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function yh(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}ih.invert=ih;1===(vh=yh).length&&(_h=vh,vh=function(t,e){return yh(_h(t),e)});var vh,_h,mh=Array.prototype;mh.slice,mh.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);function xh(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}var bh=1e9,wh=-bh;function Eh(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,l){var c=0,h=0;if(null==i||(c=s(i,a))!==(h=s(o,a))||u(i,o)<0^a>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+a+4)%4)!==h);else l.point(o[0],o[1])}function s(r,i){return kc(r[0]-t)<Sc?i>0?0:3:kc(r[0]-n)<Sc?i>0?2:1:kc(r[1]-e)<Sc?i>0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var u,l,c,h,f,p,d,g,y,v,_,m=s,x=hh(),b={point:w,lineStart:function(){b.point=E,l&&l.push(c=[]);v=!0,y=!1,d=g=NaN},lineEnd:function(){u&&(E(h,f),p&&y&&x.rejoin(),u.push(x.result()));b.point=w,y&&m.lineEnd()},polygonStart:function(){m=x,u=[],l=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,s,a=l[n],u=1,c=a.length,h=a[0],f=h[0],p=h[1];u<c;++u)o=f,s=p,f=(h=a[u])[0],p=h[1],s<=r?p>r&&(f-o)*(r-s)>(p-s)*(t-o)&&++e:p<=r&&(f-o)*(r-s)<(p-s)*(t-o)&&--e;return e}(),n=_&&e,i=(u=xh(u)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&dh(u,a,e,o,s),s.polygonEnd());m=s,u=l=c=null}};function w(t,e){i(t,e)&&m.point(t,e)}function E(o,s){var a=i(o,s);if(l&&c.push([o,s]),v)h=o,f=s,p=a,v=!1,a&&(m.lineStart(),m.point(o,s));else if(a&&y)m.point(o,s);else{var u=[d=Math.max(wh,Math.min(bh,d)),g=Math.max(wh,Math.min(bh,g))],x=[o=Math.max(wh,Math.min(bh,o)),s=Math.max(wh,Math.min(bh,s))];!function(t,e,n,r,i,o){var s,a=t[0],u=t[1],l=0,c=1,h=e[0]-a,f=e[1]-u;if(s=n-a,h||!(s>0)){if(s/=h,h<0){if(s<l)return;s<c&&(c=s)}else if(h>0){if(s>c)return;s>l&&(l=s)}if(s=i-a,h||!(s<0)){if(s/=h,h<0){if(s>c)return;s>l&&(l=s)}else if(h>0){if(s<l)return;s<c&&(c=s)}if(s=r-u,f||!(s>0)){if(s/=f,f<0){if(s<l)return;s<c&&(c=s)}else if(f>0){if(s>c)return;s>l&&(l=s)}if(s=o-u,f||!(s<0)){if(s/=f,f<0){if(s>c)return;s>l&&(l=s)}else if(f>0){if(s<l)return;s<c&&(c=s)}return l>0&&(t[0]=a+l*h,t[1]=u+l*f),c<1&&(e[0]=a+c*h,e[1]=u+c*f),!0}}}}}(u,x,t,e,n,r)?a&&(m.lineStart(),m.point(o,s),_=!1):(y||(m.lineStart(),m.point(u[0],u[1])),m.point(x[0],x[1]),a||m.lineEnd(),_=!1)}d=o,g=s,y=a}return b}}var Ch=bc();function Sh(t,e){var n=e[0],r=e[1],i=[jc(n),-Ac(n),0],o=0,s=0;Ch.reset();for(var a=0,u=t.length;a<u;++a)if(c=(l=t[a]).length)for(var l,c,h=l[c-1],f=h[0],p=h[1]/2+Mc,d=jc(p),g=Ac(p),y=0;y<c;++y,f=_,d=x,g=b,h=v){var v=l[y],_=v[0],m=v[1]/2+Mc,x=jc(m),b=Ac(m),w=_-f,E=w>=0?1:-1,C=E*w,S=C>Pc,P=d*x;if(Ch.add(Nc(P*E*jc(C),g*b+P*Ac(C))),o+=S?w+E*Oc:w,S^f>=n^_>=n){var I=Qc(Jc(h),Jc(v));nh(I);var M=Qc(i,I);nh(M);var O=(S^w>=0?-1:1)*Vc(M[2]);(r>O||r===O&&(I[0]||I[1]))&&(s+=S^w>=0?1:-1)}}return(o<-1e-6||o<Sc&&Ch<-1e-6)^1&s}bc();bc(),bc();var Ph=1/0,Ih=Ph,Mh=-Ph,Oh=Mh,Lh={point:function(t,e){t<Ph&&(Ph=t);t>Mh&&(Mh=t);e<Ih&&(Ih=e);e>Oh&&(Oh=e)},lineStart:Uc,lineEnd:Uc,polygonStart:Uc,polygonEnd:Uc,result:function(){var t=[[Ph,Ih],[Mh,Oh]];return Mh=Oh=-(Ih=Ph=1/0),t}};var Rh=Lh;bc();function kh(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Th(t,e,n,r){return function(i,o){var s,a,u,l=e(o),c=i.invert(r[0],r[1]),h=hh(),f=e(h),p=!1,d={point:g,lineStart:v,lineEnd:_,polygonStart:function(){d.point=m,d.lineStart=x,d.lineEnd=b,a=[],s=[]},polygonEnd:function(){d.point=g,d.lineStart=v,d.lineEnd=_,a=xh(a);var t=Sh(s,c);a.length?(p||(o.polygonStart(),p=!0),dh(a,Ah,t,n,o)):t&&(p||(o.polygonStart(),p=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),p&&(o.polygonEnd(),p=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function g(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function y(t,e){var n=i(t,e);l.point(n[0],n[1])}function v(){d.point=y,l.lineStart()}function _(){d.point=g,l.lineEnd()}function m(t,e){u.push([t,e]);var n=i(t,e);f.point(n[0],n[1])}function x(){f.lineStart(),u=[]}function b(){m(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),l=h.result(),c=l.length;if(u.pop(),s.push(u),u=null,c)if(1&i){if((e=(n=l[0]).length-1)>0){for(p||(o.polygonStart(),p=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else c>1&&2&i&&l.push(l.pop().concat(l.shift())),a.push(l.filter(Nh))}return d}}function Nh(t){return t.length>1}function Ah(t,e){return((t=t.x)[0]<0?t[1]-Ic-Sc:Ic-t[1])-((e=e.x)[0]<0?e[1]-Ic-Sc:Ic-e[1])}kh(4.5);var Dh=Th(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Pc:-Pc,u=kc(o-n);kc(u-Pc)<Sc?(t.point(n,r=(r+s)/2>0?Ic:-Ic),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=Pc&&(kc(n-i)<Sc&&(n-=i*Sc),kc(o-a)<Sc&&(o-=a*Sc),r=function(t,e,n,r){var i,o,s=jc(t-n);return kc(s)>Sc?Tc((jc(e)*(o=Ac(r))*jc(n)-jc(r)*(i=Ac(e))*jc(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*Ic,r.point(-Pc,i),r.point(0,i),r.point(Pc,i),r.point(Pc,0),r.point(Pc,-i),r.point(0,-i),r.point(-Pc,-i),r.point(-Pc,0),r.point(-Pc,i);else if(kc(t[0]-e[0])>Sc){var o=t[0]<e[0]?Pc:-Pc;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])},[-Pc,-Ic]);function Fh(t){return t}function jh(t){return function(e){var n=new Gh;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Gh(){}function Bh(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),Zc(n,t.stream(Rh));var s=Rh.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,l=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,l])}Gh.prototype={constructor:Gh,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var zh=Ac(30*Rc);function Vh(t,e){return+e?function(t,e){function n(r,i,o,s,a,u,l,c,h,f,p,d,g,y){var v=l-r,_=c-i,m=v*v+_*_;if(m>4*e&&g--){var x=s+f,b=a+p,w=u+d,E=Gc(x*x+b*b+w*w),C=Vc(w/=E),S=kc(kc(w)-1)<Sc||kc(o-h)<Sc?(o+h)/2:Nc(b,x),P=t(S,C),I=P[0],M=P[1],O=I-r,L=M-i,R=_*O-v*L;(R*R/m>e||kc((v*O+_*L)/m-.5)>.3||s*f+a*p+u*d<zh)&&(n(r,i,o,s,a,u,I,M,S,x/=E,b/=E,w,g,y),y.point(I,M),n(I,M,S,x,b,w,l,c,h,f,p,d,g,y))}}return function(e){var r,i,o,s,a,u,l,c,h,f,p,d,g={point:y,lineStart:v,lineEnd:m,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=v}};function y(n,r){n=t(n,r),e.point(n[0],n[1])}function v(){c=NaN,g.point=_,e.lineStart()}function _(r,i){var o=Jc([r,i]),s=t(r,i);n(c,h,l,f,p,d,c=s[0],h=s[1],l=r,f=o[0],p=o[1],d=o[2],16,e),e.point(c,h)}function m(){g.point=y,e.lineEnd()}function x(){v(),g.point=b,g.lineEnd=w}function b(t,e){_(r=t,e),i=c,o=h,s=f,a=p,u=d,g.point=_}function w(){n(c,h,l,f,p,d,i,o,r,s,a,u,16,e),g.lineEnd=m,m()}return g}}(t,e):function(t){return jh({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Uh=jh({point:function(t,e){this.stream.point(t*Rc,e*Rc)}});function Wh(t){return function(t){var e,n,r,i,o,s,a,u,l,c,h=150,f=480,p=250,d=0,g=0,y=0,v=0,_=0,m=null,x=Dh,b=null,w=Fh,E=.5,C=Vh(I,E);function S(t){return[(t=o(t[0]*Rc,t[1]*Rc))[0]*h+n,r-t[1]*h]}function P(t){return(t=o.invert((t[0]-n)/h,(r-t[1])/h))&&[t[0]*Lc,t[1]*Lc]}function I(t,i){return[(t=e(t,i))[0]*h+n,r-t[1]*h]}function M(){o=rh(i=oh(y,v,_),e);var t=e(d,g);return n=f-t[0]*h,r=p+t[1]*h,O()}function O(){return l=c=null,S}return S.stream=function(t){return l&&c===t?l:l=Uh(x(i,C(w(c=t))))},S.clipAngle=function(t){return arguments.length?(x=+t?function(t,e){var n=Ac(t),r=n>0,i=kc(n)>Sc;function o(t,e){return Ac(t)*Ac(e)>n}function s(t,e,r){var i=[1,0,0],o=Qc(Jc(t),Jc(e)),s=$c(o,o),a=o[0],u=s-a*a;if(!u)return!r&&t;var l=n*s/u,c=-n*a/u,h=Qc(i,o),f=eh(i,l);th(f,eh(o,c));var p=h,d=$c(f,p),g=$c(p,p),y=d*d-g*($c(f,f)-1);if(!(y<0)){var v=Gc(y),_=eh(p,(-d-v)/g);if(th(_,f),_=Kc(_),!r)return _;var m,x=t[0],b=e[0],w=t[1],E=e[1];b<x&&(m=x,x=b,b=m);var C=b-x,S=kc(C-Pc)<Sc;if(!S&&E<w&&(m=w,w=E,E=m),S||C<Sc?S?w+E>0^_[1]<(kc(_[0]-x)<Sc?w:E):w<=_[1]&&_[1]<=E:C>Pc^(x<=_[0]&&_[0]<=b)){var P=eh(p,(-d+v)/g);return th(P,f),[_,Kc(P)]}}}function a(e,n){var i=r?t:Pc-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Th(o,function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,f){var p,d=[h,f],g=o(h,f),y=r?g?0:a(h,f):g?a(h+(h<0?Pc:-Pc),f):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(p=s(e,d))||fh(e,p)||fh(d,p))&&(d[0]+=Sc,d[1]+=Sc,g=o(d[0],d[1])),g!==u)c=0,g?(t.lineStart(),p=s(d,e),t.point(p[0],p[1])):(p=s(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(i&&e&&r^g){var v;y&n||!(v=s(d,e,!0))||(c=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&fh(e,d)||t.point(d[0],d[1]),e=d,u=g,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}},function(n,r,i,o){lh(o,t,e,i,n,r)},r?[0,-t]:[-Pc,t-Pc])}(m=t*Rc,6*Rc):(m=null,Dh),O()):m*Lc},S.clipExtent=function(t){return arguments.length?(w=null==t?(b=s=a=u=null,Fh):Eh(b=+t[0][0],s=+t[0][1],a=+t[1][0],u=+t[1][1]),O()):null==b?null:[[b,s],[a,u]]},S.scale=function(t){return arguments.length?(h=+t,M()):h},S.translate=function(t){return arguments.length?(f=+t[0],p=+t[1],M()):[f,p]},S.center=function(t){return arguments.length?(d=t[0]%360*Rc,g=t[1]%360*Rc,M()):[d*Lc,g*Lc]},S.rotate=function(t){return arguments.length?(y=t[0]%360*Rc,v=t[1]%360*Rc,_=t.length>2?t[2]%360*Rc:0,M()):[y*Lc,v*Lc,_*Lc]},S.precision=function(t){return arguments.length?(C=Vh(I,E=t*t),O()):Gc(E)},S.fitExtent=function(t,e){return Bh(S,t,e)},S.fitSize=function(t,e){return function(t,e,n){return Bh(t,[[0,0],e],n)}(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&P,M()}}(function(){return t})()}function Xh(t){return function(e,n){var r=Ac(e),i=Ac(n),o=t(r*i);return[o*i*jc(e),o*jc(n)]}}function qh(t){return function(e,n){var r=Gc(e*e+n*n),i=t(r),o=jc(i),s=Ac(i);return[Nc(e*o,r*s),Vc(r&&n*o/r)]}}var Yh=Xh(function(t){return Gc(2/(1+t))});Yh.invert=qh(function(t){return 2*Vc(t/2)});var Hh=Xh(function(t){return(t=zc(t))&&t/jc(t)});function Zh(){return Wh(Hh).scale(79.4188).clipAngle(179.999)}function Kh(t,e){return[t,Fc(Bc((Ic+e)/2))]}function Jh(t,e){return[t,e]}function $h(t,e){var n=Ac(e),r=Ac(t)*n;return[n*jc(t)/r,jc(e)/r]}function Qh(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function tf(t,e){return[Ac(e)*jc(t),jc(e)]}function ef(t,e){var n=Ac(e),r=1+Ac(t)*n;return[n*jc(t)/r,jc(e)/r]}function nf(t,e){return[Fc(Bc((Ic+e)/2)),-t]}function rf(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return Ja(t,function(t){var i=rf(t,e,n,r);i&&s.push(i)}),za(s)}var a=function(t){var e=pu(t).geometry.coordinates,n=[-e[0],-e[1]];return Zh().rotate(n).scale(Aa)}(o),u={type:o.type,coordinates:sf(o.coordinates,a)},l=(new xc.GeoJSONReader).read(u),c=Wa(Xa(e,n),"meters"),h=xc.BufferOp.bufferOp(l,c,r);if(!of((h=(new xc.GeoJSONWriter).write(h)).coordinates))return Fa({type:h.type,coordinates:af(h.coordinates,a)},i)}function of(t){return Array.isArray(t[0])?of(t[0]):isNaN(t[0])}function sf(t,e){return"object"!=typeof t[0]?e(t):t.map(function(t){return sf(t,e)})}function af(t,e){return"object"!=typeof t[0]?e.invert(t):t.map(function(t){return af(t,e)})}Hh.invert=qh(function(t){return t}),Kh.invert=function(t,e){return[t,2*Tc(Dc(e))-Ic]},Jh.invert=Jh,$h.invert=qh(Tc),Qh.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,s=o*o;r-=n=(r*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-e)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while(kc(n)>Sc&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},tf.invert=qh(Vc),ef.invert=qh(function(t){return 2*Tc(t)}),nf.invert=function(t,e){return[-e,2*Tc(Dc(t))-Ic]};var uf=function(t,e,n){var r=(n=n||{}).units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return Ja(t,function(t){var n=rf(t,e,r,i);n&&o.push(n)}),za(o);case"FeatureCollection":return Ka(t,function(t){var n=rf(t,e,r,i);n&&Ka(n,function(t){t&&o.push(t)})}),za(o)}return rf(t,e,r,i)};var lf=n(8260),cf=function(){function t(t){this.rbush_=new lf(t),this.items_={}}return t.prototype.insert=function(t,e){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[p(e)]=n},t.prototype.load=function(t,e){for(var n=new Array(e.length),r=0,i=e.length;r<i;r++){var o=t[r],s=e[r],a={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};n[r]=a,this.items_[p(s)]=a}this.rbush_.load(n)},t.prototype.remove=function(t){var e=p(t),n=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(n)},t.prototype.update=function(t,e){var n=this.items_[p(e)];$([n.minX,n.minY,n.maxX,n.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map(function(t){return t.value})},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(t){return t.value})},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var n,r=0,i=t.length;r<i;r++)if(n=e(t[r]))return n;return n},t.prototype.isEmpty=function(){return Zt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return H(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),hf=cf,ff="addfeature",pf="changefeature",df="clear",gf="removefeature",yf="featuresloadstart",vf="featuresloadend",_f="featuresloaderror",mf=0,xf=1,bf=2,wf=3,Ef=4,Cf=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Qo(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return h()},t.prototype.getImage=function(t){return h()},t.prototype.getHitDetectionImage=function(){return h()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return h()},t.prototype.getImageSize=function(){return h()},t.prototype.getOrigin=function(){return h()},t.prototype.getSize=function(){return h()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Qo(t)},t.prototype.listenImageChange=function(t){h()},t.prototype.load=function(){h()},t.prototype.unlistenImageChange=function(t){h()},t}(),Sf=Cf;function Pf(t){return Array.isArray(t)?Gt(t):t}var If=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mf=function(t){function e(e){var n=this,r=void 0!==e.rotateWithView&&e.rotateWithView;return(n=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0],declutterMode:e.declutterMode})||this).canvas_=void 0,n.hitDetectionCanvas_=null,n.fill_=void 0!==e.fill?e.fill:null,n.origin_=[0,0],n.points_=e.points,n.radius_=void 0!==e.radius?e.radius:e.radius1,n.radius2_=e.radius2,n.angle_=void 0!==e.angle?e.angle:0,n.stroke_=void 0!==e.stroke?e.stroke:null,n.size_=null,n.renderOptions_=null,n.render(),n}return If(e,t),e.prototype.clone=function(){var t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.setFill=function(t){this.fill_=t,this.render()},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var n=this.renderOptions_,r=hn(n.size*t,n.size*t);this.draw_(n,r,t),e=r.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return bf},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.setStroke=function(t){this.stroke_=t,this.render()},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,n){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var r=this.radius_,i=void 0===this.radius2_?r:this.radius2_;if(r<i){var o=r;r=i,i=o}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,u=i*Math.sin(a),l=r-Math.sqrt(i*i-u*u),c=Math.sqrt(u*u+l*l),h=c/u;if("miter"===t&&h<=n)return h*e;var f=e/2/h,p=e/2*(l/c),d=Math.sqrt((r+f)*(r+f)+p*p)-r;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=r*Math.sin(a),y=i-Math.sqrt(r*r-g*g),v=Math.sqrt(g*g+y*y)/g;if(v<=n){var _=v*e/2-i-r;return 2*Math.max(d,_)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=wn,n=0,r=null,i=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=En),t=Pf(t),void 0===(o=this.stroke_.getWidth())&&(o=1),r=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=wn),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var s=this.calculateLineJoinSize_(e,o,n),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*a+s),lineDash:r,lineDashOffset:i,lineJoin:e,miterLimit:n}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var r=this.fill_.getColor();null===r&&(r=mn),e.fillStyle=Pf(r),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),n=0;if("string"==typeof e&&(e=Ft(e)),null===e?n=1:Array.isArray(e)&&(n=4===e.length?e[3]:1),0===n){var r=hn(t.size,t.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(t,r)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,n=this.radius_;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{var r=void 0===this.radius2_?n:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var i=this.angle_-Math.PI/2,o=2*Math.PI/e,s=0;s<e;s++){var a=i+s*o,u=s%2==0?n:r;t.lineTo(u*Math.cos(a),u*Math.sin(a))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=mn,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(Sf),Of=Mf,Lf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rf=function(t){function e(e){var n=e||{};return t.call(this,{points:1/0,fill:n.fill,radius:n.radius,stroke:n.stroke,scale:void 0!==n.scale?n.scale:1,rotation:void 0!==n.rotation?n.rotation:0,rotateWithView:void 0!==n.rotateWithView&&n.rotateWithView,displacement:void 0!==n.displacement?n.displacement:[0,0],declutterMode:n.declutterMode})||this}return Lf(e,t),e.prototype.clone=function(){var t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Of),kf=Rf,Tf=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Nf=Tf,Af=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),Df=Af,Ff=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=zf,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=zf,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var jf=null;function Gf(t,e){if(!jf){var n=new Nf({color:"rgba(255,255,255,0.4)"}),r=new Df({color:"#3399CC",width:1.25});jf=[new Ff({image:new kf({fill:n,stroke:r,radius:5}),fill:n,stroke:r})]}return jf}function Bf(){var t={},e=[255,255,255,1],n=[0,153,255,1];return t.Polygon=[new Ff({fill:new Nf({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new Ff({stroke:new Df({color:e,width:5})}),new Ff({stroke:new Df({color:n,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new Ff({image:new kf({radius:6,fill:new Nf({color:n}),stroke:new Df({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function zf(t){return t.getGeometry()}var Vf=Ff,Uf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wf="renderOrder",Xf=function(t){function e(e){var n=this,r=e||{},i=qt({},r);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(n=t.call(this,i)||this).declutter_=void 0!==r.declutter&&r.declutter,n.renderBuffer_=void 0!==r.renderBuffer?r.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(r.style),n.updateWhileAnimating_=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,n.updateWhileInteracting_=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,n}return Uf(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(Wf)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new lf(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(Wf,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Gf,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var n;Array.isArray(t)?n=t:(P("function"==typeof t.getZIndex,41),n=[t]),e=function(){return n}}return e}(this.style_),this.changed()},e}(ze),qf=Xf,Yf={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Hf=[Yf.FILL],Zf=[Yf.STROKE],Kf=[Yf.BEGIN_PATH],Jf=[Yf.CLOSE_PATH],$f=Yf,Qf=function(){function t(){}return t.prototype.drawCustom=function(t,e,n,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),tp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ep=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=n,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return tp(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},e.prototype.appendFlatPointCoordinates=function(t,e){for(var n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,o=i.length,s=0,a=t.length;s<a;s+=e)r[0]=t[s],r[1]=t[s+1],U(n,r)&&(i[o++]=r[0],i[o++]=r[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,n,r,i,o){var s=this.coordinates,a=s.length,u=this.getBufferedMaxExtent();o&&(e+=r);var l,c,h,f=t[e],p=t[e+1],d=this.tmpCoordinate_,g=!0;for(l=e+r;l<n;l+=r)d[0]=t[l],d[1]=t[l+1],(h=q(u,d))!==c?(g&&(s[a++]=f,s[a++]=p,g=!1),s[a++]=d[0],s[a++]=d[1]):h===N?(s[a++]=d[0],s[a++]=d[1],g=!1):g=!0,f=d[0],p=d[1],c=h;return(i&&g||l===e+r)&&(s[a++]=f,s[a++]=p),a},e.prototype.drawCustomCoordinates_=function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o],u=this.appendFlatLineCoordinates(t,e,a,r,!1,!1);i.push(u),e=a}return e},e.prototype.drawCustom=function(t,e,n,r){this.beginGeometry(t,e);var i,o,s,a,u,l=t.getType(),c=t.getStride(),h=this.coordinates.length;switch(l){case"MultiPolygon":i=t.getOrientedFlatCoordinates(),a=[];var f=t.getEndss();u=0;for(var p=0,d=f.length;p<d;++p){var g=[];u=this.drawCustomCoordinates_(i,u,f[p],c,g),a.push(g)}this.instructions.push([$f.CUSTOM,h,a,t,n,mo]),this.hitDetectionInstructions.push([$f.CUSTOM,h,a,t,r||n,mo]);break;case"Polygon":case"MultiLineString":s=[],i="Polygon"==l?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),u=this.drawCustomCoordinates_(i,0,t.getEnds(),c,s),this.instructions.push([$f.CUSTOM,h,s,t,n,_o]),this.hitDetectionInstructions.push([$f.CUSTOM,h,s,t,r||n,_o]);break;case"LineString":case"Circle":i=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(i,0,i.length,c,!1,!1),this.instructions.push([$f.CUSTOM,h,o,t,n,vo]),this.hitDetectionInstructions.push([$f.CUSTOM,h,o,t,r||n,vo]);break;case"MultiPoint":i=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(i,c))>h&&(this.instructions.push([$f.CUSTOM,h,o,t,n,vo]),this.hitDetectionInstructions.push([$f.CUSTOM,h,o,t,r||n,vo]));break;case"Point":i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([$f.CUSTOM,h,o,t,n]),this.hitDetectionInstructions.push([$f.CUSTOM,h,o,t,r||n])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[$f.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[$f.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var n,r,i=e.length,s=-1;for(t=0;t<i;++t)(r=(n=e[t])[0])==$f.END_GEOMETRY?s=t:r==$f.BEGIN_GEOMETRY&&(n[2]=t,o(this.hitDetectionInstructions,s,t),s=-1)},e.prototype.setFillStrokeStyle=function(t,e){var n=this.state;if(t){var r=t.getColor();n.fillStyle=Pf(r||mn)}else n.fillStyle=void 0;if(e){var i=e.getColor();n.strokeStyle=Pf(i||En);var o=e.getLineCap();n.lineCap=void 0!==o?o:xn;var s=e.getLineDash();n.lineDash=s?s.slice():bn;var a=e.getLineDashOffset();n.lineDashOffset=a||0;var u=e.getLineJoin();n.lineJoin=void 0!==u?u:wn;var l=e.getWidth();n.lineWidth=void 0!==l?l:1;var c=e.getMiterLimit();n.miterLimit=void 0!==c?c:10,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,n=[$f.SET_FILL_STYLE,e];return"string"!=typeof e&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[$f.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,r=t.lineCap,i=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,u=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=r||i!=t.currentLineDash&&!a(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=u||t.currentMiterLimit!=l)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=r,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=u,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[$f.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=z(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;B(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Qf),np=ep,rp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ip=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterMode_=void 0,o.declutterImageWithText_=void 0,o}return rp(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([$f.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([$f.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([$f.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([$f.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),r=t.getSize(),i=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e},e}(np),op=ip,sp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ap=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return sp(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,r){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,r,!1,!1),s=[$f.MOVE_TO_LINE_TO,i,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),n},e.prototype.drawLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([$f.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,bn,0],Kf);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(Zf),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([$f.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],Kf);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),u=0,l=0,c=o.length;l<c;++l)u=this.drawFlatCoordinates_(s,u,o[l],a);this.hitDetectionInstructions.push(Zf),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Zf),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Zf),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(Kf)},e}(np),up=ap,lp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cp=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return lp(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,n,r){var i=this.state,o=void 0!==i.fillStyle,s=void 0!==i.strokeStyle,a=n.length;this.instructions.push(Kf),this.hitDetectionInstructions.push(Kf);for(var u=0;u<a;++u){var l=n[u],c=this.coordinates.length,h=this.appendFlatLineCoordinates(t,e,l,r,!0,!s),f=[$f.MOVE_TO_LINE_TO,c,h];this.instructions.push(f),this.hitDetectionInstructions.push(f),s&&(this.instructions.push(Jf),this.hitDetectionInstructions.push(Jf)),e=l}return o&&(this.instructions.push(Hf),this.hitDetectionInstructions.push(Hf)),s&&(this.instructions.push(Zf),this.hitDetectionInstructions.push(Zf)),e},e.prototype.drawCircle=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([$f.SET_FILL_STYLE,mn]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([$f.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);var u=[$f.CIRCLE,a];this.instructions.push(Kf,u),this.hitDetectionInstructions.push(Kf,u),void 0!==n.fillStyle&&(this.instructions.push(Hf),this.hitDetectionInstructions.push(Hf)),void 0!==n.strokeStyle&&(this.instructions.push(Zf),this.hitDetectionInstructions.push(Zf)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([$f.SET_FILL_STYLE,mn]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([$f.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([$f.SET_FILL_STYLE,mn]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([$f.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),u=0,l=0,c=o.length;l<c;++l)u=this.drawFlatCoordinatess_(s,u,o[l],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var n=this.coordinates,r=0,i=n.length;r<i;++r)n[r]=po(n[r],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(np),hp=cp,fp="point",pp="line";function dp(t,e,n,r,i){var o,s,a,u,l,c,h,f,p,d=n,g=n,y=0,v=0,_=n;for(o=n;o<r;o+=i){var m=e[o],x=e[o+1];void 0!==u&&(f=m-u,p=x-l,a=Math.sqrt(f*f+p*p),void 0!==c&&(v+=s,Math.acos((c*f+h*p)/(s*a))>t&&(v>y&&(y=v,d=_,g=o),v=0,_=o-i)),s=a,c=f,h=p),u=m,l=x}return(v+=a)>y?[_,o]:[d,g]}var gp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yp={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},vp=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return gp(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var n=this.textFillState_,r=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(n||r)){var o=this.coordinates,s=o.length,a=t.getType(),u=null,l=t.getStride();if(i.placement!==pp||"LineString"!=a&&"MultiLineString"!=a&&"Polygon"!=a&&"MultiPolygon"!=a){var c=i.overflow?null:[];switch(a){case"Point":case"MultiPoint":u=t.getFlatCoordinates();break;case"LineString":u=t.getFlatMidpoint();break;case"Circle":u=t.getCenter();break;case"MultiLineString":u=t.getFlatMidpoints(),l=2;break;case"Polygon":u=t.getFlatInteriorPoint(),i.overflow||c.push(u[2]/this.resolution),l=3;break;case"MultiPolygon":var h=t.getFlatInteriorPoints();u=[];for(w=0,E=h.length;w<E;w+=3)i.overflow||c.push(h[w+2]/this.resolution),u.push(h[w],h[w+1]);if(0===u.length)return;l=2}if((L=this.appendFlatPointCoordinates(u,l))===s)return;if(c&&(L-s)/2!==u.length/l){var f=s/2;c=c.filter(function(t,e){var n=o[2*(f+e)]===u[e*l]&&o[2*(f+e)+1]===u[e*l+1];return n||--f,n})}this.saveTextStates_(),(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var p=i.padding;if(p!=Pn&&(i.scale[0]<0||i.scale[1]<0)){var d=i.padding[0],g=i.padding[1],y=i.padding[2],v=i.padding[3];i.scale[0]<0&&(g=-g,v=-v),i.scale[1]<0&&(d=-d,y=-y),p=[d,g,y,v]}var _=this.pixelRatio;this.instructions.push([$f.DRAW_IMAGE,s,L,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,p==Pn?Pn:p.map(function(t){return t*_}),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,c]);var m=1/_;this.hitDetectionInstructions.push([$f.DRAW_IMAGE,s,L,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,void 0,this.declutterImageWithText_,p,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,c]),this.endGeometry(e)}else{if(!yt(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(u=t.getFlatCoordinates(),"LineString"==a)x=[u.length];else if("MultiLineString"==a)x=t.getEnds();else if("Polygon"==a)x=t.getEnds().slice(0,1);else if("MultiPolygon"==a){var b=t.getEndss();x=[];for(var w=0,E=b.length;w<E;++w)x.push(b[w][0])}this.beginGeometry(t,e);for(var C=i.textAlign,S=0,P=void 0,I=0,M=x.length;I<M;++I){if(null==C){var O=dp(i.maxAngle,u,S,x[I],l);S=O[0],P=O[1]}else P=x[I];for(var w=S;w<P;w+=l)o.push(u[w],u[w+1]);var L=o.length;S=x[I],this.drawChars_(s,L),s=L}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||Cn,justify:e.justify,textBaseline:e.textBaseline||Sn,scale:e.scale});var o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))},e.prototype.drawChars_=function(t,e){var n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,o=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,u=yp[r.textBaseline],l=this.textOffsetY_*a,c=this.text_,h=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([$f.DRAW_CHARS,t,e,u,r.overflow,s,r.maxAngle,a,l,i,h*a,c,o,1]),this.hitDetectionInstructions.push([$f.DRAW_CHARS,t,e,u,r.overflow,s,r.maxAngle,1,l,i,h,c,o,1/a])},e.prototype.setTextStyle=function(t,e){var n,r,i;if(t){var o=t.getFill();o?((r=this.textFillState_)||(r={},this.textFillState_=r),r.fillStyle=Pf(o.getColor()||mn)):(r=null,this.textFillState_=r);var s=t.getStroke();if(s){(i=this.textStrokeState_)||(i={},this.textStrokeState_=i);var a=s.getLineDash(),u=s.getLineDashOffset(),l=s.getWidth(),c=s.getMiterLimit();i.lineCap=s.getLineCap()||xn,i.lineDash=a?a.slice():bn,i.lineDashOffset=void 0===u?0:u,i.lineJoin=s.getLineJoin()||wn,i.lineWidth=void 0===l?1:l,i.miterLimit=void 0===c?10:c,i.strokeStyle=Pf(s.getColor()||En)}else i=null,this.textStrokeState_=i;n=this.textState_;var h=t.getFont()||_n;kn(h);var f=t.getScaleArray();n.overflow=t.getOverflow(),n.font=h,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||Sn,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Pn,n.scale=void 0===f?[1,1]:f;var d=t.getOffsetX(),g=t.getOffsetY(),y=t.getRotateWithView(),v=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0===v?0:v,this.strokeKey_=i?("string"==typeof i.strokeStyle?i.strokeStyle:p(i.strokeStyle))+i.lineCap+i.lineDashOffset+"|"+i.lineWidth+i.lineJoin+i.miterLimit+"["+i.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+p(r.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(np),_p={Circle:hp,Default:np,Image:op,LineString:up,Polygon:hp,Text:vp},mp=function(){function t(t,e,n,r){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var n=this.buildersByZIndex_[e];for(var r in n){var i=n[r].finish();t[e][r]=i}}return t},t.prototype.getBuilder=function(t,e){var n=void 0!==t?t.toString():"0",r=this.buildersByZIndex_[n];void 0===r&&(r={},this.buildersByZIndex_[n]=r);var i=r[e];void 0===i&&(i=new(0,_p[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[e]=i);return i},t}(),xp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bp=function(t){function e(e){var n=t.call(this)||this;return n.ready=!0,n.boundHandleImageChange_=n.handleImageChange_.bind(n),n.layer_=e,n.declutterExecutorGroup=null,n}return xp(e,t),e.prototype.getFeatures=function(t){return h()},e.prototype.getData=function(t){return null},e.prototype.prepareFrame=function(t){return h()},e.prototype.renderFrame=function(t,e){return h()},e.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},e.prototype.createLoadedTileFinder=function(t,e,n){return function(r,i){var o=this.loadedTileCallback.bind(this,n,r);return t.forEachLoadedTile(e,r,i,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){},e.prototype.getDataAtPixel=function(t,e,n){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===bf&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=bf&&e!=wf&&t.addEventListener(Qt,this.boundHandleImageChange_),e==mf&&(t.load(),e=t.getState()),e==bf},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()},e.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},e}(ye),wp=bp,Ep=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cp=[],Sp=null;var Pp=function(t){function e(e){var n=t.call(this,e)||this;return n.container=null,n.renderedResolution,n.tempTransform=[1,0,0,1,0,0],n.pixelTransform=[1,0,0,1,0,0],n.inversePixelTransform=[1,0,0,1,0,0],n.context=null,n.containerReused=!1,n.pixelContext_=null,n.frameState=null,n}return Ep(e,t),e.prototype.getImageData=function(t,e,n){var r,i;Sp||((r=document.createElement("canvas")).width=1,r.height=1,Sp=r.getContext("2d")),Sp.clearRect(0,0,1,1);try{Sp.drawImage(t,e,n,1,1,0,0,1,1),i=Sp.getImageData(0,0,1,1).data}catch(t){return Sp=null,null}return i},e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,n){var r,i,o=this.getLayer().getClassName();t&&t.className===o&&(!n||t&&t.style.backgroundColor&&a(Ft(t.style.backgroundColor),Ft(n)))&&((u=t.firstElementChild)instanceof HTMLCanvasElement&&(i=u.getContext("2d")));if(i&&i.canvas.style.transform===e?(this.container=t,this.context=i,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(r=document.createElement("div")).className=o;var s=r.style;s.position="absolute",s.width="100%",s.height="100%";var u=(i=hn()).canvas;r.appendChild(u),(s=u.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=r,this.context=i}this.containerReused||!n||this.container.style.backgroundColor||(this.container.style.backgroundColor=n)},e.prototype.clipUnrotated=function(t,e,n){var r=pt(n),i=dt(n),o=st(n),s=ot(n);O(e.coordinateToPixelTransform,r),O(e.coordinateToPixelTransform,i),O(e.coordinateToPixelTransform,o),O(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;O(a,r),O(a,i),O(a,o),O(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,n){var r=this.getLayer();if(r.hasListener(t)){var i=new nn(t,this.inversePixelTransform,n,e);r.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(Te,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ne,t,e)},e.prototype.getRenderTransform=function(t,e,n,r,i,o,s){var a=i/2,u=o/2,l=r/e,c=-l,h=-t[0]+s,f=-t[1];return L(this.tempTransform,a,u,l,c,-n,h,f)},e.prototype.getDataAtPixel=function(t,e,n){var r=O(this.inversePixelTransform,t.slice()),i=this.context,o=this.getLayer().getExtent();if(o&&!U(o,O(e.pixelToCoordinateTransform,t.slice())))return null;var s,a=Math.round(r[0]),u=Math.round(r[1]),l=this.pixelContext_;if(!l){var c=document.createElement("canvas");c.width=1,c.height=1,l=c.getContext("2d"),this.pixelContext_=l}l.clearRect(0,0,1,1);try{l.drawImage(i.canvas,a,u,1,1,0,0,1,1),s=l.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):s}return 0===s[3]?null:s},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(wp),Ip=Pp;function Mp(t,e,n,r,i,o,s,a,u,l,c,h){var f=t[e],p=t[e+1],d=0,g=0,y=0,v=0;function _(){d=f,g=p,f=t[e+=r],p=t[e+1],v+=y,y=Math.sqrt((f-d)*(f-d)+(p-g)*(p-g))}do{_()}while(e<n-r&&v+y<o);for(var m=0===y?0:(o-v)/y,x=Mt(d,f,m),b=Mt(g,p,m),w=e-r,E=v,C=o+a*u(l,i,c);e<n-r&&v+y<C;)_();var S,P=Mt(d,f,m=0===y?0:(C-v)/y),I=Mt(g,p,m);if(h){var M=[x,b,P,I];Yi(M,0,4,2,h,M,M),S=M[0]>M[2]}else S=x>P;var O,L=Math.PI,R=[],k=w+r===e;if(y=0,v=E,f=t[e=w],p=t[e+1],k){_(),O=Math.atan2(p-g,f-d),S&&(O+=O>0?-L:L);var T=(P+x)/2,N=(I+b)/2;return R[0]=[T,N,(C-o)/2,O,i],R}for(var A=0,D=(i=i.replace(/\n/g," ")).length;A<D;){_();var F=Math.atan2(p-g,f-d);if(S&&(F+=F>0?-L:L),void 0!==O){var j=F-O;if(j+=j>L?-2*L:j<-L?2*L:0,Math.abs(j)>s)return null}O=F;for(var G=A,B=0;A<D;++A){var z=a*u(l,i[S?D-A-1:A],c);if(e+r<n&&v+y<o+B+z/2)break;B+=z}if(A!==G){var V=S?i.substring(D-G,D-A):i.substring(G,A);T=Mt(d,f,m=0===y?0:(o+B/2-v)/y),N=Mt(g,p,m);R.push([T,N,B/2,F,V]),o+=B}}return R}function Op(t,e,n,r){for(var i=t[e],o=t[e+1],s=0,a=e+r;a<n;a+=r){var u=t[a],l=t[a+1];s+=Math.sqrt((u-i)*(u-i)+(l-o)*(l-o)),i=u,o=l}return s}var Lp=[1/0,1/0,-1/0,-1/0],Rp=[],kp=[],Tp=[],Np=[];function Ap(t){return t[3].declutterBox}var Dp=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Fp(t,e){return"start"!==e&&"end"!==e||Dp.test(t)||(e="start"===e?"left":"right"),yp[e]}function jp(t,e,n){return n>0&&t.push("\n",""),t.push(e,""),t}var Gp=function(){function t(t,e,n,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,n,r){var i=t+e+n+r;if(this.labels_[i])return this.labels_[i];var o=r?this.strokeStates[r]:null,s=n?this.fillStates[n]:null,a=this.textStates[e],u=this.pixelRatio,l=[a.scale[0]*u,a.scale[1]*u],c=Array.isArray(t),h=a.justify?yp[a.justify]:Fp(Array.isArray(t)?t[0]:t,a.textAlign||Cn),f=r&&o.lineWidth?o.lineWidth:0,p=c?t:t.split("\n").reduce(jp,[]),d=function(t,e){for(var n=[],r=[],i=[],o=0,s=0,a=0,u=0,l=0,c=e.length;l<=c;l+=2){var h=e[l];if("\n"!==h&&l!==c){var f=e[l+1]||t.font,p=An(f,h);n.push(p),s+=p;var d=Tn(f);r.push(d),u=Math.max(u,d)}else o=Math.max(o,s),i.push(s),s=0,a+=u}return{width:o,height:a,widths:n,heights:r,lineWidths:i}}(a,p),g=d.width,y=d.height,v=d.widths,_=d.heights,m=d.lineWidths,x=g+f,w=[],E=(x+2)*l[0],C=(y+f)*l[1],S={width:E<0?Math.floor(E):Math.ceil(E),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:w};(1==l[0]&&1==l[1]||w.push("scale",l),r)&&(w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",f),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit),(b?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset)));n&&w.push("fillStyle",s.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var P,I=.5-h,M=h*x+I*f,O=[],L=[],R=0,k=0,T=0,N=0,A=0,D=p.length;A<D;A+=2){var F=p[A];if("\n"!==F){var j=p[A+1]||a.font;j!==P&&(r&&O.push("font",j),n&&L.push("font",j),P=j),R=Math.max(R,_[T]);var G=[F,M+I*v[T]+h*(v[T]-m[N]),.5*(f+R)+k];M+=v[T],r&&O.push("strokeText",G),n&&L.push("fillText",G),++T}else k+=R,R=0,M=h*x+I*f,++N}return Array.prototype.push.apply(w,O),Array.prototype.push.apply(w,L),this.labels_[i]=S,S},t.prototype.replayTextBackground_=function(t,e,n,r,i,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,n,r,i,o,s,a,u,l,c,h,f,p,d,g){var y,v=n-(s*=h[0]),_=r-(a*=h[1]),m=i+u>t?t-u:i,x=o+l>e?e-l:o,b=p[3]+m*h[0]+p[1],w=p[0]+x*h[1]+p[2],E=v-p[3],C=_-p[0];return(d||0!==c)&&(Rp[0]=E,Np[0]=E,Rp[1]=C,kp[1]=C,kp[0]=E+b,Tp[0]=kp[0],Tp[1]=C+w,Np[1]=Tp[1]),0!==c?(O(y=L([1,0,0,1,0,0],n,r,1,1,c,-n,-r),Rp),O(y,kp),O(y,Tp),O(y,Np),H(Math.min(Rp[0],kp[0],Tp[0],Np[0]),Math.min(Rp[1],kp[1],Tp[1],Np[1]),Math.max(Rp[0],kp[0],Tp[0],Np[0]),Math.max(Rp[1],kp[1],Tp[1],Np[1]),Lp)):H(Math.min(E,E+b),Math.min(C,C+w),Math.max(E,E+b),Math.max(C,C+w),Lp),f&&(v=Math.round(v),_=Math.round(_)),{drawImageX:v,drawImageY:_,drawImageW:m,drawImageH:x,originX:u,originY:l,declutterBox:{minX:Lp[0],minY:Lp[1],maxX:Lp[2],maxY:Lp[3],value:g},canvasTransform:y,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,n,r,i,o,s){var a=!(!o&&!s),u=r.declutterBox,l=t.canvas,c=s?s[2]*r.scale[0]/2:0;return u.minX-c<=l.width/e&&u.maxX+c>=0&&u.minY-c<=l.height/e&&u.maxY+c>=0&&(a&&this.replayTextBackground_(t,Rp,kp,Tp,Np,o,s),Fn(t,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=O(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,n,r){var i=this.textStates[e],o=this.createLabel(t,e,r,n),s=this.strokeStates[n],a=this.pixelRatio,u=Fp(Array.isArray(t)?t[0]:t,i.textAlign||Cn),l=yp[i.textBaseline||Sn],c=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:u*(o.width/a-2*i.scale[0])+2*(.5-u)*c,anchorY:l*o.height/a+2*(.5-l)*c}},t.prototype.execute_=function(t,e,n,r,i,o,s,u){var l,c,h;this.pixelCoordinates_&&a(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=qi(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),c=this.renderedTransform_,h=n,c[0]=h[0],c[1]=h[1],c[2]=h[2],c[3]=h[3],c[4]=h[4],c[5]=h[5]);for(var f,p,d,g,y,v,_,m,x,b,w,E,C,S,P,I,M=0,O=r.length,L=0,R=0,k=0,T=null,N=null,A=this.coordinateCache_,D=this.viewRotation_,F=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:D},G=this.instructions!=r||this.overlaps?0:200;M<O;){var B=r[M];switch(B[0]){case $f.BEGIN_GEOMETRY:C=B[1],I=B[3],C.getGeometry()?void 0===s||yt(s,I.getExtent())?++M:M=B[2]+1:M=B[2];break;case $f.BEGIN_PATH:R>G&&(this.fill_(t),R=0),k>G&&(t.stroke(),k=0),R||k||(t.beginPath(),g=NaN,y=NaN),++M;break;case $f.CIRCLE:var z=l[L=B[1]],V=l[L+1],U=l[L+2]-z,W=l[L+3]-V,X=Math.sqrt(U*U+W*W);t.moveTo(z+X,V),t.arc(z,V,X,0,2*Math.PI,!0),++M;break;case $f.CLOSE_PATH:t.closePath(),++M;break;case $f.CUSTOM:L=B[1],f=B[2];var q=B[3],Y=B[4],H=6==B.length?B[5]:void 0;j.geometry=q,j.feature=C,M in A||(A[M]=[]);var Z=A[M];H?H(l,L,f,2,Z):(Z[0]=l[L],Z[1]=l[L+1],Z.length=2),Y(Z,j),++M;break;case $f.DRAW_IMAGE:L=B[1],f=B[2],m=B[3],p=B[4],d=B[5];var K=B[6],J=B[7],$=B[8],Q=B[9],tt=B[10],et=B[11],nt=B[12],rt=B[13],it=B[14],ot=B[15];if(!m&&B.length>=20){x=B[19],b=B[20],w=B[21],E=B[22];var st=this.drawLabelWithPointPlacement_(x,b,w,E);m=st.label,B[3]=m;var at=B[23];p=(st.anchorX-at)*this.pixelRatio,B[4]=p;var ut=B[24];d=(st.anchorY-ut)*this.pixelRatio,B[5]=d,K=m.height,B[6]=K,rt=m.width,B[13]=rt}var lt=void 0;B.length>25&&(lt=B[25]);var ct=void 0,ht=void 0,ft=void 0;B.length>17?(ct=B[16],ht=B[17],ft=B[18]):(ct=Pn,ht=!1,ft=!1),tt&&F?et+=D:tt||F||(et-=D);for(var pt=0;L<f;L+=2)if(!(lt&<[pt++]<rt/this.pixelRatio)){var dt=[t,e,m,Vt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[L],l[L+1],rt,K,p,d,$,Q,et,nt,i,ct,ht||ft,C),J,ht?T:null,ft?N:null];if(u){if("none"===it)continue;if("obstacle"===it){u.insert(Vt.declutterBox);continue}var gt=void 0,vt=void 0;if(ot){var _t=f-L;if(!ot[_t]){ot[_t]=dt;continue}if(gt=ot[_t],delete ot[_t],vt=Ap(gt),u.collides(vt))continue}if(u.collides(Vt.declutterBox))continue;gt&&(u.insert(vt),this.replayImageOrLabel_.apply(this,gt)),u.insert(Vt.declutterBox)}this.replayImageOrLabel_.apply(this,dt)}++M;break;case $f.DRAW_CHARS:var mt=B[1],xt=B[2],bt=B[3],wt=B[4];E=B[5];var Et=B[6],Ct=B[7],St=B[8];w=B[9];var Pt=B[10];x=B[11],b=B[12];var It=[B[13],B[13]],Mt=this.textStates[b],Ot=Mt.font,Lt=[Mt.scale[0]*Ct,Mt.scale[1]*Ct],Rt=void 0;Ot in this.widths_?Rt=this.widths_[Ot]:(Rt={},this.widths_[Ot]=Rt);var kt=Op(l,mt,xt,2),Tt=Math.abs(Lt[0])*Dn(Ot,x,Rt);if(wt||Tt<=kt){var Nt=this.textStates[b].textAlign,At=Mp(l,mt,xt,2,x,(kt-Tt)*yp[Nt],Et,Math.abs(Lt[0]),Dn,Ot,Rt,F?0:this.viewRotation_);t:if(At){var Dt=[],Ft=void 0,jt=void 0,Gt=void 0,Bt=void 0,zt=void 0;if(w)for(Ft=0,jt=At.length;Ft<jt;++Ft){Gt=(zt=At[Ft])[4],Bt=this.createLabel(Gt,b,"",w),p=zt[2]+(Lt[0]<0?-Pt:Pt),d=bt*Bt.height+2*(.5-bt)*Pt*Lt[1]/Lt[0]-St;var Vt=this.calculateImageOrLabelDimensions_(Bt.width,Bt.height,zt[0],zt[1],Bt.width,Bt.height,p,d,0,0,zt[3],It,!1,Pn,!1,C);if(u&&u.collides(Vt.declutterBox))break t;Dt.push([t,e,Bt,Vt,1,null,null])}if(E)for(Ft=0,jt=At.length;Ft<jt;++Ft){Gt=(zt=At[Ft])[4],Bt=this.createLabel(Gt,b,E,""),p=zt[2],d=bt*Bt.height-St;Vt=this.calculateImageOrLabelDimensions_(Bt.width,Bt.height,zt[0],zt[1],Bt.width,Bt.height,p,d,0,0,zt[3],It,!1,Pn,!1,C);if(u&&u.collides(Vt.declutterBox))break t;Dt.push([t,e,Bt,Vt,1,null,null])}u&&u.load(Dt.map(Ap));for(var Ut=0,Wt=Dt.length;Ut<Wt;++Ut)this.replayImageOrLabel_.apply(this,Dt[Ut])}}++M;break;case $f.END_GEOMETRY:if(void 0!==o){var Xt=o(C=B[1],I);if(Xt)return Xt}++M;break;case $f.FILL:G?R++:this.fill_(t),++M;break;case $f.MOVE_TO_LINE_TO:for(L=B[1],f=B[2],S=l[L],_=(P=l[L+1])+.5|0,(v=S+.5|0)===g&&_===y||(t.moveTo(S,P),g=v,y=_),L+=2;L<f;L+=2)v=(S=l[L])+.5|0,_=(P=l[L+1])+.5|0,L!=f-2&&v===g&&_===y||(t.lineTo(S,P),g=v,y=_);++M;break;case $f.SET_FILL_STYLE:T=B,this.alignFill_=B[2],R&&(this.fill_(t),R=0,k&&(t.stroke(),k=0)),t.fillStyle=B[1],++M;break;case $f.SET_STROKE_STYLE:N=B,k&&(t.stroke(),k=0),this.setStrokeStyle_(t,B),++M;break;case $f.STROKE:G?k++:t.stroke(),++M;break;default:++M}}R&&this.fill_(t),k&&t.stroke()},t.prototype.execute=function(t,e,n,r,i,o){this.viewRotation_=r,this.execute_(t,e,n,this.instructions,i,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,n,r,i){return this.viewRotation_=n,this.execute_(t,1,e,this.hitDetectionInstructions,!0,r,i)},t}(),Bp=Gp,zp=["Polygon","Circle","LineString","Image","Text","Default"],Vp=function(){function t(t,e,n,r,i,o){this.maxExtent_=t,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(i)}return t.prototype.clip=function(t,e){var n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var n=this.executorsByZIndex_[e];void 0===n&&(n={},this.executorsByZIndex_[e]=n);var r=t[e];for(var i in r){var o=r[i];n[i]=new Bp(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var n=this.executorsByZIndex_[e],r=0,i=t.length;r<i;++r)if(t[r]in n)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,n,r,i,o,s){var a=2*(i=Math.round(i))+1,u=L(this.hitDetectionTransform_,i+.5,i+.5,1/n,-1/n,-r,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=hn(a,a));var c,h=this.hitDetectionContext_;h.canvas.width!==a||h.canvas.height!==a?(h.canvas.width=a,h.canvas.height=a):l||h.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(tt(c=[1/0,1/0,-1/0,-1/0],t),B(c,n*(this.renderBuffer_+i),c));var f,p=function(t){if(void 0!==Up[t])return Up[t];for(var e=2*t+1,n=t*t,r=new Array(n+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var s=i*i+o*o;if(s>n)break;var a=r[s];a||(a=[],r[s]=a),a.push(4*((t+i)*e+(t+o))+3),i>0&&a.push(4*((t-i)*e+(t+o))+3),o>0&&(a.push(4*((t+i)*e+(t-o))+3),i>0&&a.push(4*((t-i)*e+(t-o))+3))}for(var u=[],l=(i=0,r.length);i<l;++i)r[i]&&u.push.apply(u,r[i]);return Up[t]=u,u}(i);function d(t,e){for(var n=h.getImageData(0,0,a,a).data,r=0,u=p.length;r<u;r++)if(n[p[r]]>0){if(!s||"Image"!==f&&"Text"!==f||-1!==s.indexOf(t)){var l=(p[r]-3)/4,c=i-l%a,d=i-(l/a|0),g=o(t,e,c*c+d*d);if(g)return g}h.clearRect(0,0,a,a);break}}var g,y,v,_,m,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(e),g=x.length-1;g>=0;--g){var b=x[g].toString();for(v=this.executorsByZIndex_[b],y=zp.length-1;y>=0;--y)if(void 0!==(_=v[f=zp[y]])&&(m=_.executeHitDetection(h,u,r,d,c)))return m}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],r=e[1],i=e[2],o=e[3],s=[n,r,n,o,i,o,i,r];return qi(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return Zt(this.executorsByZIndex_)},t.prototype.execute=function(t,n,r,i,o,s,a){var u=Object.keys(this.executorsByZIndex_).map(Number);u.sort(e),this.maxExtent_&&(t.save(),this.clip(t,r));var l,c,h,f,p,d,g=s||zp;for(a&&u.reverse(),l=0,c=u.length;l<c;++l){var y=u[l].toString();for(p=this.executorsByZIndex_[y],h=0,f=g.length;h<f;++h){void 0!==(d=p[g[h]])&&d.execute(t,n,r,i,o,a)}}this.maxExtent_&&t.restore()},t}(),Up={};var Wp=Vp,Xp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qp=function(t){function e(e,n,r,i,o,s,a){var u=t.call(this)||this;return u.context_=e,u.pixelRatio_=n,u.extent_=r,u.transform_=i,u.viewRotation_=o,u.squaredTolerance_=s,u.userTransform_=a,u.contextFillState_=null,u.contextStrokeState_=null,u.contextTextState_=null,u.fillState_=null,u.strokeState_=null,u.image_=null,u.imageAnchorX_=0,u.imageAnchorY_=0,u.imageHeight_=0,u.imageOpacity_=0,u.imageOriginX_=0,u.imageOriginY_=0,u.imageRotateWithView_=!1,u.imageRotation_=0,u.imageScale_=[0,0],u.imageWidth_=0,u.text_="",u.textOffsetX_=0,u.textOffsetY_=0,u.textRotateWithView_=!1,u.textRotation_=0,u.textScale_=[0,0],u.textFillState_=null,u.textStrokeState_=null,u.textState_=null,u.pixelCoordinates_=[],u.tmpLocalTransform_=[1,0,0,1,0,0],u}return Xp(e,t),e.prototype.drawImages_=function(t,e,n,r){if(this.image_){var i=qi(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var u=this.imageRotation_;this.imageRotateWithView_&&(u+=this.viewRotation_);for(var l=0,c=i.length;l<c;l+=2){var h=i[l]-this.imageAnchorX_,f=i[l+1]-this.imageAnchorY_;if(0!==u||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var p=h+this.imageAnchorX_,d=f+this.imageAnchorY_;L(s,p,d,1,1,u,-p,-d),o.setTransform.apply(o,s),o.translate(p,d),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,h,f,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=a)}},e.prototype.drawText_=function(t,e,n,r){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=qi(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<n;e+=r){var a=i[e]+this.textOffsetX_,u=i[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var l=L(this.tmpLocalTransform_,a,u,1,1,s,-a,-u);o.setTransform.apply(o,l),o.translate(a,u),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,a,u),this.textFillState_&&o.fillText(this.text_,a,u)}}},e.prototype.moveToLineTo_=function(t,e,n,r,i){var o=this.context_,s=qi(t,e,n,r,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;i&&(a-=2);for(var u=2;u<a;u+=2)o.lineTo(s[u],s[u+1]);return i&&o.closePath(),n},e.prototype.drawRings_=function(t,e,n,r){for(var i=0,o=n.length;i<o;++i)e=this.moveToLineTo_(t,e,n[i],r,!0);return e},e.prototype.drawCircle=function(t){if(yt(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,n){var r=t.getFlatCoordinates();if(r){var i=t.getStride();return qi(r,0,r.length,i,e,n)}return null}(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],r=e[3]-e[1],i=Math.sqrt(n*n+r*r),o=this.context_;o.beginPath(),o.arc(e[0],e[1],i,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var n=e.getGeometryFunction()(t);n&&yt(this.extent_,n.getExtent())&&(this.setStyle(e),this.drawGeometry(n))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),n=0,r=e.length;n<r;++n)this.drawGeometry(e[n])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),yt(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var r=t.getFlatMidpoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(yt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var n=this.context_,r=t.getFlatCoordinates(),i=0,o=t.getEnds(),s=t.getStride();n.beginPath();for(var a=0,u=o.length;a<u;++a)i=this.moveToLineTo_(r,i,o[a],s,!1);n.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),yt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var n=t.getFlatInteriorPoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),yt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getOrientedFlatCoordinates(),r=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=i.length;s<a;++s){var u=i[s];r=this.drawRings_(n,r,u,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(a(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,n=this.contextTextState_,r=t.textAlign?t.textAlign:Cn;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=r&&(n.textAlign=r,e.textAlign=r),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=r,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:r,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var n=this;if(t){var r=t.getColor();this.fillState_={fillStyle:Pf(r||mn)}}else this.fillState_=null;if(e){var i=e.getColor(),o=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),u=e.getLineJoin(),l=e.getWidth(),c=e.getMiterLimit(),h=s||bn;this.strokeState_={lineCap:void 0!==o?o:xn,lineDash:1===this.pixelRatio_?h:h.map(function(t){return t*n.pixelRatio_}),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==u?u:wn,lineWidth:(void 0!==l?l:1)*this.pixelRatio_,miterLimit:void 0!==c?c:10,strokeStyle:Pf(i||En)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var n=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*this.pixelRatio_,this.imageAnchorY_=n[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var n=e.getColor();this.textFillState_={fillStyle:Pf(n||mn)}}else this.textFillState_=null;var r=t.getStroke();if(r){var i=r.getColor(),o=r.getLineCap(),s=r.getLineDash(),a=r.getLineDashOffset(),u=r.getLineJoin(),l=r.getWidth(),c=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:xn,lineDash:s||bn,lineDashOffset:a||0,lineJoin:void 0!==u?u:wn,lineWidth:void 0!==l?l:1,miterLimit:void 0!==c?c:10,strokeStyle:Pf(i||En)}}else this.textStrokeState_=null;var h=t.getFont(),f=t.getOffsetX(),p=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation(),y=t.getScaleArray(),v=t.getText(),_=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==h?h:_n,textAlign:void 0!==_?_:Cn,textBaseline:void 0!==m?m:Sn},this.text_=void 0!==v?Array.isArray(v)?v.reduce(function(t,e,n){return t+(n%2?" ":e)},""):v:"",this.textOffsetX_=void 0!==f?this.pixelRatio_*f:0,this.textOffsetY_=void 0!==p?this.pixelRatio_*p:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*y[0],this.pixelRatio_*y[1]]}else this.text_=""},e}(Qf),Yp=qp,Hp="fraction",Zp="pixels",Kp="bottom-left",Jp="bottom-right",$p="top-left",Qp="top-right",td=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ed=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=r,o.resolution=n,o.state=i,o}return td(e,t),e.prototype.changed=function(){this.dispatchEvent(Qt)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return h()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){h()},e}($t),nd=ed,rd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,r,mf)||this;return a.src_=i,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=mf,a.imageLoadFunction_=s,a}rd(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=wf,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=ht(this.extent)/this.image_.height),this.state=bf,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=mf&&this.state!=wf||(this.state=xf,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=id(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=ht(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(nd);function id(t,e,n){var r=t,i=!0,o=!1,s=!1,a=[he(r,se,function(){s=!0,o||e()})];return r.src&&w?(o=!0,r.decode().then(function(){i&&e()}).catch(function(t){i&&(s?e():n())})):a.push(he(r,te,n)),function(){i=!1,a.forEach(fe)}}var od=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sd=null,ad=function(t){function e(e,n,r,i,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==i&&(a.image_.crossOrigin=i),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=r,a.src_=n,a.tainted_,a}return od(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===bf){sd||(sd=hn(1,1)),sd.drawImage(this.image_,0,0);try{sd.getImageData(0,0,1,1),this.tainted_=!1}catch(t){sd=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Qt)},e.prototype.handleImageError_=function(){this.imageState_=wf,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=bf,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],n=hn(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==mf){this.imageState_=xf;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=id(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===bf){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),n.globalCompositeOperation="multiply","multiply"===n.globalCompositeOperation||this.isTainted_())n.fillStyle=Nt(this.color_),n.fillRect(0,0,e.width/t,e.height/t),n.globalCompositeOperation="destination-in",n.drawImage(this.image_,0,0);else{for(var r=n.getImageData(0,0,e.width,e.height),i=r.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,u=this.color_[3],l=0,c=i.length;l<c;l+=4)i[l]*=o,i[l+1]*=s,i[l+2]*=a,i[l+3]*=u;n.putImageData(r,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}($t);var ud=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ld=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.opacity?r.opacity:1,o=void 0!==r.rotation?r.rotation:0,s=void 0!==r.scale?r.scale:1,a=void 0!==r.rotateWithView&&r.rotateWithView;(n=t.call(this,{opacity:i,rotation:o,scale:s,displacement:void 0!==r.displacement?r.displacement:[0,0],rotateWithView:a,declutterMode:r.declutterMode})||this).anchor_=void 0!==r.anchor?r.anchor:[.5,.5],n.normalizedAnchor_=null,n.anchorOrigin_=void 0!==r.anchorOrigin?r.anchorOrigin:$p,n.anchorXUnits_=void 0!==r.anchorXUnits?r.anchorXUnits:Hp,n.anchorYUnits_=void 0!==r.anchorYUnits?r.anchorYUnits:Hp,n.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null;var u=void 0!==r.img?r.img:null;n.imgSize_=r.imgSize;var l=r.src;P(!(void 0!==l&&u),4),P(!u||u&&n.imgSize_,5),void 0!==l&&0!==l.length||!u||(l=u.src||p(u)),P(void 0!==l&&l.length>0,6);var c=void 0!==r.src?mf:bf;return n.color_=void 0!==r.color?Ft(r.color):null,n.iconImage_=function(t,e,n,r,i,o){var s=Vt.get(e,r,o);return s||(s=new ad(t,e,n,r,i,o),Vt.set(e,r,o,s)),s}(u,l,void 0!==n.imgSize_?n.imgSize_:null,n.crossOrigin_,c,n.color_),n.offset_=void 0!==r.offset?r.offset:[0,0],n.offsetOrigin_=void 0!==r.offsetOrigin?r.offsetOrigin:$p,n.origin_=null,n.size_=void 0!==r.size?r.size:null,n}return ud(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==Hp||this.anchorYUnits_==Hp){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Hp&&(t[0]*=e[0]),this.anchorYUnits_==Hp&&(t[1]*=e[1])}if(this.anchorOrigin_!=$p){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Qp&&this.anchorOrigin_!=Jp||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Kp&&this.anchorOrigin_!=Jp||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var n=this.getDisplacement();return[t[0]-n[0],t[1]+n[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=$p){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),this.offsetOrigin_!=Qp&&this.offsetOrigin_!=Jp||(t[0]=n[0]-e[0]-t[0]),this.offsetOrigin_!=Kp&&this.offsetOrigin_!=Jp||(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(Qt,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Qt,t)},e}(Sf),cd=ld,hd=.5;var fd={Point:function(t,e,n,r,i){var o,s=n.getImage(),a=n.getText();if(s){if(s.getImageState()!=bf)return;var u=t;if(i){var l=s.getDeclutterMode();if("none"!==l)if(u=i,"obstacle"===l){var c=t.getBuilder(n.getZIndex(),"Image");c.setImageStyle(s,o),c.drawPoint(e,r)}else a&&a.getText()&&(o={})}var h=u.getBuilder(n.getZIndex(),"Image");h.setImageStyle(s,o),h.drawPoint(e,r)}if(a&&a.getText()){var f=t;i&&(f=i);var p=f.getBuilder(n.getZIndex(),"Text");p.setTextStyle(a,o),p.drawText(e,r)}},LineString:function(t,e,n,r,i){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawLineString(e,r)}var a=n.getText();if(a&&a.getText()){var u=(i||t).getBuilder(n.getZIndex(),"Text");u.setTextStyle(a),u.drawText(e,r)}},Polygon:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(o,s),a.drawPolygon(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}},MultiPoint:function(t,e,n,r,i){var o,s=n.getImage(),a=n.getText();if(s){if(s.getImageState()!=bf)return;var u=t;if(i){var l=s.getDeclutterMode();if("none"!==l)if(u=i,"obstacle"===l){var c=t.getBuilder(n.getZIndex(),"Image");c.setImageStyle(s,o),c.drawMultiPoint(e,r)}else a&&a.getText()&&(o={})}var h=u.getBuilder(n.getZIndex(),"Image");h.setImageStyle(s,o),h.drawMultiPoint(e,r)}if(a&&a.getText()){var f=t;i&&(f=i);var p=f.getBuilder(n.getZIndex(),"Text");p.setTextStyle(a,o),p.drawText(e,r)}},MultiLineString:function(t,e,n,r,i){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,r)}var a=n.getText();if(a&&a.getText()){var u=(i||t).getBuilder(n.getZIndex(),"Text");u.setTextStyle(a),u.drawText(e,r)}},MultiPolygon:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(s||o){var a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}},GeometryCollection:function(t,e,n,r,i){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o<s;++o){(0,fd[a[o].getType()])(t,a[o],n,r,i)}},Circle:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),"Circle");a.setFillStrokeStyle(o,s),a.drawCircle(e,r)}var u=n.getText();if(u&&u.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(u),l.drawText(e,r)}}};function pd(t,e){return parseInt(p(t),10)-parseInt(p(e),10)}function dd(t,e){return.5*t/e}function gd(t,e,n,r,i,o,s){var a=!1,u=n.getImage();if(u){var l=u.getImageState();l==bf||l==wf?u.unlistenImageChange(i):(l==mf&&u.load(),u.listenImageChange(i),a=!0)}return function(t,e,n,r,i,o){var s=n.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(r,i),u=n.getRenderer();if(u)yd(t,a,n,e);else{(0,fd[a.getType()])(t,a,n,e,o)}}(t,e,n,r,o,s),a}function yd(t,e,n,r){if("GeometryCollection"!=e.getType())t.getBuilder(n.getZIndex(),"Default").drawCustom(e,r,n.getRenderer(),n.getHitDetectionRenderer());else for(var i=e.getGeometries(),o=0,s=i.length;o<s;++o)yd(t,i[o],n,r)}var vd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_d=function(t){function n(e){var n=t.call(this,e)||this;return n.boundHandleStyleImageChange_=n.handleStyleImageChange_.bind(n),n.animatingOrInteracting_,n.hitDetectionImageData_=null,n.renderedFeatures_=null,n.renderedRevision_=-1,n.renderedResolution_=NaN,n.renderedExtent_=[1/0,1/0,-1/0,-1/0],n.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],n.renderedRotation_,n.renderedCenter_=null,n.renderedProjection_=null,n.renderedRenderOrder_=null,n.replayGroup_=null,n.replayGroupChanged=!0,n.declutterExecutorGroup=null,n.clipping=!0,n.compositionContext_=null,n.opacity_=1,n}return vd(n,t),n.prototype.renderWorlds=function(t,e,n){var r=e.extent,i=e.viewState,o=i.center,s=i.resolution,a=i.projection,u=i.rotation,l=a.getExtent(),c=this.getLayer().getSource(),h=e.pixelRatio,f=e.viewHints,p=!(f[Ar]||f[Dr]),d=this.compositionContext_,g=Math.round(e.size[0]*h),y=Math.round(e.size[1]*h),v=c.getWrapX()&&a.canWrapX(),_=v?gt(l):null,m=v?Math.ceil((r[2]-l[2])/_)+1:1,x=v?Math.floor((r[0]-l[0])/_):0;do{var b=this.getRenderTransform(o,s,u,h,g,y,x*_);t.execute(d,1,b,u,p,void 0,n)}while(++x<m)},n.prototype.setupCompositionContext_=function(){if(1!==this.opacity_){var t=hn(this.context.canvas.width,this.context.canvas.height,Cp);this.compositionContext_=t}else this.compositionContext_=this.context},n.prototype.releaseCompositionContext_=function(){if(1!==this.opacity_){var t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,fn(this.compositionContext_),Cp.push(this.compositionContext_.canvas),this.compositionContext_=null}},n.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())},n.prototype.renderFrame=function(t,e){var n=t.pixelRatio,r=t.layerStatesArray[t.layerIndex];!function(t,e,n){M(t,e,0,0,n,0,0)}(this.pixelTransform,1/n,1/n),R(this.inversePixelTransform,this.pixelTransform);var i=k(this.pixelTransform);this.useContainer(e,i,this.getBackground(t));var o=this.context,s=o.canvas,a=this.replayGroup_,u=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!u||u.isEmpty()))return null;var l=Math.round(t.size[0]*n),c=Math.round(t.size[1]*n);s.width!=l||s.height!=c?(s.width=l,s.height=c,s.style.transform!==i&&(s.style.transform=i)):this.containerReused||o.clearRect(0,0,l,c),this.preRender(o,t);var h=t.viewState,f=h.projection;this.opacity_=r.opacity,this.setupCompositionContext_();var p=!1,d=!0;if(r.extent&&this.clipping){var g=Oi(r.extent,f);(p=(d=yt(g,t.extent))&&!W(g,t.extent))&&this.clipUnrotated(this.compositionContext_,t,g)}return d&&this.renderWorlds(a,t),p&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(o,t),this.renderedRotation_!==h.rotation&&(this.renderedRotation_=h.rotation,this.hitDetectionImageData_=null),this.container},n.prototype.getFeatures=function(t){return new Promise(function(n){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var r=[this.context.canvas.width,this.context.canvas.height];O(this.pixelTransform,r);var i=this.renderedCenter_,o=this.renderedResolution_,s=this.renderedRotation_,a=this.renderedProjection_,u=this.wrappedRenderedExtent_,l=this.getLayer(),c=[],h=r[0]*hd,f=r[1]*hd;c.push(this.getRenderTransform(i,o,s,hd,h,f,0).slice());var p=l.getSource(),d=a.getExtent();if(p.getWrapX()&&a.canWrapX()&&!W(d,u)){for(var g=u[0],y=gt(d),v=0,_=void 0;g<d[0];)_=y*--v,c.push(this.getRenderTransform(i,o,s,hd,h,f,_).slice()),g+=y;for(v=0,g=u[2];g>d[2];)_=y*++v,c.push(this.getRenderTransform(i,o,s,hd,h,f,_).slice()),g-=y}this.hitDetectionImageData_=function(t,n,r,i,o,s,a){var u=hn(t[0]*hd,t[1]*hd);u.imageSmoothingEnabled=!1;for(var l=u.canvas,c=new Yp(u,hd,o,null,a),h=r.length,f=Math.floor(16777215/h),p={},d=1;d<=h;++d){var g=r[d-1],y=g.getStyleFunction()||i;if(i){var v=y(g,s);if(v){Array.isArray(v)||(v=[v]);for(var _="#"+("000000"+(d*f).toString(16)).slice(-6),m=0,x=v.length;m<x;++m){var b=v[m],w=b.getGeometryFunction()(g);if(w&&yt(o,w.getExtent())){var E=b.clone(),C=E.getFill();C&&C.setColor(_);var S=E.getStroke();S&&(S.setColor(_),S.setLineDash(null)),E.setText(void 0);var P=b.getImage();if(P&&0!==P.getOpacity()){var I=P.getImageSize();if(!I)continue;var M=hn(I[0],I[1],void 0,{alpha:!1}),O=M.canvas;M.fillStyle=_,M.fillRect(0,0,O.width,O.height),E.setImage(new cd({img:O,imgSize:I,anchor:P.getAnchor(),anchorXUnits:Zp,anchorYUnits:Zp,offset:P.getOrigin(),opacity:1,size:P.getSize(),scale:P.getScale(),rotation:P.getRotation(),rotateWithView:P.getRotateWithView()}))}var L=E.getZIndex()||0;(T=p[L])||(T={},p[L]=T,T.Polygon=[],T.Circle=[],T.LineString=[],T.Point=[]),T[w.getType().replace("Multi","")].push(w,E)}}}}}for(var R=Object.keys(p).map(Number).sort(e),k=(d=0,R.length);d<k;++d){var T=p[R[d]];for(var N in T){var A=T[N];for(m=0,x=A.length;m<x;m+=2){c.setStyle(A[m+1]);for(var D=0,F=n.length;D<F;++D)c.setTransform(n[D]),c.drawGeometry(A[m])}}}return u.getImageData(0,0,l.width,l.height)}(r,c,this.renderedFeatures_,l.getStyleFunction(),u,o,s)}n(function(t,e,n){var r=[];if(n){var i=Math.floor(Math.round(t[0])*hd),o=Math.floor(Math.round(t[1])*hd),s=4*(bt(i,0,n.width-1)+bt(o,0,n.height-1)*n.width),a=n.data[s],u=n.data[s+1],l=n.data[s+2]+256*(u+256*a),c=Math.floor(16777215/e.length);l&&l%c===0&&r.push(e[l/c-1])}return r}(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},n.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){var o=this;if(this.replayGroup_){var s,a=e.viewState.resolution,u=e.viewState.rotation,l=this.getLayer(),c={},h=function(t,e,n){var o=p(t),s=c[o];if(s){if(!0!==s&&n<s.distanceSq){if(0===n)return c[o]=!0,i.splice(i.lastIndexOf(s),1),r(t,l,e);s.geometry=e,s.distanceSq=n}}else{if(0===n)return c[o]=!0,r(t,l,e);i.push(c[o]={feature:t,layer:l,geometry:e,distanceSq:n,callback:r})}},f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some(function(r){return s=r.forEachFeatureAtCoordinate(t,a,u,n,h,r===o.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(function(t){return t.value}):null)}),s}},n.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},n.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},n.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource();if(!n)return!1;var r=t.viewHints[Ar],i=t.viewHints[Dr],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(this.ready&&!o&&r||!s&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var u=t.extent,l=t.viewState,c=l.projection,h=l.resolution,f=t.pixelRatio,p=e.getRevision(),d=e.getRenderBuffer(),g=e.getRenderOrder();void 0===g&&(g=pd);var y=l.center.slice(),v=B(u,d*h),_=v.slice(),m=[v.slice()],x=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!W(x,t.extent)){var b=gt(x),w=Math.max(gt(v)/2,b);v[0]=x[0]-w,v[2]=x[2]+w,Ke(y,c);var E=xt(m[0],c);E[0]<x[0]&&E[2]<x[2]?m.push([E[0]+b,E[1],E[2]+b,E[3]]):E[0]>x[0]&&E[2]>x[2]&&m.push([E[0]-b,E[1],E[2]-b,E[3]])}if(this.ready&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==g&&W(this.wrappedRenderedExtent_,v))return a(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var C,S=new mp(dd(h,f),v,h,f);this.getLayer().getDeclutter()&&(C=new mp(dd(h,f),v,h,f));var P,I=Si();if(I){for(var M=0,O=m.length;M<O;++M){var L=Mi(m[M],c);n.loadFeatures(L,Li(h,c),I)}P=vi(I,c)}else for(M=0,O=m.length;M<O;++M)n.loadFeatures(m[M],h,c);var R=function(t,e){var n=dd(t,e);return n*n}(h,f),k=!0,T=function(t){var n,r=t.getStyleFunction()||e.getStyleFunction();if(r&&(n=r(t,h)),n){var i=this.renderFeature(t,R,n,S,P,C);k=k&&!i}}.bind(this),N=Mi(v,c),A=n.getFeaturesInExtent(N);g&&A.sort(g);for(M=0,O=A.length;M<O;++M)T(A[M]);this.renderedFeatures_=A,this.ready=k;var D=S.finish(),F=new Wp(v,h,f,n.getOverlaps(),D,e.getRenderBuffer());return C&&(this.declutterExecutorGroup=new Wp(v,h,f,n.getOverlaps(),C.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=g,this.renderedExtent_=_,this.wrappedRenderedExtent_=v,this.renderedCenter_=y,this.renderedProjection_=c,this.replayGroup_=F,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},n.prototype.renderFeature=function(t,e,n,r,i,o){if(!n)return!1;var s=!1;if(Array.isArray(n))for(var a=0,u=n.length;a<u;++a)s=gd(r,t,n[a],e,this.boundHandleStyleImageChange_,i,o)||s;else s=gd(r,t,n,e,this.boundHandleStyleImageChange_,i,o);return s},n}(Ip),md=_d,xd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bd=function(t){function e(e){return t.call(this,e)||this}return xd(e,t),e.prototype.createRenderer=function(){return new md(this)},e}(qf),wd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ed=function(t){function e(e){var n=t.call(this)||this;n.projection=fi(e.projection),n.attributions_=Cd(e.attributions),n.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,n.loading=!1,n.state_=void 0!==e.state?e.state:"ready",n.wrapX_=void 0!==e.wrapX&&e.wrapX,n.interpolate_=!!e.interpolate,n.viewResolver=null,n.viewRejector=null;var r=n;return n.viewPromise_=new Promise(function(t,e){r.viewResolver=t,r.viewRejector=e}),n}return wd(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return h()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Cd(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(me);function Cd(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Sd=Ed;function Pd(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Id=!1;function Md(t,e){return function(n,r,i,o,s){var a=this;!function(t,e,n,r,i,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,r,i):t,!0),"arraybuffer"==e.getType()&&(a.responseType="arraybuffer"),a.withCredentials=Id,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=e.getType(),u=void 0;"json"==r||"text"==r?u=a.responseText:"xml"==r?(u=a.responseXML)||(u=(new DOMParser).parseFromString(a.responseText,"application/xml")):"arraybuffer"==r&&(u=a.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):s()}else s()},a.onerror=s,a.send()}(t,e,n,r,i,function(t,e){a.addFeatures(t),void 0!==o&&o(t)},s||c)}}var Od=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ld=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.feature=n,i.features=r,i}return Od(e,t),e}(Wt),Rd=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{attributions:r.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===r.wrapX||r.wrapX})||this).on,n.once,n.un,n.loader_=c,n.format_=r.format,n.overlaps_=void 0===r.overlaps||r.overlaps,n.url_=r.url,void 0!==r.loader?n.loader_=r.loader:void 0!==n.url_&&(P(n.format_,7),n.loader_=Md(n.url_,n.format_)),n.strategy_=void 0!==r.strategy?r.strategy:Pd;var i,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return n.featuresRtree_=s?new hf:null,n.loadedExtentsRtree_=new hf,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(i=r.features).getArray()),s||void 0!==i||(i=new Yn(o)),void 0!==o&&n.addFeaturesInternal(o),void 0!==i&&n.bindFeaturesCollection_(i),n}return Od(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=p(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var r=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Ld(ff,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[ce(e,Qt,this.handleFeatureChange_,this),ce(e,Xt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,r=e.getId();return void 0!==r&&(r.toString()in this.idIndex_?n=!1:this.idIndex_[r.toString()]=e),n&&(P(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],r=[],i=0,o=t.length;i<o;i++){var s=p(u=t[i]);this.addToIndex_(s,u)&&n.push(u)}i=0;for(var a=n.length;i<a;i++){var u;s=p(u=n[i]);this.setupChangeEvents_(s,u);var l=u.getGeometry();if(l){var c=l.getExtent();e.push(c),r.push(u)}else this.nullGeometryFeatures_[s]=u}if(this.featuresRtree_&&this.featuresRtree_.load(e,r),this.hasListener(ff)){i=0;for(var h=n.length;i<h;i++)this.dispatchEvent(new Ld(ff,n[i]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(ff,function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener(gf,function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener(zn,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(Vn,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(fe)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var n=function(t){this.removeFeatureInternal(t)}.bind(this);for(var r in this.featuresRtree_.forEach(n),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new Ld(df);this.dispatchEvent(i),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(n){return n.getGeometry().intersectsCoordinate(t)?e(n):void 0})},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,function(n){if(n.getGeometry().intersectsExtent(t)){var r=e(n);if(r)return r}})},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Zt(this.nullGeometryFeatures_)||s(t,Ht(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,function(t){e.push(t)}),e},e.prototype.getFeaturesInExtent=function(t,e){var n=this;if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);var r=function(t,e){if(e.canWrapX()){var n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];xt(t,e);var r=gt(n);if(gt(t)>r)return[[n[0],t[1],n[2],t[3]]];if(t[0]<n[0])return[[t[0]+r,t[1],n[2],t[3]],[n[0],t[1],t[2],t[3]]];if(t[2]>n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}(t,e);return[].concat.apply([],r.map(function(t){return n.featuresRtree_.getInExtent(t)}))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var n=t[0],r=t[1],i=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||u;return this.featuresRtree_.forEachInExtent(a,function(t){if(l(t)){var e=t.getGeometry(),u=s;if((s=e.closestPointXY(n,r,o,s))<u){i=t;var c=Math.sqrt(s);a[0]=n-c,a[1]=r-c,a[2]=n+c,a[3]=r+c}}}),i},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,n=p(e),r=e.getGeometry();if(r){var i=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(i,e)):this.featuresRtree_&&this.featuresRtree_.update(i,e)}else n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);var o=e.getId();if(void 0!==o){var s=o.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new Ld(pf,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:p(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Zt(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()},e.prototype.loadFeatures=function(t,e,n){for(var r=this.loadedExtentsRtree_,i=this.strategy_(t,e,n),o=function(t,o){var a=i[t],u=r.forEachInExtent(a,function(t){return W(t.extent,a)});u||(++s.loadingExtentsCount_,s.dispatchEvent(new Ld(yf)),s.loader_.call(s,a,e,n,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Ld(vf,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Ld(_f))}.bind(s)),r.insert(a,{extent:a.slice()}))},s=this,a=0,u=i.length;a<u;++a)o(a);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,n=this.loadedExtentsRtree_;n.forEachInExtent(t,function(n){if($(n.extent,t))return e=n,!0}),e&&n.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=p(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}},e.prototype.removeFeatureInternal=function(t){var e=p(t),n=this.featureChangeKeys_[e];if(n){n.forEach(fe),delete this.featureChangeKeys_[e];var r=t.getId();return void 0!==r&&delete this.idIndex_[r.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Ld(gf,t)),t}},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){P(this.format_,7),this.url_=t,this.setLoader(Md(t,this.format_))},e}(Sd),kd=Rd,Td=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nd=[0,0,0,0],Ad=[],Dd="modifystart",Fd="modifyend",jd=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.features=n,i.mapBrowserEvent=r,i}return Td(e,t),e}(Wt),Gd=function(t){function e(e){var n,r=t.call(this,e)||this;if(r.on,r.once,r.un,r.boundHandleFeatureChange_=r.handleFeatureChange_.bind(r),r.condition_=e.condition?e.condition:Gs,r.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==or.SINGLECLICK}(t)},r.deleteCondition_=e.deleteCondition?e.deleteCondition:r.defaultDeleteCondition_,r.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Ts,r.vertexFeature_=null,r.vertexSegments_=null,r.lastPixel_=[0,0],r.ignoreNextSingleClick_=!1,r.featuresBeingModified_=null,r.rBush_=new hf,r.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,r.snappedToVertex_=!1,r.changingFeature_=!1,r.dragSegments_=[],r.overlay_=new bd({source:new kd({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Ud(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r)},r.source_=null,r.hitDetection_=null,e.features?n=e.features:e.source&&(r.source_=e.source,n=new Yn(r.source_.getFeatures()),r.source_.addEventListener(ff,r.handleSourceAdd_.bind(r)),r.source_.addEventListener(gf,r.handleSourceRemove_.bind(r))),!n)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(r.hitDetection_=e.hitDetection),r.features_=n,r.features_.forEach(r.addFeature_.bind(r)),r.features_.addEventListener(zn,r.handleFeatureAdd_.bind(r)),r.features_.addEventListener(Vn,r.handleFeatureRemove_.bind(r)),r.lastPointerEvent_=null,r.delta_=[0,0],r.snapToPointer_=void 0===e.snapToPointer?!r.hitDetection_:e.snapToPointer,r}return Td(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var n=this.SEGMENT_WRITERS_[e.getType()];n&&n(t,e)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,r),t.addEventListener(Qt,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Yn;for(var n=this.featuresBeingModified_.getArray(),r=0,i=e.length;r<i;++r)for(var o=e[r],s=0,a=o.length;s<a;++s){var u=o[s].feature;u&&-1===n.indexOf(u)&&this.featuresBeingModified_.push(u)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new jd(Dd,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(Qt,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,n=[];e.forEach(function(e){t===e.feature&&n.push(e)});for(var r=n.length-1;r>=0;--r){for(var i=n[r],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var n=e.getCoordinates(),r={feature:t,geometry:e,segment:[n,n]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r){var o=n[r],s={feature:t,geometry:e,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r){var o=n.slice(r,r+2),s={feature:t,geometry:e,index:r,segment:o};this.rBush_.insert(G(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var u=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:u};this.rBush_.insert(G(u),l)}},e.prototype.writePolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var u=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:u};this.rBush_.insert(G(u),l)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length;s<a;++s)for(var u=o[s],l=0,c=u.length-1;l<c;++l){var h=u.slice(l,l+2),f={feature:t,geometry:e,depth:[s,r],index:l,segment:h};this.rBush_.insert(G(h),f)}},e.prototype.writeCircleGeometry_=function(t,e){var n=e.getCenter(),r={feature:t,geometry:e,index:0,segment:[n,n]},i={feature:t,geometry:e,index:1,segment:[n,n]},o=[r,i];r.featureSegments=o,i.featureSegments=o,this.rBush_.insert(K(n),r);var s=e,a=Si();if(a&&this.getMap()){var u=this.getMap().getView().getProjection();s=Xo(s=s.clone().transform(a,u)).transform(u,a)}this.rBush_.insert(s.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=n[r];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,n){var r=this.vertexFeature_;r?r.getGeometry().setCoordinates(t):(r=new Na(new Io(t)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r));return r.set("features",e),r.set("geometries",n),r},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=or.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(n=!(e.type!=or.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==or.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!n);var n},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],n=[],r=[],i=0,o=this.dragSegments_.length;i<o;++i){var s=this.dragSegments_[i],a=s[0],u=a.feature;-1===n.indexOf(u)&&n.push(u);var l=a.geometry;-1===r.indexOf(l)&&r.push(l);for(var c=a.depth,h=void 0,f=a.segment,p=s[1];e.length<l.getStride();)e.push(f[p][e.length]);switch(l.getType()){case"Point":h=e,f[0]=e,f[1]=e;break;case"MultiPoint":(h=l.getCoordinates())[a.index]=e,f[0]=e,f[1]=e;break;case"LineString":(h=l.getCoordinates())[a.index+p]=e,f[p]=e;break;case"MultiLineString":case"Polygon":(h=l.getCoordinates())[c[0]][a.index+p]=e,f[p]=e;break;case"MultiPolygon":(h=l.getCoordinates())[c[1]][c[0]][a.index+p]=e,f[p]=e;break;case"Circle":if(f[0]=e,f[1]=e,0===a.index)this.changingFeature_=!0,l.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;var d=t.map.getView().getProjection(),g=Ze(Ii(l.getCenter(),d),Ii(e,d)),y=Si();if(y){var v=l.clone().transform(y,d);v.setRadius(g),g=v.transform(d,y).getRadius()}l.setRadius(g),this.changingFeature_=!1}}h&&this.setGeometryCoordinates_(l,h)}this.createOrUpdateVertexFeature_(e,n,r)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var n=this.vertexFeature_;if(n){var r=t.map.getView().getProjection(),i=[],o=n.getGeometry().getCoordinates(),s=G([o]),a=this.rBush_.getInExtent(s),u={};a.sort(Bd);for(var l=0,c=a.length;l<c;++l){var h=a[l],f=h.segment,d=p(h.geometry),g=h.depth;if(g&&(d+="-"+g.join("-")),u[d]||(u[d]=new Array(2)),"Circle"!==h.geometry.getType()||1!==h.index)if(!Xe(f[0],o)||u[d][0])if(!Xe(f[1],o)||u[d][1])p(f)in this.vertexSegments_&&!u[d][0]&&!u[d][1]&&this.insertVertexCondition_(t)&&i.push(h);else{if(u[d][0]&&0===u[d][0].index){var y=h.geometry.getCoordinates();switch(h.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":y=y[g[1]];case"Polygon":if(h.index!==y[g[0]].length-2)continue}}this.dragSegments_.push([h,1]),u[d][1]=h}else this.dragSegments_.push([h,0]),u[d][0]=h;else Xe(Vd(e,h,r),o)&&!u[d][0]&&(this.dragSegments_.push([h,0]),u[d][0]=h)}i.length&&this.willModifyFeatures_(t,[i]);for(var v=i.length-1;v>=0;--v)this.insertVertex_(i[v],o)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var n=this.dragSegments_[e][0],r=n.geometry;if("Circle"===r.getType()){var i=r.getCenter(),o=n.featureSegments[0],s=n.featureSegments[1];o.segment[0]=i,o.segment[1]=i,s.segment[0]=i,s.segment[1]=i,this.rBush_.update(K(i),o);var a=r,u=Si();if(u){var l=t.map.getView().getProjection();a=Xo(a=a.clone().transform(u,l)).transform(l,u)}this.rBush_.update(a.getExtent(),s)}else this.rBush_.update(G(n.segment),n)}return this.featuresBeingModified_&&(this.dispatchEvent(new jd(Fd,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,n){var r,i,o=this,s=n||e.getCoordinateFromPixel(t),a=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===o.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,function(t,e,n){if("Point"===(n=n||t.getGeometry()).getType()&&(a=o.features_.getArray(),u=t,a.indexOf(u)>=0)){i=n;var s=n.getFlatCoordinates().slice(0,2);r=[{feature:t,geometry:n,segment:[s,s]}]}var a,u;return!0},{layerFilter:u})}if(!r){var l=Mi(B(Oi(K(s,Nd),a),e.getView().getResolution()*this.pixelTolerance_,Nd),a);r=this.rBush_.getInExtent(l)}if(r&&r.length>0){var c=r.sort(function(t,e){return zd(s,t,a)-zd(s,e,a)})[0],h=c.segment,f=Vd(s,c,a),d=e.getPixelFromCoordinate(f),g=Ze(t,d);if(i||g<=this.pixelTolerance_){var y={};if(y[p(h)]=!0,this.snapToPointer_||(this.delta_[0]=f[0]-s[0],this.delta_[1]=f[1]-s[1]),"Circle"===c.geometry.getType()&&1===c.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);else{var v=e.getPixelFromCoordinate(h[0]),_=e.getPixelFromCoordinate(h[1]),m=He(d,v),x=He(d,_);g=Math.sqrt(Math.min(m,x)),this.snappedToVertex_=g<=this.pixelTolerance_,this.snappedToVertex_&&(f=m>x?h[1]:h[0]),this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);var b={};b[p(c.geometry)]=!0;for(var w=1,E=r.length;w<E;++w){var C=r[w].segment;if(!(Xe(h[0],C[0])&&Xe(h[1],C[1])||Xe(h[0],C[1])&&Xe(h[1],C[0])))break;var S=p(r[w].geometry);S in b||(b[S]=!0,y[p(C)]=!0)}}return void(this.vertexSegments_=y)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var n,r=t.segment,i=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case"MultiLineString":case"Polygon":(n=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case"MultiPolygon":(n=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case"LineString":(n=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,n);var u=this.rBush_;u.remove(t),this.updateSegmentIndices_(o,a,s,1);var l={segment:[r[0],e],feature:i,geometry:o,depth:s,index:a};u.insert(G(l.segment),l),this.dragSegments_.push([l,1]);var c={segment:[e,r[1]],feature:i,geometry:o,depth:s,index:a+1};u.insert(G(c.segment),c),this.dragSegments_.push([c,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=or.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new jd(Fd,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,n,r,i,o,s,a,u,l,c,h=this.dragSegments_,f={},d=!1;for(i=h.length-1;i>=0;--i)c=p((l=(n=h[i])[0]).feature),l.depth&&(c+="-"+l.depth.join("-")),c in f||(f[c]={}),0===n[1]?(f[c].right=l,f[c].index=l.index):1==n[1]&&(f[c].left=l,f[c].index=l.index+1);for(c in f){switch(u=f[c].right,s=f[c].left,(a=(o=f[c].index)-1)<0&&(a=0),t=e=(r=(l=void 0!==s?s:u).geometry).getCoordinates(),d=!1,r.getType()){case"MultiLineString":e[l.depth[0]].length>2&&(e[l.depth[0]].splice(o,1),d=!0);break;case"LineString":e.length>2&&(e.splice(o,1),d=!0);break;case"MultiPolygon":t=t[l.depth[1]];case"Polygon":(t=t[l.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),d=!0,0===o&&(t.pop(),t.push(t[0]),a=t.length-1))}if(d){this.setGeometryCoordinates_(r,e);var g=[];if(void 0!==s&&(this.rBush_.remove(s),g.push(s.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==s&&void 0!==u){var y={depth:l.depth,feature:l.feature,geometry:l.geometry,index:a,segment:g};this.rBush_.insert(G(y.segment),y)}this.updateSegmentIndices_(r,o,l.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),h.length=0}}return d},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,n,r){this.rBush_.forEachInExtent(t.getExtent(),function(i){i.geometry===t&&(void 0===n||void 0===i.depth||a(i.depth,n))&&i.index>e&&(i.index+=r)})},e}(Os);function Bd(t,e){return t.index-e.index}function zd(t,e,n){var r=e.geometry;if("Circle"===r.getType()){var i=r;if(1===e.index){var o=Si();o&&(i=i.clone().transform(o,n));var s=He(i.getCenter(),Ii(t,n)),a=Math.sqrt(s)-i.getRadius();return a*a}}var u=Ii(t,n);return Ad[0]=Ii(e.segment[0],n),Ad[1]=Ii(e.segment[1],n),function(t,e){return He(t,We(t,e))}(u,Ad)}function Vd(t,e,n){var r=e.geometry;if("Circle"===r.getType()&&1===e.index){var i=r,o=Si();return o&&(i=i.clone().transform(o,n)),Pi(i.getClosestPoint(Ii(t,n)),n)}var s=Ii(t,n);return Ad[0]=Ii(e.segment[0],n),Ad[1]=Ii(e.segment[1],n),Pi(We(s,Ad),n)}function Ud(){var t=Bf();return function(e,n){return t.Point}}var Wd=Gd,Xd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function qd(t){return t.feature?t.feature:t.element?t.element:void 0}var Yd=[],Hd=function(t){function e(e){var n=this,r=e||{},i=r;return i.handleDownEvent||(i.handleDownEvent=u),i.stopDown||(i.stopDown=l),(n=t.call(this,i)||this).source_=r.source?r.source:null,n.vertex_=void 0===r.vertex||r.vertex,n.edge_=void 0===r.edge||r.edge,n.features_=r.features?r.features:null,n.featuresListenerKeys_=[],n.featureChangeListenerKeys_={},n.indexedFeaturesExtents_={},n.pendingFeatures_={},n.pixelTolerance_=void 0!==r.pixelTolerance?r.pixelTolerance:10,n.rBush_=new hf,n.GEOMETRY_SEGMENTERS_={Point:n.segmentPointGeometry_.bind(n),LineString:n.segmentLineStringGeometry_.bind(n),LinearRing:n.segmentLineStringGeometry_.bind(n),Polygon:n.segmentPolygonGeometry_.bind(n),MultiPoint:n.segmentMultiPointGeometry_.bind(n),MultiLineString:n.segmentMultiLineStringGeometry_.bind(n),MultiPolygon:n.segmentMultiPolygonGeometry_.bind(n),GeometryCollection:n.segmentGeometryCollectionGeometry_.bind(n),Circle:n.segmentCircleGeometry_.bind(n)},n}return Xd(e,t),e.prototype.addFeature=function(t,e){var n=void 0===e||e,r=p(t),i=t.getGeometry();if(i){var o=this.GEOMETRY_SEGMENTERS_[i.getType()];if(o){this.indexedFeaturesExtents_[r]=i.getExtent([1/0,1/0,-1/0,-1/0]);var s=[];if(o(s,i),1===s.length)this.rBush_.insert(G(s[0]),{feature:t,segment:s[0]});else if(s.length>1){var a=s.map(function(t){return G(t)}),u=s.map(function(e){return{feature:t,segment:e}});this.rBush_.load(a,u)}}}n&&(this.featureChangeListenerKeys_[r]=ce(t,Qt,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var n=this.snapTo(e.pixel,e.coordinate,e.map);return n&&(e.coordinate=n.vertex.slice(0,2),e.pixel=n.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=qd(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=qd(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var n=p(e);n in this.pendingFeatures_||(this.pendingFeatures_[n]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=Ht(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var n=void 0===e||e,r=p(t),i=this.indexedFeaturesExtents_[r];if(i){var o=this.rBush_,s=[];o.forEachInExtent(i,function(e){t===e.feature&&s.push(e)});for(var a=s.length-1;a>=0;--a)o.remove(s[a])}n&&(fe(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])},e.prototype.setMap=function(e){var n=this.getMap(),r=this.featuresListenerKeys_,i=this.getFeatures_();n&&(r.forEach(fe),r.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?r.push(ce(this.features_,zn,this.handleFeatureAdd_,this),ce(this.features_,Vn,this.handleFeatureRemove_,this)):this.source_&&r.push(ce(this.source_,ff,this.handleFeatureAdd_,this),ce(this.source_,gf,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,n){var r=G([n.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),n.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(r),o=i.length;if(0===o)return null;var s,a=n.getView().getProjection(),u=Ii(e,a),l=1/0,c=this.pixelTolerance_*this.pixelTolerance_,h=function(){if(s){var e=n.getPixelFromCoordinate(s);if(He(t,e)<=c)return{vertex:s,vertexPixel:[Math.round(e[0]),Math.round(e[1])]}}return null};if(this.vertex_){for(var f=0;f<o;++f){"Circle"!==(p=i[f]).feature.getGeometry().getType()&&p.segment.forEach(function(t){var e=Ii(t,a),n=He(u,e);n<l&&(s=t,l=n)})}if(b=h())return b}if(this.edge_){for(f=0;f<o;++f){var p,d=null;if("Circle"===(p=i[f]).feature.getGeometry().getType()){var g=p.feature.getGeometry(),y=Si();y&&(g=g.clone().transform(y,a)),d=Pi(Ue(u,g),a)}else{var v=p.segment,_=v[0],m=v[1];m&&(Yd[0]=Ii(_,a),Yd[1]=Ii(m,a),d=We(u,Yd))}if(d){var x=He(u,d);x<l&&(s=d,l=x)}}var b;if(b=h())return b}return null},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.segmentCircleGeometry_=function(t,e){var n=this.getMap().getView().getProjection(),r=e,i=Si();i&&(r=r.clone().transform(i,n));var o=Xo(r);i&&o.transform(n,i);for(var s=o.getCoordinates()[0],a=0,u=s.length-1;a<u;++a)t.push(s.slice(a,a+2))},e.prototype.segmentGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=this.GEOMETRY_SEGMENTERS_[n[r].getType()];i&&i(t,n[r])}},e.prototype.segmentLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r)t.push(n.slice(r,r+2))},e.prototype.segmentMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},e.prototype.segmentMultiPointGeometry_=function(t,e){e.getCoordinates().forEach(function(e){t.push([e])})},e.prototype.segmentMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length;s<a;++s)for(var u=o[s],l=0,c=u.length-1;l<c;++l)t.push(u.slice(l,l+2))},e.prototype.segmentPointGeometry_=function(t,e){t.push([e.getCoordinates()])},e.prototype.segmentPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s)t.push(o.slice(s,s+2))},e}(Os),Zd=Hd,Kd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jd=function(t){function e(e,n,r){var i=t.call(this)||this;if(void 0!==r&&void 0===n)i.setFlatCoordinates(r,e);else{var o=n||0;i.setCenterAndRadius(e,o,r)}return i}return Kd(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){var i=this.flatCoordinates,o=t-i[0],s=e-i[1],a=o*o+s*s;if(a<r){if(0===a)for(var u=0;u<this.stride;++u)n[u]=i[u];else{var l=this.getRadius()/Math.sqrt(a);n[0]=i[0]+l*o,n[1]=i[1]+l*s;for(u=2;u<this.stride;++u)n[u]=i[u]}return n.length=this.stride,a}return r},e.prototype.containsXY=function(t,e){var n=this.flatCoordinates,r=t-n[0],i=e-n[1];return r*r+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,n=e[this.stride]-e[0];return H(e[0]-n,e[1]-n,e[0]+n,e[1]+n,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return"Circle"},e.prototype.intersectsExtent=function(t){if(yt(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||rt(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,n=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+n;for(var i=1;i<e;++i)r[e+i]=t[i];this.setFlatCoordinates(this.layout,r),this.changed()},e.prototype.setCenterAndRadius=function(t,e,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,i=uo(r,0,t,this.stride);r[i++]=r[0]+e;for(var o=1,s=this.stride;o<s;++o)r[i++]=r[o];r.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var n=this.getCenter(),r=this.getStride();this.setCenter(Yi(n,0,n.length,r,t,e,n)),this.changed()},e.prototype.translate=function(t,e){var n=this.getCenter(),r=this.getStride();this.setCenter(Hi(n,0,n.length,r,t,e,n)),this.changed()},e}(no);Jd.prototype.transform;var $d=Jd;function Qd(t,n,r,i,o,s,a){var u,l,c=(r-n)/i;if(1===c)u=n;else if(2===c)u=n,l=o;else if(0!==c){for(var h=t[n],f=t[n+1],p=0,d=[0],g=n+i;g<r;g+=i){var y=t[g],v=t[g+1];p+=Math.sqrt((y-h)*(y-h)+(v-f)*(v-f)),d.push(p),h=y,f=v}var _=o*p,m=function(t,n,r){for(var i,o,s=r||e,a=0,u=t.length,l=!1;a<u;)(o=+s(t[i=a+(u-a>>1)],n))<0?a=i+1:(u=i,l=!o);return l?a:~a}(d,_);m<0?(l=(_-d[-m-2])/(d[-m-1]-d[-m-2]),u=n+(-m-2)*i):u=n+m*i}var x=a>1?a:2,b=s||new Array(x);for(g=0;g<x;++g)b[g]=void 0===u?NaN:void 0===l?t[u+g]:Mt(t[u+g],t[u+i+g],l);return b}function tg(t,e,n,r,i,o){if(n==e)return null;var s;if(i<t[e+r-1])return o?((s=t.slice(e,e+r))[r-1]=i,s):null;if(t[n-1]<i)return o?((s=t.slice(n-r,n))[r-1]=i,s):null;if(i==t[e+r-1])return t.slice(e,e+r);for(var a=e/r,u=n/r;a<u;){var l=a+u>>1;i<t[(l+1)*r-1]?u=l:a=l+1}var c=t[a*r-1];if(i==c)return t.slice((a-1)*r,(a-1)*r+r);var h=(i-c)/(t[(a+1)*r-1]-c);s=[];for(var f=0;f<r-1;++f)s.push(Mt(t[(a-1)*r+f],t[a*r+f],h));return s.push(i),s}var eg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ng=function(t){function e(e,n){var r=t.call(this)||this;return r.flatMidpoint_=null,r.flatMidpointRevision_=-1,r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return eg(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?s(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<V(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),so(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.forEachSegment=function(t){return ko(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Wi&&this.layout!=Xi)return null;var n=void 0!==e&&e;return tg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n)},e.prototype.getCoordinates=function(){return vo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Qd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return Op(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=ho(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,Vi)},e.prototype.getType=function(){return"LineString"},e.prototype.intersectsExtent=function(t){return To(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=lo(this.flatCoordinates,0,t,this.stride),this.changed()},e}(no),rg=ng,ig=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),og=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,n);else if(void 0!==n&&r)i.setFlatCoordinates(n,e),i.ends_=r;else{for(var o=i.getLayout(),a=e,u=[],l=[],c=0,h=a.length;c<h;++c){var f=a[c];0===c&&(o=f.getLayout()),s(u,f.getFlatCoordinates()),l.push(u.length)}i.setFlatCoordinates(o,u),i.ends_=l}return i}return ig(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?s(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<V(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(oo(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ao(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.getCoordinateAtM=function(t,e,n){if(this.layout!=Wi&&this.layout!=Xi||0===this.flatCoordinates.length)return null;var r=void 0!==e&&e,i=void 0!==n&&n;return function(t,e,n,r,i,o,s){if(s)return tg(t,e,n[n.length-1],r,i,o);var a;if(i<t[r-1])return o?((a=t.slice(0,r))[r-1]=i,a):null;if(t[t.length-1]<i)return o?((a=t.slice(t.length-r))[r-1]=i,a):null;for(var u=0,l=n.length;u<l;++u){var c=n[u];if(e!=c){if(i<t[e+r-1])return null;if(i<=t[c-1])return tg(t,e,c,r,i,!1);e=c}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,r,i)},e.prototype.getCoordinates=function(){return _o(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new rg(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,n=this.layout,r=[],i=0,o=0,s=e.length;o<s;++o){var a=e[o],u=new rg(t.slice(i,a),n);r.push(u),i=a}return r},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,n=0,r=this.ends_,i=this.stride,o=0,a=r.length;o<a;++o){var u=r[o];s(t,Qd(e,n,u,i,.5)),n=u}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=fo(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,r),new e(n,Vi,r)},e.prototype.getType=function(){return"MultiLineString"},e.prototype.intersectsExtent=function(t){return function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){if(To(t,e,n[o],r,i))return!0;e=n[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=co(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(no),sg=og,ag=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ug=function(t){function e(e,n){var r=t.call(this)||this;return n&&!Array.isArray(e[0])?r.setFlatCoordinates(n,e):r.setCoordinates(e,n),r}return ag(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?s(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){if(r<V(this.getExtent(),t,e))return r;for(var i=this.flatCoordinates,o=this.stride,s=0,a=i.length;s<a;s+=o){var u=St(t,e,i[s],i[s+1]);if(u<r){r=u;for(var l=0;l<o;++l)n[l]=i[s+l];n.length=o}}return r},e.prototype.getCoordinates=function(){return vo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new Io(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,n=this.stride,r=[],i=0,o=t.length;i<o;i+=n){var s=new Io(t.slice(i,i+n),e);r.push(s)}return r},e.prototype.getType=function(){return"MultiPoint"},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,n=this.stride,r=0,i=e.length;r<i;r+=n){if(X(t,e[r],e[r+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=lo(this.flatCoordinates,0,t,this.stride),this.changed()},e}(no),lg=ug;var cg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hg=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){for(var o=i.getLayout(),a=e,u=[],l=[],c=0,h=a.length;c<h;++c){var f=a[c];0===c&&(o=f.getLayout());for(var p=u.length,d=f.getEnds(),g=0,y=d.length;g<y;++g)d[g]+=p;s(u,f.getFlatCoordinates()),l.push(d)}n=o,e=u,r=l}return void 0!==n&&r?(i.setFlatCoordinates(n,e),i.endss_=r):i.setCoordinates(e,n),i}return cg(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var n=this.flatCoordinates.length;s(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,i=(e=t.getEnds().slice()).length;r<i;++r)e[r]+=n}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,n=new Array(t),r=0;r<t;++r)n[r]=this.endss_[r].slice();var i=new e(this.flatCoordinates.slice(),this.layout,n);return i.applyProperties(this),i},e.prototype.closestPointXY=function(t,e,n,r){return r<V(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];i=oo(t,e,a,r,i),e=a[a.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,n,r,i,o,s,a,u,l,c){for(var h=c||[NaN,NaN],f=0,p=n.length;f<p;++f){var d=n[f];l=ao(t,e,d,r,i,o,s,a,u,l,h),e=d[d.length-1]}return l}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.containsXY=function(t,e){return function(t,e,n,r,i,o){if(0===n.length)return!1;for(var s=0,a=n.length;s<a;++s){var u=n[s];if(Lo(t,e,u,r,i,o))return!0;e=u[u.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,n,r){for(var i=0,o=0,s=n.length;o<s;++o){var a=n[o];i+=bo(t,e,a,r),e=a[a.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Bo(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,mo(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=function(t,e,n,r){for(var i=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=n.length;s<a;++s){var u=n[s];o=J(t,e,u[0],r),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=u[u.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=function(t,e,n,r,i){for(var o=[],s=0,a=n.length;s<a;++s){var u=n[s];o=Ro(t,e,u,r,i,2*s,o),e=u[u.length-1]}return o}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new lg(this.getFlatInteriorPoints().slice(),Wi)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(!jo(t,e,a,r,i))return!1;a.length&&(e=a[a.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Bo(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=function(t,e,n,r,i,o,s,a){for(var u=0,l=n.length;u<l;++u){var c=n[u],h=[];s=yo(t,e,c,r,i,o,s,h),a.push(h),e=c[c.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,r),new e(n,Vi,r)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var n=this.endss_[t-1];e=n[n.length-1]}var r=this.endss_[t].slice(),i=r[r.length-1];if(0!==e)for(var o=0,s=r.length;o<s;++o)r[o]-=e;return new Uo(this.flatCoordinates.slice(e,i),this.layout,r)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.endss_,r=[],i=0,o=0,s=n.length;o<s;++o){var a=n[o].slice(),u=a[a.length-1];if(0!==i)for(var l=0,c=a.length;l<c;++l)a[l]-=i;var h=new Uo(e.slice(i,u),t,a);r.push(h),i=u}return r},e.prototype.getType=function(){return"MultiPolygon"},e.prototype.intersectsExtent=function(t){return function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(Ao(t,e,a,r,i))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var n=function(t,e,n,r,i){for(var o=i||[],s=0,a=0,u=n.length;a<u;++a){var l=co(t,e,n[a],r,o[s]);o[s++]=l,e=l[l.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===n.length)this.flatCoordinates.length=0;else{var r=n[n.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},e}(no),fg=hg,pg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dg="Point",gg="LineString",yg="Polygon",vg="Circle",_g="drawstart",mg="drawend",xg="drawabort",bg=function(t){function e(e,n){var r=t.call(this,e)||this;return r.feature=n,r}return pg(e,t),e}(Wt),wg=function(t){function e(e){var n=this,r=e;r.stopDown||(r.stopDown=l),(n=t.call(this,r)||this).on,n.once,n.un,n.shouldHandle_=!1,n.downPx_=null,n.downTimeout_,n.lastDragTime_,n.pointerType_,n.freehand_=!1,n.source_=e.source?e.source:null,n.features_=e.features?e.features:null,n.snapTolerance_=e.snapTolerance?e.snapTolerance:12,n.type_=e.type,n.mode_=function(t){switch(t){case"Point":case"MultiPoint":return dg;case"LineString":case"MultiLineString":return gg;case"Polygon":case"MultiPolygon":return yg;case"Circle":return vg;default:throw new Error("Invalid type: "+t)}}(n.type_),n.stopClick_=!!e.stopClick,n.minPoints_=e.minPoints?e.minPoints:n.mode_===yg?3:2,n.maxPoints_=n.mode_===vg?2:e.maxPoints?e.maxPoints:1/0,n.finishCondition_=e.finishCondition?e.finishCondition:u,n.geometryLayout_=e.geometryLayout?e.geometryLayout:Vi;var i,o=e.geometryFunction;if(!o){var s,a=n.mode_;if(a===vg)o=function(t,e,n){var r=e||new $d([NaN,NaN]),i=Ii(t[0],n),o=He(i,Ii(t[t.length-1],n));r.setCenterAndRadius(i,Math.sqrt(o),this.geometryLayout_);var s=Si();return s&&r.transform(n,s),r};else a===dg?s=Io:a===gg?s=rg:a===yg&&(s=Uo),o=function(t,e,n){return e?a===yg?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])],this.geometryLayout_):e.setCoordinates([],this.geometryLayout_):e.setCoordinates(t,this.geometryLayout_):e=new s(t,this.geometryLayout_),e}}return n.geometryFunction_=o,n.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,n.finishCoordinate_=null,n.sketchFeature_=null,n.sketchPoint_=null,n.sketchCoords_=null,n.sketchLine_=null,n.sketchLineCoords_=null,n.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,n.overlay_=new bd({source:new kd({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=Bf(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),n.geometryName_=e.geometryName,n.condition_=e.condition?e.condition:As,n.freehandCondition_,e.freehand?n.freehandCondition_=Ts:n.freehandCondition_=e.freehandCondition?e.freehandCondition:Ds,n.addChangeListener(_s,n.updateState_),n}return pg(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===ee&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==dg&&this.freehandCondition_(e);var n=e.type===or.POINTERMOVE,r=!0;!this.freehand_&&this.lastDragTime_&&e.type===or.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===or.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===or.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===or.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===or.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===or.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,e)&&r},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new ir(or.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var n=!this.finishCoordinate_;n&&this.startDrawing_(t.coordinate),!n&&this.freehand_?this.finishDrawing():this.freehand_||n&&this.mode_!==dg||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,n=t.pixel,r=e[0]-n[0],i=e[1]-n[1],o=r*r+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var n=!1,r=[this.finishCoordinate_],i=this.mode_;if(i===dg)e=!0;else if(i===vg)e=2===this.sketchCoords_.length;else if(i===gg)n=this.sketchCoords_.length>this.minPoints_;else if(i===yg){var o=this.sketchCoords_;n=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(n)for(var s=this.getMap(),a=0,u=r.length;a<u;a++){var l=r[a],c=s.getPixelFromCoordinate(l),h=t[0]-c[0],f=t[1]-c[1],p=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(h*h+f*f)<=p){this.finishCoordinate_=l;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new Na(new Io(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new Na);var e=t.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),n.changed()):(n=new rg(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(n))},e.prototype.startDrawing_=function(t){for(var e=this.getMap().getView().getProjection(),n=eo(this.geometryLayout_);t.length<n;)t.push(0);this.finishCoordinate_=t,this.mode_===dg?this.sketchCoords_=t.slice():this.mode_===yg?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Na(new rg(this.sketchLineCoords_)));var r=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new Na,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new bg(_g,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){for(var e,n,r=this.getMap(),i=this.sketchFeature_.getGeometry(),o=r.getView().getProjection(),s=eo(this.geometryLayout_);t.length<s;)t.push(0);(this.mode_===dg?n=this.sketchCoords_:this.mode_===yg?(n=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(r.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):n=(e=this.sketchCoords_)[e.length-1],n[0]=t[0],n[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if("Polygon"===i.getType()&&this.mode_!==yg)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,n,r=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;o===gg||o===vg?(this.finishCoordinate_=t.slice(),(n=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),this.geometryFunction_(n,r,i)):o===yg&&((n=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),e&&(this.finishCoordinate_=n[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;if(r===gg||r===vg){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var i=this.finishCoordinate_.slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}this.geometryFunction_(t,e,n),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===yg){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){i=t[t.length-2].slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,n)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,n=t.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===gg?(e.pop(),this.geometryFunction_(e,n,r)):this.mode_===yg&&(e[0].pop(),this.geometryFunction_(e,n,r),e=n.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new lg([e])):"MultiLineString"===this.type_?t.setGeometry(new sg([e])):"MultiPolygon"===this.type_&&t.setGeometry(new fg([e])),this.dispatchEvent(new bg(mg,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new bg(xg,t))},e.prototype.appendCoordinates=function(t){var e,n=this.mode_,r=!this.sketchFeature_;if(r&&this.startDrawing_(t[0]),n===gg||n===vg)e=this.sketchCoords_;else{if(n!==yg)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}r&&e.shift(),e.pop();for(var i=0;i<t.length;i++)this.addToDrawing_(t[i]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new Na(new Io(n)),this.updateSketchFeatures_(),this.dispatchEvent(new bg(_g,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(Os);var Eg=wg,Cg="preload",Sg="useInterimTilesOnError",Pg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ig=function(t){function e(e){var n=this,r=e||{},i=qt({},r);return delete i.preload,delete i.useInterimTilesOnError,(n=t.call(this,i)||this).on,n.once,n.un,n.setPreload(void 0!==r.preload?r.preload:0),n.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),n}return Pg(e,t),e.prototype.getPreload=function(){return this.get(Cg)},e.prototype.setPreload=function(t){this.set(Cg,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Sg)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Sg,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(ze),Mg=Ig,Og=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lg=function(t){function e(e,n,r){var i=t.call(this)||this,o=r||{};return i.tileCoord=e,i.state=n,i.interimTile=null,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i.interpolate=!!o.interpolate,i}return Og(e,t),e.prototype.changed=function(){this.dispatchEvent(Qt)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Pr)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Pr){t.interimTile=null;break}t.getState()==Sr?e=t:t.getState()==Cr?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Ir&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){h()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var r=e-n+1e3/60;return r>=this.transition_?1:ji(r/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}($t),Rg=Lg,kg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tg=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,s)||this;return a.crossOrigin_=i,a.src_=r,a.key=r,a.image_=new Image,null!==i&&(a.image_.crossOrigin=i),a.unlisten_=null,a.tileLoadFunction_=o,a}return kg(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Pr,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Ir,this.unlistenImage_(),this.image_=((t=hn(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Pr:this.state=Mr,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Ir&&(this.state=Cr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Cr&&(this.state=Sr,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=id(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Rg);var Ng,Ag=Tg,Dg=function(){function t(t,e,n,r,i,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=_i(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&>(r)==gt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?gt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?gt(this.targetProj_.getExtent()):null;var u=pt(n),l=dt(n),c=st(n),h=ot(n),f=this.transformInv_(u),p=this.transformInv_(l),d=this.transformInv_(c),g=this.transformInv_(h),y=10+(o?Math.max(0,Math.ceil(Et(it(n)/(o*o*256*256)))):0);if(this.addQuad_(u,l,c,h,f,p,d,g,y),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach(function(t,e,n){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,n,r,i,o){this.triangles_.push({source:[r,i,o],target:[t,e,n]})},t.prototype.addQuad_=function(t,e,n,r,i,o,s,a,u){var l=G([i,o,s,a]),c=this.sourceWorldWidth_?gt(l)/this.sourceWorldWidth_:null,h=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&c>.5&&c<1,p=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)p=gt(G([t,e,n,r]))/this.targetWorldWidth_>.25||p;!f&&this.sourceProj_.isGlobal()&&c&&(p=c>.25||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3]))||yt(l,this.maxSourceExtent_)){var d=0;if(!(p||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(u>0)p=!0;else if(1!=(d=(isFinite(i[0])&&isFinite(i[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(u>0){if(!p){var g=[(t[0]+n[0])/2,(t[1]+n[1])/2],y=this.transformInv_(g),v=void 0;if(f)v=(It(i[0],h)+It(s[0],h))/2-It(y[0],h);else v=(i[0]+s[0])/2-y[0];var _=(i[1]+s[1])/2-y[1];p=v*v+_*_>this.errorThresholdSquared_}if(p){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var m=[(e[0]+n[0])/2,(e[1]+n[1])/2],x=this.transformInv_(m),b=[(r[0]+t[0])/2,(r[1]+t[1])/2],w=this.transformInv_(b);this.addQuad_(t,e,m,b,i,o,x,w,u-1),this.addQuad_(b,m,n,r,w,x,s,a,u-1)}else{var E=[(t[0]+e[0])/2,(t[1]+e[1])/2],C=this.transformInv_(E),S=[(n[0]+r[0])/2,(n[1]+r[1])/2],P=this.transformInv_(S);this.addQuad_(t,E,S,r,i,C,P,a,u-1),this.addQuad_(E,e,n,S,C,o,s,P,u-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}11&d||this.addTriangle_(t,n,r,i,s,a),14&d||this.addTriangle_(t,n,e,i,s,o),d&&(13&d||this.addTriangle_(e,r,t,o,a,i),7&d||this.addTriangle_(e,r,n,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(e,n,r){var i=e.source;tt(t,i[0]),tt(t,i[1]),tt(t,i[2])}),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),Fg=Dg,jg={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Gg={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},Bg=[];function zg(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function Vg(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Ug(t,e,n,r){var i=mi(n,e,t),o=pi(e,r,n),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var u=t.getExtent();if(!u||U(u,i)){var l=pi(t,o,i)/o;isFinite(l)&&l>0&&(o/=l)}return o}function Wg(t,e,n,r,i,o,s,a,u,l,c,h){var f=hn(Math.round(n*t),Math.round(n*e),Bg);if(h||qt(f,jg),0===u.length)return f.canvas;function p(t){return Math.round(t*n)/n}f.scale(n,n),f.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];u.forEach(function(t,e,n){Q(d,t.extent)});var g=gt(d),y=ht(d),v=hn(Math.round(n*g/r),Math.round(n*y/r));h||qt(v,jg);var _=n/r;u.forEach(function(t,e,n){var r=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=gt(t.extent),s=ht(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,r*_,i*_,o*_,s*_)});var m=pt(s);return a.getTriangles().forEach(function(t,e,i){var s=t.source,a=t.target,u=s[0][0],l=s[0][1],c=s[1][0],g=s[1][1],y=s[2][0],_=s[2][1],x=p((a[0][0]-m[0])/o),b=p(-(a[0][1]-m[1])/o),w=p((a[1][0]-m[0])/o),E=p(-(a[1][1]-m[1])/o),C=p((a[2][0]-m[0])/o),S=p(-(a[2][1]-m[1])/o),P=u,I=l;u=0,l=0;var M=function(t){for(var e=t.length,n=0;n<e;n++){for(var r=n,i=Math.abs(t[n][n]),o=n+1;o<e;o++){var s=Math.abs(t[o][n]);s>i&&(i=s,r=o)}if(0===i)return null;var a=t[r];t[r]=t[n],t[n]=a;for(var u=n+1;u<e;u++)for(var l=-t[u][n]/t[n][n],c=n;c<e+1;c++)n==c?t[u][c]=0:t[u][c]+=l*t[n][c]}for(var h=new Array(e),f=e-1;f>=0;f--){h[f]=t[f][e]/t[f][f];for(var p=f-1;p>=0;p--)t[p][e]-=t[p][f]*h[f]}return h}([[c-=P,g-=I,0,0,w-x],[y-=P,_-=I,0,0,C-x],[0,0,c,g,E-b],[0,0,y,_,S-b]]);if(M){if(f.save(),f.beginPath(),function(){if(void 0===Ng){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",zg(t,4,5,4,0),zg(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Ng=Vg(e,0)||Vg(e,4)||Vg(e,8)}return Ng}()||!h){f.moveTo(w,E);for(var O=x-w,L=b-E,R=0;R<4;R++)f.lineTo(w+p((R+1)*O/4),E+p(R*L/3)),3!=R&&f.lineTo(w+p((R+1)*O/4),E+p((R+1)*L/3));f.lineTo(C,S)}else f.moveTo(w,E),f.lineTo(x,b),f.lineTo(C,S);f.clip(),f.transform(M[0],M[2],M[1],M[3],x,b),f.translate(d[0]-P,d[3]-I),f.scale(r/n,-r/n),f.drawImage(v.canvas,0,0),f.restore()}}),c&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach(function(t,e,n){var r=t.target,i=(r[0][0]-m[0])/o,s=-(r[0][1]-m[1])/o,a=(r[1][0]-m[0])/o,u=-(r[1][1]-m[1])/o,l=(r[2][0]-m[0])/o,c=-(r[2][1]-m[1])/o;f.beginPath(),f.moveTo(a,u),f.lineTo(i,s),f.lineTo(l,c),f.closePath(),f.stroke()}),f.restore()),f.canvas}var Xg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qg=function(t){function e(e,n,r,i,o,s,a,u,l,c,h,f){var p=t.call(this,o,Cr,{interpolate:!!f})||this;p.renderEdges_=void 0!==h&&h,p.pixelRatio_=a,p.gutter_=u,p.canvas_=null,p.sourceTileGrid_=n,p.targetTileGrid_=i,p.wrappedTileCoord_=s||o,p.sourceTiles_=[],p.sourcesListenerKeys_=null,p.sourceZ_=0;var d=i.getTileCoordExtent(p.wrappedTileCoord_),g=p.targetTileGrid_.getExtent(),y=p.sourceTileGrid_.getExtent(),v=g?ft(d,g):d;if(0===it(v))return p.state=Mr,p;var _=e.getExtent();_&&(y=y?ft(y,_):_);var m=i.getResolution(p.wrappedTileCoord_[0]),x=function(t,e,n,r){var i=at(n),o=Ug(t,e,i,r);return(!isFinite(o)||o<=0)&&rt(n,function(n){return o=Ug(t,e,n,r),isFinite(o)&&o>0}),o}(e,r,v,m);if(!isFinite(x)||x<=0)return p.state=Mr,p;var b=void 0!==c?c:.5;if(p.triangulation_=new Fg(e,r,v,y,x*b,m),0===p.triangulation_.getTriangles().length)return p.state=Mr,p;p.sourceZ_=n.getZForResolution(x);var w=p.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(w[1]=bt(w[1],y[1],y[3]),w[3]=bt(w[3],y[1],y[3])):w=ft(w,y)),it(w)){for(var E=n.getTileRangeForExtentAndZ(w,p.sourceZ_),C=E.minX;C<=E.maxX;C++)for(var S=E.minY;S<=E.maxY;S++){var P=l(p.sourceZ_,C,S,a);P&&p.sourceTiles_.push(P)}0===p.sourceTiles_.length&&(p.state=Mr)}else p.state=Mr;return p}return Xg(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,r){e&&e.getState()==Pr&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Ir;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),r="number"==typeof n?n:n[0],i="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Wg(r,i,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=Pr}this.changed()},e.prototype.load=function(){if(this.state==Cr){this.state=Sr,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,r){var i=e.getState();if(i==Cr||i==Sr){t++;var o=ce(e,Qt,function(n){var r=e.getState();r!=Pr&&r!=Ir&&r!=Mr||(fe(o),0===--t&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(t,e,n){t.getState()==Cr&&t.load()})}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(fe),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(fn(this.canvas_.getContext("2d")),Bg.push(this.canvas_),this.canvas_=null),t.prototype.release.call(this)},e}(Rg),Yg=qg,Hg=function(){function t(t,e,n,r){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Zg(t,e,n,r,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new Hg(t,e,n,r)}var Kg=Hg,Jg=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$g=function(t){function n(e){var n=t.call(this,e)||this;return n.extentChanged=!0,n.renderedExtent_=null,n.renderedPixelRatio,n.renderedProjection=null,n.renderedRevision,n.renderedTiles=[],n.newTiles_=!1,n.tmpExtent=[1/0,1/0,-1/0,-1/0],n.tmpTileRange_=new Kg(0,0,0,0),n}return Jg(n,t),n.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),r=e.getUseInterimTilesOnError();return n==Pr||n==Mr||n==Ir&&!r},n.prototype.getTile=function(t,e,n,r){var i=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,n,i,o);return a.getState()==Ir&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(Pr)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},n.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),r=O(e.pixelToCoordinateTransform,t.slice()),i=n.getExtent();if(i&&!U(i,r))return null;for(var o=e.pixelRatio,s=e.viewState.projection,a=e.viewState,u=n.getRenderSource(),l=u.getTileGridForProjection(a.projection),c=u.getTilePixelRatio(e.pixelRatio),h=l.getZForResolution(a.resolution);h>=l.getMinZoom();--h){var f=l.getTileCoordForCoordAndZ(r,h),p=u.getTile(h,f[1],f[2],o,s);if(!(p instanceof Ag||p instanceof Yg))return null;if(p.getState()===Pr){var d=l.getOrigin(h),g=Qo(l.getTileSize(h)),y=l.getResolution(h),v=Math.floor(c*((r[0]-d[0])/y-f[1]*g[0])),_=Math.floor(c*((d[1]-r[1])/y-f[2]*g[1])),m=Math.round(c*u.getGutterForProjection(a.projection));return this.getImageData(p.getImage(),v+m,_+m)}}return null},n.prototype.loadedTileCallback=function(e,n,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,e,n,r)},n.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},n.prototype.renderFrame=function(t,n){var r=t.layerStatesArray[t.layerIndex],i=t.viewState,o=i.projection,s=i.resolution,a=i.center,u=i.rotation,l=t.pixelRatio,c=this.getLayer(),h=c.getSource(),f=h.getRevision(),d=h.getTileGridForProjection(o),g=d.getZForResolution(s,h.zDirection),y=d.getResolution(g),v=t.extent,_=t.viewState.resolution,m=h.getTilePixelRatio(l),x=Math.round(gt(v)/_*l),b=Math.round(ht(v)/_*l),w=r.extent&&Oi(r.extent,o);w&&(v=ft(v,Oi(r.extent,o)));var E=y*x/2/m,C=y*b/2/m,S=[a[0]-E,a[1]-C,a[0]+E,a[1]+C],P=d.getTileRangeForExtentAndZ(v,g),I={};I[g]={};var M=this.createLoadedTileFinder(h,o,I),T=this.tmpExtent,N=this.tmpTileRange_;this.newTiles_=!1;for(var A=u?ct(i.center,_,u,t.size):void 0,D=P.minX;D<=P.maxX;++D)for(var F=P.minY;F<=P.maxY;++F)if(!u||d.tileCoordIntersectsViewport([g,D,F],A)){var j=this.getTile(g,D,F,t);if(this.isDrawableTile(j)){var G=p(this);if(j.getState()==Pr)I[g][j.tileCoord.toString()]=j,(lt=j.inTransition(G))&&1!==r.opacity&&(j.endTransition(G),lt=!1),this.newTiles_||!lt&&-1!==this.renderedTiles.indexOf(j)||(this.newTiles_=!0);if(1===j.getAlpha(G,t.time))continue}var B=d.getTileCoordChildTileRange(j.tileCoord,N,T),z=!1;B&&(z=M(g+1,B)),z||d.forEachTileCoordParentTileRange(j.tileCoord,M,N,T)}var V=y/s*l/m;L(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/l,1/l,u,-x/2,-b/2);var U=k(this.pixelTransform);this.useContainer(n,U,this.getBackground(t));var W=this.context,X=W.canvas;R(this.inversePixelTransform,this.pixelTransform),L(this.tempTransform,x/2,b/2,V,V,0,-x/2,-b/2),X.width!=x||X.height!=b?(X.width=x,X.height=b):this.containerReused||W.clearRect(0,0,x,b),w&&this.clipUnrotated(W,t,w),h.getInterpolate()||qt(W,jg),this.preRender(W,t),this.renderedTiles.length=0;var q,Y,H,Z=Object.keys(I).map(Number);Z.sort(e),1!==r.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(q=[],Y=[]):Z=Z.reverse();for(var K=Z.length-1;K>=0;--K){var J=Z[K],Q=h.getTilePixelSize(J,l,o),tt=d.getResolution(J)/y,et=Q[0]*tt*V,nt=Q[1]*tt*V,rt=d.getTileCoordForCoordAndZ(pt(S),J),it=d.getTileCoordExtent(rt),ot=O(this.tempTransform,[m*(it[0]-S[0])/y,m*(S[3]-it[3])/y]),st=m*h.getGutterForProjection(o),at=I[J];for(var ut in at){var lt,dt=(j=at[ut]).tileCoord,vt=rt[1]-dt[1],_t=Math.round(ot[0]-(vt-1)*et),mt=rt[2]-dt[2],xt=Math.round(ot[1]-(mt-1)*nt),bt=_t-(D=Math.round(ot[0]-vt*et)),wt=xt-(F=Math.round(ot[1]-mt*nt)),Et=g===J,Ct=!1;if(!(lt=Et&&1!==j.getAlpha(p(this),t.time)))if(q){H=[D,F,D+bt,F,D+bt,F+wt,D,F+wt];for(var St=0,Pt=q.length;St<Pt;++St)if(g!==J&&J<Y[St]){var It=q[St];yt([D,F,D+bt,F+wt],[It[0],It[3],It[4],It[7]])&&(Ct||(W.save(),Ct=!0),W.beginPath(),W.moveTo(H[0],H[1]),W.lineTo(H[2],H[3]),W.lineTo(H[4],H[5]),W.lineTo(H[6],H[7]),W.moveTo(It[6],It[7]),W.lineTo(It[4],It[5]),W.lineTo(It[2],It[3]),W.lineTo(It[0],It[1]),W.clip())}q.push(H),Y.push(J)}else W.clearRect(D,F,bt,wt);this.drawTileImage(j,t,D,F,bt,wt,st,Et),q&&!lt?(Ct&&W.restore(),this.renderedTiles.unshift(j)):this.renderedTiles.push(j),this.updateUsedTiles(t.usedTiles,h,j)}}return this.renderedRevision=f,this.renderedResolution=y,this.extentChanged=!this.renderedExtent_||!$(this.renderedExtent_,S),this.renderedExtent_=S,this.renderedPixelRatio=l,this.renderedProjection=o,this.manageTilePyramid(t,h,d,l,o,v,g,c.getPreload()),this.scheduleExpireCache(t,h),this.postRender(W,t),r.extent&&W.restore(),qt(W,Gg),U!==X.style.transform&&(X.style.transform=U),this.container},n.prototype.drawTileImage=function(t,e,n,r,i,o,s,a){var u=this.getTileImage(t);if(u){var l=p(this),c=e.layerStatesArray[e.layerIndex],h=c.opacity*(a?t.getAlpha(l,e.time):1),f=h!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=h),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,n,r,i,o),f&&this.context.restore(),h!==c.opacity?e.animate=!0:a&&t.endTransition(l)}},n.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},n.prototype.getTileImage=function(t){return t.getImage()},n.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var n=function(t,e,n){var r=p(t);r in n.usedTiles&&t.expireCache(n.viewState.projection,n.usedTiles[r])}.bind(null,e);t.postRenderFunctions.push(n)}},n.prototype.updateUsedTiles=function(t,e,n){var r=p(e);r in t||(t[r]={}),t[r][n.getKey()]=!0},n.prototype.manageTilePyramid=function(t,e,n,r,i,o,s,a,u){var l=p(e);l in t.wantedTiles||(t.wantedTiles[l]={});var c,h,f,d,g,y,v=t.wantedTiles[l],_=t.tileQueue,m=n.getMinZoom(),x=t.viewState.rotation,b=x?ct(t.viewState.center,t.viewState.resolution,x,t.size):void 0,w=0;for(y=m;y<=s;++y)for(h=n.getTileRangeForExtentAndZ(o,y,h),f=n.getResolution(y),d=h.minX;d<=h.maxX;++d)for(g=h.minY;g<=h.maxY;++g)x&&!n.tileCoordIntersectsViewport([y,d,g],b)||(s-y<=a?(++w,(c=e.getTile(y,d,g,r,i)).getState()==Cr&&(v[c.getKey()]=!0,_.isKeyQueued(c.getKey())||_.enqueue([c,l,n.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(y,d,g,i));e.updateCacheSize(w,i)},n}(Ip),Qg=$g,ty=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ey=function(t){function e(e){return t.call(this,e)||this}return ty(e,t),e.prototype.createRenderer=function(){return new Qg(this)},e}(Mg),ny=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var n=this.entries_[t];return P(void 0!==n,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_},t.prototype.remove=function(t){var e=this.entries_[t];return P(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(t){if(this.containsKey(t))return this.entries_[t].value_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){P(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),ry=ny;function iy(t,e,n,r){return void 0!==r?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function oy(t,e,n){return t+"/"+e+"/"+n}function sy(t){return oy(t[0],t[1],t[2])}var ay=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uy=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ay(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=function(t){return t.split("/").map(Number)}(this.peekFirstKey()),e=t[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(sy(t.tileCoord)),t.release())}.bind(this))}},e}(ry),ly=uy,cy="tileloadstart",hy="tileloadend",fy="tileloaderror",py=[0,0,0],dy=function(){function t(t){var n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,P(function(t,n,r){var i=n||e;return t.every(function(e,n){if(0===n)return!0;var o=i(t[n-1],e);return!(o>0||r&&0===o)})}(this.resolutions_,function(t,e){return e-t},!0),17),!t.origins)for(var r=0,i=this.resolutions_.length-1;r<i;++r)if(n){if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}else n=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,P(this.origins_.length==this.resolutions_.length,20));var o=t.extent;void 0===o||this.origin_||this.origins_||(this.origin_=pt(o)),P(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,P(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:jr,P(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==o?o:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map(function(t,e){var n=new Kg(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(o){var r=this.getTileRangeForExtentAndZ(o,e);n.minX=Math.max(r.minX,n.minX),n.maxX=Math.min(r.maxX,n.maxX),n.minY=Math.max(r.minY,n.minY),n.maxY=Math.min(r.maxY,n.maxY)}return n},this):o&&this.calculateTileRanges_(o)}return t.prototype.forEachTileCoord=function(t,e,n){for(var r=this.getTileRangeForExtentAndZ(t,e),i=r.minX,o=r.maxX;i<=o;++i)for(var s=r.minY,a=r.maxY;s<=a;++s)n([e,i,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,n,r){var i,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):s=this.getTileCoordExtent(t,r);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?Zg(i=Math.floor(i/2),i,o=Math.floor(o/2),o,n):this.getTileRangeForExtentAndZ(s,a,n)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,n){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var r=2*t[1],i=2*t[2];return Zg(r,r+1,i,i+1,e)}var o=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;var r=t[0],i=t[1],o=t[2];if(e===r)return Zg(i,o,i,o,n);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-r),a=Math.floor(i*s),u=Math.floor(o*s);return e<r?Zg(a,a,u,u,n):Zg(a,Math.floor(s*(i+1))-1,u,Math.floor(s*(o+1))-1,n)}var l=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(l,e,n)},t.prototype.getTileRangeExtent=function(t,e,n){var r=this.getOrigin(t),i=this.getResolution(t),o=Qo(this.getTileSize(t),this.tmpSize_),s=r[0]+e.minX*o[0]*i,a=r[0]+(e.maxX+1)*o[0]*i;return H(s,r[1]+e.minY*o[1]*i,a,r[1]+(e.maxY+1)*o[1]*i,n)},t.prototype.getTileRangeForExtentAndZ=function(t,e,n){var r=py;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,r);var i=r[1],o=r[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,r),Zg(i,r[1],o,r[2],n)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=Qo(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*r[0]*n,e[1]-(t[2]+.5)*r[1]*n]},t.prototype.getTileCoordExtent=function(t,e){var n=this.getOrigin(t[0]),r=this.getResolution(t[0]),i=Qo(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*i[0]*r,s=n[1]-(t[2]+1)*i[1]*r;return H(o,s,o+i[0]*r,s+i[1]*r,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,n,r,i){var o=this.getZForResolution(n),s=n/this.getResolution(o),a=this.getOrigin(o),u=Qo(this.getTileSize(o),this.tmpSize_),l=s*(t-a[0])/n/u[0],c=s*(a[1]-e)/n/u[1];return r?(l=Rt(l,5)-1,c=Rt(c,5)-1):(l=Lt(l,5),c=Lt(c,5)),iy(o,l,c,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,n,r,i){var o=this.getOrigin(n),s=this.getResolution(n),a=Qo(this.getTileSize(n),this.tmpSize_),u=(t-o[0])/s/a[0],l=(o[1]-e)/s/a[1];return r?(u=Rt(u,5)-1,l=Rt(l,5)-1):(u=Lt(u,5),l=Lt(l,5)),iy(n,u,l,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return bt(i(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.tileCoordIntersectsViewport=function(t,e){return No(e,0,e.length,2,this.getTileCoordExtent(t))},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,n=new Array(e),r=this.minZoom;r<e;++r)n[r]=this.getTileRangeForExtentAndZ(t,r);this.fullTileRanges_=n},t}(),gy=dy;function yy(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,n,r){var i=_y(t);return function(t,e,n,r){var i=void 0!==r?r:"top-left",o=vy(t,e,n);return new gy({extent:t,origin:ut(t,i),resolutions:o,tileSize:n})}(i,e,n,r)}(t),t.setDefaultTileGrid(e)),e}function vy(t,e,n,r){for(var i=void 0!==e?e:42,o=ht(t),s=gt(t),a=Qo(void 0!==n?n:jr),u=r>0?r:Math.max(s/a[0],o/a[1]),l=i+1,c=new Array(l),h=0;h<l;++h)c[h]=u/Math.pow(2,h);return c}function _y(t){var e=(t=fi(t)).getExtent();if(!e){var n=180*Tr[Nr.DEGREES]/t.getMetersPerUnit();e=H(-n,-n,n,n)}return e}var my=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xy=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||this;n.on,n.once,n.un,n.opaque_=void 0!==e.opaque&&e.opaque,n.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,n.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;return n.tileGrid&&Qo(n.tileGrid.getTileSize(n.tileGrid.getMinZoom()),[256,256]),n.tileCache=new ly(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition,interpolate:e.interpolate},n.zDirection=e.zDirection?e.zDirection:0,n}return my(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,n,r){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,s,a,u=!0,l=n.minX;l<=n.maxX;++l)for(var c=n.minY;c<=n.maxY;++c)s=oy(e,l,c),a=!1,i.containsKey(s)&&(a=(o=i.get(s)).getState()===Pr)&&(a=!1!==r(o)),a||(u=!1);return u},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,e,n,r,i){return h()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:yy(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return P(null===e||yi(e,t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,n){var r,i,o,s=this.getTileGridForProjection(n),a=this.getTilePixelRatio(e),u=Qo(s.getTileSize(t),this.tmpSize);return 1==a?u:(r=u,i=a,void 0===(o=this.tmpSize)&&(o=[0,0]),o[0]=r[0]*i+.5|0,o[1]=r[1]*i+.5|0,o)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=function(t,e,n){var r=e[0],i=t.getTileCoordCenter(e),o=_y(n);if(U(o,i))return e;var s=gt(o),a=Math.ceil((o[0]-i[0])/s);return i[0]+=s*a,t.getTileCoordForCoordAndZ(i,r)}(r,t,n)),function(t,e){var n=t[0],r=t[1],i=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return!o||o.containsXY(r,i)}(t,r)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},e.prototype.useTile=function(t,e,n,r){},e}(Sd),by=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tile=n,r}return my(e,t),e}(Wt),wy=xy;function Ey(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,u){return s?t.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,function(){var t=s[0],n=e.getFullTileRange(t);return P(n,55),(n.getHeight()-s[2]-1).toString()}):void 0}}function Cy(t,e){for(var n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=Ey(t[i],e);return function(t){if(1===t.length)return t[0];return function(e,n,r){if(e){var i=function(t){return(t[1]<<t[0])+t[2]}(e),o=It(i,t.length);return t[o](e,n,r)}}}(r)}var Sy=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Py=function(t){function e(n){var r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,interpolate:n.interpolate,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return r.generateTileUrlFunction_=r.tileUrlFunction===e.prototype.tileUrlFunction,r.tileLoadFunction=n.tileLoadFunction,n.tileUrlFunction&&(r.tileUrlFunction=n.tileUrlFunction),r.urls=null,n.urls?r.setUrls(n.urls):n.url&&r.setUrl(n.url),r.tileLoadingKeys_={},r}return Sy(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,n=t.target,r=p(n),i=n.getState();i==Sr?(this.tileLoadingKeys_[r]=!0,e=cy):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=i==Ir?fy:i==Pr?hy:void 0),null!=e&&this.dispatchEvent(new by(e,n))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],n=/\{([a-z])-([a-z])\}/.exec(t);if(n){var r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),o=void 0;for(o=r;o<=i;++o)e.push(t.replace(n[0],String.fromCharCode(o)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(n[2],10),a=parseInt(n[1],10);a<=s;a++)e.push(t.replace(n[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Cy(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,n){},e.prototype.useTile=function(t,e,n){var r=oy(t,e,n);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(wy),Iy=Py,My=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Oy=function(t){function e(e){var n=this,r=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(r=e.interpolate),(n=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Ly,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:r,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,n.tileClass=void 0!==e.tileClass?e.tileClass:Ag,n.tileCacheForProjection={},n.tileGridForProjection={},n.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,n.renderReprojectionEdges_=!1,n}return My(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==n?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[r];i.expireCache(i==n?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!yi(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!yi(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!yi(e,t)){var n=p(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=yy(t)),this.tileGridForProjection[n]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||yi(e,t))return this.tileCache;var n=p(t);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new ly(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]},e.prototype.createTile_=function(t,e,n,r,i,o){var s=[t,e,n],a=this.getTileCoordForTileUrlFunction(s,i),u=a?this.tileUrlFunction(a,r,i):void 0,l=new this.tileClass(s,void 0!==u?Cr:Mr,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=o,l.addEventListener(Qt,this.handleTileChange.bind(this)),l},e.prototype.getTile=function(t,e,n,r,i){var o=this.getProjection();if(o&&i&&!yi(o,i)){var s=this.getTileCacheForProjection(i),a=[t,e,n],u=void 0,l=sy(a);s.containsKey(l)&&(u=s.get(l));var c=this.getKey();if(u&&u.key==c)return u;var h=this.getTileGridForProjection(o),f=this.getTileGridForProjection(i),p=this.getTileCoordForTileUrlFunction(a,i),d=new Yg(o,h,i,f,a,p,this.getTilePixelRatio(r),this.getGutter(),function(t,e,n,r){return this.getTileInternal(t,e,n,r,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return d.key=c,u?(d.interimTile=u,d.refreshInterimChain(),s.replace(l,d)):s.set(l,d),d}return this.getTileInternal(t,e,n,r,o||i)},e.prototype.getTileInternal=function(t,e,n,r,i){var o=null,s=oy(t,e,n),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var u=o;o=this.createTile_(t,e,n,r,i,a),u.getState()==Cr?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,n,r,i,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var n=fi(t);if(n){var r=p(n);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}},e}(Iy);function Ly(t,e){t.getImage().src=e}var Ry=Oy,ky=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ty=function(t){function e(e){var n=this,r=e||{},i=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(i=r.interpolate);var o=void 0!==r.projection?r.projection:"EPSG:3857",s=void 0!==r.tileGrid?r.tileGrid:function(t){var e=t||{},n=e.extent||fi("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:vy(n,e.maxZoom,e.tileSize,e.maxResolution)};return new gy(r)}({extent:_y(o),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return(n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:i,opaque:r.opaque,projection:o,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:s,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this).gutter_=void 0!==r.gutter?r.gutter:0,n}return ky(e,t),e.prototype.getGutter=function(){return this.gutter_},e}(Ry),Ny=Ty,Ay=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dy="element",Fy="map",jy="offset",Gy="position",By="positioning",zy=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un,n.options=e,n.id=e.id,n.insertFirst=void 0===e.insertFirst||e.insertFirst,n.stopEvent=void 0===e.stopEvent||e.stopEvent,n.element=document.createElement("div"),n.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",n.element.style.position="absolute",n.element.style.pointerEvents="auto";var r=e.autoPan;return r&&"object"!=typeof r&&(r={animation:e.autoPanAnimation,margin:e.autoPanMargin}),n.autoPan=r||!1,n.rendered={transform_:"",visible:!0},n.mapPostrenderListenerKey=null,n.addChangeListener(Dy,n.handleElementChanged),n.addChangeListener(Fy,n.handleMapChanged),n.addChangeListener(jy,n.handleOffsetChanged),n.addChangeListener(Gy,n.handlePositionChanged),n.addChangeListener(By,n.handlePositioningChanged),void 0!==e.element&&n.setElement(e.element),n.setOffset(void 0!==e.offset?e.offset:[0,0]),n.setPositioning(e.positioning||"top-left"),void 0!==e.position&&n.setPosition(e.position),n}return Ay(e,t),e.prototype.getElement=function(){return this.get(Dy)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Fy)||null},e.prototype.getOffset=function(){return this.get(jy)},e.prototype.getPosition=function(){return this.get(Gy)},e.prototype.getPositioning=function(){return this.get(By)},e.prototype.handleElementChanged=function(){vn(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(yn(this.element),fe(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=ce(t,fr,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(Dy,t)},e.prototype.setMap=function(t){this.set(Fy,t)},e.prototype.setOffset=function(t){this.set(jy,t)},e.prototype.setPosition=function(t){this.set(Gy,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(Gy)){var n=this.getRect(e.getTargetElement(),e.getSize()),r=this.getElement(),i=this.getRect(r,[pn(r),dn(r)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!W(n,i)){var a=i[0]-n[0],u=n[2]-i[2],l=i[1]-n[1],c=n[3]-i[3],h=[0,0];if(a<0?h[0]=a-s:u<0&&(h[0]=Math.abs(u)+s),l<0?h[1]=l-s:c<0&&(h[1]=Math.abs(c)+s),0!==h[0]||0!==h[1]){var f=e.getView().getCenterInternal(),p=e.getPixelFromCoordinateInternal(f);if(!p)return;var d=[p[0]+h[0],p[1]+h[1]],g=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(d),duration:g.duration,easing:g.easing})}}}},e.prototype.getRect=function(t,e){var n=t.getBoundingClientRect(),r=n.left+window.pageXOffset,i=n.top+window.pageYOffset;return[r,i,r+e[0],i+e[1]]},e.prototype.setPositioning=function(t){this.set(By,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var n=t.getPixelFromCoordinate(e),r=t.getSize();this.updateRenderedPosition(n,r)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var n=this.element.style,r=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+r[0])+"px",s=Math.round(t[1]+r[1])+"px",a="0%",u="0%";"bottom-right"==i||"center-right"==i||"top-right"==i?a="-100%":"bottom-center"!=i&&"center-center"!=i&&"top-center"!=i||(a="-50%"),"bottom-left"==i||"bottom-center"==i||"bottom-right"==i?u="-100%":"center-left"!=i&&"center-center"!=i&&"center-right"!=i||(u="-50%");var l="translate(".concat(a,", ").concat(u,") translate(").concat(o,", ").concat(s,")");this.rendered.transform_!=l&&(this.rendered.transform_=l,n.transform=l,n.msTransform=l)},e.prototype.getOptions=function(){return this.options},e}(me),Vy=zy,Uy=n(5072),Wy=n.n(Uy),Xy=n(7825),qy=n.n(Xy),Yy=n(7659),Hy=n.n(Yy),Zy=n(5056),Ky=n.n(Zy),Jy=n(540),$y=n.n(Jy),Qy=n(1113),tv=n.n(Qy),ev=n(7819),nv={};nv.styleTagTransform=tv(),nv.setAttributes=Ky(),nv.insert=Hy().bind(null,"head"),nv.domAPI=qy(),nv.insertStyleElement=$y();Wy()(ev.A,nv),ev.A&&ev.A.locals&&ev.A.locals;function rv(t){return rv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rv(t)}function iv(t){return function(t){if(Array.isArray(t))return ov(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ov(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ov(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ov(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function sv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,uv(r.key),r)}}function av(t,e,n){return(e=uv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uv(t){var e=function(t,e){if("object"!=rv(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=rv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==rv(e)?e:e+""}function lv(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function cv(t,e){return t.get(hv(t,e))}function hv(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var fv=new WeakMap,pv=function(){return t=function t(e){var n=this;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),lv(this,fv,{}),av(this,"source",void 0),av(this,"getSource",function(){return n.source}),av(this,"setSource",function(t){cv(fv,n).setSource(t),n.source=t}),av(this,"getStyle",function(){return n.style}),av(this,"setStyle",function(t){cv(fv,n).setstyle(t),n.style=t}),av(this,"addFeature",function(t){n.source.addFeature(t)}),av(this,"removeFeature",function(t){n.source.removeFeature(t)}),this.init(e),cv(fv,this).addFeature=this.addFeature,cv(fv,this).removeFeature=this.removeFeature,cv(fv,this).getSource=this.getSource,cv(fv,this)},(e=[{key:"init",value:function(t){if(!t)return new bd({source:new kd});var e={};Array.isArray(t)?(e.features=t,e.zIndex=1e3):(e.features=t.features,e.zIndex=t.zIndex);var n,r,i,o=new kd({features:iv(e.features)});this.source=o,n=fv,r=this,i=new bd({source:o,zIndex:e.zIndex}),n.set(hv(n,r),i)}}])&&sv(t.prototype,e),n&&sv(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),dv=fi("EPSG:4326"),gv={projection:dv,center:[120.566032634,33.355905081],zoom:13,maxZoom:18,minZoom:3,extent:[65.32783475401652,.4243521114706,160.16017906160056,73.83501005646247]},yv={CLICK:"click",DBLCLICK:"dbclick"};function vv(t){return vv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vv(t)}function _v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function mv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_v(Object(n),!0).forEach(function(e){xv(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_v(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function xv(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=vv(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=vv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vv(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var bv=mv(mv({},yv),{},{POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",LOADEND:"loadend"});function wv(t){return wv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wv(t)}function Ev(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Cv(r.key),r)}}function Cv(t){var e=function(t,e){if("object"!=wv(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=wv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==wv(e)?e:e+""}function Sv(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function Pv(t,e){return t.get(function(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}(t,e))}var Iv=new WeakMap,Mv=function(){return t=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Sv(this,Iv,{}),this.context=e,this.target=n},e=[{key:"eventList",get:function(){return Pv(Iv,this)}},{key:"eventCallback",value:function(t,e,n){n&&"function"===wv(n).toLocaleLowerCase()&&n({lnglat:t.coordinate,type:e,target:this.context,MAP_EVENT:t})}},{key:"onEvent",value:function(t,e,n,r){var i=t[e.toLocaleUpperCase()];if(Pv(Iv,this)[i])Pv(Iv,this)[i].set(n,r);else{var o=new WeakMap;o.set(n,r),Pv(Iv,this)[i]=o}var s=this.target.on(i,r);return s&&(s.eventType=e),s}},{key:"on",value:function(t,e,n){var r=this;if(t){var i;if(n||(n=yv),Array.isArray(t))return i=t.map(function(t){return r.on(t,e)});var o=n[t.toLocaleUpperCase()];if(o){var s=this;if(Pv(Iv,this)[o])Pv(Iv,this)[o].set(e,u);else{var a=new WeakMap;a.set(e,u),Pv(Iv,this)[o]=a}return(i=this.target.on(o,u))&&(i.eventType=t),i}console.error("Current events are not supported.")}function u(t){return s.eventCallback(t,o,e)}}},{key:"off",value:function(t,e,n){var r,i=this;if(!t)return!1;if(Array.isArray(t))return t.map(function(t){return i.off(t,e)});var o=n[t.toLocaleUpperCase()];return this.target.un(o,e),!(null===(r=Pv(Iv,this)[o])||void 0===r||!r.get(e)||(this.target.un(o,Pv(Iv,this)[o].get(e)),Pv(Iv,this)[o].delete(e),0))}},{key:"featureOn",value:function(t,e,n){var r=this;if(t){var i;if(n||(n=yv),Array.isArray(t))return i=t.map(function(t){return r.featureOn(t,e)});var o=n[t.toLocaleUpperCase()];if(o){var s=this;if(Pv(Iv,this)[o])Pv(Iv,this)[o].set(e,u);else{var a=new WeakMap;a.set(e,u),Pv(Iv,this)[o]=a}return(i=this.target.on(o,u))&&(i.eventType=t),i}console.error("Current events are not supported.")}function u(t){var n=[];s.target.forEachFeatureAtPixel(t.pixel,function(t,e,r){n.push(t)});var r=n.find(function(t){return Array.isArray(s.context.feature)?s.context.feature.some(function(e){return e===t}):t===s.context.feature});if(r)return s.eventCallback(t,o,e)}}}],e&&Ev(t.prototype,e),n&&Ev(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Ov(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Lv(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lv(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lv(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Rv(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function kv(t){var e=.017453292519943295,n=111319.49079327357,r=0;if(t.length<3)return 0;for(var i=0;i<t.length-1;i++){var o=Ov(t[i].map(parseFloat),2),s=o[0],a=o[1],u=Ov(t[i+1].map(parseFloat),2),l=u[0],c=u[1],h=a*n;r+=s*n*Math.cos(a*e)*c*n-l*n*Math.cos(c*e)*h}var f=Ov(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=Ov(t[0].map(parseFloat),2),y=g[0],v=g[1],_=d*n;return r+=p*n*Math.cos(d*e)*v*n-y*n*Math.cos(v*e)*_,.5*Math.abs(r)}function Tv(t){return Tv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tv(t)}function Nv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Av(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Nv(Object(n),!0).forEach(function(e){Dv(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nv(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Dv(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=Tv(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Tv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Tv(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Fv=Av(Av({},yv),{},{POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup"});function jv(t){return jv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jv(t)}function Gv(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Bv(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bv(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bv(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function zv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Vv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zv(Object(n),!0).forEach(function(e){Uv(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zv(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Uv(t,e,n){return(e=Xv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xv(r.key),r)}}function Xv(t){var e=function(t,e){if("object"!=jv(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=jv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==jv(e)?e:e+""}function qv(t,e,n){Yv(t,e),e.set(t,n)}function Yv(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hv(t,e){return t.get(Kv(t,e))}function Zv(t,e,n){return t.set(Kv(t,e),n),n}function Kv(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Jv=new WeakMap,$v=new WeakMap,Qv=new WeakMap,t_=new WeakMap,e_=new WeakMap,n_=new WeakSet,r_=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Yv(n=this,r=n_),r.add(n),qv(this,Jv,void 0),qv(this,$v,void 0),qv(this,Qv,void 0),qv(this,t_,void 0),qv(this,e_,void 0),this.init(Kv(n_,this,i_).call(this,e))},e=[{key:"init",value:function(t){var e=this;if(console.log("options",t),!t)return!1;Zv(Qv,this,Rv()),t.isGeomPolygon?(this.isGeomPolygon=!0,Zv(Jv,this,new Na({type:"polygon",geometry:new Uo(t.path),name:Hv(Qv,this)}))):Array.isArray(t.path[0][0])?(Zv(Jv,this,[]),t.path.forEach(function(t){Hv(Jv,e).push(new Na({type:"polygon",geometry:new Uo([t]),name:Hv(Qv,e)}))})):Zv(Jv,this,new Na({type:"polygon",geometry:new Uo([t.path]),name:Hv(Qv,this)}));var n=new Vf({stroke:new Df({width:t.borderWidth,color:t.strokeColor}),fill:new Nf({color:t.fillColor})});this.style=n,Array.isArray(Hv(Jv,this))?(Hv(Jv,this).forEach(function(t){t.setStyle(n)}),this.layer=new pv(Hv(Jv,this))):(Hv(Jv,this).setStyle(n),this.layer=new pv([Hv(Jv,this)])),t.map&&this.setMap(t.map),t.extData&&(this.extData=t.extData)}},{key:"setExtData",value:function(t){this.extData=Vv(Vv({},this.extData),t)}},{key:"feature",get:function(){return Hv(Jv,this)}},{key:"getPath",value:function(){return this.layer.getSource().getFeatures()[0].getGeometry().getCoordinates()[0]}},{key:"setPath",value:function(t){if(!t)return!1;this.layer.getSource().getFeatures()[0].getGeometry().setCoordinates([t])}},{key:"isVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){Hv($v,this)&&Hv($v,this).removeFeature(this.layer),t?(t.addFeature(this.layer),Zv($v,this,t),Zv(e_,this,new Mv(this,Hv($v,this).map))):Hv($v,this)&&Hv($v,this).removeFeature(this.layer)}},{key:"map",get:function(){return Hv($v,this)}},{key:"eventList",get:function(){return Hv(e_,this).eventList}},{key:"on",value:function(t,e){return Hv(e_,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return Hv(e_,this).off(t,e,Fv)}},{key:"openEdit",value:function(t,e){Hv($v,this).editGeom(this,t,e)}},{key:"closeEdit",value:function(){return!!Hv($v,this).getEditGeom(this)&&Hv($v,this).closeEditGeom(this)}},{key:"getArea",value:function(){if(this.isGeomPolygon){var t,e=this.layer.getSource().getFeatures()[0].getGeometry().getCoordinates();return kv(e[0])-(null!==(t=e.slice(1))&&void 0!==t?t:[]).reduce(function(t,e){return t+kv(e)},0)}return kv(this.getPath())}},{key:"getLength",value:function(){return 1e3*bu(Ba(this.getPath()),{units:"kilometers"})}},{key:"getHighByCoordinate",value:function(t){var e=.017453292519943295,n=111319.49079327357,r=0;if(t.length<3)return 0;for(var i=0;i<t.length-1;i++){var o=Gv(t[i].map(parseFloat),2),s=o[0],a=o[1],u=Gv(t[i+1].map(parseFloat),2),l=u[0],c=u[1],h=a*n;r+=s*n*Math.cos(a*e)*c*n-l*n*Math.cos(c*e)*h}var f=Gv(t[t.length-1].map(parseFloat),2),p=f[0],d=f[1],g=Gv(t[0].map(parseFloat),2),y=g[0],v=g[1],_=d*n;return r+=p*n*Math.cos(d*e)*v*n-y*n*Math.cos(v*e)*_,.5*Math.abs(r)}},{key:"setActive",value:function(t){"boolean"!==jv(t).toLocaleString()&&(t=!!t),this.active=t,t?Kv(n_,this,o_).call(this,this.activeStyle):Kv(n_,this,o_).call(this,this.style)}},{key:"isActive",value:function(){return!!this.active}},{key:"setActiveStyle",value:function(t){Zv(t_,this,t)}},{key:"activeStyle",get:function(){return Hv(t_,this)}},{key:"setSourceStyle",value:function(t){this.style=t}},{key:"destroy",value:function(){return!!Hv($v,this)&&(Hv($v,this).removeFeature(this.layer),!0)}}],e&&Wv(t.prototype,e),n&&Wv(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function i_(t){return t.path?(t.borderWidth||(t.borderWidth=3),t.strokeColor||(t.strokeColor="#3366ff66"),t.fillColor||(t.fillColor="#1199ffaa"),t):(console.error("path is error."),!1)}function o_(t){var e,n,r,i;e instanceof Vf?e=t:(null!=t&&t.borderWidth||null!=t&&t.strokeColor||null!=t&&t.fillColor||(e=this.style),e=new Vf({stroke:new Df({width:null!==(n=t.borderWidth)&&void 0!==n?n:2,color:null!==(r=t.strokeColor)&&void 0!==r?r:"#3366ff66"}),fill:new Nf({color:null!==(i=t.fillColor)&&void 0!==i?i:"#1199ffaa"})}));Array.isArray(Hv(Jv,this))?Hv(Jv,this).forEach(function(e){e.setStyle(t)}):Hv(Jv,this).setStyle(t)}function s_(t){return s_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s_(t)}function a_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u_(r.key),r)}}function u_(t){var e=function(t,e){if("object"!=s_(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=s_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==s_(e)?e:e+""}function l_(t,e,n){c_(t,e),e.set(t,n)}function c_(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h_(t,e){return t.get(p_(t,e))}function f_(t,e,n){return t.set(p_(t,e),n),n}function p_(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var d_={},g_=new WeakMap,y_=new WeakMap,v_=new WeakMap,__=new WeakMap,m_=new WeakSet,x_=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),c_(n=this,r=m_),r.add(n),l_(this,g_,void 0),l_(this,y_,void 0),l_(this,v_,void 0),l_(this,__,void 0),this.init(p_(m_,this,b_).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;f_(v_,this,Rv()),f_(g_,this,new Na({type:"polyline",geometry:new rg(t.path),name:h_(v_,this)}));var e=[];if(t.borderWidth&&e.push(new Vf({stroke:new Df({width:2*parseFloat(t.borderWidth)+parseFloat(t.width),color:t.borderColor})})),e.push(new Vf({stroke:new Df({width:t.width,color:t.color})})),this.style=e,h_(g_,this).setStyle(e),t.group)if(this.group=t.group,d_[t.group])this.layer=d_[t.group],this.layer.addFeature(h_(g_,this));else{var n=new pv([h_(g_,this)]);d_[t.group]=n,this.layer=n}else this.layer=new pv([h_(g_,this)]);t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return h_(g_,this)}},{key:"getPath",value:function(){return this.layer.getSource().getFeatures()[0].getGeometry().getCoordinates()}},{key:"isVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){h_(y_,this)&&h_(y_,this).removeFeature(this.layer),t?(t.addFeature(this.layer),f_(y_,this,t),f_(__,this,new Mv(this,h_(y_,this).map))):h_(y_,this)&&h_(y_,this).removeFeature(this.layer)}},{key:"map",get:function(){return h_(y_,this)}},{key:"eventList",get:function(){return h_(__,this).eventList}},{key:"on",value:function(t,e){return h_(__,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return h_(__,this).off(t,e,Fv)}},{key:"openEdit",value:function(){h_(y_,this).editGeom(this)}},{key:"closeEdit",value:function(){return!!h_(y_,this).getEditGeom(this)&&h_(y_,this).closeEditGeom(this)}},{key:"destroy",value:function(){return!!h_(y_,this)&&(h_(y_,this).removeFeature(this.layer),!0)}}],e&&a_(t.prototype,e),n&&a_(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function b_(t){var e,n,r,i;return t.path?(t.borderWidth=null!==(e=t.borderWidth)&&void 0!==e?e:1,t.borderColor=null!==(n=t.borderColor)&&void 0!==n?n:"#fff",t.width=null!==(r=t.width)&&void 0!==r?r:3,t.color=null!==(i=t.color)&&void 0!==i?i:"#1199ff",t):(console.error("path is error."),!1)}var w_=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Qo(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Nf({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:fp,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getJustify=function(){return this.justify_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Qo(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setJustify=function(t){this.justify_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),E_=w_,C_=n(2543),S_=n.n(C_);function P_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function I_(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?P_(Object(n),!0).forEach(function(e){L_(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P_(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function M_(t){return M_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M_(t)}function O_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,R_(r.key),r)}}function L_(t,e,n){return(e=R_(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R_(t){var e=function(t,e){if("object"!=M_(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=M_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==M_(e)?e:e+""}function k_(t,e,n){T_(t,e),e.set(t,n)}function T_(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function N_(t,e){return t.get(D_(t,e))}function A_(t,e,n){return t.set(D_(t,e),n),n}function D_(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var F_={font:'14px "Fira Sans", sans-serif',textAlign:"center",justify:void 0,textBaseline:"middle",fill:"#333",stroke:"#0000",borderWidth:0,backgroundFill:void 0,backgroundStroke:void 0,backgroundBorder:void 0,padding:void 0,rotation:void 0,draggable:!1,fitZoom:14,scaleFactor:void 0},j_={},G_=new WeakMap,B_=new WeakMap,z_=new WeakMap,V_=new WeakMap,U_=new WeakMap,W_=new WeakMap,X_=new WeakMap,q_=new WeakMap,Y_=new WeakSet,H_=function(){return t=function t(e){var n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),T_(n=this,r=Y_),r.add(n),k_(this,G_,void 0),k_(this,B_,void 0),k_(this,z_,void 0),k_(this,V_,14),k_(this,U_,""),k_(this,W_,void 0),k_(this,X_,void 0),k_(this,q_,void 0),L_(this,"draggable",!1),L_(this,"modify",void 0),L_(this,"scaleFactorCallback",function(){var t=N_(B_,i).getZoom();if("function"!==M_(N_(W_,i)).toLocaleLowerCase()){var e=t-i.getFitZoom(),n=Math.pow(N_(W_,i),Math.abs(e)),r=document.createElement("div");r.style.font=N_(U_,i),r.style.fontSize=r.style.fontSize.replace(/\d+/,function(t){return e>0?Math.round(parseFloat(t)/n).toString():Math.round(parseFloat(t)*n).toString()});var o="".concat(r.style.fontSize," ").concat(r.style.fontFamily);i.style.getText().setFont(o),N_(G_,i).changed()}else N_(W_,i).call(i,t)}),this.init(D_(Y_,this,Z_).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;A_(z_,this,Rv()),A_(G_,this,new Na({geometry:new Io(t.position),name:N_(z_,this)})),t.offset||(t.offset=[0,0]);var e={text:t.content,font:"".concat(t.fontSize," ").concat(t.fontFamily||"sans-serif"),offsetX:t.offset[0],offsetY:t.offset[1],textAlign:t.textAlign,justify:t.justify,textBaseline:t.textBaseline,fill:new Nf({color:t.fill}),stroke:new Df({color:t.stroke,width:t.borderWidth}),padding:t.padding,placement:"point",rotation:t.rotation},n=new Vf({text:new E_(e)});if(this.style=n,N_(G_,this).setStyle(n),t.group)if(this.group=t.group,j_[t.group])this.layer=j_[t.group],this.layer.addFeature(N_(G_,this));else{var r=new pv({features:[N_(G_,this)],zIndex:(t.zIndex||0)+1e4});j_[t.group]=r,this.layer=r}else this.layer=new pv({features:[N_(G_,this)],zIndex:(t.zIndex||0)+1e4});t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable),t.scaleFactor&&(A_(W_,this,t.scaleFactor),A_(V_,this,t.fitZoom||14),A_(U_,this,"".concat(t.fontSize||14," ").concat(t.fontFamily||"sans-serif")),this.setScaleFactor(t.scaleFactor),this.scaleFactorCallback())}},{key:"feature",get:function(){return N_(G_,this)}},{key:"getFitZoom",value:function(){return N_(V_,this)}},{key:"getScaleFactor",value:function(){return N_(W_,this)}},{key:"getVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setMap",value:function(t){N_(B_,this)&&(N_(B_,this).removeFeature(this.layer),this.getScaleFactor()&&N_(B_,this).map.getView().un("change:resolution",this.scaleFactorCallback)),t?(t.addFeature(this.layer),A_(B_,this,t),A_(q_,this,new Mv(this,N_(B_,this).map)),this.getScaleFactor()&&N_(B_,this).map.getView().on("change:resolution",this.scaleFactorCallback)):N_(B_,this)&&N_(B_,this).removeFeature(this.layer)}},{key:"map",get:function(){return N_(B_,this)}},{key:"setPosition",value:function(t){N_(G_,this).getGeometry().setCoordinates(t)}},{key:"position",get:function(){return N_(G_,this).getGeometry().getCoordinates()}},{key:"setText",value:function(t){N_(G_,this).getStyle().getText().setText(t),N_(G_,this).changed()}},{key:"setRotation",value:function(t){N_(G_,this).getStyle().getText().setRotation(t),N_(G_,this).changed()}},{key:"eventList",get:function(){return N_(q_,this).eventList}},{key:"on",value:function(t,e){return N_(q_,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return N_(q_,this).off(t,e,Fv)}},{key:"setDraggable",value:function(t){if(this.draggable=t,t)this.modify||(this.modify=new Wd({hitDetection:this.layer,source:this.layer.getSource()})),N_(B_,this).map.addInteraction(this.modify);else{if(!this.modify)return;N_(B_,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"setScaleFactor",value:function(t){console.log("开启跟随缩放"),N_(X_,this)?(N_(B_,this).map.getView().un("change:resolution",N_(X_,this)),A_(X_,this,void 0)):A_(X_,this,S_().throttle(this.scaleFactorCallback,600)),t?N_(B_,this)&&N_(B_,this).map.getView().on("change:resolution",N_(X_,this)):N_(X_,this)&&(N_(B_,this).map.getView().un("change:resolution",N_(X_,this)),A_(X_,this,void 0))}},{key:"destroy",value:function(){return!!N_(B_,this)&&(N_(B_,this).removeFeature(this.layer),!0)}}],e&&O_(t.prototype,e),n&&O_(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Z_(t){return t.position?t.content?(t.rotation||(t.rotation=0),I_(I_({},F_),t)):(console.error("content is error."),!1):(console.error("position is error."),!1)}function K_(t){return function(t){if(Array.isArray(t))return J_(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return J_(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J_(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J_(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function $_(t){return $_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$_(t)}function Q_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function tm(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Q_(Object(n),!0).forEach(function(e){nm(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Q_(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function em(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rm(r.key),r)}}function nm(t,e,n){return(e=rm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rm(t){var e=function(t,e){if("object"!=$_(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=$_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$_(e)?e:e+""}function im(t,e,n){om(t,e),e.set(t,n)}function om(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sm(t,e){return t.get(um(t,e))}function am(t,e,n){return t.set(um(t,e),n),n}function um(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var lm=[new Vf({fill:new Nf({color:[255,255,255,.5]})}),new Vf({stroke:new Df({color:[255,255,255,1],width:5})}),new Vf({stroke:new Df({color:[0,153,255,1],width:3})})],cm=new WeakMap,hm=new WeakMap,fm=new WeakMap,pm=new WeakMap,dm=new WeakMap,gm=new WeakMap,ym=new WeakMap,vm=new WeakMap,_m=new WeakMap,mm=new WeakMap,xm=new WeakSet,bm=function(){return t=function t(e){var n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),om(n=this,r=xm),r.add(n),im(this,cm,{}),im(this,hm,void 0),im(this,fm,void 0),im(this,pm,void 0),im(this,dm,void 0),im(this,gm,new Map),im(this,ym,void 0),im(this,vm,void 0),im(this,_m,new WeakMap),im(this,mm,0),nm(this,"_instance",void 0),nm(this,"isShowLength",!1),nm(this,"drawStartCB",function(t){t.feature.getGeometry().on("change",function(t){if(!i.isShowLength)return!1;var e=t.target,n=[];e.getCoordinates()[0].reduce(function(t,e){if(!t)return e;var r=[(t[0]+e[0])/2,(t[1]+e[1])/2],i=bu(Ba([t,e]));i=i<1?Math.round(1e3*i*100)/100+" m":Math.round(100*i)/100+" km";var o=Math.atan2(t[0]-e[0],t[1]-e[1])+Math.PI/2;return n.push({position:r,content:i,rotation:o}),e},!1),n.forEach(function(t,e){var n=sm(ym,i).textList[e];n?(n.setRotation(t.rotation),n.setText(t.content),n.setPosition(t.position)):(n=new H_(tm(tm({},t),{},{textBaseline:"bottom",fill:"#ffffff",stroke:"#2b2b2b",borderWidth:4,padding:[2,2,2,2],fontSize:"16px",map:i})),sm(ym,i).textList[e]=n)})})}),nm(this,"measureTooltipElement",void 0),nm(this,"measureTooltip",void 0),nm(this,"measureTooltipList",[]),nm(this,"count",0),nm(this,"measureSingleclickCB",function(t){i.measureTooltip.setPosition(t.coordinate),0===i.count&&(i.measureTooltipElement.innerHTML="");var e=new Io(t.coordinate);return i.gageLengthLayer.getSource().addFeature(new Na(e)),i.measureTooltipElement.className="measure tooltip tooltip-static",um(xm,i,Sm).call(i),i.count++,!0}),nm(this,"gageLengthLayer",void 0),nm(this,"isMeasure",!1),e.undoCB&&(this.undoCB=e.undoCB),e.undoDrawCB&&(this.undoDrawCB=e.undoDrawCB);try{if(e._instance&&e._instance.map)return this._instance=e._instance,am(hm,this,e._instance.map._instance._map),this}catch(n){console.error("instance error in options")}this.baseOptions=e,am(cm,this,um(xm,this,Cm).call(this,e)),am(pm,this,new Mv(this,sm(hm,this)))},e=[{key:"init",value:function(t){var e=this;t.zoom=2,console.log("这里是什么时候调用的?",t),console.log("init map",t),am(hm,this,new Ra(tm({interactions:Ma({shiftDragZoom:!1}).extend([new Xs({condition:Ds})])},t))),this._instance=sm(hm,this),setTimeout(function(){console.log("Map zoom:",e.getZoom())},2220)}},{key:"getZoom",value:function(){return sm(hm,this).getView().getZoom()}},{key:"getRotation",value:function(){return sm(hm,this).getView().getRotation()}},{key:"map",get:function(){return sm(hm,this)}},{key:"addFeature",value:function(t){if(sm(hm,this).getAllLayers().indexOf(t)>=0)return!1;sm(hm,this).addLayer(t)}},{key:"removeFeature",value:function(t){sm(hm,this).removeLayer(t)}},{key:"addMarker",value:function(t){if(!t)return!1;t.setMap(this)}},{key:"addTileLayer",value:function(t){if(!t)return!1;t.setMap(this)}},{key:"addOverlay",value:function(t){if(!t)return!1;sm(hm,this).addOverlay(t)}},{key:"removeOverlay",value:function(t){sm(hm,this).removeOverlay(t)}},{key:"addInfoWindow",value:function(t){if(!t||!t.setMap)return!1;t.setMap(this)}},{key:"addControl",value:function(t){if(!t||!t.setMap)return!1;t.setMap(this)}},{key:"eventList",get:function(){return sm(pm,this).eventList}},{key:"on",value:function(t,e){if("drawend"!==t)return sm(pm,this).on(t,e,bv);am(vm,this,e)}},{key:"off",value:function(t,e){return sm(pm,this).off(t,e,bv)}},{key:"editGeom",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(sm(gm,this).get(t))return sm(gm,this).get(t);sm(_m,this).set(t,[]),this.undoCB&&this.undoCB(sm(_m,this).get(t).length,t);var o={source:t.layer.getSource(),condition:i};n&&(o.style=n),am(dm,this,{geom:t,sourceStyle:t.style,modify:new Wd(o),snap:new Zd({source:t.layer.getSource()})}),sm(gm,this).set(t,sm(dm,this)),this.modify=sm(dm,this).modify,this.modify.on("modifystart",function(e){i(e);var n=e.features.item(0),o=new Na;o.setGeometry(n.getGeometry().clone()),o.setGeometryName(n.getGeometryName()),o.setStyle(n.getStyle()),o.ol_uid=n.ol_uid;var s=sm(_m,r).get(t);s.push(o),sm(_m,r).set(t,s),r.undoCB&&r.undoCB(sm(_m,r).get(t).length,t)}),this.modify.on("modifyend",function(t){i(t)}),this.snap=sm(dm,this).snap,this.snap.on("change:active",function(t){console.log("change:active",t)}),sm(hm,this).addInteraction(sm(dm,this).modify),sm(hm,this).addInteraction(sm(dm,this).snap),Array.isArray(t.feature)?t.feature.forEach(function(t){e?t.setStyle(e):t.setStyle(lm)}):e?t.feature.setStyle(e):t.feature.setStyle(lm)}},{key:"getEditGeom",value:function(t){return sm(gm,this).get(t)}},{key:"getAllEditGeom",value:function(){return sm(gm,this)}},{key:"getUndoStack",value:function(){return sm(_m,this)}},{key:"getUndoCountForGeom",value:function(t){return t?sm(_m,this).get(t).length:0}},{key:"undoEditForGeom",value:function(t){var e=sm(_m,this).get(t).pop();this.undoCB&&this.undoCB(sm(_m,this).get(t).length,t),console.log(e.ol_uid);var n=t.layer.getSource(),r=n.getFeatureByUid(e.ol_uid);n.removeFeature(r),n.addFeature(e)}},{key:"deletePointForGeom",value:function(t){if(!t)return!1;sm(gm,this).get(t).modify.removePoint()}},{key:"closeEditGeom",value:function(t){var e=sm(gm,this).get(t);return e&&(sm(gm,this).delete(t),sm(_m,this).delete(t),this.undoCB&&this.undoCB(0,t),this.closeEdit(e)),null==e?void 0:e.geom}},{key:"closeAllEditGeom",value:function(){var t=this;sm(gm,this).forEach(function(e){t.closeEdit(e)}),sm(gm,this).clear()}},{key:"closeEdit",value:function(t){sm(hm,this).removeInteraction(t.modify),sm(hm,this).removeInteraction(t.snap);var e=t.geom.layer.getSource().getFeatures();Array.isArray(e)?e.forEach(function(e){e.setStyle(t.sourceStyle)}):e.setStyle(t.sourceStyle)}},{key:"startDraw",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},r=arguments.length>3?arguments[3]:void 0;if(sm(ym,this))return!1;var i=this;"function"===$_(e).toLocaleLowerCase()&&am(vm,this,e);var o={polygon:"Polygon",polyline:"LineString",smartPolygon:"Polygon",riskArea:"Polygon"},s=new pv([]),a=s.getSource(),u={type:o[t],source:a,snapTolerance:1,condition:function(t){var e;return am(mm,i,(e=sm(mm,i),++e)),i.undoDrawCB&&i.undoDrawCB(sm(mm,i)),n(t)}};r&&(u.style=r);var l=new Eg(u),c=new Zd({source:a});return am(ym,this,{vectorLayer:s,draw:l,snap:c,type:t,textList:[]}),sm(hm,this).addLayer(s),sm(hm,this).addInteraction(l),sm(hm,this).addInteraction(c),sm(hm,this).getTargetElement().style.cursor="crosshair","Polygon"===o[t]&&l.on("drawstart",this.drawStartCB),l.once("drawend",function(e){i.stopDraw(e.feature.getGeometry().getCoordinates()),"Polygon"===o[t]&&l.un("drawstart",i.drawStartCB)}),s}},{key:"hideLength",value:function(){var t;this.isShowLength=!1,(null===(t=sm(ym,this))||void 0===t?void 0:t.textList.length)>0&&sm(ym,this).textList.forEach(function(t){return t.destroy()})}},{key:"showLength",value:function(){this.isShowLength=!0}},{key:"undoDraw",value:function(){var t;sm(ym,this)&&(sm(ym,this).draw.removeLastPoint(),am(mm,this,(t=sm(mm,this),--t)),this.undoDrawCB&&this.undoDrawCB(sm(mm,this)))}},{key:"drawGeom",get:function(){return sm(ym,this)}},{key:"endDraw",value:function(){sm(ym,this)&&sm(ym,this).draw.finishDrawing()}},{key:"cancelDraw",value:function(){if(sm(ym,this)){sm(ym,this).draw.abortDrawing(),sm(hm,this).getTargetElement().style.cursor="auto";var t=sm(ym,this),e=t.vectorLayer,n=t.draw,r=t.snap;sm(ym,this).textList.length>0&&(sm(ym,this).textList.forEach(function(t){return t.destroy()}),sm(ym,this).textList=[]),am(ym,this,void 0);var i=this;setTimeout(function(){sm(hm,i).removeLayer(e),sm(hm,i).removeInteraction(n),sm(hm,i).removeInteraction(r)},0)}}},{key:"stopDraw",value:function(t){if(!sm(ym,this))return!1;sm(hm,this).getTargetElement().style.cursor="auto";var e,n,r=sm(ym,this),i=r.vectorLayer,o=r.draw,s=r.snap,a=r.type;if(sm(ym,this).textList.length>0&&sm(ym,this).textList.forEach(function(t){return t.destroy()}),am(ym,this,void 0),t)switch(a){case"polygon":n=new r_({path:t[0],map:this}),e={path:t[0],geom:n};break;case"polyline":e={path:t,geom:n=new x_({path:t,map:this})};break;case"riskArea":case"smartPolygon":e={path:t,geom:n=new r_({path:t,map:this,borderWidth:1,strokeColor:"#ffffff",fillColor:"#ffffff80"})};break;default:console.error("type is error.")}var u=this;setTimeout(function(){sm(hm,u).removeLayer(i),sm(hm,u).removeInteraction(o),sm(hm,u).removeInteraction(s)},0),"function"===$_(sm(vm,this)).toLocaleLowerCase()&&sm(vm,this).call(this,e)}},{key:"updateSize",value:function(){sm(hm,this).updateSize()}},{key:"setFitView",value:function(t,e){var n,r,i;Array.isArray(t)?t.forEach(function(t){var e;try{e=t.feature.getGeometry().getExtent()}catch(t){return}i||(i=e.map(function(t){return t})),i=Q(i,e)}):i=t.feature.getGeometry().getExtent();var o={padding:null!==(n=e.avoid)&&void 0!==n?n:[0,0,0,0],duration:null!==(r=e.duration)&&void 0!==r?r:.3};sm(fm,this).fit(i,o)}},{key:"setFitForGeom",value:function(t,e){var n,r,i={padding:null!==(n=e.avoid)&&void 0!==n?n:[0,0,0,0],duration:null!==(r=e.duration)&&void 0!==r?r:.3};sm(fm,this).fit(t,i)}},{key:"openMeasure",value:function(t){if(this.isMeasure)return console.error("Measurement is currently turned on."),!1;if(this.isMeasure=!0,"length"!==(t=null!=t?t:"length")&&"area"!==t)return!1;this.measureType=t,this.gageLengthLayer=new pv([]),sm(hm,this).addLayer(this.gageLengthLayer);var e=new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#fff",width:2}),image:new kf({fill:new Nf({color:"#e59810"}),stroke:new Df({color:"#ffffff",width:1}),radius:5})});this.gageLengthLayer.setStyle(e),this.gageLengthLayer.setZIndex(1e4);var n=this.gageLengthLayer.getSource(),r={type:"length"===t?"LineString":"Polygon",source:n,freehandCondition:function(){return!1},style:new Vf({fill:new Nf({color:"#ffffff4d"}),stroke:new Df({color:"#fff",width:2}),image:new kf({fill:new Nf({color:"#e59810"}),stroke:new Df({color:"#ffffff",width:1}),radius:5})})};r.finishCondition="length"===t?function(){return!1}:function(t){var e,n=t.coordinate,r=null===(e=o.measureDraw)||void 0===e?void 0:e.sketchLineCoords_;if(r){var i=r.at(-3);if(i&&i[0]===n[0]&&i[1]===n[1])return!1}return!0};var i=new Eg(r);this.measureDraw=i,sm(hm,this).addInteraction(i),um(xm,this,Sm).call(this);var o=this;this.count=0,i.on("drawabort",function(t){console.log("drawabort",t)}),i.on("drawstart",function(e){o.sketch=e.feature;var r=e.coordinate;o.listener=o.sketch.getGeometry().on("change",function(e){var n,i=e.target;if("length"===t){var s=bu(Ba(i.getCoordinates()));n=s<1?Math.round(1e3*s*100)/100+" m":Math.round(100*s)/100+" km",r=i.getLastCoordinate()}else{var a=i.getCoordinates()[0],u=bu(Ba(a.slice(0,-1)));n=u<1?Math.round(1e3*u*100)/100+" m":Math.round(100*u)/100+" km";var l=kv(i.getCoordinates()[0])/2e3*3;o.measureCentroidText=l>1e4?Math.round(l/1e4*100)/100+" 万亩":Math.round(100*l)/100+" 亩",o.measureCentroid=i.getInteriorPoint().getCoordinates(),r=a.slice(-2)[0]}o.measureTooltipElement.innerHTML=n,o.measureTooltip.setPosition(r)}),"length"!==t?(sm(hm,o).on("click",o.measureSingleclickCB),sm(hm,o).once("dblclick",function(t){var e=new Io(t.coordinate);n.addFeature(new Na(e))})):(sm(hm,o).on("click",o.measureSingleclickCB),sm(hm,o).once("dblclick",function(t){i.finishDrawing()}))},this),i.on("drawend",function(t){if(console.log("drawend"),"length"===o.measureType)return!1;"area"===o.measureType&&(um(xm,o,Sm).call(o),o.measureTooltipElement.innerHTML=o.measureCentroidText,o.measureTooltip.setPosition(o.measureCentroid)),o.measureTooltipElement.className="measure tooltip tooltip-static",o.sketch=null,o.measureTooltipElement=null,o.count=0,ge(o.listener),sm(hm,o).un("click",o.measureSingleclickCB),um(xm,o,Sm).call(o)},this)}},{key:"closeMeasure",value:function(){var t,e=this;this.isMeasure=!1,null===(t=this.gageLengthLayer)||void 0===t||t.getSource().clear(),sm(hm,this).removeLayer(this.gageLengthLayer),this.measureTooltipList.forEach(function(t){sm(hm,e).removeOverlay(t)}),this.measureTooltipList=[],sm(hm,this).removeInteraction(this.measureDraw),sm(hm,this).un("singleclick",this.measureSingleclickCB),sm(hm,this).un("dbclick",this.measureSingleclickCB),sm(hm,this).un("click",this.measureSingleclickCB)}},{key:"destroy",value:function(){try{var t=document.querySelector("#".concat(sm(cm,this).target)),e=t.cloneNode(),n=t.parentNode,r=document.createElement("div");n.insertBefore(r,t),n.removeChild(t),r.parentNode.insertBefore(e,r),n.removeChild(r)}catch(t){console.error("target error in options.")}am(hm,this,null),this._instance=null}}],e&&em(t.prototype,e),n&&em(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function wm(){return{target:"mapbox",zoom:15,zooms:[1,18],center:[116.4,39.9],layers:um(xm,this,Em).call(this)}}function Em(){var t,e,n,r;this.baseOptions.zooms?n=this.baseOptions.zooms[1]:n=null!==(r=this.baseOptions.maxZoom)&&void 0!==r?r:18;return[new ey({name:"default_DT",zIndex:100,source:new Ny({minZoom:1,maxZoom:null!==(t=this.baseOptions.tileMax)&&void 0!==t?t:n,crossOrigin:"anonymous",url:"https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"})}),new ey({name:"default_BZ",zIndex:100,source:new Ny({minZoom:1,maxZoom:null!==(e=this.baseOptions.tileMax)&&void 0!==e?e:n,crossOrigin:"anonymous",url:"https://webst04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"})})]}function Cm(){var t,e,n,r,i,o,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=um(xm,this,wm).call(this);s.target&&(a.target=s.target),s.layerConfig&&0!==s.layerConfig.layers.length&&(s.layerConfig.default||(a.layers=[]),a.layers=[].concat(K_(a.layers),K_(s.layerConfig.layers))),this.layers=a.layers,a.controls=vs({attribution:null!==(t=null===(e=s.controls)||void 0===e?void 0:e.attribution)&&void 0!==t&&t,zoom:null!==(n=null===(r=s.controls)||void 0===r?void 0:r.zoom)&&void 0!==n&&n,rotate:null!==(i=null===(o=s.controls)||void 0===o?void 0:o.rotate)&&void 0!==i&&i});var u=tm({},gv);s.initViewConfig&&(u=tm(tm({},gv),s.initViewConfig)),s.zoom&&(u.zoom=s.zoom),Array.isArray(s.zooms)&&2===s.zooms.length&&(u.minZoom=s.zooms[0],u.maxZoom=s.zooms[1]),s.center&&(u.center=s.center);var l=new Jo(u);return am(fm,this,l),a.view=l,a}function Sm(){this.measureTooltipElement=document.createElement("div"),this.measureTooltipElement.className="measure tooltip tooltip-measure",this.measureTooltip&&this.measureTooltipList.push(this.measureTooltip),this.measureTooltip=new Vy({element:this.measureTooltipElement,offset:[0,-15],positioning:"bottom-center"}),sm(hm,this).addOverlay(this.measureTooltip)}function Pm(t){return Pm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pm(t)}function Im(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Om(r.key),r)}}function Mm(t,e,n){return(e=Om(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Om(t){var e=function(t,e){if("object"!=Pm(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Pm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Pm(e)?e:e+""}function Lm(t,e,n){Rm(t,e),e.set(t,n)}function Rm(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function km(t,e){return t.get(Nm(t,e))}function Tm(t,e,n){return t.set(Nm(t,e),n),n}function Nm(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Am={},Dm=new WeakMap,Fm=new WeakMap,jm=new WeakMap,Gm=new WeakMap,Bm=new WeakMap,zm=new WeakSet,Vm=new WeakMap,Um=new WeakMap,Wm=function(){return t=function t(e){var n,r,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Rm(n=this,r=zm),r.add(n),Lm(this,Dm,void 0),Lm(this,Fm,void 0),Lm(this,jm,void 0),Lm(this,Gm,void 0),Lm(this,Bm,0),Mm(this,"draggable",!1),Mm(this,"modify",void 0),Lm(this,Vm,!1),Lm(this,Um,function(t){km(Vm,i)&&(i.moveBasePosition=i.startPosition,Tm(Vm,i,!1),Tm(Bm,i,0));var e=t.frameState.time,n=e-i.moveBaseTime;i.moveBaseTime=e;var r=parseFloat(i.moveMultiply||1);if(Tm(Bm,i,km(Bm,i)+i.moveSpeed*n/6e4*r),km(Bm,i)>i.moveLength)return i.pauseMove(),Tm(Vm,i,!0),i.moveFinishCB&&i.moveFinishCB(),!0;var o,s=km(Bm,i)/i.moveLength%2;if(i.ratio=s,i.movePathList){var a,u=null!==(a=i.movePathList.findIndex(function(t){return s>t[0]&&s<=t[1]}))&&void 0!==a?a:i.movePathList.length-1;-1===u&&(u=0);var l=i.movePathList[u],c=(s-l[0])/(l[1]-l[0]);o=i.movePath.getLineString(u).getCoordinateAt(c>1?2-c:c)}else o=i.movePath.getCoordinateAt(s>1?2-s:s);if(i.setPosition(o),i.options.autoRotation){var h=o[0]-i.moveBasePosition[0],f=o[1]-i.moveBasePosition[1],p=-Math.atan2(f,h);km(Dm,i).getStyle().getImage().setRotation(i.options.rotation+p)}i.moveBasePosition=o,i.movePlayingCB&&i.movePlayingCB(s)}),this.options=e,this.init(Nm(zm,this,Xm).call(this,e))},e=[{key:"init",value:function(t){if(!t)return!1;var e;if(Tm(jm,this,Rv()),Tm(Dm,this,new Na({geometry:new Io(t.position),name:km(jm,this)})),t.src)t.activeSrc||(t.activeSrc=t.src),e=new Vf({image:new cd({anchor:t.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:t.src,offset:t.offset,rotation:t.rotation,scale:t.scale})});else{var n,r,i,o=new Nf({color:null!==(n=t.color)&&void 0!==n?n:"rgba(37, 165, 247,0.6)"}),s=new Df({color:null!==(r=t.borderColor)&&void 0!==r?r:"#ffeeff",width:null!==(i=t.borderWidth)&&void 0!==i?i:2});e=new Vf({image:new kf({fill:o,stroke:s,radius:5})})}if(t.text){var a=t.fontSize,u=void 0===a?14:a,l=t.scale,c=void 0===l?1:l;u*=c;var h={text:t.text,font:"".concat(u,"px ").concat(t.fontFamily||"sans-serif"),textAlign:"center",textBaseline:"top",offsetY:-62*c,fill:new Nf({color:"#fff"}),placement:"point"};e.setText(new E_(h))}if(this.style=e,this.options=t,km(Dm,this).setStyle(e),t.group)if(this.group=t.group,Am[t.group])this.layer=Am[t.group],this.layer.addFeature(km(Dm,this));else{var f=new pv({features:[km(Dm,this)],zIndex:(t.zIndex||0)+1e4});Am[t.group]=f,this.layer=f}else this.layer=new pv({features:[km(Dm,this)],zIndex:(t.zIndex||0)+1e4});t.map&&this.setMap(t.map),t.draggable&&this.setDraggable(t.draggable)}},{key:"feature",get:function(){return km(Dm,this)}},{key:"setGroup",value:function(t){if(!t)return!1;this.group&&Am[this.group].removeFeature(km(Dm,this)),Am[t]?(this.layer.removeFeature(km(Dm,this)),this.layer=Am[t],Am[t].addFeature(km(Dm,this))):Am[t]=this.layer}},{key:"getGroup",value:function(){return this.group}},{key:"getVisible",value:function(){return this.layer.getVisible()}},{key:"show",value:function(){this.layer.setVisible(!0)}},{key:"hide",value:function(){this.layer.setVisible(!1)}},{key:"setScale",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(e=parseFloat(e),isNaN(e))return!1;null===(t=this.style.getImage())||void 0===t||t.setScale(e),km(Dm,this).changed()}},{key:"setTextFontSize",value:function(t){var e,n,r,i,o,s,a="".concat(t,"px ").concat(this.options.fontFamily||"sans-serif");switch(null===(e=this.style.getText())||void 0===e||e.setFont(a),t){case 14:null===(n=this.style.getText())||void 0===n||n.setOffsetY(-25);break;case 12:null===(r=this.style.getText())||void 0===r||r.setOffsetY(-22);break;case 9:null===(i=this.style.getText())||void 0===i||i.setOffsetY(-18);break;case 7:null===(o=this.style.getText())||void 0===o||o.setOffsetY(-14);break;default:null===(s=this.style.getText())||void 0===s||s.setOffsetY(-25)}}},{key:"setMap",value:function(t){km(Fm,this)&&km(Fm,this).removeFeature(this.layer),t?(t.addFeature(this.layer),Tm(Fm,this,t),Tm(Gm,this,new Mv(this,km(Fm,this).map))):km(Fm,this)&&km(Fm,this).removeFeature(this.layer)}},{key:"map",get:function(){return km(Fm,this)}},{key:"setPosition",value:function(t){km(Dm,this).getGeometry().setCoordinates(t),km(Dm,this).changed()}},{key:"position",get:function(){return km(Dm,this).getGeometry().getCoordinates()}},{key:"moveAlong",value:function(t){var e,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;if(!this.map)return!1;if(this.startPosition=t[0],this.moveBaseTime=Date.now(),this.moveBasePosition=this.startPosition,Array.isArray(t[0][0])){this.movePath=new sg(t),e=Va(t);var s=0;this.moveLength=bu(e,{units:"kilometers"}),this.movePathList=t.map(function(t){var e=bu(Ba(t),{units:"kilometers"}),r=s,i=e/n.moveLength;return[r,s+=i]})}else this.movePath=new rg(t),e=Ba(t),this.moveLength=bu(e,{units:"kilometers"});this.moveSpeed=r,this.layer.on("postrender",km(Um,this)),this.map.map.render(),"function"===Pm(i).toLocaleLowerCase()&&(this.moveFinishCB=i),"function"===Pm(o).toLocaleLowerCase()&&(this.movePlayingCB=o)}},{key:"setMoveRatio",value:function(t){if(this.ratio=t,Tm(Bm,this,this.moveLength*t),km(Bm,this)>this.moveLength)return this.pauseMove(),Tm(Vm,this,!0),this.moveFinishCB&&this.moveFinishCB(),!0;var e;if(this.movePathList){var n,r=null!==(n=this.movePathList.findIndex(function(e){return t>e[0]&&t<=e[1]}))&&void 0!==n?n:this.movePathList.length-1;-1===r&&(r=0);var i=this.movePathList[r],o=(t-i[0])/(i[1]-i[0]);e=this.movePath.getLineString(r).getCoordinateAt(o>1?2-o:o)}else e=this.movePath.getCoordinateAt(t>1?2-t:t);this.setPosition(e)}},{key:"setMoveMultiply",value:function(t){isNaN(parseFloat(t))&&(t=1),this.moveMultiply=t}},{key:"getMoveMultiply",value:function(){var t;return null!==(t=this.moveMultiply)&&void 0!==t?t:1}},{key:"pauseMove",value:function(){this.layer.un("postrender",km(Um,this))}},{key:"resumeMove",value:function(){this.map&&(this.moveBaseTime=Date.now(),this.layer.on("postrender",km(Um,this)),this.map.map.render())}},{key:"setSrc",value:function(t){var e;if(t)e=new Vf({image:new cd({anchor:this.options.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:t,offset:this.options.offset,rotation:this.options.rotation})});else{var n=new Nf({color:"rgba(37, 165, 247,0.6)"}),r=new Df({color:"#ffeeff",width:2});e=new Vf({image:new kf({fill:n,stroke:r,radius:5})})}this.style=e,km(Dm,this).setStyle(e)}},{key:"eventList",get:function(){return km(Gm,this).eventList}},{key:"on",value:function(t,e){if("dragstart"!==t){if("dragend"!==t)return km(Gm,this).featureOn(t,e,Fv);this.dragEndCallback=e}else this.dragStartCallback=e}},{key:"off",value:function(t,e){if("dragstart"!==t){if("dragend"!==t)return km(Gm,this).off(t,e,Fv);this.dragEndCallback=void 0}else this.dragStartCallback=void 0}},{key:"setDraggable",value:function(t){if(this.draggable=t,t){if(!this.modify){this.modify=new Wd({hitDetection:this.layer,source:this.layer.getSource()});var e=this;this.modify.on("modifystart",function(t){"function"===Pm(e.dragStartCallback).toLocaleLowerCase()&&e.dragStartCallback(t)}),this.modify.on("modifyend",function(t){"function"===Pm(e.dragEndCallback).toLocaleLowerCase()&&e.dragEndCallback(t)})}km(Fm,this).map.addInteraction(this.modify)}else{if(!this.modify)return;km(Fm,this).map.removeInteraction(this.modify)}}},{key:"getDraggable",value:function(){return this.draggable}},{key:"setActive",value:function(t){if(this.active=t,!this.options.activeSrc)return!1;t?this.setSrc(this.options.activeSrc):this.setSrc(this.options.src)}},{key:"isActive",value:function(){return!!this.active}},{key:"destroy",value:function(){return!!km(Fm,this)&&(km(Fm,this).removeFeature(this.layer),!0)}}],e&&Im(t.prototype,e),n&&Im(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Xm(t){var e;return t.position?(t.anchor||(t.anchor=[0,0]),t.offset||(t.offset=[0,0]),t.rotation||(t.rotation=0),t.scale=null!==(e=t.scale)&&void 0!==e?e:1,t):(console.error("position is error."),!1)}function qm(t){return qm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qm(t)}function Ym(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hm(r.key),r)}}function Hm(t){var e=function(t,e){if("object"!=qm(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=qm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==qm(e)?e:e+""}function Zm(t,e,n){Km(t,e),e.set(t,n)}function Km(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jm(t,e){return t.get(Qm(t,e))}function $m(t,e,n){return t.set(Qm(t,e),n),n}function Qm(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var tx=new WeakMap,ex=new WeakMap,nx=new WeakMap,rx=new WeakMap,ix=new WeakSet,ox=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Km(n=this,r=ix),r.add(n),Zm(this,tx,void 0),Zm(this,ex,void 0),Zm(this,nx,void 0),Zm(this,rx,void 0),this.init(Qm(ix,this,sx).call(this,e))},e=[{key:"init",value:function(t){if(console.log("options",t),!t)return!1;if(!t.dom)throw new Error("dom is error.");$m(nx,this,Rv());var e=t.dom;if("string"===qm(e).toLocaleLowerCase()&&(e=document.querySelector("#".concat(t.dom))),!(e instanceof Element))throw new Error("dom is error.");$m(tx,this,new Vy({position:t.position,element:e})),t.map&&this.setMap(t.map)}},{key:"feature",get:function(){return Jm(tx,this)}},{key:"setPosition",value:function(t){Jm(tx,this).setPosition(t)}},{key:"getPosition",value:function(){return Jm(tx,this).getPosition()}},{key:"isVisible",value:function(){return"none"!==this.feature.getElement().style.display}},{key:"show",value:function(){this.feature.getElement().style.display="block"}},{key:"hide",value:function(){this.feature.getElement().style.display="none"}},{key:"setMap",value:function(t){Jm(ex,this)&&Jm(ex,this).removeOverlay(Jm(tx,this)),t?(t.addOverlay(Jm(tx,this)),$m(ex,this,t),$m(rx,this,new Mv(this,Jm(ex,this).map))):Jm(ex,this)&&Jm(ex,this).removeOverlay(Jm(tx,this))}},{key:"map",get:function(){return Jm(ex,this)}},{key:"eventList",get:function(){return Jm(rx,this).eventList}},{key:"on",value:function(t,e){return Jm(rx,this).featureOn(t,e,Fv)}},{key:"off",value:function(t,e){return Jm(rx,this).off(t,e,Fv)}},{key:"destroy",value:function(){return!!Jm(ex,this)&&(Jm(ex,this).removeOverlay(Jm(tx,this)),!0)}}],e&&Ym(t.prototype,e),n&&Ym(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function sx(t){return t.position?(t.anchor||(t.anchor="bottom-center"),t.offset||(t.offset=[0,0]),t.fillColor||(t.fillColor="#1199ffaa"),t):(console.error("position is error."),!1)}function ax(t){return ax="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ax(t)}function ux(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function lx(t,e,n){return(e=hx(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hx(r.key),r)}}function hx(t){var e=function(t,e){if("object"!=ax(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=ax(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ax(e)?e:e+""}function fx(t,e,n){px(t,e),e.set(t,n)}function px(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dx(t,e){return t.get(yx(t,e))}function gx(t,e,n){return t.set(yx(t,e),n),n}function yx(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var vx={name:Rv(),minZoom:1,maxZoom:18,zIndex:101},_x=new WeakMap,mx=new WeakMap,xx=new WeakMap,bx=new WeakSet,wx=function(){return t=function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),px(n=this,r=bx),r.add(n),fx(this,_x,void 0),fx(this,mx,void 0),fx(this,xx,void 0),gx(_x,this,yx(bx,this,Ex).call(this,e)),gx(mx,this,this.init(dx(_x,this))),dx(_x,this).map&&this.setMap(dx(_x,this).map)},e=[{key:"init",value:function(t){return!!t.tileUrl&&new ey({name:t.name,zIndex:t.zIndex,source:new Ny({minZoom:t.minZoom,maxZoom:t.maxZoom,url:t.tileUrl,crossOrigin:"anonymous"})})}},{key:"layer",get:function(){return dx(mx,this)}},{key:"getTileName",value:function(){return dx(_x,this).name}},{key:"setMap",value:function(t){dx(xx,this)&&dx(xx,this).removeFeature(dx(mx,this)),t?(t.addFeature(dx(mx,this)),gx(xx,this,t)):dx(xx,this)&&dx(xx,this).removeFeature(dx(mx,this))}}],e&&cx(t.prototype,e),n&&cx(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Ex(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ux(Object(n),!0).forEach(function(e){lx(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ux(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},vx);return t.zooms&&Array.isArray(t.zooms)&&(e.minZoom=t.zooms[0],e.maxZoom=t.zooms[1]),t.name&&(e.name=t.name),e.tileUrl=t.tileUrl,t.zIndex&&(e.zIndex=t.zIndex),e.map=t.map,e}var Cx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sx=function(t){function e(e,n,r,i,o){var s=this,a=void 0!==o?mf:bf;return(s=t.call(this,e,n,r,a)||this).loader_=void 0!==o?o:null,s.canvas_=i,s.error_=null,s}return Cx(e,t),e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=wf):this.state=bf,this.changed()},e.prototype.load=function(){this.state==mf&&(this.state=xf,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(nd),Px=Sx,Ix=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mx=function(t){function e(e,n,r,i,o,s,a){var u=this,l=e.getExtent(),c=n.getExtent(),h=c?ft(r,c):r,f=Ug(e,n,at(h),i),p=new Fg(e,n,h,l,.5*f,i),d=s(p.calculateSourceExtent(),f,o),g=d?mf:Ef,y=d?d.getPixelRatio():1;return(u=t.call(this,r,i,y,g)||this).targetProj_=n,u.maxSourceExtent_=l,u.triangulation_=p,u.targetResolution_=i,u.targetExtent_=r,u.sourceImage_=d,u.sourcePixelRatio_=y,u.interpolate_=a,u.canvas_=null,u.sourceListenerKey_=null,u}return Ix(e,t),e.prototype.disposeInternal=function(){this.state==xf&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==bf){var e=gt(this.targetExtent_)/this.targetResolution_,n=ht(this.targetExtent_)/this.targetResolution_;this.canvas_=Wg(e,n,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==mf){this.state=xf,this.changed();var t=this.sourceImage_.getState();t==bf||t==wf?this.reproject_():(this.sourceListenerKey_=ce(this.sourceImage_,Qt,function(t){var e=this.sourceImage_.getState();e!=bf&&e!=wf||(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){fe(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(nd),Ox=Mx,Lx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rx="imageloadstart",kx="imageloadend",Tx="imageloaderror",Nx=function(t){function e(e,n){var r=t.call(this,e)||this;return r.image=n,r}return Lx(e,t),e}(Wt),Ax=function(t){function e(e){var n=this,r=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(r=e.interpolate),(n=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state,interpolate:r})||this).on,n.once,n.un,n.resolutions_=void 0!==e.resolutions?e.resolutions:null,n.reprojectedImage_=null,n.reprojectedRevision_=0,n}return Lx(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=i(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,n,r){var i=this.getProjection();if(i&&r&&!yi(i,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&yi(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&$(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Ox(i,r,t,e,n,function(t,e,n){return this.getImageInternal(t,e,n,i)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(r=i),this.getImageInternal(t,e,n,r)},e.prototype.getImageInternal=function(t,e,n,r){return h()},e.prototype.handleImageChange=function(t){var e,n=t.target;switch(n.getState()){case xf:this.loading=!0,e=Rx;break;case bf:this.loading=!1,e=kx;break;case wf:this.loading=!1,e=Tx;break;default:return}this.hasListener(e)&&this.dispatchEvent(new Nx(e,n))},e}(Sd);var Dx=Ax,Fx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jx=function(t){function e(e){var n=this,r=e||{},i=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(i=r.interpolate),(n=t.call(this,{attributions:r.attributions,interpolate:i,projection:r.projection,resolutions:r.resolutions,state:r.state})||this).canvasFunction_=r.canvasFunction,n.canvas_=null,n.renderedRevision_=0,n.ratio_=void 0!==r.ratio?r.ratio:1.5,n}return Fx(e,t),e.prototype.getImageInternal=function(t,e,n,r){e=this.findNearestResolution(e);var i=this.canvas_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==n&&W(i.getExtent(),t))return i;_t(t=t.slice(),this.ratio_);var o=[gt(t)/e*n,ht(t)/e*n],s=this.canvasFunction_.call(this,t,e,n,o,r);return s&&(i=new Px(t,e,n,s)),this.canvas_=i,this.renderedRevision_=this.getRevision(),i},e}(Dx),Gx=jx,Bx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zx=function(t){function e(e){var n=e||{};return t.call(this,n)||this}return Bx(e,t),e}(ze),Vx=zx,Ux=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wx=function(t){function e(e){var n=t.call(this,e)||this;return n.image_=null,n}return Ux(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,r=t.viewState,i=r.resolution,o=this.getLayer().getSource(),s=t.viewHints,a=t.extent;if(void 0!==e.extent&&(a=ft(a,Oi(e.extent,r.projection))),!s[Ar]&&!s[Dr]&&!vt(a))if(o){var u=r.projection,l=o.getImage(a,i,n,u);l&&(this.loadImage(l)?this.image_=l:l.getState()===Ef&&(this.image_=null))}else this.image_=null;return!!this.image_},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),r=O(e.pixelToCoordinateTransform,t.slice()),i=n.getExtent();if(i&&!U(i,r))return null;var o=this.image_.getExtent(),s=this.image_.getImage(),a=gt(o),u=Math.floor(s.width*((r[0]-o[0])/a));if(u<0||u>=s.width)return null;var l=ht(o),c=Math.floor(s.height*((o[3]-r[1])/l));return c<0||c>=s.height?null:this.getImageData(s,u,c)},e.prototype.renderFrame=function(t,e){var n=this.image_,r=n.getExtent(),i=n.getResolution(),o=n.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,u=t.viewState,l=u.center,c=a*i/(u.resolution*o),h=t.extent,f=u.resolution,p=u.rotation,d=Math.round(gt(h)/f*a),g=Math.round(ht(h)/f*a);L(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,p,-d/2,-g/2),R(this.inversePixelTransform,this.pixelTransform);var y=k(this.pixelTransform);this.useContainer(e,y,this.getBackground(t));var v=this.context,_=v.canvas;_.width!=d||_.height!=g?(_.width=d,_.height=g):this.containerReused||v.clearRect(0,0,d,g);var m=!1,x=!0;if(s.extent){var b=Oi(s.extent,u.projection);(m=(x=yt(b,t.extent))&&!W(b,t.extent))&&this.clipUnrotated(v,t,b)}var w=n.getImage(),E=L(this.tempTransform,d/2,g/2,c,c,0,o*(r[0]-l[0])/i,o*(l[1]-r[3])/i);this.renderedResolution=i*a/o;var C=w.width*E[0],S=w.height*E[3];if(this.getLayer().getSource().getInterpolate()||qt(v,jg),this.preRender(v,t),x&&C>=.5&&S>=.5){var P=E[4],I=E[5],M=s.opacity,O=void 0;1!==M&&(O=v.globalAlpha,v.globalAlpha=M),v.drawImage(w,0,0,+w.width,+w.height,P,I,C,S),1!==M&&(v.globalAlpha=O)}return this.postRender(v,t),m&&v.restore(),qt(v,Gg),y!==_.style.transform&&(_.style.transform=y),this.container},e}(Ip),Xx=Wx,qx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yx=function(t){function e(e){return t.call(this,e)||this}return qx(e,t),e.prototype.createRenderer=function(){return new Xx(this)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(Vx);
|
|
37
37
|
/*!
|
|
38
38
|
* author: [object Object]
|
|
39
39
|
* @sakitam-gis/kriging v0.1.0
|