@maptiler/geocoding-control 2.1.0-rc1 → 2.1.1
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/leaflet-controller.js +1942 -1523
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +1 -22
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.js +2800 -2368
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +1 -22
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.js +1918 -1498
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +1 -22
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.js +2858 -2425
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +1 -22
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +2863 -2428
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +1 -22
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers-controller.js +1686 -1264
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +1 -22
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.js +2785 -2353
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +1 -22
- package/openlayers.umd.js.map +1 -1
- package/package.json +19 -19
- package/react.js +800 -784
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/{MapLibreBasedGeocodingControl.d.ts → src/MapLibreBasedGeocodingControl.d.ts} +35 -69
- package/{maplibregl.d.ts → src/maplibregl.d.ts} +34 -68
- package/{maptilersdk.d.ts → src/maptilersdk.d.ts} +34 -68
- package/src/types.d.ts +391 -0
- package/svelte/GeocodingControl.svelte +55 -14
- package/svelte/GeocodingControl.svelte.d.ts +5 -2
- package/svelte/MapLibreBasedGeocodingControl.d.ts +35 -69
- package/svelte/maplibregl.d.ts +34 -68
- package/svelte/maptilersdk.d.ts +34 -68
- package/svelte/maptilersdk.js +2 -0
- package/svelte/react.js +3 -0
- package/svelte/types.d.ts +175 -127
- package/vanilla.js +870 -857
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
- package/types.d.ts +0 -343
- /package/{geo-coordinates-parser.t.d.ts → src/geo-coordinates-parser.t.d.ts} +0 -0
- /package/{geoUtils.d.ts → src/geoUtils.d.ts} +0 -0
- /package/{leaflet-controller.d.ts → src/leaflet-controller.d.ts} +0 -0
- /package/{leaflet.d.ts → src/leaflet.d.ts} +0 -0
- /package/{maplibregl-controller.d.ts → src/maplibregl-controller.d.ts} +0 -0
- /package/{mask.d.ts → src/mask.d.ts} +0 -0
- /package/{openlayers-controller.d.ts → src/openlayers-controller.d.ts} +0 -0
- /package/{openlayers.d.ts → src/openlayers.d.ts} +0 -0
- /package/{proximity.d.ts → src/proximity.d.ts} +0 -0
- /package/{react.d.ts → src/react.d.ts} +0 -0
- /package/{vanilla.d.ts → src/vanilla.d.ts} +0 -0
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
(function(M,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],L):(M=typeof globalThis<"u"?globalThis:M||self,L(M.leafletMaptilerGeocodingController={},M.L))})(this,function(M,L){"use strict";var fn=Object.defineProperty;var cn=(M,L,j)=>L in M?fn(M,L,{enumerable:!0,configurable:!0,writable:!0,value:j}):M[L]=j;var St=(M,L,j)=>cn(M,typeof L!="symbol"?L+"":L,j);function j(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const Q=j(L);function V(r,t,e={}){const n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=r,n}function lt(r,t,e={}){for(const i of r){if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(i[i.length-1].length!==i[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<i[i.length-1].length;o++)if(i[i.length-1][o]!==i[0][o])throw new Error("First and last Position are not equivalent.")}return V({type:"Polygon",coordinates:r},t,e)}function Z(r,t={}){const e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function Pt(r,t,e={}){return V({type:"MultiPolygon",coordinates:r},t,e)}function Mt(r,t,e){if(r!==null)for(var n,i,o,u,l,c,f,p=0,s=0,a,h=r.type,g=h==="FeatureCollection",d=h==="Feature",b=g?r.features.length:1,y=0;y<b;y++){f=g?r.features[y].geometry:d?r.geometry:r,a=f?f.type==="GeometryCollection":!1,l=a?f.geometries.length:1;for(var m=0;m<l;m++){var x=0,v=0;if(u=a?f.geometries[m]:f,u!==null){c=u.coordinates;var w=u.type;switch(p=0,w){case null:break;case"Point":if(t(c,s,y,x,v)===!1)return!1;s++,x++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(t(c[n],s,y,x,v)===!1)return!1;s++,w==="MultiPoint"&&x++}w==="LineString"&&x++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(i=0;i<c[n].length-p;i++){if(t(c[n][i],s,y,x,v)===!1)return!1;s++}w==="MultiLineString"&&x++,w==="Polygon"&&v++}w==="Polygon"&&x++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(v=0,i=0;i<c[n].length;i++){for(o=0;o<c[n][i].length-p;o++){if(t(c[n][i][o],s,y,x,v)===!1)return!1;s++}v++}x++}break;case"GeometryCollection":for(n=0;n<u.geometries.length;n++)if(Mt(u.geometries[n],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ut(r,t){var e,n,i,o,u,l,c,f,p,s,a=0,h=r.type==="FeatureCollection",g=r.type==="Feature",d=h?r.features.length:1;for(e=0;e<d;e++){for(l=h?r.features[e].geometry:g?r.geometry:r,f=h?r.features[e].properties:g?r.properties:{},p=h?r.features[e].bbox:g?r.bbox:void 0,s=h?r.features[e].id:g?r.id:void 0,c=l?l.type==="GeometryCollection":!1,u=c?l.geometries.length:1,i=0;i<u;i++){if(o=c?l.geometries[i]:l,o===null){if(t(null,a,f,p,s)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,a,f,p,s)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],a,f,p,s)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}a++}}function ie(r,t){ut(r,function(e,n,i,o,u){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(V(e,i,{bbox:o,id:u}),n,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var f=0;f<e.coordinates.length;f++){var p=e.coordinates[f],s={type:c,coordinates:p};if(t(V(s,i),n,f)===!1)return!1}})}function oe(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;const e=[1/0,1/0,-1/0,-1/0];return Mt(r,n=>{e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]<n[0]&&(e[2]=n[0]),e[3]<n[1]&&(e[3]=n[1])}),e}var ft=oe;function se(r){if(!r)throw new Error("geojson is required");switch(r.type){case"Feature":return Lt(r);case"FeatureCollection":return le(r);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return ct(r);default:throw new Error("unknown GeoJSON type")}}function Lt(r){const t={type:"Feature"};return Object.keys(r).forEach(e=>{switch(e){case"type":case"properties":case"geometry":return;default:t[e]=r[e]}}),t.properties=Ct(r.properties),r.geometry==null?t.geometry=null:t.geometry=ct(r.geometry),t}function Ct(r){const t={};return r&&Object.keys(r).forEach(e=>{const n=r[e];typeof n=="object"?n===null?t[e]=null:Array.isArray(n)?t[e]=n.map(i=>i):t[e]=Ct(n):t[e]=n}),t}function le(r){const t={type:"FeatureCollection"};return Object.keys(r).forEach(e=>{switch(e){case"type":case"features":return;default:t[e]=r[e]}}),t.features=r.features.map(e=>Lt(e)),t}function ct(r){const t={type:r.type};return r.bbox&&(t.bbox=r.bbox),r.type==="GeometryCollection"?(t.geometries=r.geometries.map(e=>ct(e)),t):(t.coordinates=Rt(r.coordinates),t)}function Rt(r){const t=r;return typeof t[0]!="object"?t.slice():t.map(e=>Rt(e))}var ue=se;/**
|
|
2
|
-
* splaytree v3.1.2
|
|
3
|
-
* Fast Splay tree for Node and browser
|
|
4
|
-
*
|
|
5
|
-
* @author Alexander Milevski <info@w8r.name>
|
|
6
|
-
* @license MIT
|
|
7
|
-
* @preserve
|
|
8
|
-
*//*! *****************************************************************************
|
|
9
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
11
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
12
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
|
|
14
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
16
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
17
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
18
|
-
|
|
19
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
20
|
-
and limitations under the License.
|
|
21
|
-
***************************************************************************** */function fe(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,u;return u={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function l(f){return function(p){return c([f,p])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return e.label++,{value:f[1],done:!1};case 5:e.label++,i=f[1],f=[0];continue;case 7:f=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){e=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){e.label=f[1];break}if(f[0]===6&&e.label<o[1]){e.label=o[1],o=f;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(f);break}o[2]&&e.ops.pop(),e.trys.pop();continue}f=t.call(r,e)}catch(p){f=[6,p],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var G=function(){function r(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return r}();function ce(r,t){return r>t?1:r<t?-1:0}function T(r,t,e){for(var n=new G(null,null),i=n,o=n;;){var u=e(r,t.key);if(u<0){if(t.left===null)break;if(e(r,t.left.key)<0){var l=t.left;if(t.left=l.right,l.right=t,t=l,t.left===null)break}o.left=t,o=t,t=t.left}else if(u>0){if(t.right===null)break;if(e(r,t.right.key)>0){var l=t.right;if(t.right=l.left,l.left=t,t=l,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,o.left=t.right,t.left=n.right,t.right=n.left,t}function ht(r,t,e,n){var i=new G(r,t);if(e===null)return i.left=i.right=null,i;e=T(r,e,n);var o=n(r,e.key);return o<0?(i.left=e.left,i.right=e,e.left=null):o>=0&&(i.right=e.right,i.left=e,e.right=null),i}function It(r,t,e){var n=null,i=null;if(t){t=T(r,t,e);var o=e(t.key,r);o===0?(n=t.left,i=t.right):o<0?(i=t.right,t.right=null,n=t):(n=t.left,t.left=null,i=t)}return{left:n,right:i}}function he(r,t,e){return t===null?r:(r===null||(t=T(r.key,t,e),t.left=r),t)}function at(r,t,e,n,i){if(r){n(""+t+(e?"└── ":"├── ")+i(r)+`
|
|
22
|
-
`);var o=t+(e?" ":"│ ");r.left&&at(r.left,o,!1,n,i),r.right&&at(r.right,o,!0,n,i)}}var pt=function(){function r(t){t===void 0&&(t=ce),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=ht(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new G(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=T(t,this._root,i),u=i(t,o.key);return u===0?this._root=o:(u<0?(n.left=o.left,n.right=o,o.left=null):u>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},r.prototype._remove=function(t,e,n){var i;if(e===null)return null;e=T(t,e,n);var o=n(t,e.key);return o===0?(e.left===null?i=e.right:(i=T(t,e.left,n),i.right=e.right),this._size--,i):e},r.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=T(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},r.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},r.prototype.find=function(t){return this._root&&(this._root=T(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},r.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},r.prototype.forEach=function(t,e){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(e,n),n=n.right):o=!0;return this},r.prototype.range=function(t,e,n,i){for(var o=[],u=this._comparator,l=this._root,c;o.length!==0||l;)if(l)o.push(l),l=l.left;else{if(l=o.pop(),c=u(l.key,e),c>0)break;if(u(l.key,t)>=0&&n.call(i,l))return this;l=l.right}return this},r.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},r.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.at=function(t){for(var e=this._root,n=!1,i=0,o=[];!n;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},r.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 i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(n=e,e=e.left):e=e.right}return n},r.prototype.prev=function(t){var e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(n=e,e=e.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return pe(this._root)},r.prototype.load=function(t,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var i=t.length,o=this._comparator;if(n&&dt(t,e,0,i-1,o),this._root===null)this._root=gt(t,e,0,i),this._size=i;else{var u=ge(this.toList(),ae(t,e),o);i=this._size+i,this._root=yt({head:u},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(t){t===void 0&&(t=function(n){return String(n.key)});var e=[];return at(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,o=It(t,this._root,i),u=o.left,l=o.right;i(t,e)<0?l=ht(e,n,l,i):u=ht(e,n,u,i),this._root=he(u,l,i)},r.prototype.split=function(t){return It(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t,e,n;return fe(this,function(i){switch(i.label){case 0:t=this._root,e=[],n=!1,i.label=1;case 1:return n?[3,6]:t===null?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return e.length===0?[3,4]:(t=e.pop(),[4,t]);case 3:return i.sent(),t=t.right,[3,5];case 4:n=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},r}();function gt(r,t,e,n){var i=n-e;if(i>0){var o=e+Math.floor(i/2),u=r[o],l=t[o],c=new G(u,l);return c.left=gt(r,t,e,o),c.right=gt(r,t,o+1,n),c}return null}function ae(r,t){for(var e=new G(null,null),n=e,i=0;i<r.length;i++)n=n.next=new G(r[i],t[i]);return n.next=null,e.next}function pe(r){for(var t=r,e=[],n=!1,i=new G(null,null),o=i;!n;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):n=!0;return o.next=null,i.next}function yt(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),o=yt(r,t,i),u=r.head;return u.left=o,r.head=r.head.next,u.right=yt(r,i+1,e),u}return null}function ge(r,t,e){for(var n=new G(null,null),i=n,o=r,u=t;o!==null&&u!==null;)e(o.key,u.key)<0?(i.next=o,o=o.next):(i.next=u,u=u.next),i=i.next;return o!==null?i.next=o:u!==null&&(i.next=u),n.next}function dt(r,t,e,n,i){if(!(e>=n)){for(var o=r[e+n>>1],u=e-1,l=n+1;;){do u++;while(i(r[u],o)<0);do l--;while(i(r[l],o)>0);if(u>=l)break;var c=r[u];r[u]=r[l],r[l]=c,c=t[u],t[u]=t[l],t[l]=c}dt(r,t,e,l,i),dt(r,t,l+1,n,i)}}const N=11102230246251565e-32,E=134217729,ye=(3+8*N)*N;function xt(r,t,e,n,i){let o,u,l,c,f=t[0],p=n[0],s=0,a=0;p>f==p>-f?(o=f,f=t[++s]):(o=p,p=n[++a]);let h=0;if(s<r&&a<e)for(p>f==p>-f?(u=f+o,l=o-(u-f),f=t[++s]):(u=p+o,l=o-(u-p),p=n[++a]),o=u,l!==0&&(i[h++]=l);s<r&&a<e;)p>f==p>-f?(u=o+f,c=u-o,l=o-(u-c)+(f-c),f=t[++s]):(u=o+p,c=u-o,l=o-(u-c)+(p-c),p=n[++a]),o=u,l!==0&&(i[h++]=l);for(;s<r;)u=o+f,c=u-o,l=o-(u-c)+(f-c),f=t[++s],o=u,l!==0&&(i[h++]=l);for(;a<e;)u=o+p,c=u-o,l=o-(u-c)+(p-c),p=n[++a],o=u,l!==0&&(i[h++]=l);return(o!==0||h===0)&&(i[h++]=o),h}function de(r,t){let e=t[0];for(let n=1;n<r;n++)e+=t[n];return e}function J(r){return new Float64Array(r)}const xe=(3+16*N)*N,me=(2+12*N)*N,ve=(9+64*N)*N*N,U=J(4),$t=J(8),kt=J(12),Ot=J(16),P=J(4);function be(r,t,e,n,i,o,u){let l,c,f,p,s,a,h,g,d,b,y,m,x,v,w,_,R,S;const $=r-i,k=e-i,O=t-o,A=n-o;v=$*A,a=E*$,h=a-(a-$),g=$-h,a=E*A,d=a-(a-A),b=A-d,w=g*b-(v-h*d-g*d-h*b),_=O*k,a=E*O,h=a-(a-O),g=O-h,a=E*k,d=a-(a-k),b=k-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,U[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,U[1]=x-(y+s)+(s-_),S=m+y,s=S-m,U[2]=m-(S-s)+(y-s),U[3]=S;let B=de(4,U),et=me*u;if(B>=et||-B>=et||(s=r-$,l=r-($+s)+(s-i),s=e-k,f=e-(k+s)+(s-i),s=t-O,c=t-(O+s)+(s-o),s=n-A,p=n-(A+s)+(s-o),l===0&&c===0&&f===0&&p===0)||(et=ve*u+ye*Math.abs(B),B+=$*p+A*l-(O*f+k*c),B>=et||-B>=et))return B;v=l*A,a=E*l,h=a-(a-l),g=l-h,a=E*A,d=a-(a-A),b=A-d,w=g*b-(v-h*d-g*d-h*b),_=c*k,a=E*c,h=a-(a-c),g=c-h,a=E*k,d=a-(a-k),b=k-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,P[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,P[1]=x-(y+s)+(s-_),S=m+y,s=S-m,P[2]=m-(S-s)+(y-s),P[3]=S;const sn=xt(4,U,4,P,$t);v=$*p,a=E*$,h=a-(a-$),g=$-h,a=E*p,d=a-(a-p),b=p-d,w=g*b-(v-h*d-g*d-h*b),_=O*f,a=E*O,h=a-(a-O),g=O-h,a=E*f,d=a-(a-f),b=f-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,P[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,P[1]=x-(y+s)+(s-_),S=m+y,s=S-m,P[2]=m-(S-s)+(y-s),P[3]=S;const ln=xt(sn,$t,4,P,kt);v=l*p,a=E*l,h=a-(a-l),g=l-h,a=E*p,d=a-(a-p),b=p-d,w=g*b-(v-h*d-g*d-h*b),_=c*f,a=E*c,h=a-(a-c),g=c-h,a=E*f,d=a-(a-f),b=f-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,P[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,P[1]=x-(y+s)+(s-_),S=m+y,s=S-m,P[2]=m-(S-s)+(y-s),P[3]=S;const un=xt(ln,kt,4,P,Ot);return Ot[un-1]}function we(r,t,e,n,i,o){const u=(t-o)*(e-i),l=(r-i)*(n-o),c=u-l,f=Math.abs(u+l);return Math.abs(c)>=xe*f?c:-be(r,t,e,n,i,o,f)}const W=(r,t)=>r.ll.x<=t.x&&t.x<=r.ur.x&&r.ll.y<=t.y&&t.y<=r.ur.y,mt=(r,t)=>{if(t.ur.x<r.ll.x||r.ur.x<t.ll.x||t.ur.y<r.ll.y||r.ur.y<t.ll.y)return null;const e=r.ll.x<t.ll.x?t.ll.x:r.ll.x,n=r.ur.x<t.ur.x?r.ur.x:t.ur.x,i=r.ll.y<t.ll.y?t.ll.y:r.ll.y,o=r.ur.y<t.ur.y?r.ur.y:t.ur.y;return{ll:{x:e,y:i},ur:{x:n,y:o}}};let z=Number.EPSILON;z===void 0&&(z=Math.pow(2,-52));const Ee=z*z,At=(r,t)=>{if(-z<r&&r<z&&-z<t&&t<z)return 0;const e=r-t;return e*e<Ee*r*t?0:r<t?-1:1};class _e{constructor(){this.reset()}reset(){this.xRounder=new Nt,this.yRounder=new Nt}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class Nt{constructor(){this.tree=new pt,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(n!==null&&At(e.key,n.key)===0)return this.tree.remove(t),n.key;const i=this.tree.next(e);return i!==null&&At(e.key,i.key)===0?(this.tree.remove(t),i.key):t}}const K=new _e,nt=(r,t)=>r.x*t.y-r.y*t.x,Bt=(r,t)=>r.x*t.x+r.y*t.y,Gt=(r,t,e)=>{const n=we(r.x,r.y,t.x,t.y,e.x,e.y);return n>0?-1:n<0?1:0},rt=r=>Math.sqrt(Bt(r,r)),Se=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return nt(i,n)/rt(i)/rt(n)},Pe=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return Bt(i,n)/rt(i)/rt(n)},Tt=(r,t,e)=>t.y===0?null:{x:r.x+t.x/t.y*(e-r.y),y:e},zt=(r,t,e)=>t.x===0?null:{x:e,y:r.y+t.y/t.x*(e-r.x)},Me=(r,t,e,n)=>{if(t.x===0)return zt(e,n,r.x);if(n.x===0)return zt(r,t,e.x);if(t.y===0)return Tt(e,n,r.y);if(n.y===0)return Tt(r,t,e.y);const i=nt(t,n);if(i==0)return null;const o={x:e.x-r.x,y:e.y-r.y},u=nt(o,t)/i,l=nt(o,n)/i,c=r.x+l*t.x,f=e.x+u*n.x,p=r.y+l*t.y,s=e.y+u*n.y,a=(c+f)/2,h=(p+s)/2;return{x:a,y:h}};class C{static compare(t,e){const n=C.comparePoints(t.point,e.point);return n!==0?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:F.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){t.events===void 0?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 n=0,i=e.length;n<i;n++){const o=e[n];this.point.events.push(o),o.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(n.segment.consumedBy===void 0)for(let i=e+1;i<t;i++){const o=this.point.events[i];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const i=this.point.events[e];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const e=new Map,n=i=>{const o=i.otherSE;e.set(i,{sine:Se(this.point,t.point,o.point),cosine:Pe(this.point,t.point,o.point)})};return(i,o)=>{e.has(i)||n(i),e.has(o)||n(o);const{sine:u,cosine:l}=e.get(i),{sine:c,cosine:f}=e.get(o);return u>=0&&c>=0?l<f?1:l>f?-1:0:u<0&&c<0?l<f?-1:l>f?1:0:c<u?-1:c>u?1:0}}}let Le=0;class F{static compare(t,e){const n=t.leftSE.point.x,i=e.leftSE.point.x,o=t.rightSE.point.x,u=e.rightSE.point.x;if(u<n)return 1;if(o<i)return-1;const l=t.leftSE.point.y,c=e.leftSE.point.y,f=t.rightSE.point.y,p=e.rightSE.point.y;if(n<i){if(c<l&&c<f)return 1;if(c>l&&c>f)return-1;const s=t.comparePoint(e.leftSE.point);if(s<0)return 1;if(s>0)return-1;const a=e.comparePoint(t.rightSE.point);return a!==0?a:-1}if(n>i){if(l<c&&l<p)return-1;if(l>c&&l>p)return 1;const s=e.comparePoint(t.leftSE.point);if(s!==0)return s;const a=t.comparePoint(e.rightSE.point);return a<0?1:a>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(o<u){const s=e.comparePoint(t.rightSE.point);if(s!==0)return s}if(o>u){const s=t.comparePoint(e.rightSE.point);if(s<0)return 1;if(s>0)return-1}if(o!==u){const s=f-l,a=o-n,h=p-c,g=u-i;if(s>a&&h<g)return 1;if(s<a&&h>g)return-1}return o>u?1:o<u||f<p?-1:f>p?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,i){this.id=++Le,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}static fromRing(t,e,n){let i,o,u;const l=C.comparePoints(t,e);if(l<0)i=t,o=e,u=1;else if(l>0)i=e,o=t,u=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const c=new C(i,!0),f=new C(o,!1);return new F(c,f,[n],[u])}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,i=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const o=(t.y-e.y)/i.y,u=e.x+o*i.x;if(t.x===u)return 0;const l=(t.x-e.x)/i.x,c=e.y+l*i.y;return t.y===c?0:t.y<c?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),i=mt(e,n);if(i===null)return null;const o=this.leftSE.point,u=this.rightSE.point,l=t.leftSE.point,c=t.rightSE.point,f=W(e,l)&&this.comparePoint(l)===0,p=W(n,o)&&t.comparePoint(o)===0,s=W(e,c)&&this.comparePoint(c)===0,a=W(n,u)&&t.comparePoint(u)===0;if(p&&f)return a&&!s?u:!a&&s?c:null;if(p)return s&&o.x===c.x&&o.y===c.y?null:o;if(f)return a&&u.x===l.x&&u.y===l.y?null:l;if(a&&s)return null;if(a)return u;if(s)return c;const h=Me(o,this.vector(),l,t.vector());return h===null||!W(i,h)?null:K.round(h.x,h.y)}split(t){const e=[],n=t.events!==void 0,i=new C(t,!0),o=new C(t,!1),u=this.rightSE;this.replaceRightSE(o),e.push(o),e.push(i);const l=new F(i,u,this.rings.slice(),this.windings.slice());return C.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),C.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=F.compare(e,n);if(i!==0){if(i>0){const o=e;e=n,n=o}if(e.prev===n){const o=e;e=n,n=o}for(let o=0,u=n.rings.length;o<u;o++){const l=n.rings[o],c=n.windings[o],f=e.rings.indexOf(l);f===-1?(e.rings.push(l),e.windings.push(c)):e.windings[f]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){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)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)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,i=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const f=this.rings[l],p=this.windings[l],s=e.indexOf(f);s===-1?(e.push(f),n.push(p)):n[s]+=p}const o=[],u=[];for(let l=0,c=e.length;l<c;l++){if(n[l]===0)continue;const f=e[l],p=f.poly;if(u.indexOf(p)===-1)if(f.isExterior)o.push(p);else{u.indexOf(p)===-1&&u.push(p);const s=o.indexOf(f.poly);s!==-1&&o.splice(s,1)}}for(let l=0,c=o.length;l<c;l++){const f=o[l].multiPoly;i.indexOf(f)===-1&&i.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(I.type){case"union":{const n=t.length===0,i=e.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<e.length?(n=t.length,i=e.length):(n=e.length,i=t.length),this._isInResult=i===I.numMultiPolys&&n<i;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${I.type}`)}return this._isInResult}}class Ft{constructor(t,e,n){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=K.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let o=i;for(let u=1,l=t.length;u<l;u++){if(typeof t[u][0]!="number"||typeof t[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=K.round(t[u][0],t[u][1]);c.x===o.x&&c.y===o.y||(this.segments.push(F.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(F.fromRing(o,i,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const i=this.segments[e];t.push(i.leftSE),t.push(i.rightSE)}return t}}class Ce{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ft(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 n=1,i=t.length;n<i;n++){const o=new Ft(t[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getSweepEvents();for(let o=0,u=i.length;o<u;o++)t.push(i[o])}return t}}class qt{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,i=t.length;n<i;n++){const o=new Ce(t[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getSweepEvents();for(let o=0,u=i.length;o<u;o++)t.push(i[o])}return t}}class it{static factory(t){const e=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.isInResult()||o.ringOut)continue;let u=null,l=o.leftSE,c=o.rightSE;const f=[l],p=l.point,s=[];for(;u=l,l=c,f.push(l),l.point!==p;)for(;;){const a=l.getAvailableLinkedEvents();if(a.length===0){const d=f[0].point,b=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${d.x}, ${d.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(a.length===1){c=a[0].otherSE;break}let h=null;for(let d=0,b=s.length;d<b;d++)if(s[d].point===l.point){h=d;break}if(h!==null){const d=s.splice(h)[0],b=f.splice(d.index);b.unshift(b[0].otherSE),e.push(new it(b.reverse()));continue}s.push({index:f.length,point:l.point});const g=l.getLeftmostComparator(u);c=a.sort(g)[0].otherSE;break}e.push(new it(f))}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 f=1,p=this.events.length-1;f<p;f++){const s=this.events[f].point,a=this.events[f+1].point;Gt(s,t,a)!==0&&(e.push(s),t=s)}if(e.length===1)return null;const n=e[0],i=e[1];Gt(n,t,i)===0&&e.shift(),e.push(e[0]);const o=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,c=[];for(let f=u;f!=l;f+=o)c.push([e[f].x,e[f].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,o=this.events.length;i<o;i++){const u=this.events[i];C.compare(t,u)>0&&(t=u)}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 jt{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(t[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getGeom();i!==null&&t.push(i)}return t}}class Re{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 i=this.polys[e].getGeom();i!==null&&t.push(i)}return t}_composePolys(t){const e=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.poly)if(o.isExteriorRing())e.push(new jt(o));else{const u=o.enclosingRing();u.poly||e.push(new jt(u)),u.poly.addInterior(o)}}return e}}class Ie{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F.compare;this.queue=t,this.tree=new pt(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 i=t.isLeft?this.tree.add(e):this.tree.find(e);if(!i)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 o=i,u=i,l,c;for(;l===void 0;)o=this.tree.prev(o),o===null?l=null:o.key.consumedBy===void 0&&(l=o.key);for(;c===void 0;)u=this.tree.next(u),u===null?c=null:u.key.consumedBy===void 0&&(c=u.key);if(t.isLeft){let f=null;if(l){const s=l.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(f=s),!l.isAnEndpoint(s))){const a=this._splitSafely(l,s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}}let p=null;if(c){const s=c.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(p=s),!c.isAnEndpoint(s))){const a=this._splitSafely(c,s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}}if(f!==null||p!==null){let s=null;f===null?s=p:p===null?s=f:s=C.comparePoints(f,p)<=0?f:p,this.queue.remove(e.rightSE),n.push(e.rightSE);const a=e.split(s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=l)}else{if(l&&c){const f=l.getIntersection(c);if(f!==null){if(!l.isAnEndpoint(f)){const p=this._splitSafely(l,f);for(let s=0,a=p.length;s<a;s++)n.push(p[s])}if(!c.isAnEndpoint(f)){const p=this._splitSafely(c,f);for(let s=0,a=p.length;s<a;s++)n.push(p[s])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const i=t.split(e);return i.push(n),t.consumedBy===void 0&&this.tree.add(t),i}}const Qt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,$e=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class ke{run(t,e,n){I.type=t,K.reset();const i=[new qt(e,!0)];for(let s=0,a=n.length;s<a;s++)i.push(new qt(n[s],!1));if(I.numMultiPolys=i.length,I.type==="difference"){const s=i[0];let a=1;for(;a<i.length;)mt(i[a].bbox,s.bbox)!==null?a++:i.splice(a,1)}if(I.type==="intersection")for(let s=0,a=i.length;s<a;s++){const h=i[s];for(let g=s+1,d=i.length;g<d;g++)if(mt(h.bbox,i[g].bbox)===null)return[]}const o=new pt(C.compare);for(let s=0,a=i.length;s<a;s++){const h=i[s].getSweepEvents();for(let g=0,d=h.length;g<d;g++)if(o.insert(h[g]),o.size>Qt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const u=new Ie(o);let l=o.size,c=o.pop();for(;c;){const s=c.key;if(o.size===l){const h=s.segment;throw new Error(`Unable to pop() ${s.isLeft?"left":"right"} SweepEvent [${s.point.x}, ${s.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`)}if(o.size>Qt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(u.segments.length>$e)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const a=u.process(s);for(let h=0,g=a.length;h<g;h++){const d=a[h];d.consumedBy===void 0&&o.insert(d)}l=o.size,c=o.pop()}K.reset();const f=it.factory(u.segments);return new Re(f).getGeom()}}const I=new ke;var Ut={union:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("union",r,e)},intersection:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("intersection",r,e)},xor:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("xor",r,e)},difference:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("difference",r,e)}};function Oe(r,t={}){const e=[];if(ut(r,i=>{e.push(i.coordinates)}),e.length<2)throw new Error("Must have at least 2 geometries");const n=Ut.union(e[0],...e.slice(1));return n.length===0?null:n.length===1?lt(n[0],t.properties):Pt(n,t.properties)}var Dt=Oe;function vt(r){const t=[...r];return t[2]<t[0]&&(Math.abs((t[0]+t[2]+360)/2)>Math.abs((t[0]-360+t[2])/2)?t[0]-=360:t[2]+=360),t}function H(){}function Yt(r){return r()}function Xt(){return Object.create(null)}function ot(r){r.forEach(Yt)}function Vt(r){return typeof r=="function"}function Ae(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function Ne(r){return Object.keys(r).length===0}function Be(r,t){r.appendChild(t)}function Ge(r,t,e){r.insertBefore(t,e||null)}function Zt(r){r.parentNode&&r.parentNode.removeChild(r)}function Jt(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function q(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function Te(r){return Array.from(r.childNodes)}function st(r,t,e){r.classList.toggle(t,!!e)}let bt;function tt(r){bt=r}const D=[],Wt=[];let Y=[];const Kt=[],ze=Promise.resolve();let wt=!1;function Fe(){wt||(wt=!0,ze.then(Ht))}function Et(r){Y.push(r)}const _t=new Set;let X=0;function Ht(){if(X!==0)return;const r=bt;do{try{for(;X<D.length;){const t=D[X];X++,tt(t),qe(t.$$)}}catch(t){throw D.length=0,X=0,t}for(tt(null),D.length=0,X=0;Wt.length;)Wt.pop()();for(let t=0;t<Y.length;t+=1){const e=Y[t];_t.has(e)||(_t.add(e),e())}Y.length=0}while(D.length);for(;Kt.length;)Kt.pop()();wt=!1,_t.clear(),tt(r)}function qe(r){if(r.fragment!==null){r.update(),ot(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(Et)}}function je(r){const t=[],e=[];Y.forEach(n=>r.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),Y=t}const Qe=new Set;function Ue(r,t){r&&r.i&&(Qe.delete(r),r.i(t))}function De(r,t,e){const{fragment:n,after_update:i}=r.$$;n&&n.m(t,e),Et(()=>{const o=r.$$.on_mount.map(Yt).filter(Vt);r.$$.on_destroy?r.$$.on_destroy.push(...o):ot(o),r.$$.on_mount=[]}),i.forEach(Et)}function Ye(r,t){const e=r.$$;e.fragment!==null&&(je(e.after_update),ot(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Xe(r,t){r.$$.dirty[0]===-1&&(D.push(r),Fe(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function Ve(r,t,e,n,i,o,u=null,l=[-1]){const c=bt;tt(r);const f=r.$$={fragment:null,ctx:[],props:o,update:H,not_equal:i,bound:Xt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:Xt(),dirty:l,skip_bound:!1,root:t.target||c.$$.root};u&&u(f.root);let p=!1;if(f.ctx=e?e(r,t.props||{},(s,a,...h)=>{const g=h.length?h[0]:a;return f.ctx&&i(f.ctx[s],f.ctx[s]=g)&&(!f.skip_bound&&f.bound[s]&&f.bound[s](g),p&&Xe(r,s)),a}):[],f.update(),p=!0,ot(f.before_update),f.fragment=n?n(f.ctx):!1,t.target){if(t.hydrate){const s=Te(t.target);f.fragment&&f.fragment.l(s),s.forEach(Zt)}else f.fragment&&f.fragment.c();t.intro&&Ue(r.$$.fragment),De(r,t.target,t.anchor),Ht()}tt(c)}class Ze{constructor(){St(this,"$$");St(this,"$$set")}$destroy(){Ye(this,1),this.$destroy=H}$on(t,e){if(!Vt(e))return H;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!Ne(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Je="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Je);function We(r){let t,e,n;return{c(){t=Jt("svg"),e=Jt("path"),q(e,"stroke-width","4"),q(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),q(e,"class","svelte-gzo3ar"),q(t,"width",n=r[0]==="list"?20:void 0),q(t,"viewBox","0 0 70 85"),q(t,"fill","none"),q(t,"class","svelte-gzo3ar"),st(t,"in-map",r[0]!=="list"),st(t,"list-icon",r[0]==="list")},m(i,o){Ge(i,t,o),Be(t,e)},p(i,[o]){o&1&&n!==(n=i[0]==="list"?20:void 0)&&q(t,"width",n),o&1&&st(t,"in-map",i[0]!=="list"),o&1&&st(t,"list-icon",i[0]==="list")},i:H,o:H,d(i){i&&Zt(t)}}}function Ke(r,t,e){let{displayIn:n}=t;return r.$$set=i=>{"displayIn"in i&&e(0,n=i.displayIn)},[n]}class He extends Ze{constructor(t){super(),Ve(this,t,Ke,We,Ae,{displayIn:0})}}function tn(r){const t=[];if(ut(r,i=>{t.push(i.coordinates)}),t.length<2)throw new Error("Must have at least two features");const e=r.features[0].properties||{},n=Ut.difference(t[0],...t.slice(1));return n.length===0?null:n.length===1?lt(n[0],e):Pt(n,e)}var en=tn;function nn(r){if(!r)throw new Error("geojson is required");var t=[];return ie(r,function(e){t.push(e)}),Z(t)}var rn=nn;function te(r,t){const e=en(Z([lt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),r]));if(!e)return;e.properties={isMask:!0};const n=vt(ft(r)),i=(n[2]-n[0])/360/1e3,o=n[0]<-180,u=n[2]>180,l=rn(r);if(l.features.length>1&&(o||u))for(const c of l.features){const f=vt(ft(c));if(u&&f[0]<-180+i)for(const p of c.geometry.coordinates)for(const s of p)s[0]+=360-i;if(o&&f[2]>180-i)for(const p of c.geometry.coordinates)for(const s of p)s[0]-=360-i}t(Z([l.features.length<2?r:Dt(l)??r,e]))}const ee=r=>{var n,i,o;const t=(n=r==null?void 0:r.geometry)==null?void 0:n.type,e=(i=r==null?void 0:r.properties)!=null&&i.isMask?0:t==="LineString"||t==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(o=r==null?void 0:r.properties)!=null&&o.isMask?.1:0,weight:e,dashArray:[e,e],lineCap:"butt"}};function on(r,t=!0,e=!0,n={},i={},o=ee){let u;const l=[];let c,f;const p=Q.geoJSON(void 0,{style:o===!0?ee:o===!1?void 0:o??void 0,interactive:!1}).addTo(r),s=h=>{u==null||u({type:"mapClick",coordinates:[h.latlng.lng,h.latlng.lat]})};function a(h,g=!1){const d=document.createElement("div");return new He({props:{displayIn:"leaflet"},target:d}),new Q.Marker(h,{interactive:g,icon:new Q.DivIcon({html:d,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(h){h?(u=h,r.on("click",s)):(u=void 0,r.off("click",s))},flyTo(h,g){r.flyTo([h[1],h[0]],g,{duration:2,...n})},fitBounds(h,g,d){r.flyToBounds([[h[1],h[0]],[h[3],h[2]]],{padding:[g,g],duration:2,...d?{maxZoom:d}:{},...i})},indicateReverse(h){r.getContainer().style.cursor=h?"crosshair":""},setReverseMarker(h){var d;if(!t)return;const g=h&&[h[1],h[0]];f?g?f.setLatLng(g):(f.remove(),f=void 0):g&&(t instanceof Function?f=t(r)??void 0:(f=(typeof t=="object"?new Q.Marker(g,t):a(g)).addTo(r),(d=f.getElement())==null||d.classList.add("marker-reverse")))},setFeatures(h,g,d){function b(y){p.clearLayers(),y&&p.addData(y)}for(const y of l)y.remove();l.length=0,b();t:if(g){let y=!1;if(g.geometry.type==="GeometryCollection"){const m=g.geometry.geometries.filter(x=>x.type==="Polygon"||x.type==="MultiPolygon");e:if(m.length>0){const x=Dt(Z(m.map(v=>V(v))));if(!x)break e;te({...g,geometry:x.geometry},b),y=!0}else{const x=g.geometry.geometries.filter(v=>v.type==="LineString"||v.type==="MultiLineString");x.length>0&&(b({...g,geometry:{type:"GeometryCollection",geometries:x}}),y=!0)}}if(!y){if(g.geometry.type==="Polygon"||g.geometry.type==="MultiPolygon")te(g,m=>{if(!m)return;const x=[...m.features],v=vt(ft(g)),w=v[2]-v[0];v[0]-w/4<-180&&x.push(...ne(m,-360).features),v[2]+w/4>180&&x.push(...ne(m,360).features),b(Z(x))});else if(g.geometry.type==="LineString"||g.geometry.type==="MultiLineString"){b(g);break t}}if(!d&&g.geometry.type!=="Point")break t;if(t instanceof Function){const m=t(r,g);m&&l.push(m.addTo(r))}else if(t){const m=[g.center[1],g.center[0]];l.push(typeof t=="object"?new Q.Marker(m,t):a(m).addTo(r))}}if(e)for(const y of h??[]){if(y===g)continue;const m=[y.center[1],y.center[0]];let x;if(e instanceof Function){if(x=e(r,y),!x)continue}else x=(typeof e=="object"?new Q.Marker(m,e):a(m,!0)).addTo(r).bindTooltip(y.place_type[0]==="reverse"?y.place_name:y.place_name.replace(/,.*/,""),{direction:"top"});const v=x.getElement();v&&(v.addEventListener("click",w=>{w.stopPropagation(),u==null||u({type:"markerClick",id:y.id})}),v.addEventListener("mouseenter",()=>{u==null||u({type:"markerMouseEnter",id:y.id})}),v.addEventListener("mouseleave",()=>{u==null||u({type:"markerMouseLeave",id:y.id})}),v.classList.toggle("marker-fuzzy",!!y.matching_text)),l.push(x)}},setSelectedMarker(h){var g,d;c&&((g=c.getElement())==null||g.classList.toggle("marker-selected",!1)),c=h>-1?l[h]:void 0,(d=c==null?void 0:c.getElement())==null||d.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const h=r.getCenter();return[r.getZoom(),h.lng,h.lat]}}}function ne(r,t){const e=ue(r);for(const n of e.features)if(n.geometry.type=="MultiPolygon")for(const i of n.geometry.coordinates)re(i,t);else re(n.geometry.coordinates,t);return e}function re(r,t){for(const e of r)for(const n of e)n[0]+=t}M.createLeafletMapController=on,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(Y,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],j):(Y=typeof globalThis<"u"?globalThis:Y||self,j(Y.leafletMaptilerGeocodingController={},Y.L))})(this,function(Y,j){"use strict";var Cn=Object.defineProperty;var On=(Y,j,he)=>j in Y?Cn(Y,j,{enumerable:!0,configurable:!0,writable:!0,value:he}):Y[j]=he;var P=(Y,j,he)=>On(Y,typeof j!="symbol"?j+"":j,he);var Ct,Ot;function he(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const pe=he(j);function me(t,e,n={}){const i={type:"Feature"};return(n.id===0||n.id)&&(i.id=n.id),n.bbox&&(i.bbox=n.bbox),i.properties=e||{},i.geometry=t,i}function Ge(t,e,n={}){for(const r of t){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;u<r[r.length-1].length;u++)if(r[r.length-1][u]!==r[0][u])throw new Error("First and last Position are not equivalent.")}return me({type:"Polygon",coordinates:t},e,n)}function xe(t,e={}){const n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function et(t,e,n={}){return me({type:"MultiPolygon",coordinates:t},e,n)}function tt(t,e,n){if(t!==null)for(var i,r,u,a,h,E,p,_=0,b=0,M,T=t.type,L=T==="FeatureCollection",B=T==="Feature",q=L?t.features.length:1,I=0;I<q;I++){p=L?t.features[I].geometry:B?t.geometry:t,M=p?p.type==="GeometryCollection":!1,h=M?p.geometries.length:1;for(var v=0;v<h;v++){var N=0,$=0;if(a=M?p.geometries[v]:p,a!==null){E=a.coordinates;var K=a.type;switch(_=0,K){case null:break;case"Point":if(e(E,b,I,N,$)===!1)return!1;b++,N++;break;case"LineString":case"MultiPoint":for(i=0;i<E.length;i++){if(e(E[i],b,I,N,$)===!1)return!1;b++,K==="MultiPoint"&&N++}K==="LineString"&&N++;break;case"Polygon":case"MultiLineString":for(i=0;i<E.length;i++){for(r=0;r<E[i].length-_;r++){if(e(E[i][r],b,I,N,$)===!1)return!1;b++}K==="MultiLineString"&&N++,K==="Polygon"&&$++}K==="Polygon"&&N++;break;case"MultiPolygon":for(i=0;i<E.length;i++){for($=0,r=0;r<E[i].length;r++){for(u=0;u<E[i][r].length-_;u++){if(e(E[i][r][u],b,I,N,$)===!1)return!1;b++}$++}N++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(tt(a.geometries[i],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function $e(t,e){var n,i,r,u,a,h,E,p,_,b,M=0,T=t.type==="FeatureCollection",L=t.type==="Feature",B=T?t.features.length:1;for(n=0;n<B;n++){for(h=T?t.features[n].geometry:L?t.geometry:t,p=T?t.features[n].properties:L?t.properties:{},_=T?t.features[n].bbox:L?t.bbox:void 0,b=T?t.features[n].id:L?t.id:void 0,E=h?h.type==="GeometryCollection":!1,a=E?h.geometries.length:1,r=0;r<a;r++){if(u=E?h.geometries[r]:h,u===null){if(e(null,M,p,_,b)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(u,M,p,_,b)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<u.geometries.length;i++)if(e(u.geometries[i],M,p,_,b)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function Nt(t,e){$e(t,function(n,i,r,u,a){var h=n===null?null:n.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return e(me(n,r,{bbox:u,id:a}),i,0)===!1?!1:void 0}var E;switch(h){case"MultiPoint":E="Point";break;case"MultiLineString":E="LineString";break;case"MultiPolygon":E="Polygon";break}for(var p=0;p<n.coordinates.length;p++){var _=n.coordinates[p],b={type:E,coordinates:_};if(e(me(b,r),i,p)===!1)return!1}})}function At(t,e={}){if(t.bbox!=null&&e.recompute!==!0)return t.bbox;const n=[1/0,1/0,-1/0,-1/0];return tt(t,i=>{n[0]>i[0]&&(n[0]=i[0]),n[1]>i[1]&&(n[1]=i[1]),n[2]<i[0]&&(n[2]=i[0]),n[3]<i[1]&&(n[3]=i[1])}),n}var qe=At;function It(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return nt(t);case"FeatureCollection":return kt(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Fe(t);default:throw new Error("unknown GeoJSON type")}}function nt(t){const e={type:"Feature"};return Object.keys(t).forEach(n=>{switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}}),e.properties=it(t.properties),t.geometry==null?e.geometry=null:e.geometry=Fe(t.geometry),e}function it(t){const e={};return t&&Object.keys(t).forEach(n=>{const i=t[n];typeof i=="object"?i===null?e[n]=null:Array.isArray(i)?e[n]=i.map(r=>r):e[n]=it(i):e[n]=i}),e}function kt(t){const e={type:"FeatureCollection"};return Object.keys(t).forEach(n=>{switch(n){case"type":case"features":return;default:e[n]=t[n]}}),e.features=t.features.map(n=>nt(n)),e}function Fe(t){const e={type:t.type};return t.bbox&&(e.bbox=t.bbox),t.type==="GeometryCollection"?(e.geometries=t.geometries.map(n=>Fe(n)),e):(e.coordinates=rt(t.coordinates),e)}function rt(t){const e=t;return typeof e[0]!="object"?e.slice():e.map(n=>rt(n))}var Bt=It,Gt=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,De=Math.ceil,J=Math.floor,Z="[BigNumber Error] ",st=Z+"Number primitive has more than 15 significant digits: ",ne=1e14,R=14,ot=9007199254740991,ze=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],fe=1e7,W=1e9;function lt(t){var e,n,i,r=v.prototype={constructor:v,toString:null,valueOf:null},u=new v(1),a=20,h=4,E=-7,p=21,_=-1e7,b=1e7,M=!1,T=1,L=0,B={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},q="0123456789abcdefghijklmnopqrstuvwxyz",I=!0;function v(s,o){var l,m,c,y,w,f,g,x,d=this;if(!(d instanceof v))return new v(s,o);if(o==null){if(s&&s._isBigNumber===!0){d.s=s.s,!s.c||s.e>b?d.c=d.e=null:s.e<_?d.c=[d.e=0]:(d.e=s.e,d.c=s.c.slice());return}if((f=typeof s=="number")&&s*0==0){if(d.s=1/s<0?(s=-s,-1):1,s===~~s){for(y=0,w=s;w>=10;w/=10,y++);y>b?d.c=d.e=null:(d.e=y,d.c=[s]);return}x=String(s)}else{if(!Gt.test(x=String(s)))return i(d,x,f);d.s=x.charCodeAt(0)==45?(x=x.slice(1),-1):1}(y=x.indexOf("."))>-1&&(x=x.replace(".","")),(w=x.search(/e/i))>0?(y<0&&(y=w),y+=+x.slice(w+1),x=x.substring(0,w)):y<0&&(y=x.length)}else{if(F(o,2,q.length,"Base"),o==10&&I)return d=new v(s),ee(d,a+d.e+1,h);if(x=String(s),f=typeof s=="number"){if(s*0!=0)return i(d,x,f,o);if(d.s=1/s<0?(x=x.slice(1),-1):1,v.DEBUG&&x.replace(/^0\.0*|\./,"").length>15)throw Error(st+s)}else d.s=x.charCodeAt(0)===45?(x=x.slice(1),-1):1;for(l=q.slice(0,o),y=w=0,g=x.length;w<g;w++)if(l.indexOf(m=x.charAt(w))<0){if(m=="."){if(w>y){y=g;continue}}else if(!c&&(x==x.toUpperCase()&&(x=x.toLowerCase())||x==x.toLowerCase()&&(x=x.toUpperCase()))){c=!0,w=-1,y=0;continue}return i(d,String(s),f,o)}f=!1,x=n(x,o,10,d.s),(y=x.indexOf("."))>-1?x=x.replace(".",""):y=x.length}for(w=0;x.charCodeAt(w)===48;w++);for(g=x.length;x.charCodeAt(--g)===48;);if(x=x.slice(w,++g)){if(g-=w,f&&v.DEBUG&&g>15&&(s>ot||s!==J(s)))throw Error(st+d.s*s);if((y=y-w-1)>b)d.c=d.e=null;else if(y<_)d.c=[d.e=0];else{if(d.e=y,d.c=[],w=(y+1)%R,y<0&&(w+=R),w<g){for(w&&d.c.push(+x.slice(0,w)),g-=R;w<g;)d.c.push(+x.slice(w,w+=R));w=R-(x=x.slice(w)).length}else w-=g;for(;w--;x+="0");d.c.push(+x)}}else d.c=[d.e=0]}v.clone=lt,v.ROUND_UP=0,v.ROUND_DOWN=1,v.ROUND_CEIL=2,v.ROUND_FLOOR=3,v.ROUND_HALF_UP=4,v.ROUND_HALF_DOWN=5,v.ROUND_HALF_EVEN=6,v.ROUND_HALF_CEIL=7,v.ROUND_HALF_FLOOR=8,v.EUCLID=9,v.config=v.set=function(s){var o,l;if(s!=null)if(typeof s=="object"){if(s.hasOwnProperty(o="DECIMAL_PLACES")&&(l=s[o],F(l,0,W,o),a=l),s.hasOwnProperty(o="ROUNDING_MODE")&&(l=s[o],F(l,0,8,o),h=l),s.hasOwnProperty(o="EXPONENTIAL_AT")&&(l=s[o],l&&l.pop?(F(l[0],-1e9,0,o),F(l[1],0,W,o),E=l[0],p=l[1]):(F(l,-1e9,W,o),E=-(p=l<0?-l:l))),s.hasOwnProperty(o="RANGE"))if(l=s[o],l&&l.pop)F(l[0],-1e9,-1,o),F(l[1],1,W,o),_=l[0],b=l[1];else if(F(l,-1e9,W,o),l)_=-(b=l<0?-l:l);else throw Error(Z+o+" cannot be zero: "+l);if(s.hasOwnProperty(o="CRYPTO"))if(l=s[o],l===!!l)if(l)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))M=l;else throw M=!l,Error(Z+"crypto unavailable");else M=l;else throw Error(Z+o+" not true or false: "+l);if(s.hasOwnProperty(o="MODULO_MODE")&&(l=s[o],F(l,0,9,o),T=l),s.hasOwnProperty(o="POW_PRECISION")&&(l=s[o],F(l,0,W,o),L=l),s.hasOwnProperty(o="FORMAT"))if(l=s[o],typeof l=="object")B=l;else throw Error(Z+o+" not an object: "+l);if(s.hasOwnProperty(o="ALPHABET"))if(l=s[o],typeof l=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(l))I=l.slice(0,10)=="0123456789",q=l;else throw Error(Z+o+" invalid: "+l)}else throw Error(Z+"Object expected: "+s);return{DECIMAL_PLACES:a,ROUNDING_MODE:h,EXPONENTIAL_AT:[E,p],RANGE:[_,b],CRYPTO:M,MODULO_MODE:T,POW_PRECISION:L,FORMAT:B,ALPHABET:q}},v.isBigNumber=function(s){if(!s||s._isBigNumber!==!0)return!1;if(!v.DEBUG)return!0;var o,l,m=s.c,c=s.e,y=s.s;e:if({}.toString.call(m)=="[object Array]"){if((y===1||y===-1)&&c>=-1e9&&c<=W&&c===J(c)){if(m[0]===0){if(c===0&&m.length===1)return!0;break e}if(o=(c+1)%R,o<1&&(o+=R),String(m[0]).length==o){for(o=0;o<m.length;o++)if(l=m[o],l<0||l>=ne||l!==J(l))break e;if(l!==0)return!0}}}else if(m===null&&c===null&&(y===null||y===1||y===-1))return!0;throw Error(Z+"Invalid BigNumber: "+s)},v.maximum=v.max=function(){return $(arguments,-1)},v.minimum=v.min=function(){return $(arguments,1)},v.random=function(){var s=9007199254740992,o=Math.random()*s&2097151?function(){return J(Math.random()*s)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(l){var m,c,y,w,f,g=0,x=[],d=new v(u);if(l==null?l=a:F(l,0,W),w=De(l/R),M)if(crypto.getRandomValues){for(m=crypto.getRandomValues(new Uint32Array(w*=2));g<w;)f=m[g]*131072+(m[g+1]>>>11),f>=9e15?(c=crypto.getRandomValues(new Uint32Array(2)),m[g]=c[0],m[g+1]=c[1]):(x.push(f%1e14),g+=2);g=w/2}else if(crypto.randomBytes){for(m=crypto.randomBytes(w*=7);g<w;)f=(m[g]&31)*281474976710656+m[g+1]*1099511627776+m[g+2]*4294967296+m[g+3]*16777216+(m[g+4]<<16)+(m[g+5]<<8)+m[g+6],f>=9e15?crypto.randomBytes(7).copy(m,g):(x.push(f%1e14),g+=7);g=w/7}else throw M=!1,Error(Z+"crypto unavailable");if(!M)for(;g<w;)f=o(),f<9e15&&(x[g++]=f%1e14);for(w=x[--g],l%=R,w&&l&&(f=ze[R-l],x[g]=J(w/f)*f);x[g]===0;x.pop(),g--);if(g<0)x=[y=0];else{for(y=-1;x[0]===0;x.splice(0,1),y-=R);for(g=1,f=x[0];f>=10;f/=10,g++);g<R&&(y-=R-g)}return d.e=y,d.c=x,d}}(),v.sum=function(){for(var s=1,o=arguments,l=new v(o[0]);s<o.length;)l=l.plus(o[s++]);return l},n=function(){var s="0123456789";function o(l,m,c,y){for(var w,f=[0],g,x=0,d=l.length;x<d;){for(g=f.length;g--;f[g]*=m);for(f[0]+=y.indexOf(l.charAt(x++)),w=0;w<f.length;w++)f[w]>c-1&&(f[w+1]==null&&(f[w+1]=0),f[w+1]+=f[w]/c|0,f[w]%=c)}return f.reverse()}return function(l,m,c,y,w){var f,g,x,d,S,C,O,k,D=l.indexOf("."),U=a,A=h;for(D>=0&&(d=L,L=0,l=l.replace(".",""),k=new v(m),C=k.pow(l.length-D),L=d,k.c=o(oe(Q(C.c),C.e,"0"),10,c,s),k.e=k.c.length),O=o(l,m,c,w?(f=q,s):(f=s,q)),x=d=O.length;O[--d]==0;O.pop());if(!O[0])return f.charAt(0);if(D<0?--x:(C.c=O,C.e=x,C.s=y,C=e(C,k,U,A,c),O=C.c,S=C.r,x=C.e),g=x+U+1,D=O[g],d=c/2,S=S||g<0||O[g+1]!=null,S=A<4?(D!=null||S)&&(A==0||A==(C.s<0?3:2)):D>d||D==d&&(A==4||S||A==6&&O[g-1]&1||A==(C.s<0?8:7)),g<1||!O[0])l=S?oe(f.charAt(1),-U,f.charAt(0)):f.charAt(0);else{if(O.length=g,S)for(--c;++O[--g]>c;)O[g]=0,g||(++x,O=[1].concat(O));for(d=O.length;!O[--d];);for(D=0,l="";D<=d;l+=f.charAt(O[D++]));l=oe(l,x,f.charAt(0))}return l}}(),e=function(){function s(m,c,y){var w,f,g,x,d=0,S=m.length,C=c%fe,O=c/fe|0;for(m=m.slice();S--;)g=m[S]%fe,x=m[S]/fe|0,w=O*g+x*C,f=C*g+w%fe*fe+d,d=(f/y|0)+(w/fe|0)+O*x,m[S]=f%y;return d&&(m=[d].concat(m)),m}function o(m,c,y,w){var f,g;if(y!=w)g=y>w?1:-1;else for(f=g=0;f<y;f++)if(m[f]!=c[f]){g=m[f]>c[f]?1:-1;break}return g}function l(m,c,y,w){for(var f=0;y--;)m[y]-=f,f=m[y]<c[y]?1:0,m[y]=f*w+m[y]-c[y];for(;!m[0]&&m.length>1;m.splice(0,1));}return function(m,c,y,w,f){var g,x,d,S,C,O,k,D,U,A,G,V,ke,Je,He,se,_e,te=m.s==c.s?1:-1,X=m.c,z=c.c;if(!X||!X[0]||!z||!z[0])return new v(!m.s||!c.s||(X?z&&X[0]==z[0]:!z)?NaN:X&&X[0]==0||!z?te*0:te/0);for(D=new v(te),U=D.c=[],x=m.e-c.e,te=y+x+1,f||(f=ne,x=H(m.e/R)-H(c.e/R),te=te/R|0),d=0;z[d]==(X[d]||0);d++);if(z[d]>(X[d]||0)&&x--,te<0)U.push(1),S=!0;else{for(Je=X.length,se=z.length,d=0,te+=2,C=J(f/(z[0]+1)),C>1&&(z=s(z,C,f),X=s(X,C,f),se=z.length,Je=X.length),ke=se,A=X.slice(0,se),G=A.length;G<se;A[G++]=0);_e=z.slice(),_e=[0].concat(_e),He=z[0],z[1]>=f/2&&He++;do{if(C=0,g=o(z,A,se,G),g<0){if(V=A[0],se!=G&&(V=V*f+(A[1]||0)),C=J(V/He),C>1)for(C>=f&&(C=f-1),O=s(z,C,f),k=O.length,G=A.length;o(O,A,k,G)==1;)C--,l(O,se<k?_e:z,k,f),k=O.length,g=1;else C==0&&(g=C=1),O=z.slice(),k=O.length;if(k<G&&(O=[0].concat(O)),l(A,O,G,f),G=A.length,g==-1)for(;o(z,A,se,G)<1;)C++,l(A,se<G?_e:z,G,f),G=A.length}else g===0&&(C++,A=[0]);U[d++]=C,A[0]?A[G++]=X[ke]||0:(A=[X[ke]],G=1)}while((ke++<Je||A[0]!=null)&&te--);S=A[0]!=null,U[0]||U.splice(0,1)}if(f==ne){for(d=1,te=U[0];te>=10;te/=10,d++);ee(D,y+(D.e=d+x*R-1)+1,w,S)}else D.e=x,D.r=+S;return D}}();function N(s,o,l,m){var c,y,w,f,g;if(l==null?l=h:F(l,0,8),!s.c)return s.toString();if(c=s.c[0],w=s.e,o==null)g=Q(s.c),g=m==1||m==2&&(w<=E||w>=p)?Me(g,w):oe(g,w,"0");else if(s=ee(new v(s),o,l),y=s.e,g=Q(s.c),f=g.length,m==1||m==2&&(o<=y||y<=E)){for(;f<o;g+="0",f++);g=Me(g,y)}else if(o-=w,g=oe(g,y,"0"),y+1>f){if(--o>0)for(g+=".";o--;g+="0");}else if(o+=y-f,o>0)for(y+1==f&&(g+=".");o--;g+="0");return s.s<0&&c?"-"+g:g}function $(s,o){for(var l,m,c=1,y=new v(s[0]);c<s.length;c++)m=new v(s[c]),(!m.s||(l=ae(y,m))===o||l===0&&y.s===o)&&(y=m);return y}function K(s,o,l){for(var m=1,c=o.length;!o[--c];o.pop());for(c=o[0];c>=10;c/=10,m++);return(l=m+l*R-1)>b?s.c=s.e=null:l<_?s.c=[s.e=0]:(s.e=l,s.c=o),s}i=function(){var s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,o=/^([^.]+)\.$/,l=/^\.([^.]+)$/,m=/^-?(Infinity|NaN)$/,c=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(y,w,f,g){var x,d=f?w:w.replace(c,"");if(m.test(d))y.s=isNaN(d)?null:d<0?-1:1;else{if(!f&&(d=d.replace(s,function(S,C,O){return x=(O=O.toLowerCase())=="x"?16:O=="b"?2:8,!g||g==x?C:S}),g&&(x=g,d=d.replace(o,"$1").replace(l,"0.$1")),w!=d))return new v(d,x);if(v.DEBUG)throw Error(Z+"Not a"+(g?" base "+g:"")+" number: "+w);y.s=null}y.c=y.e=null}}();function ee(s,o,l,m){var c,y,w,f,g,x,d,S=s.c,C=ze;if(S){e:{for(c=1,f=S[0];f>=10;f/=10,c++);if(y=o-c,y<0)y+=R,w=o,g=S[x=0],d=J(g/C[c-w-1]%10);else if(x=De((y+1)/R),x>=S.length)if(m){for(;S.length<=x;S.push(0));g=d=0,c=1,y%=R,w=y-R+1}else break e;else{for(g=f=S[x],c=1;f>=10;f/=10,c++);y%=R,w=y-R+c,d=w<0?0:J(g/C[c-w-1]%10)}if(m=m||o<0||S[x+1]!=null||(w<0?g:g%C[c-w-1]),m=l<4?(d||m)&&(l==0||l==(s.s<0?3:2)):d>5||d==5&&(l==4||m||l==6&&(y>0?w>0?g/C[c-w]:0:S[x-1])%10&1||l==(s.s<0?8:7)),o<1||!S[0])return S.length=0,m?(o-=s.e+1,S[0]=C[(R-o%R)%R],s.e=-o||0):S[0]=s.e=0,s;if(y==0?(S.length=x,f=1,x--):(S.length=x+1,f=C[R-y],S[x]=w>0?J(g/C[c-w]%C[w])*f:0),m)for(;;)if(x==0){for(y=1,w=S[0];w>=10;w/=10,y++);for(w=S[0]+=f,f=1;w>=10;w/=10,f++);y!=f&&(s.e++,S[0]==ne&&(S[0]=1));break}else{if(S[x]+=f,S[x]!=ne)break;S[x--]=0,f=1}for(y=S.length;S[--y]===0;S.pop());}s.e>b?s.c=s.e=null:s.e<_&&(s.c=[s.e=0])}return s}function ue(s){var o,l=s.e;return l===null?s.toString():(o=Q(s.c),o=l<=E||l>=p?Me(o,l):oe(o,l,"0"),s.s<0?"-"+o:o)}return r.absoluteValue=r.abs=function(){var s=new v(this);return s.s<0&&(s.s=1),s},r.comparedTo=function(s,o){return ae(this,new v(s,o))},r.decimalPlaces=r.dp=function(s,o){var l,m,c,y=this;if(s!=null)return F(s,0,W),o==null?o=h:F(o,0,8),ee(new v(y),s+y.e+1,o);if(!(l=y.c))return null;if(m=((c=l.length-1)-H(this.e/R))*R,c=l[c])for(;c%10==0;c/=10,m--);return m<0&&(m=0),m},r.dividedBy=r.div=function(s,o){return e(this,new v(s,o),a,h)},r.dividedToIntegerBy=r.idiv=function(s,o){return e(this,new v(s,o),0,1)},r.exponentiatedBy=r.pow=function(s,o){var l,m,c,y,w,f,g,x,d,S=this;if(s=new v(s),s.c&&!s.isInteger())throw Error(Z+"Exponent not an integer: "+ue(s));if(o!=null&&(o=new v(o)),f=s.e>14,!S.c||!S.c[0]||S.c[0]==1&&!S.e&&S.c.length==1||!s.c||!s.c[0])return d=new v(Math.pow(+ue(S),f?s.s*(2-Le(s)):+ue(s))),o?d.mod(o):d;if(g=s.s<0,o){if(o.c?!o.c[0]:!o.s)return new v(NaN);m=!g&&S.isInteger()&&o.isInteger(),m&&(S=S.mod(o))}else{if(s.e>9&&(S.e>0||S.e<-1||(S.e==0?S.c[0]>1||f&&S.c[1]>=24e7:S.c[0]<8e13||f&&S.c[0]<=9999975e7)))return y=S.s<0&&Le(s)?-0:0,S.e>-1&&(y=1/y),new v(g?1/y:y);L&&(y=De(L/R+2))}for(f?(l=new v(.5),g&&(s.s=1),x=Le(s)):(c=Math.abs(+ue(s)),x=c%2),d=new v(u);;){if(x){if(d=d.times(S),!d.c)break;y?d.c.length>y&&(d.c.length=y):m&&(d=d.mod(o))}if(c){if(c=J(c/2),c===0)break;x=c%2}else if(s=s.times(l),ee(s,s.e+1,1),s.e>14)x=Le(s);else{if(c=+ue(s),c===0)break;x=c%2}S=S.times(S),y?S.c&&S.c.length>y&&(S.c.length=y):m&&(S=S.mod(o))}return m?d:(g&&(d=u.div(d)),o?d.mod(o):y?ee(d,L,h,w):d)},r.integerValue=function(s){var o=new v(this);return s==null?s=h:F(s,0,8),ee(o,o.e+1,s)},r.isEqualTo=r.eq=function(s,o){return ae(this,new v(s,o))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(s,o){return ae(this,new v(s,o))>0},r.isGreaterThanOrEqualTo=r.gte=function(s,o){return(o=ae(this,new v(s,o)))===1||o===0},r.isInteger=function(){return!!this.c&&H(this.e/R)>this.c.length-2},r.isLessThan=r.lt=function(s,o){return ae(this,new v(s,o))<0},r.isLessThanOrEqualTo=r.lte=function(s,o){return(o=ae(this,new v(s,o)))===-1||o===0},r.isNaN=function(){return!this.s},r.isNegative=function(){return this.s<0},r.isPositive=function(){return this.s>0},r.isZero=function(){return!!this.c&&this.c[0]==0},r.minus=function(s,o){var l,m,c,y,w=this,f=w.s;if(s=new v(s,o),o=s.s,!f||!o)return new v(NaN);if(f!=o)return s.s=-o,w.plus(s);var g=w.e/R,x=s.e/R,d=w.c,S=s.c;if(!g||!x){if(!d||!S)return d?(s.s=-o,s):new v(S?w:NaN);if(!d[0]||!S[0])return S[0]?(s.s=-o,s):new v(d[0]?w:h==3?-0:0)}if(g=H(g),x=H(x),d=d.slice(),f=g-x){for((y=f<0)?(f=-f,c=d):(x=g,c=S),c.reverse(),o=f;o--;c.push(0));c.reverse()}else for(m=(y=(f=d.length)<(o=S.length))?f:o,f=o=0;o<m;o++)if(d[o]!=S[o]){y=d[o]<S[o];break}if(y&&(c=d,d=S,S=c,s.s=-s.s),o=(m=S.length)-(l=d.length),o>0)for(;o--;d[l++]=0);for(o=ne-1;m>f;){if(d[--m]<S[m]){for(l=m;l&&!d[--l];d[l]=o);--d[l],d[m]+=ne}d[m]-=S[m]}for(;d[0]==0;d.splice(0,1),--x);return d[0]?K(s,d,x):(s.s=h==3?-1:1,s.c=[s.e=0],s)},r.modulo=r.mod=function(s,o){var l,m,c=this;return s=new v(s,o),!c.c||!s.s||s.c&&!s.c[0]?new v(NaN):!s.c||c.c&&!c.c[0]?new v(c):(T==9?(m=s.s,s.s=1,l=e(c,s,0,3),s.s=m,l.s*=m):l=e(c,s,0,T),s=c.minus(l.times(s)),!s.c[0]&&T==1&&(s.s=c.s),s)},r.multipliedBy=r.times=function(s,o){var l,m,c,y,w,f,g,x,d,S,C,O,k,D,U,A=this,G=A.c,V=(s=new v(s,o)).c;if(!G||!V||!G[0]||!V[0])return!A.s||!s.s||G&&!G[0]&&!V||V&&!V[0]&&!G?s.c=s.e=s.s=null:(s.s*=A.s,!G||!V?s.c=s.e=null:(s.c=[0],s.e=0)),s;for(m=H(A.e/R)+H(s.e/R),s.s*=A.s,g=G.length,S=V.length,g<S&&(k=G,G=V,V=k,c=g,g=S,S=c),c=g+S,k=[];c--;k.push(0));for(D=ne,U=fe,c=S;--c>=0;){for(l=0,C=V[c]%U,O=V[c]/U|0,w=g,y=c+w;y>c;)x=G[--w]%U,d=G[w]/U|0,f=O*x+d*C,x=C*x+f%U*U+k[y]+l,l=(x/D|0)+(f/U|0)+O*d,k[y--]=x%D;k[y]=l}return l?++m:k.splice(0,1),K(s,k,m)},r.negated=function(){var s=new v(this);return s.s=-s.s||null,s},r.plus=function(s,o){var l,m=this,c=m.s;if(s=new v(s,o),o=s.s,!c||!o)return new v(NaN);if(c!=o)return s.s=-o,m.minus(s);var y=m.e/R,w=s.e/R,f=m.c,g=s.c;if(!y||!w){if(!f||!g)return new v(c/0);if(!f[0]||!g[0])return g[0]?s:new v(f[0]?m:c*0)}if(y=H(y),w=H(w),f=f.slice(),c=y-w){for(c>0?(w=y,l=g):(c=-c,l=f),l.reverse();c--;l.push(0));l.reverse()}for(c=f.length,o=g.length,c-o<0&&(l=g,g=f,f=l,o=c),c=0;o;)c=(f[--o]=f[o]+g[o]+c)/ne|0,f[o]=ne===f[o]?0:f[o]%ne;return c&&(f=[c].concat(f),++w),K(s,f,w)},r.precision=r.sd=function(s,o){var l,m,c,y=this;if(s!=null&&s!==!!s)return F(s,1,W),o==null?o=h:F(o,0,8),ee(new v(y),s,o);if(!(l=y.c))return null;if(c=l.length-1,m=c*R+1,c=l[c]){for(;c%10==0;c/=10,m--);for(c=l[0];c>=10;c/=10,m++);}return s&&y.e+1>m&&(m=y.e+1),m},r.shiftedBy=function(s){return F(s,-9007199254740991,ot),this.times("1e"+s)},r.squareRoot=r.sqrt=function(){var s,o,l,m,c,y=this,w=y.c,f=y.s,g=y.e,x=a+4,d=new v("0.5");if(f!==1||!w||!w[0])return new v(!f||f<0&&(!w||w[0])?NaN:w?y:1/0);if(f=Math.sqrt(+ue(y)),f==0||f==1/0?(o=Q(w),(o.length+g)%2==0&&(o+="0"),f=Math.sqrt(+o),g=H((g+1)/2)-(g<0||g%2),f==1/0?o="5e"+g:(o=f.toExponential(),o=o.slice(0,o.indexOf("e")+1)+g),l=new v(o)):l=new v(f+""),l.c[0]){for(g=l.e,f=g+x,f<3&&(f=0);;)if(c=l,l=d.times(c.plus(e(y,c,x,1))),Q(c.c).slice(0,f)===(o=Q(l.c)).slice(0,f))if(l.e<g&&--f,o=o.slice(f-3,f+1),o=="9999"||!m&&o=="4999"){if(!m&&(ee(c,c.e+a+2,0),c.times(c).eq(y))){l=c;break}x+=4,f+=4,m=1}else{(!+o||!+o.slice(1)&&o.charAt(0)=="5")&&(ee(l,l.e+a+2,1),s=!l.times(l).eq(y));break}}return ee(l,l.e+a+1,h,s)},r.toExponential=function(s,o){return s!=null&&(F(s,0,W),s++),N(this,s,o,1)},r.toFixed=function(s,o){return s!=null&&(F(s,0,W),s=s+this.e+1),N(this,s,o)},r.toFormat=function(s,o,l){var m,c=this;if(l==null)s!=null&&o&&typeof o=="object"?(l=o,o=null):s&&typeof s=="object"?(l=s,s=o=null):l=B;else if(typeof l!="object")throw Error(Z+"Argument not an object: "+l);if(m=c.toFixed(s,o),c.c){var y,w=m.split("."),f=+l.groupSize,g=+l.secondaryGroupSize,x=l.groupSeparator||"",d=w[0],S=w[1],C=c.s<0,O=C?d.slice(1):d,k=O.length;if(g&&(y=f,f=g,g=y,k-=y),f>0&&k>0){for(y=k%f||f,d=O.substr(0,y);y<k;y+=f)d+=x+O.substr(y,f);g>0&&(d+=x+O.slice(y)),C&&(d="-"+d)}m=S?d+(l.decimalSeparator||"")+((g=+l.fractionGroupSize)?S.replace(new RegExp("\\d{"+g+"}\\B","g"),"$&"+(l.fractionGroupSeparator||"")):S):d}return(l.prefix||"")+m+(l.suffix||"")},r.toFraction=function(s){var o,l,m,c,y,w,f,g,x,d,S,C,O=this,k=O.c;if(s!=null&&(f=new v(s),!f.isInteger()&&(f.c||f.s!==1)||f.lt(u)))throw Error(Z+"Argument "+(f.isInteger()?"out of range: ":"not an integer: ")+ue(f));if(!k)return new v(O);for(o=new v(u),x=l=new v(u),m=g=new v(u),C=Q(k),y=o.e=C.length-O.e-1,o.c[0]=ze[(w=y%R)<0?R+w:w],s=!s||f.comparedTo(o)>0?y>0?o:x:f,w=b,b=1/0,f=new v(C),g.c[0]=0;d=e(f,o,0,1),c=l.plus(d.times(m)),c.comparedTo(s)!=1;)l=m,m=c,x=g.plus(d.times(c=x)),g=c,o=f.minus(d.times(c=o)),f=c;return c=e(s.minus(l),m,0,1),g=g.plus(c.times(x)),l=l.plus(c.times(m)),g.s=x.s=O.s,y=y*2,S=e(x,m,y,h).minus(O).abs().comparedTo(e(g,l,y,h).minus(O).abs())<1?[x,m]:[g,l],b=w,S},r.toNumber=function(){return+ue(this)},r.toPrecision=function(s,o){return s!=null&&F(s,1,W),N(this,s,o,2)},r.toString=function(s){var o,l=this,m=l.s,c=l.e;return c===null?m?(o="Infinity",m<0&&(o="-"+o)):o="NaN":(s==null?o=c<=E||c>=p?Me(Q(l.c),c):oe(Q(l.c),c,"0"):s===10&&I?(l=ee(new v(l),a+c+1,h),o=oe(Q(l.c),l.e,"0")):(F(s,2,q.length,"Base"),o=n(oe(Q(l.c),c,"0"),10,s,m,!0)),m<0&&l.c[0]&&(o="-"+o)),o},r.valueOf=r.toJSON=function(){return ue(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,t!=null&&v.set(t),v}function H(t){var e=t|0;return t>0||t===e?e:e-1}function Q(t){for(var e,n,i=1,r=t.length,u=t[0]+"";i<r;){for(e=t[i++]+"",n=R-e.length;n--;e="0"+e);u+=e}for(r=u.length;u.charCodeAt(--r)===48;);return u.slice(0,r+1||1)}function ae(t,e){var n,i,r=t.c,u=e.c,a=t.s,h=e.s,E=t.e,p=e.e;if(!a||!h)return null;if(n=r&&!r[0],i=u&&!u[0],n||i)return n?i?0:-h:a;if(a!=h)return a;if(n=a<0,i=E==p,!r||!u)return i?0:!r^n?1:-1;if(!i)return E>p^n?1:-1;for(h=(E=r.length)<(p=u.length)?E:p,a=0;a<h;a++)if(r[a]!=u[a])return r[a]>u[a]^n?1:-1;return E==p?0:E>p^n?1:-1}function F(t,e,n,i){if(t<e||t>n||t!==J(t))throw Error(Z+(i||"Argument")+(typeof t=="number"?t<e||t>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function Le(t){var e=t.c.length-1;return H(t.e/R)==e&&t.c[e]%2!=0}function Me(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function oe(t,e,n){var i,r;if(e<0){for(r=n+".";++e;r+=n);t=r+t}else if(i=t.length,++e>i){for(r=n,e-=i;--e;r+=n);t+=r}else e<i&&(t=t.slice(0,e)+"."+t.slice(e));return t}var ie=lt(),$t=class{constructor(t){P(this,"key");P(this,"left",null);P(this,"right",null);this.key=t}},we=class extends $t{constructor(t){super(t)}},qt=class{constructor(){P(this,"size",0);P(this,"modificationCount",0);P(this,"splayCount",0)}splay(t){const e=this.root;if(e==null)return this.compare(t,t),-1;let n=null,i=null,r=null,u=null,a=e;const h=this.compare;let E;for(;;)if(E=h(a.key,t),E>0){let p=a.left;if(p==null||(E=h(p.key,t),E>0&&(a.left=p.right,p.right=a,a=p,p=a.left,p==null)))break;n==null?i=a:n.left=a,n=a,a=p}else if(E<0){let p=a.right;if(p==null||(E=h(p.key,t),E<0&&(a.right=p.left,p.left=a,a=p,p=a.right,p==null)))break;r==null?u=a:r.right=a,r=a,a=p}else break;return r!=null&&(r.right=a.left,a.left=u),n!=null&&(n.left=a.right,a.right=i),this.root!==a&&(this.root=a,this.splayCount++),E}splayMin(t){let e=t,n=e.left;for(;n!=null;){const i=n;e.left=i.right,i.right=e,e=i,n=e.left}return e}splayMax(t){let e=t,n=e.right;for(;n!=null;){const i=n;e.right=i.left,i.left=e,e=i,n=e.right}return e}_delete(t){if(this.root==null||this.splay(t)!=0)return null;let n=this.root;const i=n,r=n.left;if(this.size--,r==null)this.root=n.right;else{const u=n.right;n=this.splayMax(r),n.right=u,this.root=n}return this.modificationCount++,i}addNewRoot(t,e){this.size++,this.modificationCount++;const n=this.root;if(n==null){this.root=t;return}e<0?(t.left=n,t.right=n.right,n.right=null):(t.right=n,t.left=n.left,n.left=null),this.root=t}_first(){const t=this.root;return t==null?null:(this.root=this.splayMin(t),this.root)}_last(){const t=this.root;return t==null?null:(this.root=this.splayMax(t),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(t){return this.validKey(t)&&this.splay(t)==0}defaultCompare(){return(t,e)=>t<e?-1:t>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:t=>{this.root=t},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:t=>{this.splayCount=t},splay:t=>this.splay(t),has:t=>this.has(t)}}},Pe=class Te extends qt{constructor(n,i){super();P(this,"root",null);P(this,"compare");P(this,"validKey");P(this,Ct,"[object Set]");this.compare=n??this.defaultCompare(),this.validKey=i??(r=>r!=null&&r!=null)}delete(n){return this.validKey(n)?this._delete(n)!=null:!1}deleteAll(n){for(const i of n)this.delete(i)}forEach(n){const i=this[Symbol.iterator]();let r;for(;r=i.next(),!r.done;)n(r.value,r.value,this)}add(n){const i=this.splay(n);return i!=0&&this.addNewRoot(new we(n),i),this}addAndReturn(n){const i=this.splay(n);return i!=0&&this.addNewRoot(new we(n),i),this.root.key}addAll(n){for(const i of n)this.add(i)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(n){if(n==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(n)<0)return this.root.key;let r=this.root.left;if(r==null)return null;let u=r.right;for(;u!=null;)r=u,u=r.right;return r.key}firstAfter(n){if(n==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(n)>0)return this.root.key;let r=this.root.right;if(r==null)return null;let u=r.left;for(;u!=null;)r=u,u=r.left;return r.key}retainAll(n){const i=new Te(this.compare,this.validKey),r=this.modificationCount;for(const u of n){if(r!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(u)&&this.splay(u)==0&&i.add(this.root.key)}i.size!=this.size&&(this.root=i.root,this.size=i.size,this.modificationCount++)}lookup(n){return!this.validKey(n)||this.splay(n)!=0?null:this.root.key}intersection(n){const i=new Te(this.compare,this.validKey);for(const r of this)n.has(r)&&i.add(r);return i}difference(n){const i=new Te(this.compare,this.validKey);for(const r of this)n.has(r)||i.add(r);return i}union(n){const i=this.clone();return i.addAll(n),i}clone(){const n=new Te(this.compare,this.validKey);return n.size=this.size,n.root=this.copyNode(this.root),n}copyNode(n){if(n==null)return null;function i(u,a){let h,E;do{if(h=u.left,E=u.right,h!=null){const p=new we(h.key);a.left=p,i(h,p)}if(E!=null){const p=new we(E.key);a.right=p,u=E,a=p}}while(E!=null)}const r=new we(n.key);return i(n,r),r}toSet(){return this.clone()}entries(){return new Dt(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(Ot=Symbol.iterator,Ct=Symbol.toStringTag,Ot)](){return new Ft(this.wrap())}},ut=class{constructor(t){P(this,"tree");P(this,"path",new Array);P(this,"modificationCount",null);P(this,"splayCount");this.tree=t,this.splayCount=t.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;const t=this.path[this.path.length-1];return this.getValue(t)}rebuildPath(t){this.path.splice(0,this.path.length),this.tree.splay(t),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(t){for(;t!=null;)this.path.push(t),t=t.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let n=this.tree.getRoot();for(;n!=null;)this.path.push(n),n=n.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let t=this.path[this.path.length-1],e=t.right;if(e!=null){for(;e!=null;)this.path.push(e),e=e.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===t;)t=this.path.pop();return this.path.length>0}},Ft=class extends ut{getValue(t){return t.key}},Dt=class extends ut{getValue(t){return[t.key,t.key]}},ft=t=>()=>t,Ue=t=>{const e=t?(n,i)=>i.minus(n).abs().isLessThanOrEqualTo(t):ft(!1);return(n,i)=>e(n,i)?0:n.comparedTo(i)};function zt(t){const e=t?(n,i,r,u,a)=>n.exponentiatedBy(2).isLessThanOrEqualTo(u.minus(i).exponentiatedBy(2).plus(a.minus(r).exponentiatedBy(2)).times(t)):ft(!1);return(n,i,r)=>{const u=n.x,a=n.y,h=r.x,E=r.y,p=a.minus(E).times(i.x.minus(h)).minus(u.minus(h).times(i.y.minus(E)));return e(p,u,a,h,E)?0:p.comparedTo(0)}}var Ut=t=>t,Vt=t=>{if(t){const e=new Pe(Ue(t)),n=new Pe(Ue(t)),i=(u,a)=>a.addAndReturn(u),r=u=>({x:i(u.x,e),y:i(u.y,n)});return r({x:new ie(0),y:new ie(0)}),r}return Ut},Ve=t=>({set:e=>{le=Ve(e)},reset:()=>Ve(t),compare:Ue(t),snap:Vt(t),orient:zt(t)}),le=Ve(),Ee=(t,e)=>t.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(t.ur.x)&&t.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(t.ur.y),Ke=(t,e)=>{if(e.ur.x.isLessThan(t.ll.x)||t.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(t.ll.y)||t.ur.y.isLessThan(e.ll.y))return null;const n=t.ll.x.isLessThan(e.ll.x)?e.ll.x:t.ll.x,i=t.ur.x.isLessThan(e.ur.x)?t.ur.x:e.ur.x,r=t.ll.y.isLessThan(e.ll.y)?e.ll.y:t.ll.y,u=t.ur.y.isLessThan(e.ur.y)?t.ur.y:e.ur.y;return{ll:{x:n,y:r},ur:{x:i,y:u}}},Ce=(t,e)=>t.x.times(e.y).minus(t.y.times(e.x)),ct=(t,e)=>t.x.times(e.x).plus(t.y.times(e.y)),Oe=t=>ct(t,t).sqrt(),Kt=(t,e,n)=>{const i={x:e.x.minus(t.x),y:e.y.minus(t.y)},r={x:n.x.minus(t.x),y:n.y.minus(t.y)};return Ce(r,i).div(Oe(r)).div(Oe(i))},Xt=(t,e,n)=>{const i={x:e.x.minus(t.x),y:e.y.minus(t.y)},r={x:n.x.minus(t.x),y:n.y.minus(t.y)};return ct(r,i).div(Oe(r)).div(Oe(i))},at=(t,e,n)=>e.y.isZero()?null:{x:t.x.plus(e.x.div(e.y).times(n.minus(t.y))),y:n},ht=(t,e,n)=>e.x.isZero()?null:{x:n,y:t.y.plus(e.y.div(e.x).times(n.minus(t.x)))},Zt=(t,e,n,i)=>{if(e.x.isZero())return ht(n,i,t.x);if(i.x.isZero())return ht(t,e,n.x);if(e.y.isZero())return at(n,i,t.y);if(i.y.isZero())return at(t,e,n.y);const r=Ce(e,i);if(r.isZero())return null;const u={x:n.x.minus(t.x),y:n.y.minus(t.y)},a=Ce(u,e).div(r),h=Ce(u,i).div(r),E=t.x.plus(h.times(e.x)),p=n.x.plus(a.times(i.x)),_=t.y.plus(h.times(e.y)),b=n.y.plus(a.times(i.y)),M=E.plus(p).div(2),T=_.plus(b).div(2);return{x:M,y:T}},re=class Rt{constructor(e,n){P(this,"point");P(this,"isLeft");P(this,"segment");P(this,"otherSE");P(this,"consumedBy");e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=n}static compare(e,n){const i=Rt.comparePoints(e.point,n.point);return i!==0?i:(e.point!==n.point&&e.link(n),e.isLeft!==n.isLeft?e.isLeft?1:-1:Ne.compare(e.segment,n.segment))}static comparePoints(e,n){return e.x.isLessThan(n.x)?-1:e.x.isGreaterThan(n.x)?1:e.y.isLessThan(n.y)?-1:e.y.isGreaterThan(n.y)?1:0}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const n=e.point.events;for(let i=0,r=n.length;i<r;i++){const u=n[i];this.point.events.push(u),u.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let n=0;n<e;n++){const i=this.point.events[n];if(i.segment.consumedBy===void 0)for(let r=n+1;r<e;r++){const u=this.point.events[r];u.consumedBy===void 0&&i.otherSE.point.events===u.otherSE.point.events&&i.segment.consume(u.segment)}}}getAvailableLinkedEvents(){const e=[];for(let n=0,i=this.point.events.length;n<i;n++){const r=this.point.events[n];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const n=new Map,i=r=>{const u=r.otherSE;n.set(r,{sine:Kt(this.point,e.point,u.point),cosine:Xt(this.point,e.point,u.point)})};return(r,u)=>{n.has(r)||i(r),n.has(u)||i(u);const{sine:a,cosine:h}=n.get(r),{sine:E,cosine:p}=n.get(u);return a.isGreaterThanOrEqualTo(0)&&E.isGreaterThanOrEqualTo(0)?h.isLessThan(p)?1:h.isGreaterThan(p)?-1:0:a.isLessThan(0)&&E.isLessThan(0)?h.isLessThan(p)?-1:h.isGreaterThan(p)?1:0:E.isLessThan(a)?-1:E.isGreaterThan(a)?1:0}}},Yt=class Qe{constructor(e){P(this,"events");P(this,"poly");P(this,"_isExteriorRing");P(this,"_enclosingRing");this.events=e;for(let n=0,i=e.length;n<i;n++)e[n].segment.ringOut=this;this.poly=null}static factory(e){const n=[];for(let i=0,r=e.length;i<r;i++){const u=e[i];if(!u.isInResult()||u.ringOut)continue;let a=null,h=u.leftSE,E=u.rightSE;const p=[h],_=h.point,b=[];for(;a=h,h=E,p.push(h),h.point!==_;)for(;;){const M=h.getAvailableLinkedEvents();if(M.length===0){const B=p[0].point,q=p[p.length-1].point;throw new Error(`Unable to complete output ring starting at [${B.x}, ${B.y}]. Last matching segment found ends at [${q.x}, ${q.y}].`)}if(M.length===1){E=M[0].otherSE;break}let T=null;for(let B=0,q=b.length;B<q;B++)if(b[B].point===h.point){T=B;break}if(T!==null){const B=b.splice(T)[0],q=p.splice(B.index);q.unshift(q[0].otherSE),n.push(new Qe(q.reverse()));continue}b.push({index:p.length,point:h.point});const L=h.getLeftmostComparator(a);E=M.sort(L)[0].otherSE;break}n.push(new Qe(p))}return n}getGeom(){let e=this.events[0].point;const n=[e];for(let p=1,_=this.events.length-1;p<_;p++){const b=this.events[p].point,M=this.events[p+1].point;le.orient(b,e,M)!==0&&(n.push(b),e=b)}if(n.length===1)return null;const i=n[0],r=n[1];le.orient(i,e,r)===0&&n.shift(),n.push(n[0]);const u=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:n.length-1,h=this.isExteriorRing()?n.length:-1,E=[];for(let p=a;p!=h;p+=u)E.push([n[p].x.toNumber(),n[p].y.toNumber()]);return E}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){var r,u;let e=this.events[0];for(let a=1,h=this.events.length;a<h;a++){const E=this.events[a];re.compare(e,E)>0&&(e=E)}let n=e.segment.prevInResult(),i=n?n.prevInResult():null;for(;;){if(!n)return null;if(!i)return n.ringOut;if(i.ringOut!==n.ringOut)return((r=i.ringOut)==null?void 0:r.enclosingRing())!==n.ringOut?n.ringOut:(u=n.ringOut)==null?void 0:u.enclosingRing();n=i.prevInResult(),i=n?n.prevInResult():null}}},pt=class{constructor(t){P(this,"exteriorRing");P(this,"interiorRings");this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=this.exteriorRing.getGeom();if(t===null)return null;const e=[t];for(let n=0,i=this.interiorRings.length;n<i;n++){const r=this.interiorRings[n].getGeom();r!==null&&e.push(r)}return e}},jt=class{constructor(t){P(this,"rings");P(this,"polys");this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getGeom();i!==null&&t.push(i)}return t}_composePolys(t){var n;const e=[];for(let i=0,r=t.length;i<r;i++){const u=t[i];if(!u.poly)if(u.isExteriorRing())e.push(new pt(u));else{const a=u.enclosingRing();a!=null&&a.poly||e.push(new pt(a)),(n=a==null?void 0:a.poly)==null||n.addInterior(u)}}return e}},Wt=class{constructor(t,e=Ne.compare){P(this,"queue");P(this,"tree");P(this,"segments");this.queue=t,this.tree=new Pe(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.delete(t.otherSE):this.tree.delete(e),n;t.isLeft&&this.tree.add(e);let i=e,r=e;do i=this.tree.lastBefore(i);while(i!=null&&i.consumedBy!=null);do r=this.tree.firstAfter(r);while(r!=null&&r.consumedBy!=null);if(t.isLeft){let u=null;if(i){const h=i.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(u=h),!i.isAnEndpoint(h))){const E=this._splitSafely(i,h);for(let p=0,_=E.length;p<_;p++)n.push(E[p])}}let a=null;if(r){const h=r.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(a=h),!r.isAnEndpoint(h))){const E=this._splitSafely(r,h);for(let p=0,_=E.length;p<_;p++)n.push(E[p])}}if(u!==null||a!==null){let h=null;u===null?h=a:a===null?h=u:h=re.comparePoints(u,a)<=0?u:a,this.queue.delete(e.rightSE),n.push(e.rightSE);const E=e.split(h);for(let p=0,_=E.length;p<_;p++)n.push(E[p])}n.length>0?(this.tree.delete(e),n.push(t)):(this.segments.push(e),e.prev=i)}else{if(i&&r){const u=i.getIntersection(r);if(u!==null){if(!i.isAnEndpoint(u)){const a=this._splitSafely(i,u);for(let h=0,E=a.length;h<E;h++)n.push(a[h])}if(!r.isAnEndpoint(u)){const a=this._splitSafely(r,u);for(let h=0,E=a.length;h<E;h++)n.push(a[h])}}}this.tree.delete(e)}return n}_splitSafely(t,e){this.tree.delete(t);const n=t.rightSE;this.queue.delete(n);const i=t.split(e);return i.push(n),t.consumedBy===void 0&&this.tree.add(t),i}},Jt=class{constructor(){P(this,"type");P(this,"numMultiPolys")}run(t,e,n){ve.type=t;const i=[new yt(e,!0)];for(let p=0,_=n.length;p<_;p++)i.push(new yt(n[p],!1));if(ve.numMultiPolys=i.length,ve.type==="difference"){const p=i[0];let _=1;for(;_<i.length;)Ke(i[_].bbox,p.bbox)!==null?_++:i.splice(_,1)}if(ve.type==="intersection")for(let p=0,_=i.length;p<_;p++){const b=i[p];for(let M=p+1,T=i.length;M<T;M++)if(Ke(b.bbox,i[M].bbox)===null)return[]}const r=new Pe(re.compare);for(let p=0,_=i.length;p<_;p++){const b=i[p].getSweepEvents();for(let M=0,T=b.length;M<T;M++)r.add(b[M])}const u=new Wt(r);let a=null;for(r.size!=0&&(a=r.first(),r.delete(a));a;){const p=u.process(a);for(let _=0,b=p.length;_<b;_++){const M=p[_];M.consumedBy===void 0&&r.add(M)}r.size!=0?(a=r.first(),r.delete(a)):a=null}le.reset();const h=Yt.factory(u.segments);return new jt(h).getGeom()}},ve=new Jt,Re=ve,Ht=0,Ne=class Be{constructor(e,n,i,r){P(this,"id");P(this,"leftSE");P(this,"rightSE");P(this,"rings");P(this,"windings");P(this,"ringOut");P(this,"consumedBy");P(this,"prev");P(this,"_prevInResult");P(this,"_beforeState");P(this,"_afterState");P(this,"_isInResult");this.id=++Ht,this.leftSE=e,e.segment=this,e.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=e,this.rings=i,this.windings=r}static compare(e,n){const i=e.leftSE.point.x,r=n.leftSE.point.x,u=e.rightSE.point.x,a=n.rightSE.point.x;if(a.isLessThan(i))return 1;if(u.isLessThan(r))return-1;const h=e.leftSE.point.y,E=n.leftSE.point.y,p=e.rightSE.point.y,_=n.rightSE.point.y;if(i.isLessThan(r)){if(E.isLessThan(h)&&E.isLessThan(p))return 1;if(E.isGreaterThan(h)&&E.isGreaterThan(p))return-1;const b=e.comparePoint(n.leftSE.point);if(b<0)return 1;if(b>0)return-1;const M=n.comparePoint(e.rightSE.point);return M!==0?M:-1}if(i.isGreaterThan(r)){if(h.isLessThan(E)&&h.isLessThan(_))return-1;if(h.isGreaterThan(E)&&h.isGreaterThan(_))return 1;const b=n.comparePoint(e.leftSE.point);if(b!==0)return b;const M=e.comparePoint(n.rightSE.point);return M<0?1:M>0?-1:1}if(h.isLessThan(E))return-1;if(h.isGreaterThan(E))return 1;if(u.isLessThan(a)){const b=n.comparePoint(e.rightSE.point);if(b!==0)return b}if(u.isGreaterThan(a)){const b=e.comparePoint(n.rightSE.point);if(b<0)return 1;if(b>0)return-1}if(!u.eq(a)){const b=p.minus(h),M=u.minus(i),T=_.minus(E),L=a.minus(r);if(b.isGreaterThan(M)&&T.isLessThan(L))return 1;if(b.isLessThan(M)&&T.isGreaterThan(L))return-1}return u.isGreaterThan(a)?1:u.isLessThan(a)||p.isLessThan(_)?-1:p.isGreaterThan(_)?1:e.id<n.id?-1:e.id>n.id?1:0}static fromRing(e,n,i){let r,u,a;const h=re.comparePoints(e,n);if(h<0)r=e,u=n,a=1;else if(h>0)r=n,u=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const E=new re(r,!0),p=new re(u,!1);return new Be(E,p,[i],[a])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e.isLessThan(n)?e:n},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(n)?e:n}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(e){return e.x.eq(this.leftSE.point.x)&&e.y.eq(this.leftSE.point.y)||e.x.eq(this.rightSE.point.x)&&e.y.eq(this.rightSE.point.y)}comparePoint(e){return le.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const n=this.bbox(),i=e.bbox(),r=Ke(n,i);if(r===null)return null;const u=this.leftSE.point,a=this.rightSE.point,h=e.leftSE.point,E=e.rightSE.point,p=Ee(n,h)&&this.comparePoint(h)===0,_=Ee(i,u)&&e.comparePoint(u)===0,b=Ee(n,E)&&this.comparePoint(E)===0,M=Ee(i,a)&&e.comparePoint(a)===0;if(_&&p)return M&&!b?a:!M&&b?E:null;if(_)return b&&u.x.eq(E.x)&&u.y.eq(E.y)?null:u;if(p)return M&&a.x.eq(h.x)&&a.y.eq(h.y)?null:h;if(M&&b)return null;if(M)return a;if(b)return E;const T=Zt(u,this.vector(),h,e.vector());return T===null||!Ee(r,T)?null:le.snap(T)}split(e){const n=[],i=e.events!==void 0,r=new re(e,!0),u=new re(e,!1),a=this.rightSE;this.replaceRightSE(u),n.push(u),n.push(r);const h=new Be(r,a,this.rings.slice(),this.windings.slice());return re.comparePoints(h.leftSE.point,h.rightSE.point)>0&&h.swapEvents(),re.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(r.checkForConsuming(),u.checkForConsuming()),n}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let n=0,i=this.windings.length;n<i;n++)this.windings[n]*=-1}consume(e){let n=this,i=e;for(;n.consumedBy;)n=n.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const r=Be.compare(n,i);if(r!==0){if(r>0){const u=n;n=i,i=u}if(n.prev===i){const u=n;n=i,i=u}for(let u=0,a=i.rings.length;u<a;u++){const h=i.rings[u],E=i.windings[u],p=n.rings.indexOf(h);p===-1?(n.rings.push(h),n.windings.push(E)):n.windings[p]+=E}i.rings=null,i.windings=null,i.consumedBy=n,i.leftSE.consumedBy=n.leftSE,i.rightSE.consumedBy=n.rightSE}}prevInResult(){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)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const n=this._afterState.rings,i=this._afterState.windings,r=this._afterState.multiPolys;for(let h=0,E=this.rings.length;h<E;h++){const p=this.rings[h],_=this.windings[h],b=n.indexOf(p);b===-1?(n.push(p),i.push(_)):i[b]+=_}const u=[],a=[];for(let h=0,E=n.length;h<E;h++){if(i[h]===0)continue;const p=n[h],_=p.poly;if(a.indexOf(_)===-1)if(p.isExterior)u.push(_);else{a.indexOf(_)===-1&&a.push(_);const b=u.indexOf(p.poly);b!==-1&&u.splice(b,1)}}for(let h=0,E=u.length;h<E;h++){const p=u[h].multiPoly;r.indexOf(p)===-1&&r.push(p)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,n=this.afterState().multiPolys;switch(Re.type){case"union":{const i=e.length===0,r=n.length===0;this._isInResult=i!==r;break}case"intersection":{let i,r;e.length<n.length?(i=e.length,r=n.length):(i=n.length,r=e.length),this._isInResult=r===Re.numMultiPolys&&i<r;break}case"xor":{const i=Math.abs(e.length-n.length);this._isInResult=i%2===1;break}case"difference":{const i=r=>r.length===1&&r[0].isSubject;this._isInResult=i(e)!==i(n);break}}return this._isInResult}},gt=class{constructor(t,e,n){P(this,"poly");P(this,"isExterior");P(this,"segments");P(this,"bbox");if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=le.snap({x:new ie(t[0][0]),y:new ie(t[0][1])});this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let r=i;for(let u=1,a=t.length;u<a;u++){if(typeof t[u][0]!="number"||typeof t[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const h=le.snap({x:new ie(t[u][0]),y:new ie(t[u][1])});h.x.eq(r.x)&&h.y.eq(r.y)||(this.segments.push(Ne.fromRing(r,h,this)),h.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=h.x),h.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=h.y),h.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=h.x),h.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=h.y),r=h)}(!i.x.eq(r.x)||!i.y.eq(r.y))&&this.segments.push(Ne.fromRing(r,i,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const i=this.segments[e];t.push(i.leftSE),t.push(i.rightSE)}return t}},Qt=class{constructor(t,e){P(this,"multiPoly");P(this,"exteriorRing");P(this,"interiorRings");P(this,"bbox");if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new gt(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 n=1,i=t.length;n<i;n++){const r=new gt(t[n],this,!1);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getSweepEvents();for(let r=0,u=i.length;r<u;r++)t.push(i[r])}return t}},yt=class{constructor(t,e){P(this,"isSubject");P(this,"polys");P(this,"bbox");if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:new ie(Number.POSITIVE_INFINITY),y:new ie(Number.POSITIVE_INFINITY)},ur:{x:new ie(Number.NEGATIVE_INFINITY),y:new ie(Number.NEGATIVE_INFINITY)}};for(let n=0,i=t.length;n<i;n++){const r=new Qt(t[n],this);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getSweepEvents();for(let r=0,u=i.length;r<u;r++)t.push(i[r])}return t}},en=(t,...e)=>Re.run("union",t,e),tn=(t,...e)=>Re.run("difference",t,e);le.set;function nn(t,e={}){const n=[];if($e(t,r=>{n.push(r.coordinates)}),n.length<2)throw new Error("Must have at least 2 geometries");const i=en(n[0],...n.slice(1));return i.length===0?null:i.length===1?Ge(i[0],e.properties):et(i,e.properties)}var dt=nn;function Xe(t){const e=[...t];return e[2]<e[0]&&(Math.abs((e[0]+e[2]+360)/2)>Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}function Se(){}function mt(t){return t()}function xt(){return Object.create(null)}function Ae(t){t.forEach(mt)}function wt(t){return typeof t=="function"}function rn(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function sn(t){return Object.keys(t).length===0}function on(t,e){t.appendChild(e)}function ln(t,e,n){t.insertBefore(e,n||null)}function Et(t){t.parentNode&&t.parentNode.removeChild(t)}function vt(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ce(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function un(t){return Array.from(t.childNodes)}function Ie(t,e,n){t.classList.toggle(e,!!n)}let Ze;function be(t){Ze=t}const ge=[],St=[];let ye=[];const bt=[],fn=Promise.resolve();let Ye=!1;function cn(){Ye||(Ye=!0,fn.then(_t))}function je(t){ye.push(t)}const We=new Set;let de=0;function _t(){if(de!==0)return;const t=Ze;do{try{for(;de<ge.length;){const e=ge[de];de++,be(e),an(e.$$)}}catch(e){throw ge.length=0,de=0,e}for(be(null),ge.length=0,de=0;St.length;)St.pop()();for(let e=0;e<ye.length;e+=1){const n=ye[e];We.has(n)||(We.add(n),n())}ye.length=0}while(ge.length);for(;bt.length;)bt.pop()();Ye=!1,We.clear(),be(t)}function an(t){if(t.fragment!==null){t.update(),Ae(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(je)}}function hn(t){const e=[],n=[];ye.forEach(i=>t.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),ye=e}const pn=new Set;function gn(t,e){t&&t.i&&(pn.delete(t),t.i(e))}function yn(t,e,n){const{fragment:i,after_update:r}=t.$$;i&&i.m(e,n),je(()=>{const u=t.$$.on_mount.map(mt).filter(wt);t.$$.on_destroy?t.$$.on_destroy.push(...u):Ae(u),t.$$.on_mount=[]}),r.forEach(je)}function dn(t,e){const n=t.$$;n.fragment!==null&&(hn(n.after_update),Ae(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function mn(t,e){t.$$.dirty[0]===-1&&(ge.push(t),cn(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function xn(t,e,n,i,r,u,a=null,h=[-1]){const E=Ze;be(t);const p=t.$$={fragment:null,ctx:[],props:u,update:Se,not_equal:r,bound:xt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(E?E.$$.context:[])),callbacks:xt(),dirty:h,skip_bound:!1,root:e.target||E.$$.root};a&&a(p.root);let _=!1;if(p.ctx=n(t,e.props||{},(b,M,...T)=>{const L=T.length?T[0]:M;return p.ctx&&r(p.ctx[b],p.ctx[b]=L)&&(!p.skip_bound&&p.bound[b]&&p.bound[b](L),_&&mn(t,b)),M}),p.update(),_=!0,Ae(p.before_update),p.fragment=i(p.ctx),e.target){if(e.hydrate){const b=un(e.target);p.fragment&&p.fragment.l(b),b.forEach(Et)}else p.fragment&&p.fragment.c();e.intro&&gn(t.$$.fragment),yn(t,e.target,e.anchor),_t()}be(E)}class wn{constructor(){P(this,"$$");P(this,"$$set")}$destroy(){dn(this,1),this.$destroy=Se}$on(e,n){if(!wt(n))return Se;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!sn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const En="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(En);function vn(t){let e,n,i;return{c(){e=vt("svg"),n=vt("path"),ce(n,"stroke-width","4"),ce(n,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),ce(n,"class","svelte-gzo3ar"),ce(e,"width",i=t[0]==="list"?20:void 0),ce(e,"viewBox","0 0 70 85"),ce(e,"fill","none"),ce(e,"class","svelte-gzo3ar"),Ie(e,"in-map",t[0]!=="list"),Ie(e,"list-icon",t[0]==="list")},m(r,u){ln(r,e,u),on(e,n)},p(r,[u]){u&1&&i!==(i=r[0]==="list"?20:void 0)&&ce(e,"width",i),u&1&&Ie(e,"in-map",r[0]!=="list"),u&1&&Ie(e,"list-icon",r[0]==="list")},i:Se,o:Se,d(r){r&&Et(e)}}}function Sn(t,e,n){let{displayIn:i}=e;return t.$$set=r=>{"displayIn"in r&&n(0,i=r.displayIn)},[i]}class bn extends wn{constructor(e){super(),xn(this,e,Sn,vn,rn,{displayIn:0})}}function _n(t){const e=[];if($e(t,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const n=t.features[0].properties||{},i=tn(e[0],...e.slice(1));return i.length===0?null:i.length===1?Ge(i[0],n):et(i,n)}var Tn=_n;function Ln(t){if(!t)throw new Error("geojson is required");var e=[];return Nt(t,function(n){e.push(n)}),xe(e)}var Mn=Ln;function Tt(t,e){const n=Tn(xe([Ge([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),t]));if(!n)return;n.properties={isMask:!0};const i=Xe(qe(t)),r=(i[2]-i[0])/360/1e3,u=i[0]<-180,a=i[2]>180,h=Mn(t);if(h.features.length>1&&(u||a))for(const E of h.features){const p=Xe(qe(E));if(a&&p[0]<-180+r)for(const _ of E.geometry.coordinates)for(const b of _)b[0]+=360-r;if(u&&p[2]>180-r)for(const _ of E.geometry.coordinates)for(const b of _)b[0]-=360-r}e(xe([h.features.length<2?t:dt(h)??t,n]))}const Lt=t=>{var i,r,u;const e=(i=t==null?void 0:t.geometry)==null?void 0:i.type,n=(r=t==null?void 0:t.properties)!=null&&r.isMask?0:e==="LineString"||e==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(u=t==null?void 0:t.properties)!=null&&u.isMask?.1:0,weight:n,dashArray:[n,n],lineCap:"butt"}};function Pn(t,e=!0,n=!0,i={},r={},u=Lt){let a;const h=[];let E,p;const _=pe.geoJSON(void 0,{style:u===!0?Lt:u===!1?void 0:u??void 0,interactive:!1}).addTo(t),b=T=>{a==null||a({type:"mapClick",coordinates:[T.latlng.lng,T.latlng.lat]})};function M(T,L=!1){const B=document.createElement("div");return new bn({props:{displayIn:"leaflet"},target:B}),new pe.Marker(T,{interactive:L,icon:new pe.DivIcon({html:B,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(T){T?(a=T,t.on("click",b)):(a=void 0,t.off("click",b))},flyTo(T,L){t.flyTo([T[1],T[0]],L,{duration:2,...i})},fitBounds(T,L,B){t.flyToBounds([[T[1],T[0]],[T[3],T[2]]],{padding:[L,L],duration:2,...B?{maxZoom:B}:{},...r})},indicateReverse(T){t.getContainer().style.cursor=T?"crosshair":""},setReverseMarker(T){var B;if(!e)return;const L=T&&[T[1],T[0]];p?L?p.setLatLng(L):(p.remove(),p=void 0):L&&(e instanceof Function?p=e(t)??void 0:(p=(typeof e=="object"?new pe.Marker(L,e):M(L)).addTo(t),(B=p.getElement())==null||B.classList.add("marker-reverse")))},setFeatures(T,L,B){function q(I){_.clearLayers(),I&&_.addData(I)}for(const I of h)I.remove();h.length=0,q();e:if(L){let I=!1;if(L.geometry.type==="GeometryCollection"){const v=L.geometry.geometries.filter(N=>N.type==="Polygon"||N.type==="MultiPolygon");t:if(v.length>0){const N=dt(xe(v.map($=>me($))));if(!N)break t;Tt({...L,geometry:N.geometry},q),I=!0}else{const N=L.geometry.geometries.filter($=>$.type==="LineString"||$.type==="MultiLineString");N.length>0&&(q({...L,geometry:{type:"GeometryCollection",geometries:N}}),I=!0)}}if(!I){if(L.geometry.type==="Polygon"||L.geometry.type==="MultiPolygon")Tt(L,v=>{if(!v)return;const N=[...v.features],$=Xe(qe(L)),K=$[2]-$[0];$[0]-K/4<-180&&N.push(...Mt(v,-360).features),$[2]+K/4>180&&N.push(...Mt(v,360).features),q(xe(N))});else if(L.geometry.type==="LineString"||L.geometry.type==="MultiLineString"){q(L);break e}}if(!B&&L.geometry.type!=="Point")break e;if(e instanceof Function){const v=e(t,L);v&&h.push(v.addTo(t))}else if(e){const v=[L.center[1],L.center[0]];h.push(typeof e=="object"?new pe.Marker(v,e):M(v).addTo(t))}}if(n)for(const I of T??[]){if(I===L)continue;const v=[I.center[1],I.center[0]];let N;if(n instanceof Function){if(N=n(t,I),!N)continue}else N=(typeof n=="object"?new pe.Marker(v,n):M(v,!0)).addTo(t).bindTooltip(I.place_type[0]==="reverse"?I.place_name:I.place_name.replace(/,.*/,""),{direction:"top"});const $=N.getElement();$&&($.addEventListener("click",K=>{K.stopPropagation(),a==null||a({type:"markerClick",id:I.id})}),$.addEventListener("mouseenter",()=>{a==null||a({type:"markerMouseEnter",id:I.id})}),$.addEventListener("mouseleave",()=>{a==null||a({type:"markerMouseLeave",id:I.id})}),$.classList.toggle("marker-fuzzy",!!I.matching_text)),h.push(N)}},setSelectedMarker(T){var L,B;E&&((L=E.getElement())==null||L.classList.toggle("marker-selected",!1)),E=T>-1?h[T]:void 0,(B=E==null?void 0:E.getElement())==null||B.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const T=t.getCenter();return[t.getZoom(),T.lng,T.lat]}}}function Mt(t,e){const n=Bt(t);for(const i of n.features)if(i.geometry.type=="MultiPolygon")for(const r of i.geometry.coordinates)Pt(r,e);else Pt(i.geometry.coordinates,e);return n}function Pt(t,e){for(const n of t)for(const i of n)i[0]+=e}Y.createLeafletMapController=Pn,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
|
|
23
2
|
//# sourceMappingURL=leaflet-controller.umd.js.map
|