@basemaps/landing 6.41.0 → 6.44.0
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/CHANGELOG.md +26 -0
- package/README.md +21 -0
- package/build/__tests__/map.config.test.js +0 -19
- package/build/__tests__/map.config.test.js.map +1 -1
- package/build/components/debug.js +3 -3
- package/build/components/debug.js.map +1 -1
- package/build/components/layer.switcher.dropdown.d.ts.map +1 -1
- package/build/components/layer.switcher.dropdown.js +26 -2
- package/build/components/layer.switcher.dropdown.js.map +1 -1
- package/build/components/layout.header.d.ts.map +1 -1
- package/build/components/layout.header.js +1 -1
- package/build/components/layout.header.js.map +1 -1
- package/build/components/map.d.ts.map +1 -1
- package/build/components/map.js +6 -3
- package/build/components/map.js.map +1 -1
- package/build/config.d.ts +2 -0
- package/build/config.d.ts.map +1 -1
- package/build/config.js +5 -0
- package/build/config.js.map +1 -1
- package/build/config.map.d.ts.map +1 -1
- package/build/config.map.js +15 -10
- package/build/config.map.js.map +1 -1
- package/build/url.d.ts +0 -13
- package/build/url.d.ts.map +1 -1
- package/build/url.js +1 -39
- package/build/url.js.map +1 -1
- package/package.json +7 -7
- package/dist/android-chrome-192x192.png +0 -0
- package/dist/android-chrome-512x512.png +0 -0
- package/dist/apple-touch-icon.png +0 -0
- package/dist/assets/fonts/OpenSans-Bold.woff2 +0 -0
- package/dist/assets/fonts/OpenSans-Italic.woff2 +0 -0
- package/dist/assets/fonts/OpenSans-Light.woff2 +0 -0
- package/dist/assets/fonts/OpenSans-Regular.woff2 +0 -0
- package/dist/assets/fonts/OpenSans-SemiBold.woff2 +0 -0
- package/dist/assets/logo-linz.svg +0 -256
- package/dist/assets/logo-nz-govt.svg +0 -11
- package/dist/basemaps-card.jpeg +0 -0
- package/dist/examples/index.html +0 -33
- package/dist/examples/index.leaflet.xyz.3857.html +0 -43
- package/dist/examples/index.maplibre.compare.3857.html +0 -111
- package/dist/examples/index.maplibre.opacity.3857.html +0 -218
- package/dist/examples/index.maplibre.vector.3857.html +0 -48
- package/dist/examples/index.openlayers.attribution.wmts.3857.html +0 -55
- package/dist/examples/index.openlayers.wmts.3857.html +0 -49
- package/dist/examples/index.openlayers.xyz.3857.html +0 -49
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/index-6.41.0-04bd3d24eee59f30.css +0 -6280
- package/dist/index-6.41.0-ae3950c364b06ab8.js +0 -59403
- package/dist/index-6.41.0-dce2cbdab3dc8de4.js +0 -624
- package/dist/index.css +0 -6280
- package/dist/index.html +0 -26
- package/dist/index.js +0 -624
- package/dist/json-schema/stac-basemaps-extension/1.0/schema.json +0 -144
- package/dist/lib/attribution-6.41.0-a06a4339e5df297e.js +0 -10
- package/dist/lib/attribution-6.41.0-f0099e1099a7c0ac.js +0 -2330
- package/dist/lib/attribution.js +0 -10
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://basemaps.linz.govt.nz/json-schema/stac-basemaps-extension/1.0/schema.json#",
|
|
4
|
-
"title": "LINZ Basemaps Extension",
|
|
5
|
-
"description": "STAC LINZ Basemaps extension to a SATC item and STAC collection.",
|
|
6
|
-
"oneOf": [
|
|
7
|
-
{
|
|
8
|
-
"allOf": [
|
|
9
|
-
{
|
|
10
|
-
"$ref": "https://schemas.stacspec.org/v1.0.0-beta.2/item-spec/json-schema/item.json"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"$ref": "#/definitions/common"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"$ref": "#/definitions/item"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"allOf": [
|
|
22
|
-
{
|
|
23
|
-
"$ref": "https://schemas.stacspec.org/v1.0.0-beta.2/collection-spec/json-schema/collection.json"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"$ref": "#/definitions/common"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"$ref": "#/definitions/collection"
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"definitions": {
|
|
35
|
-
"common": {
|
|
36
|
-
"type": "object",
|
|
37
|
-
"required": ["stac_extensions"],
|
|
38
|
-
"properties": {
|
|
39
|
-
"stac_extensions": {
|
|
40
|
-
"type": "array",
|
|
41
|
-
"contains": {
|
|
42
|
-
"enum": ["https://basemaps.linz.govt.nz/json-schema/stac-basemaps-extension/1.0/schema.json"]
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"item": {
|
|
48
|
-
"type": "object",
|
|
49
|
-
"properties": {
|
|
50
|
-
"properties": {
|
|
51
|
-
"type": "object",
|
|
52
|
-
"properties": {
|
|
53
|
-
"linz:gdal:version": {
|
|
54
|
-
"type": "string"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
"collection": {
|
|
61
|
-
"type": "object",
|
|
62
|
-
"properties": {
|
|
63
|
-
"summaries": {
|
|
64
|
-
"type": "object",
|
|
65
|
-
"properties": {
|
|
66
|
-
"proj:epsg": {
|
|
67
|
-
"type": "array",
|
|
68
|
-
"items": {
|
|
69
|
-
"type": "number"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"linz:zoom": {
|
|
73
|
-
"type": "object",
|
|
74
|
-
"required": ["min", "max"],
|
|
75
|
-
"properties": {
|
|
76
|
-
"min": {
|
|
77
|
-
"type": "number"
|
|
78
|
-
},
|
|
79
|
-
"max": {
|
|
80
|
-
"type": "number"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"linz:priority": {
|
|
85
|
-
"type": "array",
|
|
86
|
-
"minItems": 1,
|
|
87
|
-
"maxItems": 1,
|
|
88
|
-
"items": {
|
|
89
|
-
"type": "number"
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
"linz:output": {
|
|
93
|
-
"type": "array",
|
|
94
|
-
"contains": {
|
|
95
|
-
"properties": {
|
|
96
|
-
"resampling": {
|
|
97
|
-
"type": "object",
|
|
98
|
-
"properties": {
|
|
99
|
-
"warp": {
|
|
100
|
-
"type": "string"
|
|
101
|
-
},
|
|
102
|
-
"overview": {
|
|
103
|
-
"type": "string"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"quality": {
|
|
108
|
-
"type": "number"
|
|
109
|
-
},
|
|
110
|
-
"cutlineBlend": {
|
|
111
|
-
"type": "number"
|
|
112
|
-
},
|
|
113
|
-
"addAlpha": {
|
|
114
|
-
"type": "boolean"
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
"linz:generated": {
|
|
120
|
-
"type": "array",
|
|
121
|
-
"contains": {
|
|
122
|
-
"properties": {
|
|
123
|
-
"package": {
|
|
124
|
-
"type": "string"
|
|
125
|
-
},
|
|
126
|
-
"version": {
|
|
127
|
-
"type": "string"
|
|
128
|
-
},
|
|
129
|
-
"hash": {
|
|
130
|
-
"type": "string"
|
|
131
|
-
},
|
|
132
|
-
"datetime": {
|
|
133
|
-
"type": "string",
|
|
134
|
-
"format": "date-time"
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";var Jt=Object.create;var St=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty;var Pt=(l,u)=>()=>(u||l((u={exports:{}}).exports,u),u.exports);var re=(l,u,h,c)=>{if(u&&typeof u=="object"||typeof u=="function")for(let v of jt(u))!ee.call(l,v)&&v!==h&&St(l,v,{get:()=>u[v],enumerable:!(c=Kt(u,v))||c.enumerable});return l};var bt=(l,u,h)=>(h=l!=null?Jt(te(l)):{},re(u||!l||!l.__esModule?St(h,"default",{value:l,enumerable:!0}):h,l));var It=Pt((ae,kt)=>{"use strict";kt.exports=rt;rt.polyline=rt;rt.polygon=ne;function rt(l,u,h){var c=l.length,v=W(l[0],u),y=[],w,S,k,B,_;for(h||(h=[]),w=1;w<c;w++){for(S=l[w-1],k=l[w],B=_=W(k,u);;)if(v|B){if(v&B)break;v?(S=ft(S,k,v,u),v=W(S,u)):(k=ft(S,k,B,u),B=W(k,u))}else{y.push(S),B!==_?(y.push(k),w<c-1&&(h.push(y),y=[])):w===c-1&&y.push(k);break}v=_}return y.length&&h.push(y),h}function ne(l,u){var h,c,v,y,w,S,k;for(c=1;c<=8;c*=2){for(h=[],v=l[l.length-1],y=!(W(v,u)&c),w=0;w<l.length;w++)S=l[w],k=!(W(S,u)&c),k!==y&&h.push(ft(v,S,c,u)),k&&h.push(S),v=S,y=k;if(l=h,!l.length)break}return h}function ft(l,u,h,c){return h&8?[l[0]+(u[0]-l[0])*(c[3]-l[1])/(u[1]-l[1]),c[3]]:h&4?[l[0]+(u[0]-l[0])*(c[1]-l[1])/(u[1]-l[1]),c[1]]:h&2?[c[2],l[1]+(u[1]-l[1])*(c[2]-l[0])/(u[0]-l[0])]:h&1?[c[0],l[1]+(u[1]-l[1])*(c[0]-l[0])/(u[0]-l[0])]:null}function W(l,u){var h=0;return l[0]<u[0]?h|=1:l[0]>u[2]&&(h|=2),l[1]<u[1]?h|=4:l[1]>u[3]&&(h|=8),h}});var _t=Pt((at,ht)=>{(function(l,u){typeof at=="object"&&typeof ht<"u"?ht.exports=u():typeof define=="function"&&define.amd?define(u):(l=typeof globalThis<"u"?globalThis:l||self,l.polygonClipping=u())})(at,function(){"use strict";function l(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function u(o,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,r.key,r)}}function h(o,e,t){return e&&u(o.prototype,e),t&&u(o,t),o}var c=function(){function o(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return o}();function v(o,e){return o>e?1:o<e?-1:0}function y(o,e,t){for(var r=new c(null,null),n=r,i=r;;){var s=t(o,e.key);if(s<0){if(e.left===null)break;if(t(o,e.left.key)<0){var f=e.left;if(e.left=f.right,f.right=e,e=f,e.left===null)break}i.left=e,i=e,e=e.left}else if(s>0){if(e.right===null)break;if(t(o,e.right.key)>0){var f=e.right;if(e.right=f.left,f.left=e,e=f,e.right===null)break}n.right=e,n=e,e=e.right}else break}return n.right=e.left,i.left=e.right,e.left=r.right,e.right=r.left,e}function w(o,e,t,r){var n=new c(o,e);if(t===null)return n.left=n.right=null,n;t=y(o,t,r);var i=r(o,t.key);return i<0?(n.left=t.left,n.right=t,t.left=null):i>=0&&(n.right=t.right,n.left=t,t.right=null),n}function S(o,e,t){var r=null,n=null;if(e){e=y(o,e,t);var i=t(e.key,o);i===0?(r=e.left,n=e.right):i<0?(n=e.right,e.right=null,r=e):(r=e.left,e.left=null,n=e)}return{left:r,right:n}}function k(o,e,t){return e===null?o:(o===null||(e=y(o.key,e,t),e.left=o),e)}function B(o,e,t,r,n){if(o){r(""+e+(t?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+n(o)+`
|
|
2
|
-
`);var i=e+(t?" ":"\u2502 ");o.left&&B(o.left,i,!1,r,n),o.right&&B(o.right,i,!0,r,n)}}var _=function(){function o(e){e===void 0&&(e=v),this._root=null,this._size=0,this._comparator=e}return o.prototype.insert=function(e,t){return this._size++,this._root=w(e,t,this._root,this._comparator)},o.prototype.add=function(e,t){var r=new c(e,t);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var n=this._comparator,i=y(e,this._root,n),s=n(e,i.key);return s===0?this._root=i:(s<0?(r.left=i.left,r.right=i,i.left=null):s>0&&(r.right=i.right,r.left=i,i.right=null),this._size++,this._root=r),this._root},o.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},o.prototype._remove=function(e,t,r){var n;if(t===null)return null;t=y(e,t,r);var i=r(e,t.key);return i===0?(t.left===null?n=t.right:(n=y(e,t.left,r),n.right=t.right),this._size--,n):t},o.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=y(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},o.prototype.findStatic=function(e){for(var t=this._root,r=this._comparator;t;){var n=r(e,t.key);if(n===0)return t;n<0?t=t.left:t=t.right}return null},o.prototype.find=function(e){return this._root&&(this._root=y(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},o.prototype.contains=function(e){for(var t=this._root,r=this._comparator;t;){var n=r(e,t.key);if(n===0)return!0;n<0?t=t.left:t=t.right}return!1},o.prototype.forEach=function(e,t){for(var r=this._root,n=[],i=!1;!i;)r!==null?(n.push(r),r=r.left):n.length!==0?(r=n.pop(),e.call(t,r),r=r.right):i=!0;return this},o.prototype.range=function(e,t,r,n){for(var i=[],s=this._comparator,f=this._root,a;i.length!==0||f;)if(f)i.push(f),f=f.left;else{if(f=i.pop(),a=s(f.key,t),a>0)break;if(s(f.key,e)>=0&&r.call(n,f))return this;f=f.right}return this},o.prototype.keys=function(){var e=[];return this.forEach(function(t){var r=t.key;return e.push(r)}),e},o.prototype.values=function(){var e=[];return this.forEach(function(t){var r=t.data;return e.push(r)}),e},o.prototype.min=function(){return this._root?this.minNode(this._root).key:null},o.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},o.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},o.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},o.prototype.at=function(e){for(var t=this._root,r=!1,n=0,i=[];!r;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),n===e)return t;n++,t=t.right}else r=!0;return null},o.prototype.next=function(e){var t=this._root,r=null;if(e.right){for(r=e.right;r.left;)r=r.left;return r}for(var n=this._comparator;t;){var i=n(e.key,t.key);if(i===0)break;i<0?(r=t,t=t.left):t=t.right}return r},o.prototype.prev=function(e){var t=this._root,r=null;if(e.left!==null){for(r=e.left;r.right;)r=r.right;return r}for(var n=this._comparator;t;){var i=n(e.key,t.key);if(i===0)break;i<0?t=t.left:(r=t,t=t.right)}return r},o.prototype.clear=function(){return this._root=null,this._size=0,this},o.prototype.toList=function(){return Lt(this._root)},o.prototype.load=function(e,t,r){t===void 0&&(t=[]),r===void 0&&(r=!1);var n=e.length,i=this._comparator;if(r&&it(e,t,0,n-1,i),this._root===null)this._root=j(e,t,0,n),this._size=n;else{var s=Mt(this.toList(),U(e,t),i);n=this._size+n,this._root=nt({head:s},0,n)}return this},o.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(o.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),o.prototype.toString=function(e){e===void 0&&(e=function(n){return String(n.key)});var t=[];return B(this._root,"",!0,function(r){return t.push(r)},e),t.join("")},o.prototype.update=function(e,t,r){var n=this._comparator,i=S(e,this._root,n),s=i.left,f=i.right;n(e,t)<0?f=w(t,r,f,n):s=w(t,r,s,n),this._root=k(s,f,n)},o.prototype.split=function(e){return S(e,this._root,this._comparator)},o}();function j(o,e,t,r){var n=r-t;if(n>0){var i=t+Math.floor(n/2),s=o[i],f=e[i],a=new c(s,f);return a.left=j(o,e,t,i),a.right=j(o,e,i+1,r),a}return null}function U(o,e){for(var t=new c(null,null),r=t,n=0;n<o.length;n++)r=r.next=new c(o[n],e[n]);return r.next=null,t.next}function Lt(o){for(var e=o,t=[],r=!1,n=new c(null,null),i=n;!r;)e?(t.push(e),e=e.left):t.length>0?(e=i=i.next=t.pop(),e=e.right):r=!0;return i.next=null,n.next}function nt(o,e,t){var r=t-e;if(r>0){var n=e+Math.floor(r/2),i=nt(o,e,n),s=o.head;return s.left=i,o.head=o.head.next,s.right=nt(o,n+1,t),s}return null}function Mt(o,e,t){for(var r=new c(null,null),n=r,i=o,s=e;i!==null&&s!==null;)t(i.key,s.key)<0?(n.next=i,i=i.next):(n.next=s,s=s.next),n=n.next;return i!==null?n.next=i:s!==null&&(n.next=s),r.next}function it(o,e,t,r,n){if(!(t>=r)){for(var i=o[t+r>>1],s=t-1,f=r+1;;){do s++;while(n(o[s],i)<0);do f--;while(n(o[f],i)>0);if(s>=f)break;var a=o[s];o[s]=o[f],o[f]=a,a=e[s],e[s]=e[f],e[f]=a}it(o,e,t,f,n),it(o,e,f+1,r,n)}}var X=function(e,t){return e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y},ot=function(e,t){if(t.ur.x<e.ll.x||e.ur.x<t.ll.x||t.ur.y<e.ll.y||e.ur.y<t.ll.y)return null;var r=e.ll.x<t.ll.x?t.ll.x:e.ll.x,n=e.ur.x<t.ur.x?e.ur.x:t.ur.x,i=e.ll.y<t.ll.y?t.ll.y:e.ll.y,s=e.ur.y<t.ur.y?e.ur.y:t.ur.y;return{ll:{x:r,y:i},ur:{x:n,y:s}}},T=Number.EPSILON;T===void 0&&(T=Math.pow(2,-52));var Nt=T*T,st=function(e,t){if(-T<e&&e<T&&-T<t&&t<T)return 0;var r=e-t;return r*r<Nt*e*t?0:e<t?-1:1},Ct=function(){function o(){l(this,o),this.reset()}return h(o,[{key:"reset",value:function(){this.xRounder=new vt,this.yRounder=new vt}},{key:"round",value:function(t,r){return{x:this.xRounder.round(t),y:this.yRounder.round(r)}}}]),o}(),vt=function(){function o(){l(this,o),this.tree=new _,this.round(0)}return h(o,[{key:"round",value:function(t){var r=this.tree.add(t),n=this.tree.prev(r);if(n!==null&&st(r.key,n.key)===0)return this.tree.remove(t),n.key;var i=this.tree.next(r);return i!==null&&st(r.key,i.key)===0?(this.tree.remove(t),i.key):t}}]),o}(),Q=new Ct,Z=function(e,t){return e.x*t.y-e.y*t.x},gt=function(e,t){return e.x*t.x+e.y*t.y},pt=function(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},i={x:r.x-e.x,y:r.y-e.y},s=Z(n,i);return st(s,0)},tt=function(e){return Math.sqrt(gt(e,e))},Tt=function(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},i={x:r.x-e.x,y:r.y-e.y};return Z(i,n)/tt(i)/tt(n)},zt=function(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},i={x:r.x-e.x,y:r.y-e.y};return gt(i,n)/tt(i)/tt(n)},yt=function(e,t,r){return t.y===0?null:{x:e.x+t.x/t.y*(r-e.y),y:r}},xt=function(e,t,r){return t.x===0?null:{x:r,y:e.y+t.y/t.x*(r-e.x)}},Ft=function(e,t,r,n){if(t.x===0)return xt(r,n,e.x);if(n.x===0)return xt(e,t,r.x);if(t.y===0)return yt(r,n,e.y);if(n.y===0)return yt(e,t,r.y);var i=Z(t,n);if(i==0)return null;var s={x:r.x-e.x,y:r.y-e.y},f=Z(s,t)/i,a=Z(s,n)/i,g=e.x+a*t.x,p=r.x+f*n.x,x=e.y+a*t.y,m=r.y+f*n.y,d=(g+p)/2,P=(x+m)/2;return{x:d,y:P}},N=function(){h(o,null,[{key:"compare",value:function(t,r){var n=o.comparePoints(t.point,r.point);return n!==0?n:(t.point!==r.point&&t.link(r),t.isLeft!==r.isLeft?t.isLeft?1:-1:et.compare(t.segment,r.segment))}},{key:"comparePoints",value:function(t,r){return t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0}}]);function o(e,t){l(this,o),e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}return h(o,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var r=t.point.events,n=0,i=r.length;n<i;n++){var s=r[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,r=0;r<t;r++){var n=this.point.events[r];if(n.segment.consumedBy===void 0)for(var i=r+1;i<t;i++){var s=this.point.events[i];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],r=0,n=this.point.events.length;r<n;r++){var i=this.point.events[r];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}},{key:"getLeftmostComparator",value:function(t){var r=this,n=new Map,i=function(f){var a=f.otherSE;n.set(f,{sine:Tt(r.point,t.point,a.point),cosine:zt(r.point,t.point,a.point)})};return function(s,f){n.has(s)||i(s),n.has(f)||i(f);var a=n.get(s),g=a.sine,p=a.cosine,x=n.get(f),m=x.sine,d=x.cosine;return g>=0&&m>=0?p<d?1:p>d?-1:0:g<0&&m<0?p<d?-1:p>d?1:0:m<g?-1:m>g?1:0}}}]),o}(),Yt=0,et=function(){h(o,null,[{key:"compare",value:function(t,r){var n=t.leftSE.point.x,i=r.leftSE.point.x,s=t.rightSE.point.x,f=r.rightSE.point.x;if(f<n)return 1;if(s<i)return-1;var a=t.leftSE.point.y,g=r.leftSE.point.y,p=t.rightSE.point.y,x=r.rightSE.point.y;if(n<i){if(g<a&&g<p)return 1;if(g>a&&g>p)return-1;var m=t.comparePoint(r.leftSE.point);if(m<0)return 1;if(m>0)return-1;var d=r.comparePoint(t.rightSE.point);return d!==0?d:-1}if(n>i){if(a<g&&a<x)return-1;if(a>g&&a>x)return 1;var P=r.comparePoint(t.leftSE.point);if(P!==0)return P;var E=t.comparePoint(r.rightSE.point);return E<0?1:E>0?-1:1}if(a<g)return-1;if(a>g)return 1;if(s<f){var b=r.comparePoint(t.rightSE.point);if(b!==0)return b}if(s>f){var R=t.comparePoint(r.rightSE.point);if(R<0)return 1;if(R>0)return-1}if(s!==f){var A=p-a,O=s-n,I=x-g,C=f-i;if(A>O&&I<C)return 1;if(A<O&&I>C)return-1}return s>f?1:s<f||p<x?-1:p>x?1:t.id<r.id?-1:t.id>r.id?1:0}}]);function o(e,t,r,n){l(this,o),this.id=++Yt,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=r,this.windings=n}return h(o,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<r?t:r},ur:{x:this.rightSE.point.x,y:t>r?t:r}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(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}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var r=this.leftSE.point,n=this.rightSE.point,i=this.vector();if(r.x===n.x)return t.x===r.x?0:t.x<r.x?1:-1;var s=(t.y-r.y)/i.y,f=r.x+s*i.x;if(t.x===f)return 0;var a=(t.x-r.x)/i.x,g=r.y+a*i.y;return t.y===g?0:t.y<g?-1:1}},{key:"getIntersection",value:function(t){var r=this.bbox(),n=t.bbox(),i=ot(r,n);if(i===null)return null;var s=this.leftSE.point,f=this.rightSE.point,a=t.leftSE.point,g=t.rightSE.point,p=X(r,a)&&this.comparePoint(a)===0,x=X(n,s)&&t.comparePoint(s)===0,m=X(r,g)&&this.comparePoint(g)===0,d=X(n,f)&&t.comparePoint(f)===0;if(x&&p)return d&&!m?f:!d&&m?g:null;if(x)return m&&s.x===g.x&&s.y===g.y?null:s;if(p)return d&&f.x===a.x&&f.y===a.y?null:a;if(d&&m)return null;if(d)return f;if(m)return g;var P=Ft(s,this.vector(),a,t.vector());return P===null||!X(i,P)?null:Q.round(P.x,P.y)}},{key:"split",value:function(t){var r=[],n=t.events!==void 0,i=new N(t,!0),s=new N(t,!1),f=this.rightSE;this.replaceRightSE(s),r.push(s),r.push(i);var a=new o(i,f,this.rings.slice(),this.windings.slice());return N.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),N.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),s.checkForConsuming()),r}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var r=0,n=this.windings.length;r<n;r++)this.windings[r]*=-1}},{key:"consume",value:function(t){for(var r=this,n=t;r.consumedBy;)r=r.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var i=o.compare(r,n);if(i!==0){if(i>0){var s=r;r=n,n=s}if(r.prev===n){var f=r;r=n,n=f}for(var a=0,g=n.rings.length;a<g;a++){var p=n.rings[a],x=n.windings[a],m=r.rings.indexOf(p);m===-1?(r.rings.push(p),r.windings.push(x)):r.windings[m]+=x}n.rings=null,n.windings=null,n.consumedBy=r,n.leftSE.consumedBy=r.leftSE,n.rightSE.consumedBy=r.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var r=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys,s=0,f=this.rings.length;s<f;s++){var a=this.rings[s],g=this.windings[s],p=r.indexOf(a);p===-1?(r.push(a),n.push(g)):n[p]+=g}for(var x=[],m=[],d=0,P=r.length;d<P;d++)if(n[d]!==0){var E=r[d],b=E.poly;if(m.indexOf(b)===-1)if(E.isExterior)x.push(b);else{m.indexOf(b)===-1&&m.push(b);var R=x.indexOf(E.poly);R!==-1&&x.splice(R,1)}}for(var A=0,O=x.length;A<O;A++){var I=x[A].multiPoly;i.indexOf(I)===-1&&i.push(I)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var t=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch(L.type){case"union":{var n=t.length===0,i=r.length===0;this._isInResult=n!==i;break}case"intersection":{var s,f;t.length<r.length?(s=t.length,f=r.length):(s=r.length,f=t.length),this._isInResult=f===L.numMultiPolys&&s<f;break}case"xor":{var a=Math.abs(t.length-r.length);this._isInResult=a%2===1;break}case"difference":{var g=function(x){return x.length===1&&x[0].isSubject};this._isInResult=g(t)!==g(r);break}default:throw new Error("Unrecognized operation type found ".concat(L.type))}return this._isInResult}}],[{key:"fromRing",value:function(t,r,n){var i,s,f,a=N.comparePoints(t,r);if(a<0)i=t,s=r,f=1;else if(a>0)i=r,s=t,f=-1;else throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));var g=new N(i,!0),p=new N(s,!1);return new o(g,p,[n],[f])}}]),o}(),dt=function(){function o(e,t,r){if(l(this,o),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=r,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=Q.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var i=n,s=1,f=e.length;s<f;s++){if(typeof e[s][0]!="number"||typeof e[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var a=Q.round(e[s][0],e[s][1]);a.x===i.x&&a.y===i.y||(this.segments.push(et.fromRing(i,a,this)),a.x<this.bbox.ll.x&&(this.bbox.ll.x=a.x),a.y<this.bbox.ll.y&&(this.bbox.ll.y=a.y),a.x>this.bbox.ur.x&&(this.bbox.ur.x=a.x),a.y>this.bbox.ur.y&&(this.bbox.ur.y=a.y),i=a)}(n.x!==i.x||n.y!==i.y)&&this.segments.push(et.fromRing(i,n,this))}return h(o,[{key:"getSweepEvents",value:function(){for(var t=[],r=0,n=this.segments.length;r<n;r++){var i=this.segments[r];t.push(i.leftSE),t.push(i.rightSE)}return t}}]),o}(),Dt=function(){function o(e,t){if(l(this,o),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new dt(e[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(var r=1,n=e.length;r<n;r++){var i=new dt(e[r],this,!1);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i)}this.multiPoly=t}return h(o,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),r=0,n=this.interiorRings.length;r<n;r++)for(var i=this.interiorRings[r].getSweepEvents(),s=0,f=i.length;s<f;s++)t.push(i[s]);return t}}]),o}(),mt=function(){function o(e,t){if(l(this,o),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var r=0,n=e.length;r<n;r++){var i=new Dt(e[r],this);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i)}this.isSubject=t}return h(o,[{key:"getSweepEvents",value:function(){for(var t=[],r=0,n=this.polys.length;r<n;r++)for(var i=this.polys[r].getSweepEvents(),s=0,f=i.length;s<f;s++)t.push(i[s]);return t}}]),o}(),Gt=function(){h(o,null,[{key:"factory",value:function(t){for(var r=[],n=0,i=t.length;n<i;n++){var s=t[n];if(!(!s.isInResult()||s.ringOut)){for(var f=null,a=s.leftSE,g=s.rightSE,p=[a],x=a.point,m=[];f=a,a=g,p.push(a),a.point!==x;)for(;;){var d=a.getAvailableLinkedEvents();if(d.length===0){var P=p[0].point,E=p[p.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(P.x,",")+" ".concat(P.y,"]. Last matching segment found ends at")+" [".concat(E.x,", ").concat(E.y,"]."))}if(d.length===1){g=d[0].otherSE;break}for(var b=null,R=0,A=m.length;R<A;R++)if(m[R].point===a.point){b=R;break}if(b!==null){var O=m.splice(b)[0],I=p.splice(O.index);I.unshift(I[0].otherSE),r.push(new o(I.reverse()));continue}m.push({index:p.length,point:a.point});var C=a.getLeftmostComparator(f);g=d.sort(C)[0].otherSE;break}r.push(new o(p))}}return r}}]);function o(e){l(this,o),this.events=e;for(var t=0,r=e.length;t<r;t++)e[t].segment.ringOut=this;this.poly=null}return h(o,[{key:"getGeom",value:function(){for(var t=this.events[0].point,r=[t],n=1,i=this.events.length-1;n<i;n++){var s=this.events[n].point,f=this.events[n+1].point;pt(s,t,f)!==0&&(r.push(s),t=s)}if(r.length===1)return null;var a=r[0],g=r[1];pt(a,t,g)===0&&r.shift(),r.push(r[0]);for(var p=this.isExteriorRing()?1:-1,x=this.isExteriorRing()?0:r.length-1,m=this.isExteriorRing()?r.length:-1,d=[],P=x;P!=m;P+=p)d.push([r[P].x,r[P].y]);return d}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],r=1,n=this.events.length;r<n;r++){var i=this.events[r];N.compare(t,i)>0&&(t=i)}for(var s=t.segment.prevInResult(),f=s?s.prevInResult():null;;){if(!s)return null;if(!f)return s.ringOut;if(f.ringOut!==s.ringOut)return f.ringOut.enclosingRing()!==s.ringOut?s.ringOut:s.ringOut.enclosingRing();s=f.prevInResult(),f=s?s.prevInResult():null}}}]),o}(),Et=function(){function o(e){l(this,o),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return h(o,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(var r=0,n=this.interiorRings.length;r<n;r++){var i=this.interiorRings[r].getGeom();i!==null&&t.push(i)}return t}}]),o}(),qt=function(){function o(e){l(this,o),this.rings=e,this.polys=this._composePolys(e)}return h(o,[{key:"getGeom",value:function(){for(var t=[],r=0,n=this.polys.length;r<n;r++){var i=this.polys[r].getGeom();i!==null&&t.push(i)}return t}},{key:"_composePolys",value:function(t){for(var r=[],n=0,i=t.length;n<i;n++){var s=t[n];if(!s.poly)if(s.isExteriorRing())r.push(new Et(s));else{var f=s.enclosingRing();f.poly||r.push(new Et(f)),f.poly.addInterior(s)}}return r}}]),o}(),Ut=function(){function o(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:et.compare;l(this,o),this.queue=e,this.tree=new _(t),this.segments=[]}return h(o,[{key:"process",value:function(t){var r=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(r),n;var i=t.isLeft?this.tree.insert(r):this.tree.find(r);if(!i)throw new Error("Unable to find segment #".concat(r.id," ")+"[".concat(r.leftSE.point.x,", ").concat(r.leftSE.point.y,"] -> ")+"[".concat(r.rightSE.point.x,", ").concat(r.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var s=i,f=i,a=void 0,g=void 0;a===void 0;)s=this.tree.prev(s),s===null?a=null:s.key.consumedBy===void 0&&(a=s.key);for(;g===void 0;)f=this.tree.next(f),f===null?g=null:f.key.consumedBy===void 0&&(g=f.key);if(t.isLeft){var p=null;if(a){var x=a.getIntersection(r);if(x!==null&&(r.isAnEndpoint(x)||(p=x),!a.isAnEndpoint(x)))for(var m=this._splitSafely(a,x),d=0,P=m.length;d<P;d++)n.push(m[d])}var E=null;if(g){var b=g.getIntersection(r);if(b!==null&&(r.isAnEndpoint(b)||(E=b),!g.isAnEndpoint(b)))for(var R=this._splitSafely(g,b),A=0,O=R.length;A<O;A++)n.push(R[A])}if(p!==null||E!==null){var I=null;if(p===null)I=E;else if(E===null)I=p;else{var C=N.comparePoints(p,E);I=C<=0?p:E}this.queue.remove(r.rightSE),n.push(r.rightSE);for(var $=r.split(I),z=0,F=$.length;z<F;z++)n.push($[z])}n.length>0?(this.tree.remove(r),n.push(t)):(this.segments.push(r),r.prev=a)}else{if(a&&g){var M=a.getIntersection(g);if(M!==null){if(!a.isAnEndpoint(M))for(var V=this._splitSafely(a,M),Y=0,ut=V.length;Y<ut;Y++)n.push(V[Y]);if(!g.isAnEndpoint(M))for(var H=this._splitSafely(g,M),J=0,lt=H.length;J<lt;J++)n.push(H[J])}}this.tree.remove(r)}return n}},{key:"_splitSafely",value:function(t,r){this.tree.remove(t);var n=t.rightSE;this.queue.remove(n);var i=t.split(r);return i.push(n),t.consumedBy===void 0&&this.tree.insert(t),i}}]),o}(),wt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Wt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Xt=function(){function o(){l(this,o)}return h(o,[{key:"run",value:function(t,r,n){L.type=t,Q.reset();for(var i=[new mt(r,!0)],s=0,f=n.length;s<f;s++)i.push(new mt(n[s],!1));if(L.numMultiPolys=i.length,L.type==="difference")for(var a=i[0],g=1;g<i.length;)ot(i[g].bbox,a.bbox)!==null?g++:i.splice(g,1);if(L.type==="intersection"){for(var p=0,x=i.length;p<x;p++)for(var m=i[p],d=p+1,P=i.length;d<P;d++)if(ot(m.bbox,i[d].bbox)===null)return[]}for(var E=new _(N.compare),b=0,R=i.length;b<R;b++)for(var A=i[b].getSweepEvents(),O=0,I=A.length;O<I;O++)if(E.insert(A[O]),E.size>wt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var C=new Ut(E),$=E.size,z=E.pop();z;){var F=z.key;if(E.size===$){var M=F.segment;throw new Error("Unable to pop() ".concat(F.isLeft?"left":"right"," SweepEvent ")+"[".concat(F.point.x,", ").concat(F.point.y,"] from segment #").concat(M.id," ")+"[".concat(M.leftSE.point.x,", ").concat(M.leftSE.point.y,"] -> ")+"[".concat(M.rightSE.point.x,", ").concat(M.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(E.size>wt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(C.segments.length>Wt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var V=C.process(F),Y=0,ut=V.length;Y<ut;Y++){var H=V[Y];H.consumedBy===void 0&&E.insert(H)}$=E.size,z=E.pop()}Q.reset();var J=Gt.factory(C.segments),lt=new qt(J);return lt.getGeom()}}]),o}(),L=new Xt,Qt=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return L.run("union",e,r)},Zt=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return L.run("intersection",e,r)},$t=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return L.run("xor",e,r)},Vt=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return L.run("difference",e,r)},Ht={union:Qt,intersection:Zt,xor:$t,difference:Vt};return Ht})});var ie=bt(It(),1),Rt=bt(_t(),1);var{intersection:At,union:ge}=Rt.default;var K=l=>(l<-360?l=-(-l%360):l>360&&(l=l%360),l<-180?360+l:l>180?l-360:l),D=(l,u)=>{let h=u-l;return h>180?h-360:h<-180?h+360:h},oe=(l,u)=>K(l+(u<l?u+360-l:u-l)),G={boxLonCenter(l){return K(l[0]+.5*(l[2]<l[0]?360+l[2]-l[0]:l[2]-l[0]))},delta:D,crossesAM(l,u){return Math.sign(D(l,u))!==Math.sign(u-l)},normLon:K,normExtent(l){return[K(l[0]),l[1],K(l[2]),l[3]]},union(l,u){if(u==null)return l.slice();let h=G.boxLonCenter(l),c=G.boxLonCenter(u);if(D(h,c)<0)return this.union(u,l);let v=l.slice(),y=oe(h,c);return D(y,u[0])<D(y,l[0])&&(v[0]=u[0]),D(y,u[2])>D(y,l[2])&&(v[2]=u[2]),u[1]<l[1]&&(v[1]=u[1]),u[3]>l[3]&&(v[3]=u[3]),v},intersects(l,u){if(l[1]>u[3]||u[1]>l[3])return!1;let h=l[0],c=u[0],v=h<l[2]?l[2]:l[2]+360,y=c<u[2]?u[2]:u[2]+360;return h<=y&&c<=v||h+360<=y&&c<=v+360||h<=y+360&&c+360<=v},ringToBbox(l){if(l.length<3)throw new Error("Invalid ring");let u=!1,h=l[0],c=h[0],v=h[1],y=c,w=v,S=c;for(let k=1;k<l.length;++k){let B=l[k],_=B[0];G.crossesAM(S,_)&&(u=!u),u&&(_<0?_+=360:(S+=360,k===1&&(c=y=S))),_<c?c=_:_>y&&(y=_);let U=B[1];U<v?v=U:U>w&&(w=U),S=B[0]}return[this.normLon(c),v,this.normLon(y),w]},multiPolygonToBbox(l){let u=null;for(let h of l){if(h.length===0)continue;let c=h[0];if(c.length<3)continue;let v=this.ringToBbox(c);u=u==null?v:this.union(u,v)}if(u==null)throw new Error("Invalid multipolygon");return u},bboxToMultiPolygon(l){let u=[l[0],l[1]],h=[l[2],l[1]],c=[l[0],l[3]],v=[l[2],l[3]];return l[0]<l[2]?[[[u,c,v,h,u]]]:[[[u,c,[180,v[1]],[180,h[1]],u]],[[v,h,[-180,u[1]],[-180,c[1]],v]]]}};function Bt(l){let u=document.createElement("span");return u.textContent=l,u.innerHTML}var ct=class{constructor(u){this.boundaries=[];this.collection=u;let h=u.summaries["linz:zoom"];this.minZoom=h.min,this.maxZoom=h.max,this.bbox=u.extent.spatial.bbox[0],this.startDate=u.extent.temporal?.interval[0][0],this.endDate=u.extent.temporal?.interval[0][1]}intersects(u){return u.zoom>this.maxZoom||u.zoom<this.minZoom||u.dateAfter&&u.dateBefore&&u.dateAfter>u.dateBefore||u.dateAfter&&this.endDate&&u.dateAfter>this.endDate||u.dateBefore&&this.startDate&&u.dateBefore<this.startDate||!G.intersects(u.extent,this.bbox)?!1:this.intersection(G.bboxToMultiPolygon(u.extent))}intersection(u){for(let h of this.boundaries)if(At(h,u).length>0)return!0;return!1}addBoundary(u){se(u),this.boundaries.push(u)}};function se(l){for(let u of l)for(let h of u)if(h.length!==2)throw new Error("Invalid ring wrong length")}function ue(l){let u=new Map,h=[];for(let c of l.collections){let v=new ct(c);h.push(v),u.set(c.id,v)}for(let c of l.features){let v=u.get(c.collection??"");if(v==null)throw new Error("Could not match feature to collection: "+c.collection);if(c.geometry.type==="Polygon")v.addBoundary(c.geometry.coordinates);else if(c.geometry.type==="MultiPolygon")for(let y of c.geometry.coordinates)v.addBoundary(y)}return h}function Ot(l){let u=l.extent?.temporal?.interval;if(u==null||u.length===0)return[-1,-1];let h=u[0],c=new Date(h[0]).getFullYear(),v=(h.length<2?c:new Date(h[1]).getFullYear())-1;return[c,v<c?c:v]}var q=class{constructor(u){this.attributions=u}static async load(u){let h=await fetch(u);if(h.ok){let c=await h.json();return q.fromStac(c)}throw new Error(`fetch attribution failed [${h.status}] ${h.statusText}`)}static fromStac(u){return new q(ue(u).reverse())}filter(u){u.zoom=Math.round(u.zoom);let h=[],{attributions:c}=this;if(c==null)return h;for(let v of c)this.isIgnored!=null&&this.isIgnored(v)||v.intersects(u)&&h.push(v);return h}renderList(u){if(u.length===0)return"";let h=Bt(u[0].collection.title);if(u.length>1)if(u.length===2)h+=` & ${Bt(u[1].collection.title)}`;else{let[c,v]=Ot(u[1].collection);for(let y=1;y<u.length;++y){let[w,S]=Ot(u[y].collection);w!==-1&&(c===-1||w<c)&&(c=w),S!==-1&&(v===-1||S>v)&&(v=S)}c===-1&&(c=v),v!==-1&&(h+=` & others ${c}-${v}`)}return h}};window.BasemapsAttribution=q;
|
|
3
|
-
/**
|
|
4
|
-
* splaytree v3.1.0
|
|
5
|
-
* Fast Splay tree for Node and browser
|
|
6
|
-
*
|
|
7
|
-
* @author Alexander Milevski <info@w8r.name>
|
|
8
|
-
* @license MIT
|
|
9
|
-
* @preserve
|
|
10
|
-
*/
|