@maptiler/geocoding-control 2.1.2 → 2.1.3-rc1
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/icons/sprite.json +259 -0
- package/icons/sprite.png +0 -0
- package/icons/sprite@2x.json +259 -0
- package/icons/sprite@2x.png +0 -0
- package/leaflet.js +1668 -1581
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +13 -1
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.js +1405 -1318
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +13 -1
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +1406 -1319
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +13 -1
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers.js +1471 -1384
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +13 -1
- package/openlayers.umd.js.map +1 -1
- package/package.json +5 -5
- package/react.js +985 -898
- package/react.js.map +1 -1
- package/react.umd.js +13 -1
- package/react.umd.js.map +1 -1
- package/style.css +1 -1
- package/svelte/FeatureItem.svelte +70 -18
- package/svelte/GeocodingControl.svelte +46 -17
- package/svelte/GeocodingControl.svelte.d.ts +1 -0
- package/svelte/info.json +1 -1
- package/svelte/types.d.ts +1 -0
- package/types.d.ts +1 -0
- package/vanilla.js +1028 -941
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +13 -1
- package/vanilla.umd.js.map +1 -1
- package/icons/aerialway.svg +0 -1
- package/icons/airfield.svg +0 -1
- package/icons/airport.svg +0 -6
- package/icons/alcohol_shop.svg +0 -1
- package/icons/american_football.svg +0 -1
- package/icons/animal_shelter.svg +0 -4
- package/icons/aquarium.svg +0 -1
- package/icons/art_gallery.svg +0 -4
- package/icons/atm.svg +0 -5
- package/icons/attraction.svg +0 -1
- package/icons/bakery.svg +0 -1
- package/icons/bank.svg +0 -1
- package/icons/bar.svg +0 -1
- package/icons/barrier.svg +0 -4
- package/icons/baseball.svg +0 -4
- package/icons/basketball.svg +0 -4
- package/icons/bbq.svg +0 -4
- package/icons/beach.svg +0 -4
- package/icons/beer.svg +0 -4
- package/icons/bench.svg +0 -4
- package/icons/bicycle.svg +0 -4
- package/icons/bicycle_parking.svg +0 -5
- package/icons/bicycle_rental.svg +0 -5
- package/icons/bicycle_share.svg +0 -1
- package/icons/billiards.svg +0 -4
- package/icons/board.svg +0 -4
- package/icons/bollard.svg +0 -4
- package/icons/bowling.svg +0 -4
- package/icons/buddhist.svg +0 -1
- package/icons/building.svg +0 -4
- package/icons/bulldozer.svg +0 -4
- package/icons/bus_guided.svg +0 -4
- package/icons/bus_stop.svg +0 -1
- package/icons/bus_trolley.svg +0 -4
- package/icons/butcher.svg +0 -4
- package/icons/cafe.svg +0 -1
- package/icons/camper_trailer.svg +0 -4
- package/icons/campfire.svg +0 -4
- package/icons/campsite.svg +0 -1
- package/icons/car.svg +0 -1
- package/icons/car_rental.svg +0 -1
- package/icons/car_repair.svg +0 -14
- package/icons/casino.svg +0 -1
- package/icons/castle.svg +0 -1
- package/icons/caution.svg +0 -4
- package/icons/cemetery.svg +0 -4
- package/icons/charging_station.svg +0 -4
- package/icons/christian.svg +0 -5
- package/icons/cinema.svg +0 -1
- package/icons/circle-dot.svg +0 -4
- package/icons/circle-stroke.svg +0 -4
- package/icons/circle.svg +0 -4
- package/icons/city.svg +0 -4
- package/icons/clothing_store.svg +0 -1
- package/icons/college.svg +0 -1
- package/icons/commercial.svg +0 -1
- package/icons/communications_tower.svg +0 -4
- package/icons/confectionery.svg +0 -4
- package/icons/construction.svg +0 -4
- package/icons/convenience.svg +0 -1
- package/icons/cricket.svg +0 -4
- package/icons/cross.svg +0 -4
- package/icons/cycle_barrier.svg +0 -4
- package/icons/dam.svg +0 -4
- package/icons/danger.svg +0 -4
- package/icons/defibrillator.svg +0 -1
- package/icons/dentist.svg +0 -1
- package/icons/diamond.svg +0 -4
- package/icons/diamond_stroked.svg +0 -4
- package/icons/diplomatic.svg +0 -1
- package/icons/doctors.svg +0 -1
- package/icons/dog_park.svg +0 -1
- package/icons/dot.svg +0 -4
- package/icons/drinking_water.svg +0 -4
- package/icons/elevator.svg +0 -1
- package/icons/emergency_phone.svg +0 -4
- package/icons/entrance.svg +0 -4
- package/icons/farm.svg +0 -4
- package/icons/fast_food.svg +0 -1
- package/icons/fence.svg +0 -4
- package/icons/ferry_terminal.svg +0 -1
- package/icons/fire_station.svg +0 -1
- package/icons/fitness_centre.svg +0 -1
- package/icons/florist.svg +0 -4
- package/icons/fountain.svg +0 -1
- package/icons/fuel.svg +0 -1
- package/icons/furniture.svg +0 -4
- package/icons/gaming.svg +0 -4
- package/icons/garden.svg +0 -4
- package/icons/garden_centre.svg +0 -4
- package/icons/gate.svg +0 -4
- package/icons/gift.svg +0 -1
- package/icons/globe.svg +0 -4
- package/icons/golf.svg +0 -1
- package/icons/golf_green.svg +0 -4
- package/icons/gondola.svg +0 -4
- package/icons/grocery.svg +0 -1
- package/icons/guidepost.svg +0 -4
- package/icons/hairdresser.svg +0 -1
- package/icons/harbor.svg +0 -1
- package/icons/hardware.svg +0 -4
- package/icons/heart.svg +0 -4
- package/icons/heliport.svg +0 -4
- package/icons/highway_rest_area.svg +0 -4
- package/icons/hinduist.svg +0 -1
- package/icons/historic.svg +0 -1
- package/icons/home.svg +0 -4
- package/icons/horse_riding.svg +0 -1
- package/icons/hospital.svg +0 -1
- package/icons/hot_spring.svg +0 -4
- package/icons/hut.svg +0 -1
- package/icons/ice_cream.svg +0 -1
- package/icons/industry.svg +0 -4
- package/icons/information.svg +0 -1
- package/icons/jewelry.svg +0 -1
- package/icons/jewish.svg +0 -1
- package/icons/karaoke.svg +0 -4
- package/icons/landmark.svg +0 -1
- package/icons/laundry.svg +0 -1
- package/icons/library.svg +0 -1
- package/icons/lift_gate.svg +0 -4
- package/icons/light_rail.svg +0 -4
- package/icons/lighthouse.svg +0 -4
- package/icons/lodging.svg +0 -1
- package/icons/marker.svg +0 -4
- package/icons/marker_stroked.svg +0 -4
- package/icons/mobile_phone.svg +0 -1
- package/icons/monorail.svg +0 -4
- package/icons/monument.svg +0 -1
- package/icons/motorcycle.svg +0 -4
- package/icons/motorcycle_parking.svg +0 -4
- package/icons/motorcycle_rental.svg +0 -4
- package/icons/motorcycle_repair.svg +0 -4
- package/icons/museum.svg +0 -1
- package/icons/music.svg +0 -1
- package/icons/muslim.svg +0 -1
- package/icons/natural.svg +0 -4
- package/icons/noodle.svg +0 -4
- package/icons/obelisk.svg +0 -4
- package/icons/observation_tower.svg +0 -4
- package/icons/oneway.svg +0 -4
- package/icons/optician.svg +0 -4
- package/icons/outdoor.svg +0 -1
- package/icons/paint.svg +0 -1
- package/icons/park.svg +0 -4
- package/icons/parking.svg +0 -1
- package/icons/parking_garage.svg +0 -1
- package/icons/parking_paid.svg +0 -4
- package/icons/peak.svg +0 -1
- package/icons/perfumery.svg +0 -1
- package/icons/pharmacy.svg +0 -1
- package/icons/picnic_site.svg +0 -1
- package/icons/pin.svg +0 -4
- package/icons/pipe.svg +0 -4
- package/icons/pitch.svg +0 -1
- package/icons/pizza.svg +0 -4
- package/icons/place_of_worship.svg +0 -4
- package/icons/playground.svg +0 -4
- package/icons/police.svg +0 -1
- package/icons/post.svg +0 -1
- package/icons/prison.svg +0 -1
- package/icons/racetrack.svg +0 -4
- package/icons/radiation.svg +0 -4
- package/icons/railway.svg +0 -4
- package/icons/ranger_station.svg +0 -4
- package/icons/recycling.svg +0 -4
- package/icons/restaurant.svg +0 -1
- package/icons/road_accident.svg +0 -4
- package/icons/roadblock.svg +0 -4
- package/icons/rocket.svg +0 -4
- package/icons/school.svg +0 -1
- package/icons/school_bus.svg +0 -4
- package/icons/scooter.svg +0 -1
- package/icons/sculpture.svg +0 -4
- package/icons/seafood.svg +0 -4
- package/icons/shelter.svg +0 -4
- package/icons/shinto.svg +0 -1
- package/icons/shoes.svg +0 -4
- package/icons/shop.svg +0 -1
- package/icons/sikh.svg +0 -4
- package/icons/skateboard.svg +0 -1
- package/icons/snow.svg +0 -4
- package/icons/soccer.svg +0 -4
- package/icons/spring.svg +0 -4
- package/icons/square.svg +0 -4
- package/icons/square_stroked.svg +0 -4
- package/icons/stadium.svg +0 -1
- package/icons/star.svg +0 -4
- package/icons/star_stroked.svg +0 -4
- package/icons/statue.svg +0 -4
- package/icons/subway.svg +0 -4
- package/icons/suitcase.svg +0 -1
- package/icons/sushi.svg +0 -4
- package/icons/swimming.svg +0 -5
- package/icons/swimming_pool.svg +0 -8
- package/icons/tako.svg +0 -4
- package/icons/taoist.svg +0 -1
- package/icons/taxi.svg +0 -4
- package/icons/teahouse.svg +0 -4
- package/icons/telephone.svg +0 -1
- package/icons/tennis.svg +0 -1
- package/icons/terminal.svg +0 -4
- package/icons/theatre.svg +0 -1
- package/icons/theme_park.svg +0 -4
- package/icons/toilets.svg +0 -1
- package/icons/toll.svg +0 -1
- package/icons/town.svg +0 -4
- package/icons/town_hall.svg +0 -4
- package/icons/tram_stop.svg +0 -4
- package/icons/tramway.svg +0 -1
- package/icons/transit.svg +0 -4
- package/icons/triangle.svg +0 -4
- package/icons/triangle_stroked.svg +0 -4
- package/icons/truck.svg +0 -4
- package/icons/tunnel.svg +0 -4
- package/icons/veterinary.svg +0 -4
- package/icons/viewpoint.svg +0 -4
- package/icons/village.svg +0 -4
- package/icons/volcano.svg +0 -1
- package/icons/volleyball.svg +0 -4
- package/icons/warehouse.svg +0 -4
- package/icons/waste_basket.svg +0 -1
- package/icons/watches.svg +0 -1
- package/icons/water.svg +0 -4
- package/icons/water_park.svg +0 -6
- package/icons/water_tower.svg +0 -4
- package/icons/watermill.svg +0 -4
- package/icons/wetland.svg +0 -4
- package/icons/wheelchair.svg +0 -1
- package/icons/windmill.svg +0 -1
- package/icons/wine.svg +0 -4
- package/icons/zoo.svg +0 -1
package/openlayers.umd.js
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
(function(W,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("ol/control"),require("ol/events/Event"),require("ol"),require("ol/geom"),require("ol/layer/Vector"),require("ol/proj"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Icon"),require("ol/style/Stroke"),require("ol/style/Style"),require("ol/style/Text")):typeof define=="function"&&define.amd?define(["exports","ol/control","ol/events/Event","ol","ol/geom","ol/layer/Vector","ol/proj","ol/source/Vector","ol/style/Fill","ol/style/Icon","ol/style/Stroke","ol/style/Style","ol/style/Text"],$):(W=typeof globalThis<"u"?globalThis:W||self,$(W.openlayersMaptilerGeocoder={},W.ol.control,W.ol.events.Event,W.ol,W.ol.geom,W.ol.layer.Vector,W.ol.proj,W.ol.source.Vector,W.ol.style.Fill,W.ol.style.Icon,W.ol.style.Stroke,W.ol.style.Style,W.ol.style.Text))})(this,function(W,$,te,Te,Me,xn,Ke,Tn,mi,Mn,pi,Nn,Cn){"use strict";var Rs=Object.defineProperty;var Ln=W=>{throw TypeError(W)};var Is=(W,$,te)=>$ in W?Rs(W,$,{enumerable:!0,configurable:!0,writable:!0,value:te}):W[$]=te;var P=(W,$,te)=>Is(W,typeof $!="symbol"?$+"":$,te),Sn=(W,$,te)=>$.has(W)||Ln("Cannot "+te);var he=(W,$,te)=>(Sn(W,$,"read from private field"),te?te.call(W):$.get(W)),hi=(W,$,te)=>$.has(W)?Ln("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(W):$.set(W,te),di=(W,$,te,Te)=>(Sn(W,$,"write to private field"),Te?Te.call(W,te):$.set(W,te),te);var dn,gn,fe,st;function re(){}function kn(i,e){for(const t in e)i[t]=e[t];return i}function yi(i){return i()}function vi(){return Object.create(null)}function Fe(i){i.forEach(yi)}function bi(i){return typeof i=="function"}function et(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Nt;function ve(i,e){return i===e?!0:(Nt||(Nt=document.createElement("a")),Nt.href=e,i===Nt.href)}function On(i){return Object.keys(i).length===0}function Pn(i,e,t,n){if(i){const r=wi(i,e,t,n);return i[0](r)}}function wi(i,e,t,n){return i[1]&&n?kn(t.ctx.slice(),i[1](n(e))):t.ctx}function Rn(i,e,t,n){return i[2],e.dirty}function In(i,e,t,n,r,u){if(r){const a=wi(e,t,n,u);i.p(a,r)}}function An(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function Ct(i){return i??""}function H(i,e){i.appendChild(e)}function se(i,e,t){i.insertBefore(e,t||null)}function ie(i){i.parentNode&&i.parentNode.removeChild(i)}function J(i){return document.createElement(i)}function De(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Ye(i){return document.createTextNode(i)}function Ee(){return Ye(" ")}function Gn(){return Ye("")}function de(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function Bn(i){return function(e){return e.preventDefault(),i.call(this,e)}}function x(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function zn(i){return Array.from(i.childNodes)}function mt(i,e){e=""+e,i.data!==e&&(i.data=e)}function Ei(i,e){i.value=e??""}function at(i,e,t){i.classList.toggle(e,!!t)}function Wn(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let pt;function yt(i){pt=i}function Li(){if(!pt)throw new Error("Function called outside component initialization");return pt}function Fn(i){Li().$$.on_destroy.push(i)}function Si(){const i=Li();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const u=Wn(e,t,{cancelable:n});return r.slice().forEach(a=>{a.call(i,u)}),!u.defaultPrevented}return!0}}function Dn(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const ft=[],jt=[];let ct=[];const _i=[],Un=Promise.resolve();let Ht=!1;function qn(){Ht||(Ht=!0,Un.then(xi))}function Zt(i){ct.push(i)}const Kt=new Set;let ht=0;function xi(){if(ht!==0)return;const i=pt;do{try{for(;ht<ft.length;){const e=ft[ht];ht++,yt(e),Vn(e.$$)}}catch(e){throw ft.length=0,ht=0,e}for(yt(null),ft.length=0,ht=0;jt.length;)jt.pop()();for(let e=0;e<ct.length;e+=1){const t=ct[e];Kt.has(t)||(Kt.add(t),t())}ct.length=0}while(ft.length);for(;_i.length;)_i.pop()();Ht=!1,Kt.clear(),yt(i)}function Vn(i){if(i.fragment!==null){i.update(),Fe(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Zt)}}function jn(i){const e=[],t=[];ct.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),ct=e}const kt=new Set;let tt;function Ot(){tt={r:0,c:[],p:tt}}function Pt(){tt.r||Fe(tt.c),tt=tt.p}function ue(i,e){i&&i.i&&(kt.delete(i),i.i(e))}function pe(i,e,t,n){if(i&&i.o){if(kt.has(i))return;kt.add(i),tt.c.push(()=>{kt.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function Ti(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Hn(i,e){pe(i,1,1,()=>{e.delete(i.key)})}function Zn(i,e,t,n,r,u,a,s,g,h,b,S){let M=i.length,k=u.length,N=M;const C={};for(;N--;)C[i[N].key]=N;const O=[],A=new Map,_=new Map,R=[];for(N=k;N--;){const G=S(r,u,N),o=t(G);let l=a.get(o);l?R.push(()=>l.p(G,e)):(l=h(o,G),l.c()),A.set(o,O[N]=l),o in C&&_.set(o,Math.abs(N-C[o]))}const F=new Set,K=new Set;function D(G){ue(G,1),G.m(s,b),a.set(G.key,G),b=G.first,k--}for(;M&&k;){const G=O[k-1],o=i[M-1],l=G.key,f=o.key;G===o?(b=G.first,M--,k--):A.has(f)?!a.has(l)||F.has(l)?D(G):K.has(f)?M--:_.get(l)>_.get(f)?(K.add(l),D(G)):(F.add(f),M--):(g(o,a),M--)}for(;M--;){const G=i[M];A.has(G.key)||g(G,a)}for(;k;)D(O[k-1]);return Fe(R),O}function Qe(i){i&&i.c()}function Ue(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),Zt(()=>{const u=i.$$.on_mount.map(yi).filter(bi);i.$$.on_destroy?i.$$.on_destroy.push(...u):Fe(u),i.$$.on_mount=[]}),r.forEach(Zt)}function qe(i,e){const t=i.$$;t.fragment!==null&&(jn(t.after_update),Fe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Kn(i,e){i.$$.dirty[0]===-1&&(ft.push(i),qn(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function it(i,e,t,n,r,u,a=null,s=[-1]){const g=pt;yt(i);const h=i.$$={fragment:null,ctx:[],props:u,update:re,not_equal:r,bound:vi(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(g?g.$$.context:[])),callbacks:vi(),dirty:s,skip_bound:!1,root:e.target||g.$$.root};a&&a(h.root);let b=!1;if(h.ctx=t?t(i,e.props||{},(S,M,...k)=>{const N=k.length?k[0]:M;return h.ctx&&r(h.ctx[S],h.ctx[S]=N)&&(!h.skip_bound&&h.bound[S]&&h.bound[S](N),b&&Kn(i,S)),M}):[],h.update(),b=!0,Fe(h.before_update),h.fragment=n?n(h.ctx):!1,e.target){if(e.hydrate){const S=zn(e.target);h.fragment&&h.fragment.l(S),S.forEach(ie)}else h.fragment&&h.fragment.c();e.intro&&ue(i.$$.fragment),Ue(i,e.target,e.anchor),xi()}yt(g)}class nt{constructor(){P(this,"$$");P(this,"$$set")}$destroy(){qe(this,1),this.$destroy=re}$on(e,t){if(!bi(t))return re;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!On(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Yn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Yn);function Qn(i){let e,t;return{c(){e=De("svg"),t=De("path"),x(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),x(e,"viewBox","0 0 14 14"),x(e,"width","13"),x(e,"height","13"),x(e,"class","svelte-en2qvf")},m(n,r){se(n,e,r),H(e,t)},p:re,i:re,o:re,d(n){n&&ie(e)}}}class Mi extends nt{constructor(e){super(),it(this,e,null,Qn,et,{})}}function Xn(i){let e,t;return{c(){e=De("svg"),t=De("path"),x(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),x(e,"viewBox","0 0 30 30"),x(e,"fill","none"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"class","svelte-d2loi5")},m(n,r){se(n,e,r),H(e,t)},p:re,i:re,o:re,d(n){n&&ie(e)}}}class Ni extends nt{constructor(e){super(),it(this,e,null,Xn,et,{})}}function Jn(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"area.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"area.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function $n(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"reverse.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"reverse.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function er(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"poi.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"poi.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function tr(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"postal_code.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"postal_code.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function ir(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"street.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"street.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function nr(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"road.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"road.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function rr(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"housenumber.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"housenumber.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function sr(i){let e,t,n,r;return{c(){e=J("img"),ve(e.src,t=i[5])||x(e,"src",t),x(e,"alt",i[4]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(u,a){se(u,e,a),n||(r=de(e,"error",i[14]),n=!0)},p(u,a){a&32&&!ve(e.src,t=u[5])&&x(e,"src",t),a&16&&x(e,"alt",u[4]),a&64&&x(e,"title",u[6])},d(u){u&&ie(e),n=!1,r()}}}function Ci(i){let e,t;return{c(){e=J("span"),t=Ye(i[6]),x(e,"class","secondary svelte-z7p9pp")},m(n,r){se(n,e,r),H(e,t)},p(n,r){r&64&&mt(t,n[6])},d(n){n&&ie(e)}}}function or(i){let e,t,n,r,u,a,s,g,h,b=(i[8]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",S,M,k=i[2]==="always"||i[2]!=="never"&&!i[0].address&&!i[0].id.startsWith("road.")&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[8],N,C,O=(i[8]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",A,_,R,F,K,D;function G(m,c){return c&1&&(t=null),c&1&&(n=null),c&1&&(r=null),c&1&&(u=null),m[5]?sr:m[0].address?rr:(t==null&&(t=!!m[0].id.startsWith("road.")),t?nr:(n==null&&(n=!!m[0].id.startsWith("address.")),n?ir:(r==null&&(r=!!m[0].id.startsWith("postal_code.")),r?tr:(u==null&&(u=!!m[0].id.startsWith("poi.")),u?er:m[8]?$n:Jn))))}let o=G(i,-1),l=o(i),f=k&&Ci(i);return{c(){e=J("li"),l.c(),a=Ee(),s=J("span"),g=J("span"),h=J("span"),S=Ye(b),M=Ee(),f&&f.c(),N=Ee(),C=J("span"),A=Ye(O),x(h,"class","primary svelte-z7p9pp"),x(g,"class","svelte-z7p9pp"),x(C,"class","line2 svelte-z7p9pp"),x(s,"class","texts svelte-z7p9pp"),x(e,"tabindex","-1"),x(e,"role","option"),x(e,"aria-selected",_=i[1]==="selected"),x(e,"aria-checked",R=i[1]==="picked"),x(e,"class",F=Ct(i[1])+" svelte-z7p9pp")},m(m,c){se(m,e,c),l.m(e,null),H(e,a),H(e,s),H(s,g),H(g,h),H(h,S),H(g,M),f&&f.m(g,null),H(s,N),H(s,C),H(C,A),K||(D=[de(e,"mouseenter",i[13]),de(e,"focus",i[15]),de(e,"click",i[16])],K=!0)},p(m,[c]){o===(o=G(m,c))&&l?l.p(m,c):(l.d(1),l=o(m),l&&(l.c(),l.m(e,a))),c&1&&b!==(b=(m[8]?m[0].place_name:m[0].place_name.replace(/,.*/,""))+"")&&mt(S,b),c&37&&(k=m[2]==="always"||m[2]!=="never"&&!m[0].address&&!m[0].id.startsWith("road.")&&!m[0].id.startsWith("address.")&&!m[0].id.startsWith("postal_code.")&&(!m[0].id.startsWith("poi.")||!m[5])&&!m[8]),k?f?f.p(m,c):(f=Ci(m),f.c(),f.m(g,null)):f&&(f.d(1),f=null),c&1&&O!==(O=(m[8]?"":m[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&mt(A,O),c&2&&_!==(_=m[1]==="selected")&&x(e,"aria-selected",_),c&2&&R!==(R=m[1]==="picked")&&x(e,"aria-checked",R),c&2&&F!==(F=Ct(m[1])+" svelte-z7p9pp")&&x(e,"class",F)},i:re,o:re,d(m){m&&ie(e),l.d(),f&&f.d(),K=!1,Fe(D)}}}function lr(i,e,t){var K;let n,r,{feature:u}=e,{style:a="default"}=e,{showPlaceType:s}=e,{missingIconsCache:g}=e,{iconsBaseUrl:h}=e;const b=Si(),S=(K=u.properties)==null?void 0:K.categories;let M,k,N=0,C=u.place_type[0]==="reverse";function O(){k&&g.add(k),t(11,N++,N)}function A(D){Dn.call(this,i,D)}const _=()=>O(),R=()=>b("select",void 0),F=D=>{document.activeElement!==D.target&&b("select",void 0)};return i.$$set=D=>{"feature"in D&&t(0,u=D.feature),"style"in D&&t(1,a=D.style),"showPlaceType"in D&&t(2,s=D.showPlaceType),"missingIconsCache"in D&&t(10,g=D.missingIconsCache),"iconsBaseUrl"in D&&t(3,h=D.iconsBaseUrl)},i.$$.update=()=>{var D,G,o,l;if(i.$$.dirty&7224)do t(12,n--,n),t(4,M=S==null?void 0:S[n]),t(5,k=M?h+M.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!k||g.has(k)));i.$$.dirty&1&&t(6,r=((G=(D=u.properties)==null?void 0:D.categories)==null?void 0:G.join(", "))??((l=(o=u.properties)==null?void 0:o.place_type_name)==null?void 0:l[0])??u.place_type[0])},t(12,n=(S==null?void 0:S.length)??0),[u,a,s,h,M,k,r,b,C,O,g,N,n,A,_,R,F]}class ur extends nt{constructor(e){super(),it(this,e,lr,or,et,{feature:0,style:1,showPlaceType:2,missingIconsCache:10,iconsBaseUrl:3})}}function ar(i){let e;return{c(){e=J("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',x(e,"class","svelte-7cmwmc")},m(t,n){se(t,e,n)},p:re,i:re,o:re,d(t){t&&ie(e)}}}class fr extends nt{constructor(e){super(),it(this,e,null,ar,et,{})}}function cr(i){let e,t;return{c(){e=De("svg"),t=De("path"),x(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),x(e,"viewBox","0 0 60.006 21.412"),x(e,"width","14"),x(e,"height","20"),x(e,"class","svelte-en2qvf")},m(n,r){se(n,e,r),H(e,t)},p:re,i:re,o:re,d(n){n&&ie(e)}}}class hr extends nt{constructor(e){super(),it(this,e,null,cr,et,{})}}function dr(i){let e,t,n;return{c(){e=De("svg"),t=De("circle"),n=De("path"),x(t,"cx","4.789"),x(t,"cy","4.787"),x(t,"r","3.85"),x(t,"class","svelte-1aq105l"),x(n,"d","M12.063 12.063 7.635 7.635"),x(n,"class","svelte-1aq105l"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"width","13"),x(e,"height","13"),x(e,"viewBox","0 0 13 13"),x(e,"class","svelte-1aq105l")},m(r,u){se(r,e,u),H(e,t),H(e,n)},p:re,i:re,o:re,d(r){r&&ie(e)}}}class gr extends nt{constructor(e){super(),it(this,e,null,dr,et,{})}}function mr(i,e,t){const n=e[1],r=e[0],u=n-r;return i===n&&t?i:((i-r)%u+u)%u+r}function Rt(i){const e=[...i];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}let vt;async function pr(i,e,t){const n=i==null?void 0:i.getCenterAndZoom();for(const r of e??[])if(!(n&&(r.minZoom!=null&&r.minZoom>n[0]||r.maxZoom!=null&&r.maxZoom<n[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(vt&&r.cachedLocationExpiry&&vt.time+r.cachedLocationExpiry>Date.now()){if(!vt.coords)break e;return vt.coords}let u;try{return u=await new Promise((a,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(g=>{a([g.coords.longitude,g.coords.latitude].map(h=>h.toFixed(6)).join(","))},g=>{s(g)},r)}),u}catch{}finally{r.cachedLocationExpiry&&(vt={time:Date.now(),coords:u})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(n&&r.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const yr=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,ki=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,Oi=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,Pi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,Ri=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,Ii=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function vr(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(k=>Number(k.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),u=Math.abs(n),a=t>0?"N":"S",s=n>0?"E":"W";let g;i=="DD"&&(g=`${r}° ${a}, ${u}° ${s}`);const h=Math.floor(r),b=Math.floor(u),S=(r-h)*60,M=(u-b)*60;if(i=="DM"){let k=Ai(S,3).toFixed(3).padStart(6,"0"),N=Ai(M,3).toFixed(3).padStart(6,"0");k.endsWith(".000")&&N.endsWith(".000")&&(k=k.replace(/\.000$/,""),N=N.replace(/\.000$/,"")),g=`${h}° ${k}' ${a}, ${b}° ${N}' ${s}`}if(i=="DMS"){const k=Math.floor(S),N=Math.floor(M);let C=((S-k)*60).toFixed(1).padStart(4,"0"),O=((M-N)*60).toFixed(1).padStart(4,"0");const A=k.toString().padStart(2,"0"),_=N.toString().padStart(2,"0");C.endsWith(".0")&&O.endsWith(".0")&&(C=C.replace(/\.0$/,""),O=O.replace(/\.0$/,"")),g=`${h}° ${A}' ${C}" ${a}, ${b}° ${_}' ${O}" ${s}`}return g}else throw new Error("no decimal coordinates to convert")}function Ai(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function Yt(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",u="",a=null,s=[],g=!1;if(yr.test(i))throw new Error("invalid coordinate value");if(ki.test(i))if(s=ki.exec(i),g=bt(s),g)t=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(t*=-1),n=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(n*=-1),a="DM";else throw new Error("invalid coordinate format");else if(Oi.test(i))if(s=Oi.exec(i),g=bt(s),g){if(t=s[2],n=s[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),a="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");s[1]?(r=s[1],u=s[5]):s[4]&&(r=s[4],u=s[8])}else throw new Error("invalid decimal coordinate format");else if(Pi.test(i))if(s=Pi.exec(i),g=bt(s),g)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,a="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,a="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[9])),s[11]&&(n+=s[11]/60),s[13]&&(n+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(n=-1*n),s[1]?(r=s[1],u=s[8]):s[7]&&(r=s[7],u=s[14]);else throw new Error("invalid DMS coordinates format");else if(Ri.test(i))if(s=Ri.exec(i),g=bt(s),g)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,a="DM"),s[6]&&(t+=s[6]/3600,a="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12]/60),s[14]&&(n+=s[14]/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],u=s[9]):s[8]&&(r=s[8],u=s[16]);else throw new Error("invalid DMS coordinates format");else if(Ii.test(i)){if(s=Ii.exec(i),g=bt(s),s.filter(h=>h).length<=5)throw new Error("invalid coordinates format");if(g)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,a="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,a="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12].replace(",",".")/60),s[14]&&(n+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],u=s[9]):s[8]&&(r=s[8],u=s[16]);else throw new Error("invalid coordinates format")}if(g){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!u||!r&&u)throw new Error("invalid coordinates value");if(r&&r==u)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let h=/S|SOUTH/i;h.test(r)&&t>0&&(t=-1*t),h=/W|WEST/i,h.test(u)&&n>0&&(n=-1*n);const b=s[0].trim();let S,M;const k=/[,/;\u0020]/g,N=b.match(k);if(N==null){const A=Math.floor(i.length/2);S=b.substring(0,A).trim(),M=b.substring(A).trim()}else{let A;N.length%2==1?A=Math.floor(N.length/2):A=N.length/2-1;let _=0;if(A==0)_=b.indexOf(N[0]),S=b.substring(0,_).trim(),M=b.substring(_+1).trim();else{let R=0,F=0;for(;R<=A;)_=b.indexOf(N[R],F),F=_+1,R++;S=b.substring(0,_).trim(),M=b.substring(_+1).trim()}}const C=S.split(".");if(C.length==2&&C[1]==0&&C[1].length!=2)throw new Error("invalid coordinates format");const O=M.split(".");if(O.length==2&&O[1]==0&&O[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(S)||/^\d+$/.test(M))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:b,verbatimLatitude:S,verbatimLongitude:M,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:a,closeEnough:br,toCoordinateFormat:vr})}else throw new Error("coordinates pattern match failed")}function bt(i){if(!isNaN(i[0]))return!1;const e=[...i];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,r=e.length/2;for(let u=0;u<r;u++){const a=e[u],s=e[u+r],g=t.test(a)&&t.test(s),h=n.test(a)&&n.test(s),b=a==s;if(!(a==null&&s==null)){if(a==null||s==null)return!1;if(g||h||b)continue;return!1}}return!0}function Gi(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function br(i){if(!i)throw new Error("coords must be provided");if(i.includes(",")){const e=i.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return Gi(this.decimalLatitude,Number(e[0]))&&Gi(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const wr=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Yt.to=wr;const Er=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],Lr={decimalLatitude:40.123,decimalLongitude:-74.123},Sr=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],_r=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function xr(){const i=[];return Er.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...Lr})}),[...i,...Sr,..._r]}const Tr=xr();Yt.formats=Tr.map(i=>i.verbatimCoordinates);const Mr=Yt;function Bi(i,e,t){const n=i.slice();return n[97]=e[t],n[99]=t,n}function zi(i){let e,t;return e=new fr({}),{c(){Qe(e.$$.fragment)},m(n,r){Ue(e,n,r),t=!0},i(n){t||(ue(e.$$.fragment,n),t=!0)},o(n){pe(e.$$.fragment,n),t=!1},d(n){qe(e,n)}}}function Wi(i){let e,t,n,r,u;return t=new hr({}),{c(){e=J("button"),Qe(t.$$.fragment),x(e,"type","button"),x(e,"title",i[10]),x(e,"class","svelte-bz0zu3"),at(e,"active",i[0])},m(a,s){se(a,e,s),Ue(t,e,null),n=!0,r||(u=de(e,"click",i[79]),r=!0)},p(a,s){(!n||s[0]&1024)&&x(e,"title",a[10]),(!n||s[0]&1)&&at(e,"active",a[0])},i(a){n||(ue(t.$$.fragment,a),n=!0)},o(a){pe(t.$$.fragment,a),n=!1},d(a){a&&ie(e),qe(t),r=!1,u()}}}function Nr(i){let e,t=[],n=new Map,r,u,a,s=Ti(i[13]);const g=h=>h[97].id+(h[97].address?","+h[97].address:"");for(let h=0;h<s.length;h+=1){let b=Bi(i,s,h),S=g(b);n.set(S,t[h]=Fi(S,b))}return{c(){e=J("ul");for(let h=0;h<t.length;h+=1)t[h].c();x(e,"class","options svelte-bz0zu3"),x(e,"role","listbox")},m(h,b){se(h,e,b);for(let S=0;S<t.length;S+=1)t[S]&&t[S].m(e,null);r=!0,u||(a=[de(e,"mouseleave",i[27]),de(e,"blur",i[83]),de(e,"keydown",i[23])],u=!0)},p(h,b){b[0]&102823936&&(s=Ti(h[13]),Ot(),t=Zn(t,b,g,1,h,s,n,e,Hn,Fi,null,Bi),Pt())},i(h){if(!r){for(let b=0;b<s.length;b+=1)ue(t[b]);r=!0}},o(h){for(let b=0;b<t.length;b+=1)pe(t[b]);r=!1},d(h){h&&ie(e);for(let b=0;b<t.length;b+=1)t[b].d();u=!1,Fe(a)}}}function Cr(i){let e,t,n,r,u,a;return t=new Ni({}),{c(){e=J("div"),Qe(t.$$.fragment),n=Ee(),r=J("div"),u=Ye(i[8]),x(r,"class","svelte-bz0zu3"),x(e,"class","no-results svelte-bz0zu3")},m(s,g){se(s,e,g),Ue(t,e,null),H(e,n),H(e,r),H(r,u),a=!0},p(s,g){(!a||g[0]&256)&&mt(u,s[8])},i(s){a||(ue(t.$$.fragment,s),a=!0)},o(s){pe(t.$$.fragment,s),a=!1},d(s){s&&ie(e),qe(t)}}}function kr(i){let e="",t;return{c(){t=Ye(e)},m(n,r){se(n,t,r)},p:re,i:re,o:re,d(n){n&&ie(t)}}}function Or(i){let e,t,n,r,u,a,s,g,h,b,S;return t=new Ni({}),g=new Mi({}),{c(){e=J("div"),Qe(t.$$.fragment),n=Ee(),r=J("div"),u=Ye(i[7]),a=Ee(),s=J("button"),Qe(g.$$.fragment),x(r,"class","svelte-bz0zu3"),x(s,"class","svelte-bz0zu3"),x(e,"class","error svelte-bz0zu3")},m(M,k){se(M,e,k),Ue(t,e,null),H(e,n),H(e,r),H(r,u),H(e,a),H(e,s),Ue(g,s,null),h=!0,b||(S=de(s,"click",i[80]),b=!0)},p(M,k){(!h||k[0]&128)&&mt(u,M[7])},i(M){h||(ue(t.$$.fragment,M),ue(g.$$.fragment,M),h=!0)},o(M){pe(t.$$.fragment,M),pe(g.$$.fragment,M),h=!1},d(M){M&&ie(e),qe(t),qe(g),b=!1,S()}}}function Fi(i,e){var s;let t,n,r;function u(){return e[81](e[99])}function a(){return e[82](e[97])}return n=new ur({props:{feature:e[97],showPlaceType:e[11],style:e[15]===e[99]?"selected":((s=e[14])==null?void 0:s.id)===e[97].id?"picked":"default",missingIconsCache:e[21],iconsBaseUrl:e[12]}}),n.$on("mouseenter",u),n.$on("select",a),{key:i,first:null,c(){t=Gn(),Qe(n.$$.fragment),this.first=t},m(g,h){se(g,t,h),Ue(n,g,h),r=!0},p(g,h){var S;e=g;const b={};h[0]&8192&&(b.feature=e[97]),h[0]&2048&&(b.showPlaceType=e[11]),h[0]&57344&&(b.style=e[15]===e[99]?"selected":((S=e[14])==null?void 0:S.id)===e[97].id?"picked":"default"),h[0]&4096&&(b.iconsBaseUrl=e[12]),n.$set(b)},i(g){r||(ue(n.$$.fragment,g),r=!0)},o(g){pe(n.$$.fragment,g),r=!1},d(g){g&&ie(t),qe(n,g)}}}function Pr(i){let e,t,n,r,u,a,s,g,h,b,S,M,k,N,C,O,A,_,R,F,K,D=!1;u=new gr({}),S=new Mi({});let G=i[20]&&zi(),o=i[6]==="button"&&Wi(i);const l=i[70].default,f=Pn(l,i,i[69],null),m=[Or,kr,Cr,Nr],c=[];function v(p,d){var y,w;return p[19]?0:!p[16]&&!p[4]?1:((y=p[13])==null?void 0:y.length)===0?2:(w=p[13])!=null&&w.length&&(p[16]||p[4])?3:-1}return~(O=v(i))&&(A=c[O]=m[O](i)),{c(){e=Ee(),t=J("form"),n=J("div"),r=J("button"),Qe(u.$$.fragment),a=Ee(),s=J("input"),g=Ee(),h=J("div"),b=J("button"),Qe(S.$$.fragment),M=Ee(),G&&G.c(),k=Ee(),o&&o.c(),N=Ee(),f&&f.c(),C=Ee(),A&&A.c(),x(r,"class","search-button svelte-bz0zu3"),x(r,"type","button"),x(s,"placeholder",i[9]),x(s,"aria-label",i[9]),x(s,"class","svelte-bz0zu3"),x(b,"type","button"),x(b,"title",i[3]),x(b,"class","svelte-bz0zu3"),x(h,"class","clear-button-container svelte-bz0zu3"),at(h,"displayable",i[1]!==""),x(n,"class","input-group svelte-bz0zu3"),x(t,"class",_=Ct(i[2])+" svelte-bz0zu3"),at(t,"can-collapse",i[5]&&i[1]==="")},m(p,d){se(p,e,d),se(p,t,d),H(t,n),H(n,r),Ue(u,r,null),H(n,a),H(n,s),i[72](s),Ei(s,i[1]),H(n,g),H(n,h),H(h,b),Ue(S,b,null),H(h,M),G&&G.m(h,null),H(n,k),o&&o.m(n,null),H(n,N),f&&f.m(n,null),H(t,C),~O&&c[O].m(t,null),R=!0,F||(K=[de(r,"click",i[71]),de(s,"input",i[73]),de(s,"focus",i[74]),de(s,"blur",i[75]),de(s,"click",i[76]),de(s,"keydown",i[23]),de(s,"input",i[24]),de(s,"change",i[77]),de(b,"click",i[78]),de(t,"submit",Bn(i[22]))],F=!0)},p(p,d){(!R||d[0]&512)&&x(s,"placeholder",p[9]),(!R||d[0]&512)&&x(s,"aria-label",p[9]),d[0]&2&&s.value!==p[1]&&Ei(s,p[1]),(!R||d[0]&8)&&x(b,"title",p[3]),p[20]?G?d[0]&1048576&&ue(G,1):(G=zi(),G.c(),ue(G,1),G.m(h,null)):G&&(Ot(),pe(G,1,1,()=>{G=null}),Pt()),(!R||d[0]&2)&&at(h,"displayable",p[1]!==""),p[6]==="button"?o?(o.p(p,d),d[0]&64&&ue(o,1)):(o=Wi(p),o.c(),ue(o,1),o.m(n,N)):o&&(Ot(),pe(o,1,1,()=>{o=null}),Pt()),f&&f.p&&(!R||d[2]&128)&&In(f,l,p,p[69],R?Rn(l,p[69],d,null):An(p[69]),null);let y=O;O=v(p),O===y?~O&&c[O].p(p,d):(A&&(Ot(),pe(c[y],1,1,()=>{c[y]=null}),Pt()),~O?(A=c[O],A?A.p(p,d):(A=c[O]=m[O](p),A.c()),ue(A,1),A.m(t,null)):A=null),(!R||d[0]&4&&_!==(_=Ct(p[2])+" svelte-bz0zu3"))&&x(t,"class",_),(!R||d[0]&38)&&at(t,"can-collapse",p[5]&&p[1]==="")},i(p){R||(ue(D),ue(u.$$.fragment,p),ue(S.$$.fragment,p),ue(G),ue(o),ue(f,p),ue(A),R=!0)},o(p){pe(D),pe(u.$$.fragment,p),pe(S.$$.fragment,p),pe(G),pe(o),pe(f,p),pe(A),R=!1},d(p){p&&(ie(e),ie(t)),qe(u),i[72](null),qe(S),G&&G.d(),o&&o.d(),f&&f.d(p),~O&&c[O].d(),F=!1,Fe(K)}}}function Rr(i,e,t){let n,r,u,{$$slots:a={},$$scope:s}=e;const g={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:h=void 0}=e,{apiKey:b}=e,{bbox:S=void 0}=e,{clearButtonTitle:M="clear"}=e,{clearOnBlur:k=!1}=e,{clearListOnPick:N=!1}=e,{keepListOpen:C=!1}=e,{collapsed:O=!1}=e,{country:A=void 0}=e,{debounceSearch:_=200}=e,{enableReverse:R="never"}=e,{errorMessage:F="Something went wrong…"}=e,{filter:K=()=>!0}=e,{flyTo:D=!0}=e,{fuzzyMatch:G=!0}=e,{language:o=void 0}=e,{limit:l=void 0}=e;const f=41415112612;let{reverseGeocodingLimit:m=f}=e,{mapController:c=void 0}=e,{minLength:v=2}=e,{noResultsMessage:p="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:d="Search"}=e,{proximity:y=[{type:"server-geolocation"}]}=e,{reverseActive:w=R==="always"}=e,{reverseButtonTitle:E="toggle reverse geocoding"}=e,{searchValue:T=""}=e,{pickedResultStyle:I="full-geometry"}=e,{showPlaceType:B="if-needed"}=e,{showResultsWhileTyping:j=!0}=e,{selectFirst:Y=!0}=e,{flyToSelected:ne=!1}=e,{markerOnSelected:V=!0}=e,{types:Z=void 0}=e;const ge=[];let{reverseGeocodingTypes:He=ge}=e,{exhaustiveReverseGeocoding:ot=!1}=e,{excludeTypes:lt=!1}=e;const Se=void 0;let{reverseGeocodingExcludeTypes:Ge=Se}=e,{zoom:ye=g}=e,{apiUrl:me="https://api.maptiler.com/geocoding"}=e,{fetchParameters:ee={}}=e,{iconsBaseUrl:mn="https://cdn.maptiler.com/maptiler-geocoding-control/v2.1.2/icons/"}=e,{adjustUrlQuery:ri=()=>{}}=e,{adjustUrl:si=()=>{}}=e;function fs(L){Re.focus(L)}function cs(){Re.blur()}function pn(L,le=!0,ae=!1){t(1,T=L),le?(t(15,Q=-1),vn()):(bn(void 0,!ae,ae),setTimeout(()=>{Re.focus(),Re.select()}))}function hs(){t(13,q=void 0),t(14,z=void 0),t(15,Q=-1)}function ds(){t(64,ce=[]),t(14,z=void 0)}let q,ce,z,yn="",Re,Q=-1,Be,Ut=[],ut,dt,gt,oi,Ze=!1;const gs=new Set,Je=Si();Fn(()=>{c&&(c.setEventHandler(void 0),c.indicateReverse(!1),c.setSelectedMarker(-1),c.setFeatures(void 0,void 0,!1))});function vn(L){if(t(17,Ze=!1),dt&&(clearTimeout(dt),dt=void 0),Q>-1&&q)t(14,z=q[Q]),t(1,T=z.place_type[0]==="reverse"?z.place_name:z.place_name.replace(/,.*/,"")),t(19,Be=void 0),t(64,ce=void 0),t(15,Q=-1);else if(T){const le=L||!li(T);ui(T,{exact:!0}).then(()=>{t(64,ce=q),t(14,z=void 0),le&&ms()}).catch(ae=>t(19,Be=ae))}}function li(L){try{return Mr(L,6)}catch{return!1}}async function ui(L,{byId:le=!1,exact:ae=!1}={}){var xe,ze,$e;t(19,Be=void 0),ut==null||ut.abort();const _e=new AbortController;t(20,ut=_e);try{const X=li(L),_t=new URL(me+"/"+encodeURIComponent(X?X.decimalLongitude+","+X.decimalLatitude:L)+".json"),Oe=_t.searchParams;o!==void 0&&Oe.set("language",Array.isArray(o)?o.join(","):o??"");const[ci]=(c==null?void 0:c.getCenterAndZoom())??[];let We=(xe=!X||He===ge?Z:He)==null?void 0:xe.map(be=>typeof be=="string"?be:ci===void 0||(be[0]??0)<=ci&&ci<(be[1]??1/0)?be[2]:void 0).filter(be=>be!==void 0);We&&(We=[...new Set(We)],Oe.set("types",We.join(",")));const En=!X||Ge===Se?lt:Ge;if(En&&Oe.set("excludeTypes",String(En)),S&&Oe.set("bbox",S.map(be=>be.toFixed(6)).join(",")),A&&Oe.set("country",Array.isArray(A)?A.join(","):A),!le&&!X){const be=await pr(c,y,_e);be&&Oe.set("proximity",be),(ae||!j)&&Oe.set("autocomplete","false"),Oe.set("fuzzyMatch",String(G))}const xt=m===f?l:m;xt!==void 0&&xt>1&&(We==null?void 0:We.length)!==1&&console.warn("For reverse geocoding when limit > 1 then types must contain single value."),X?(xt===1||xt!==void 0&&(ot||(We==null?void 0:We.length)===1))&&Oe.set("limit",String(xt)):l!==void 0&&Oe.set("limit",String(l)),Oe.set("key",b),ri(Oe),si(_t);const Ps=_t.searchParams.get("types")===""&&_t.searchParams.get("excludeTypes")!=="true",qt=_t.toString();if(qt===yn){le?(N&&t(13,q=void 0),t(14,z=Ut[0])):(t(13,q=Ut),((ze=q[Q])==null?void 0:ze.id)!==(r==null?void 0:r.id)&&t(15,Q=-1));return}yn=qt;let Tt;if(Ps)Tt={type:"FeatureCollection",features:[]};else{const be=await fetch(qt,{signal:_e.signal,...ee});if(!be.ok)throw new Error(await be.text());Tt=await be.json()}Je("response",{url:qt,featureCollection:Tt}),le?(N&&t(13,q=void 0),t(14,z=Tt.features[0]),Ut=[z]):(t(13,q=Tt.features.filter(K)),X&&q.unshift({type:"Feature",properties:{},id:"reverse_"+X.decimalLongitude+"_"+X.decimalLatitude,text:X.decimalLatitude+", "+X.decimalLongitude,place_name:X.decimalLatitude+", "+X.decimalLongitude,place_type:["reverse"],center:[X.decimalLongitude,X.decimalLatitude],bbox:[X.decimalLongitude,X.decimalLatitude,X.decimalLongitude,X.decimalLatitude],geometry:{type:"Point",coordinates:[X.decimalLongitude,X.decimalLatitude]}}),Ut=q,(($e=q[Q])==null?void 0:$e.id)!==(r==null?void 0:r.id)&&t(15,Q=-1),X&&Re.focus())}catch(X){if(X&&typeof X=="object"&&"name"in X&&X.name==="AbortError")return;throw X}finally{_e===ut&&t(20,ut=void 0)}}function ms(){var _e;if(!(ce!=null&&ce.length)||!D)return;const L=[180,90,-180,-90],le=!ce.some(xe=>!xe.matching_text);let ae;for(const xe of ce){const ze=St(xe);if(ae=ae===void 0?ze:ze===void 0?ae:Math.max(ae,ze),le||!xe.matching_text)for(const $e of[0,1,2,3])L[$e]=Math[$e<2?"min":"max"](L[$e],((_e=xe.bbox)==null?void 0:_e[$e])??xe.center[$e%2])}c&&ce.length>0&&(z&&L[0]===L[2]&&L[1]===L[3]?c.flyTo(z.center,St(z)):c.fitBounds(Rt(L),50,ae))}function ai(){!z||!c||(!z.bbox||z.bbox[0]===z.bbox[2]&&z.bbox[1]===z.bbox[3]?c.flyTo(z.center,St(z)):c.fitBounds(Rt(z.bbox),50,St(z)))}function St(L){var ae;if(!L.bbox||L.bbox[0]!==L.bbox[2]&&L.bbox[1]!==L.bbox[3])return;const le=L.id.replace(/\..*/,"");return(Array.isArray((ae=L.properties)==null?void 0:ae.categories)?L.properties.categories.reduce((_e,xe)=>{const ze=ye[le+"."+xe];return _e===void 0?ze:ze===void 0?_e:Math.max(_e,ze)},void 0):void 0)??ye[le]}function ps(L){t(0,w=R==="always"),t(13,q=void 0),t(14,z=void 0),t(15,Q=-1),pn(L[1].toFixed(6)+", "+mr(L[0],[-180,180],!0).toFixed(6),!1,!0)}function ys(L){if(!q)return;let le=L.key==="ArrowDown"?1:L.key==="ArrowUp"?-1:0;le&&(Re.focus(),t(17,Ze=!0),L.preventDefault(),z&&Q===-1&&t(15,Q=q.findIndex(ae=>ae.id===(z==null?void 0:z.id))),Q===(z||Y?0:-1)&&le===-1&&t(15,Q=q.length),t(15,Q+=le),Q>=q.length&&t(15,Q=-1),Q<0&&(z||Y)&&t(15,Q=0))}function bn(L,le=!0,ae=!1){if(t(19,Be=void 0),t(14,z=void 0),t(17,Ze=!0),j||ae){if(dt&&clearTimeout(dt),T.length<v)return;const _e=T;dt=window.setTimeout(()=>{ui(_e).catch(xe=>t(19,Be=xe))},le?_:0)}else t(13,q=void 0),t(19,Be=void 0)}function fi(L){z&&(z==null?void 0:z.id)===(L==null?void 0:L.id)?ai():(t(14,z=L),t(1,T=L.place_name))}function wn(L){t(15,Q=L)}function vs(){(!Y||z)&&t(15,Q=-1),ne&&ai()}const bs=()=>Re.focus();function ws(L){jt[L?"unshift":"push"](()=>{Re=L,t(18,Re)})}function Es(){T=this.value,t(1,T),t(17,Ze),t(31,k),t(16,gt)}const Ls=()=>t(17,Ze=!0),Ss=()=>t(17,Ze=!1),_s=()=>t(17,Ze=!0),xs=()=>t(14,z=void 0),Ts=()=>{t(1,T=""),Re.focus()},Ms=()=>t(0,w=!w),Ns=()=>t(19,Be=void 0),Cs=L=>wn(L),ks=L=>fi(L),Os=()=>{};return i.$$set=L=>{"class"in L&&t(2,h=L.class),"apiKey"in L&&t(29,b=L.apiKey),"bbox"in L&&t(30,S=L.bbox),"clearButtonTitle"in L&&t(3,M=L.clearButtonTitle),"clearOnBlur"in L&&t(31,k=L.clearOnBlur),"clearListOnPick"in L&&t(32,N=L.clearListOnPick),"keepListOpen"in L&&t(4,C=L.keepListOpen),"collapsed"in L&&t(5,O=L.collapsed),"country"in L&&t(33,A=L.country),"debounceSearch"in L&&t(34,_=L.debounceSearch),"enableReverse"in L&&t(6,R=L.enableReverse),"errorMessage"in L&&t(7,F=L.errorMessage),"filter"in L&&t(35,K=L.filter),"flyTo"in L&&t(36,D=L.flyTo),"fuzzyMatch"in L&&t(37,G=L.fuzzyMatch),"language"in L&&t(38,o=L.language),"limit"in L&&t(39,l=L.limit),"reverseGeocodingLimit"in L&&t(40,m=L.reverseGeocodingLimit),"mapController"in L&&t(41,c=L.mapController),"minLength"in L&&t(42,v=L.minLength),"noResultsMessage"in L&&t(8,p=L.noResultsMessage),"placeholder"in L&&t(9,d=L.placeholder),"proximity"in L&&t(43,y=L.proximity),"reverseActive"in L&&t(0,w=L.reverseActive),"reverseButtonTitle"in L&&t(10,E=L.reverseButtonTitle),"searchValue"in L&&t(1,T=L.searchValue),"pickedResultStyle"in L&&t(44,I=L.pickedResultStyle),"showPlaceType"in L&&t(11,B=L.showPlaceType),"showResultsWhileTyping"in L&&t(45,j=L.showResultsWhileTyping),"selectFirst"in L&&t(46,Y=L.selectFirst),"flyToSelected"in L&&t(47,ne=L.flyToSelected),"markerOnSelected"in L&&t(48,V=L.markerOnSelected),"types"in L&&t(49,Z=L.types),"reverseGeocodingTypes"in L&&t(50,He=L.reverseGeocodingTypes),"exhaustiveReverseGeocoding"in L&&t(51,ot=L.exhaustiveReverseGeocoding),"excludeTypes"in L&&t(52,lt=L.excludeTypes),"reverseGeocodingExcludeTypes"in L&&t(53,Ge=L.reverseGeocodingExcludeTypes),"zoom"in L&&t(54,ye=L.zoom),"apiUrl"in L&&t(55,me=L.apiUrl),"fetchParameters"in L&&t(56,ee=L.fetchParameters),"iconsBaseUrl"in L&&t(12,mn=L.iconsBaseUrl),"adjustUrlQuery"in L&&t(57,ri=L.adjustUrlQuery),"adjustUrl"in L&&t(58,si=L.adjustUrl),"$$scope"in L&&t(69,s=L.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&64&&t(0,w=R==="always"),i.$$.dirty[0]&16384|i.$$.dirty[1]&8192&&I!=="marker-only"&&z&&!z.address&&z.geometry.type==="Point"&&z.place_type[0]!=="reverse"&&ui(z.id,{byId:!0}).catch(L=>t(19,Be=L)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1058|i.$$.dirty[2]&8&&(c&&z&&z.id!==oi&&D&&(ai(),N&&t(13,q=void 0),t(64,ce=void 0),t(15,Q=-1)),t(65,oi=z==null?void 0:z.id)),i.$$.dirty[0]&196608|i.$$.dirty[1]&1&&setTimeout(()=>{t(16,gt=Ze),k&&!gt&&t(1,T="")}),i.$$.dirty[0]&8194|i.$$.dirty[1]&2048&&T.length<v&&(t(13,q=void 0),t(19,Be=void 0),t(64,ce=q)),i.$$.dirty[0]&57344|i.$$.dirty[1]&32768&&Y&&q!=null&&q.length&&Q==-1&&!z&&t(15,Q=0),i.$$.dirty[0]&8192|i.$$.dirty[2]&4&&ce!==q&&t(64,ce=void 0),i.$$.dirty[0]&73729|i.$$.dirty[1]&1024|i.$$.dirty[2]&4&&c&&c.setEventHandler(L=>{switch(L.type){case"mapClick":w&&ps(L.coordinates);break;case"markerClick":{const le=q==null?void 0:q.find(ae=>ae.id===L.id);le&&fi(le)}break;case"markerMouseEnter":ce&&t(15,Q=gt?(q==null?void 0:q.findIndex(le=>le.id===L.id))??-1:-1);break;case"markerMouseLeave":ce&&t(15,Q=-1);break}}),i.$$.dirty[0]&40960&&t(66,r=q==null?void 0:q[Q]),i.$$.dirty[1]&66592|i.$$.dirty[2]&16&&c&&r&&D&&ne&&c.flyTo(r.center,St(r)),i.$$.dirty[1]&8192&&t(68,n=I==="full-geometry-including-polygon-center-marker"),i.$$.dirty[1]&132096|i.$$.dirty[2]&64&&(V||c==null||c.setFeatures(void 0,void 0,n)),i.$$.dirty[0]&16384|i.$$.dirty[1]&132096|i.$$.dirty[2]&84&&c&&V&&!ce&&(c.setFeatures(r?[r]:void 0,z,n),c.setSelectedMarker(r?0:-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1024|i.$$.dirty[2]&68&&c&&c.setFeatures(ce,z,n),i.$$.dirty[0]&32768|i.$$.dirty[1]&1024|i.$$.dirty[2]&4&&ce&&c&&c.setSelectedMarker(Q),i.$$.dirty[0]&2|i.$$.dirty[1]&1024&&c){const L=li(T);c.setReverseMarker(L?[L.decimalLongitude,L.decimalLatitude]:void 0)}i.$$.dirty[2]&16&&Je("select",{feature:r}),i.$$.dirty[0]&16384&&Je("pick",{feature:z}),i.$$.dirty[0]&73744&&t(67,u=!!(q!=null&&q.length)&&(gt||C)),i.$$.dirty[2]&32&&Je("optionsvisibilitychange",{optionsVisible:u}),i.$$.dirty[0]&8192&&Je("featureslisted",{features:q}),i.$$.dirty[2]&4&&Je("featuresmarked",{features:ce}),i.$$.dirty[0]&1&&Je("reversetoggle",{reverse:w}),i.$$.dirty[0]&2&&Je("querychange",{query:T}),i.$$.dirty[0]&1|i.$$.dirty[1]&1024&&c&&c.indicateReverse(w)},[w,T,h,M,C,O,R,F,p,d,E,B,mn,q,z,Q,gt,Ze,Re,Be,ut,gs,vn,ys,bn,fi,wn,vs,g,b,S,k,N,A,_,K,D,G,o,l,m,c,v,y,I,j,Y,ne,V,Z,He,ot,lt,Ge,ye,me,ee,ri,si,fs,cs,pn,hs,ds,ce,oi,r,u,n,s,a,bs,ws,Es,Ls,Ss,_s,xs,Ts,Ms,Ns,Cs,ks,Os]}let Ir=class extends nt{constructor(e){super(),it(this,e,Rr,Pr,et,{ZOOM_DEFAULTS:28,class:2,apiKey:29,bbox:30,clearButtonTitle:3,clearOnBlur:31,clearListOnPick:32,keepListOpen:4,collapsed:5,country:33,debounceSearch:34,enableReverse:6,errorMessage:7,filter:35,flyTo:36,fuzzyMatch:37,language:38,limit:39,reverseGeocodingLimit:40,mapController:41,minLength:42,noResultsMessage:8,placeholder:9,proximity:43,reverseActive:0,reverseButtonTitle:10,searchValue:1,pickedResultStyle:44,showPlaceType:11,showResultsWhileTyping:45,selectFirst:46,flyToSelected:47,markerOnSelected:48,types:49,reverseGeocodingTypes:50,exhaustiveReverseGeocoding:51,excludeTypes:52,reverseGeocodingExcludeTypes:53,zoom:54,apiUrl:55,fetchParameters:56,iconsBaseUrl:12,adjustUrlQuery:57,adjustUrl:58,focus:59,blur:60,setQuery:61,clearList:62,clearMap:63},null,[-1,-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[28]}get focus(){return this.$$.ctx[59]}get blur(){return this.$$.ctx[60]}get setQuery(){return this.$$.ctx[61]}get clearList(){return this.$$.ctx[62]}get clearMap(){return this.$$.ctx[63]}};function It(i,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=i,n}function Qt(i,e,t={}){for(const r of i){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 It({type:"Polygon",coordinates:i},e,t)}function Xt(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function Di(i,e,t={}){return It({type:"MultiPolygon",coordinates:i},e,t)}function Ui(i,e,t){if(i!==null)for(var n,r,u,a,s,g,h,b=0,S=0,M,k=i.type,N=k==="FeatureCollection",C=k==="Feature",O=N?i.features.length:1,A=0;A<O;A++){h=N?i.features[A].geometry:C?i.geometry:i,M=h?h.type==="GeometryCollection":!1,s=M?h.geometries.length:1;for(var _=0;_<s;_++){var R=0,F=0;if(a=M?h.geometries[_]:h,a!==null){g=a.coordinates;var K=a.type;switch(b=0,K){case null:break;case"Point":if(e(g,S,A,R,F)===!1)return!1;S++,R++;break;case"LineString":case"MultiPoint":for(n=0;n<g.length;n++){if(e(g[n],S,A,R,F)===!1)return!1;S++,K==="MultiPoint"&&R++}K==="LineString"&&R++;break;case"Polygon":case"MultiLineString":for(n=0;n<g.length;n++){for(r=0;r<g[n].length-b;r++){if(e(g[n][r],S,A,R,F)===!1)return!1;S++}K==="MultiLineString"&&R++,K==="Polygon"&&F++}K==="Polygon"&&R++;break;case"MultiPolygon":for(n=0;n<g.length;n++){for(F=0,r=0;r<g[n].length;r++){for(u=0;u<g[n][r].length-b;u++){if(e(g[n][r][u],S,A,R,F)===!1)return!1;S++}F++}R++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(Ui(a.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Jt(i,e){var t,n,r,u,a,s,g,h,b,S,M=0,k=i.type==="FeatureCollection",N=i.type==="Feature",C=k?i.features.length:1;for(t=0;t<C;t++){for(s=k?i.features[t].geometry:N?i.geometry:i,h=k?i.features[t].properties:N?i.properties:{},b=k?i.features[t].bbox:N?i.bbox:void 0,S=k?i.features[t].id:N?i.id:void 0,g=s?s.type==="GeometryCollection":!1,a=g?s.geometries.length:1,r=0;r<a;r++){if(u=g?s.geometries[r]:s,u===null){if(e(null,M,h,b,S)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(u,M,h,b,S)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<u.geometries.length;n++)if(e(u.geometries[n],M,h,b,S)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function Ar(i,e){Jt(i,function(t,n,r,u,a){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(It(t,r,{bbox:u,id:a}),n,0)===!1?!1:void 0}var g;switch(s){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var h=0;h<t.coordinates.length;h++){var b=t.coordinates[h],S={type:g,coordinates:b};if(e(It(S,r),n,h)===!1)return!1}})}function Gr(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return Ui(i,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}var qi=Gr,Br=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,$t=Math.ceil,Ne=Math.floor,we="[BigNumber Error] ",Vi=we+"Number primitive has more than 15 significant digits: ",Pe=1e14,U=14,ji=9007199254740991,ei=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Xe=1e7,Le=1e9;function Hi(i){var e,t,n,r=_.prototype={constructor:_,toString:null,valueOf:null},u=new _(1),a=20,s=4,g=-7,h=21,b=-1e7,S=1e7,M=!1,k=1,N=0,C={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},O="0123456789abcdefghijklmnopqrstuvwxyz",A=!0;function _(o,l){var f,m,c,v,p,d,y,w,E=this;if(!(E instanceof _))return new _(o,l);if(l==null){if(o&&o._isBigNumber===!0){E.s=o.s,!o.c||o.e>S?E.c=E.e=null:o.e<b?E.c=[E.e=0]:(E.e=o.e,E.c=o.c.slice());return}if((d=typeof o=="number")&&o*0==0){if(E.s=1/o<0?(o=-o,-1):1,o===~~o){for(v=0,p=o;p>=10;p/=10,v++);v>S?E.c=E.e=null:(E.e=v,E.c=[o]);return}w=String(o)}else{if(!Br.test(w=String(o)))return n(E,w,d);E.s=w.charCodeAt(0)==45?(w=w.slice(1),-1):1}(v=w.indexOf("."))>-1&&(w=w.replace(".","")),(p=w.search(/e/i))>0?(v<0&&(v=p),v+=+w.slice(p+1),w=w.substring(0,p)):v<0&&(v=w.length)}else{if(oe(l,2,O.length,"Base"),l==10&&A)return E=new _(o),D(E,a+E.e+1,s);if(w=String(o),d=typeof o=="number"){if(o*0!=0)return n(E,w,d,l);if(E.s=1/o<0?(w=w.slice(1),-1):1,_.DEBUG&&w.replace(/^0\.0*|\./,"").length>15)throw Error(Vi+o)}else E.s=w.charCodeAt(0)===45?(w=w.slice(1),-1):1;for(f=O.slice(0,l),v=p=0,y=w.length;p<y;p++)if(f.indexOf(m=w.charAt(p))<0){if(m=="."){if(p>v){v=y;continue}}else if(!c&&(w==w.toUpperCase()&&(w=w.toLowerCase())||w==w.toLowerCase()&&(w=w.toUpperCase()))){c=!0,p=-1,v=0;continue}return n(E,String(o),d,l)}d=!1,w=t(w,l,10,E.s),(v=w.indexOf("."))>-1?w=w.replace(".",""):v=w.length}for(p=0;w.charCodeAt(p)===48;p++);for(y=w.length;w.charCodeAt(--y)===48;);if(w=w.slice(p,++y)){if(y-=p,d&&_.DEBUG&&y>15&&(o>ji||o!==Ne(o)))throw Error(Vi+E.s*o);if((v=v-p-1)>S)E.c=E.e=null;else if(v<b)E.c=[E.e=0];else{if(E.e=v,E.c=[],p=(v+1)%U,v<0&&(p+=U),p<y){for(p&&E.c.push(+w.slice(0,p)),y-=U;p<y;)E.c.push(+w.slice(p,p+=U));p=U-(w=w.slice(p)).length}else p-=y;for(;p--;w+="0");E.c.push(+w)}}else E.c=[E.e=0]}_.clone=Hi,_.ROUND_UP=0,_.ROUND_DOWN=1,_.ROUND_CEIL=2,_.ROUND_FLOOR=3,_.ROUND_HALF_UP=4,_.ROUND_HALF_DOWN=5,_.ROUND_HALF_EVEN=6,_.ROUND_HALF_CEIL=7,_.ROUND_HALF_FLOOR=8,_.EUCLID=9,_.config=_.set=function(o){var l,f;if(o!=null)if(typeof o=="object"){if(o.hasOwnProperty(l="DECIMAL_PLACES")&&(f=o[l],oe(f,0,Le,l),a=f),o.hasOwnProperty(l="ROUNDING_MODE")&&(f=o[l],oe(f,0,8,l),s=f),o.hasOwnProperty(l="EXPONENTIAL_AT")&&(f=o[l],f&&f.pop?(oe(f[0],-1e9,0,l),oe(f[1],0,Le,l),g=f[0],h=f[1]):(oe(f,-1e9,Le,l),g=-(h=f<0?-f:f))),o.hasOwnProperty(l="RANGE"))if(f=o[l],f&&f.pop)oe(f[0],-1e9,-1,l),oe(f[1],1,Le,l),b=f[0],S=f[1];else if(oe(f,-1e9,Le,l),f)b=-(S=f<0?-f:f);else throw Error(we+l+" cannot be zero: "+f);if(o.hasOwnProperty(l="CRYPTO"))if(f=o[l],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))M=f;else throw M=!f,Error(we+"crypto unavailable");else M=f;else throw Error(we+l+" not true or false: "+f);if(o.hasOwnProperty(l="MODULO_MODE")&&(f=o[l],oe(f,0,9,l),k=f),o.hasOwnProperty(l="POW_PRECISION")&&(f=o[l],oe(f,0,Le,l),N=f),o.hasOwnProperty(l="FORMAT"))if(f=o[l],typeof f=="object")C=f;else throw Error(we+l+" not an object: "+f);if(o.hasOwnProperty(l="ALPHABET"))if(f=o[l],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))A=f.slice(0,10)=="0123456789",O=f;else throw Error(we+l+" invalid: "+f)}else throw Error(we+"Object expected: "+o);return{DECIMAL_PLACES:a,ROUNDING_MODE:s,EXPONENTIAL_AT:[g,h],RANGE:[b,S],CRYPTO:M,MODULO_MODE:k,POW_PRECISION:N,FORMAT:C,ALPHABET:O}},_.isBigNumber=function(o){if(!o||o._isBigNumber!==!0)return!1;if(!_.DEBUG)return!0;var l,f,m=o.c,c=o.e,v=o.s;e:if({}.toString.call(m)=="[object Array]"){if((v===1||v===-1)&&c>=-1e9&&c<=Le&&c===Ne(c)){if(m[0]===0){if(c===0&&m.length===1)return!0;break e}if(l=(c+1)%U,l<1&&(l+=U),String(m[0]).length==l){for(l=0;l<m.length;l++)if(f=m[l],f<0||f>=Pe||f!==Ne(f))break e;if(f!==0)return!0}}}else if(m===null&&c===null&&(v===null||v===1||v===-1))return!0;throw Error(we+"Invalid BigNumber: "+o)},_.maximum=_.max=function(){return F(arguments,-1)},_.minimum=_.min=function(){return F(arguments,1)},_.random=function(){var o=9007199254740992,l=Math.random()*o&2097151?function(){return Ne(Math.random()*o)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var m,c,v,p,d,y=0,w=[],E=new _(u);if(f==null?f=a:oe(f,0,Le),p=$t(f/U),M)if(crypto.getRandomValues){for(m=crypto.getRandomValues(new Uint32Array(p*=2));y<p;)d=m[y]*131072+(m[y+1]>>>11),d>=9e15?(c=crypto.getRandomValues(new Uint32Array(2)),m[y]=c[0],m[y+1]=c[1]):(w.push(d%1e14),y+=2);y=p/2}else if(crypto.randomBytes){for(m=crypto.randomBytes(p*=7);y<p;)d=(m[y]&31)*281474976710656+m[y+1]*1099511627776+m[y+2]*4294967296+m[y+3]*16777216+(m[y+4]<<16)+(m[y+5]<<8)+m[y+6],d>=9e15?crypto.randomBytes(7).copy(m,y):(w.push(d%1e14),y+=7);y=p/7}else throw M=!1,Error(we+"crypto unavailable");if(!M)for(;y<p;)d=l(),d<9e15&&(w[y++]=d%1e14);for(p=w[--y],f%=U,p&&f&&(d=ei[U-f],w[y]=Ne(p/d)*d);w[y]===0;w.pop(),y--);if(y<0)w=[v=0];else{for(v=-1;w[0]===0;w.splice(0,1),v-=U);for(y=1,d=w[0];d>=10;d/=10,y++);y<U&&(v-=U-y)}return E.e=v,E.c=w,E}}(),_.sum=function(){for(var o=1,l=arguments,f=new _(l[0]);o<l.length;)f=f.plus(l[o++]);return f},t=function(){var o="0123456789";function l(f,m,c,v){for(var p,d=[0],y,w=0,E=f.length;w<E;){for(y=d.length;y--;d[y]*=m);for(d[0]+=v.indexOf(f.charAt(w++)),p=0;p<d.length;p++)d[p]>c-1&&(d[p+1]==null&&(d[p+1]=0),d[p+1]+=d[p]/c|0,d[p]%=c)}return d.reverse()}return function(f,m,c,v,p){var d,y,w,E,T,I,B,j,Y=f.indexOf("."),ne=a,V=s;for(Y>=0&&(E=N,N=0,f=f.replace(".",""),j=new _(m),I=j.pow(f.length-Y),N=E,j.c=l(Ve(ke(I.c),I.e,"0"),10,c,o),j.e=j.c.length),B=l(f,m,c,p?(d=O,o):(d=o,O)),w=E=B.length;B[--E]==0;B.pop());if(!B[0])return d.charAt(0);if(Y<0?--w:(I.c=B,I.e=w,I.s=v,I=e(I,j,ne,V,c),B=I.c,T=I.r,w=I.e),y=w+ne+1,Y=B[y],E=c/2,T=T||y<0||B[y+1]!=null,T=V<4?(Y!=null||T)&&(V==0||V==(I.s<0?3:2)):Y>E||Y==E&&(V==4||T||V==6&&B[y-1]&1||V==(I.s<0?8:7)),y<1||!B[0])f=T?Ve(d.charAt(1),-ne,d.charAt(0)):d.charAt(0);else{if(B.length=y,T)for(--c;++B[--y]>c;)B[y]=0,y||(++w,B=[1].concat(B));for(E=B.length;!B[--E];);for(Y=0,f="";Y<=E;f+=d.charAt(B[Y++]));f=Ve(f,w,d.charAt(0))}return f}}(),e=function(){function o(m,c,v){var p,d,y,w,E=0,T=m.length,I=c%Xe,B=c/Xe|0;for(m=m.slice();T--;)y=m[T]%Xe,w=m[T]/Xe|0,p=B*y+w*I,d=I*y+p%Xe*Xe+E,E=(d/v|0)+(p/Xe|0)+B*w,m[T]=d%v;return E&&(m=[E].concat(m)),m}function l(m,c,v,p){var d,y;if(v!=p)y=v>p?1:-1;else for(d=y=0;d<v;d++)if(m[d]!=c[d]){y=m[d]>c[d]?1:-1;break}return y}function f(m,c,v,p){for(var d=0;v--;)m[v]-=d,d=m[v]<c[v]?1:0,m[v]=d*p+m[v]-c[v];for(;!m[0]&&m.length>1;m.splice(0,1));}return function(m,c,v,p,d){var y,w,E,T,I,B,j,Y,ne,V,Z,ge,He,ot,lt,Se,Ge,ye=m.s==c.s?1:-1,me=m.c,ee=c.c;if(!me||!me[0]||!ee||!ee[0])return new _(!m.s||!c.s||(me?ee&&me[0]==ee[0]:!ee)?NaN:me&&me[0]==0||!ee?ye*0:ye/0);for(Y=new _(ye),ne=Y.c=[],w=m.e-c.e,ye=v+w+1,d||(d=Pe,w=Ce(m.e/U)-Ce(c.e/U),ye=ye/U|0),E=0;ee[E]==(me[E]||0);E++);if(ee[E]>(me[E]||0)&&w--,ye<0)ne.push(1),T=!0;else{for(ot=me.length,Se=ee.length,E=0,ye+=2,I=Ne(d/(ee[0]+1)),I>1&&(ee=o(ee,I,d),me=o(me,I,d),Se=ee.length,ot=me.length),He=Se,V=me.slice(0,Se),Z=V.length;Z<Se;V[Z++]=0);Ge=ee.slice(),Ge=[0].concat(Ge),lt=ee[0],ee[1]>=d/2&<++;do{if(I=0,y=l(ee,V,Se,Z),y<0){if(ge=V[0],Se!=Z&&(ge=ge*d+(V[1]||0)),I=Ne(ge/lt),I>1)for(I>=d&&(I=d-1),B=o(ee,I,d),j=B.length,Z=V.length;l(B,V,j,Z)==1;)I--,f(B,Se<j?Ge:ee,j,d),j=B.length,y=1;else I==0&&(y=I=1),B=ee.slice(),j=B.length;if(j<Z&&(B=[0].concat(B)),f(V,B,Z,d),Z=V.length,y==-1)for(;l(ee,V,Se,Z)<1;)I++,f(V,Se<Z?Ge:ee,Z,d),Z=V.length}else y===0&&(I++,V=[0]);ne[E++]=I,V[0]?V[Z++]=me[He]||0:(V=[me[He]],Z=1)}while((He++<ot||V[0]!=null)&&ye--);T=V[0]!=null,ne[0]||ne.splice(0,1)}if(d==Pe){for(E=1,ye=ne[0];ye>=10;ye/=10,E++);D(Y,v+(Y.e=E+w*U-1)+1,p,T)}else Y.e=w,Y.r=+T;return Y}}();function R(o,l,f,m){var c,v,p,d,y;if(f==null?f=s:oe(f,0,8),!o.c)return o.toString();if(c=o.c[0],p=o.e,l==null)y=ke(o.c),y=m==1||m==2&&(p<=g||p>=h)?Gt(y,p):Ve(y,p,"0");else if(o=D(new _(o),l,f),v=o.e,y=ke(o.c),d=y.length,m==1||m==2&&(l<=v||v<=g)){for(;d<l;y+="0",d++);y=Gt(y,v)}else if(l-=p,y=Ve(y,v,"0"),v+1>d){if(--l>0)for(y+=".";l--;y+="0");}else if(l+=v-d,l>0)for(v+1==d&&(y+=".");l--;y+="0");return o.s<0&&c?"-"+y:y}function F(o,l){for(var f,m,c=1,v=new _(o[0]);c<o.length;c++)m=new _(o[c]),(!m.s||(f=rt(v,m))===l||f===0&&v.s===l)&&(v=m);return v}function K(o,l,f){for(var m=1,c=l.length;!l[--c];l.pop());for(c=l[0];c>=10;c/=10,m++);return(f=m+f*U-1)>S?o.c=o.e=null:f<b?o.c=[o.e=0]:(o.e=f,o.c=l),o}n=function(){var o=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,f=/^\.([^.]+)$/,m=/^-?(Infinity|NaN)$/,c=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(v,p,d,y){var w,E=d?p:p.replace(c,"");if(m.test(E))v.s=isNaN(E)?null:E<0?-1:1;else{if(!d&&(E=E.replace(o,function(T,I,B){return w=(B=B.toLowerCase())=="x"?16:B=="b"?2:8,!y||y==w?I:T}),y&&(w=y,E=E.replace(l,"$1").replace(f,"0.$1")),p!=E))return new _(E,w);if(_.DEBUG)throw Error(we+"Not a"+(y?" base "+y:"")+" number: "+p);v.s=null}v.c=v.e=null}}();function D(o,l,f,m){var c,v,p,d,y,w,E,T=o.c,I=ei;if(T){e:{for(c=1,d=T[0];d>=10;d/=10,c++);if(v=l-c,v<0)v+=U,p=l,y=T[w=0],E=Ne(y/I[c-p-1]%10);else if(w=$t((v+1)/U),w>=T.length)if(m){for(;T.length<=w;T.push(0));y=E=0,c=1,v%=U,p=v-U+1}else break e;else{for(y=d=T[w],c=1;d>=10;d/=10,c++);v%=U,p=v-U+c,E=p<0?0:Ne(y/I[c-p-1]%10)}if(m=m||l<0||T[w+1]!=null||(p<0?y:y%I[c-p-1]),m=f<4?(E||m)&&(f==0||f==(o.s<0?3:2)):E>5||E==5&&(f==4||m||f==6&&(v>0?p>0?y/I[c-p]:0:T[w-1])%10&1||f==(o.s<0?8:7)),l<1||!T[0])return T.length=0,m?(l-=o.e+1,T[0]=I[(U-l%U)%U],o.e=-l||0):T[0]=o.e=0,o;if(v==0?(T.length=w,d=1,w--):(T.length=w+1,d=I[U-v],T[w]=p>0?Ne(y/I[c-p]%I[p])*d:0),m)for(;;)if(w==0){for(v=1,p=T[0];p>=10;p/=10,v++);for(p=T[0]+=d,d=1;p>=10;p/=10,d++);v!=d&&(o.e++,T[0]==Pe&&(T[0]=1));break}else{if(T[w]+=d,T[w]!=Pe)break;T[w--]=0,d=1}for(v=T.length;T[--v]===0;T.pop());}o.e>S?o.c=o.e=null:o.e<b&&(o.c=[o.e=0])}return o}function G(o){var l,f=o.e;return f===null?o.toString():(l=ke(o.c),l=f<=g||f>=h?Gt(l,f):Ve(l,f,"0"),o.s<0?"-"+l:l)}return r.absoluteValue=r.abs=function(){var o=new _(this);return o.s<0&&(o.s=1),o},r.comparedTo=function(o,l){return rt(this,new _(o,l))},r.decimalPlaces=r.dp=function(o,l){var f,m,c,v=this;if(o!=null)return oe(o,0,Le),l==null?l=s:oe(l,0,8),D(new _(v),o+v.e+1,l);if(!(f=v.c))return null;if(m=((c=f.length-1)-Ce(this.e/U))*U,c=f[c])for(;c%10==0;c/=10,m--);return m<0&&(m=0),m},r.dividedBy=r.div=function(o,l){return e(this,new _(o,l),a,s)},r.dividedToIntegerBy=r.idiv=function(o,l){return e(this,new _(o,l),0,1)},r.exponentiatedBy=r.pow=function(o,l){var f,m,c,v,p,d,y,w,E,T=this;if(o=new _(o),o.c&&!o.isInteger())throw Error(we+"Exponent not an integer: "+G(o));if(l!=null&&(l=new _(l)),d=o.e>14,!T.c||!T.c[0]||T.c[0]==1&&!T.e&&T.c.length==1||!o.c||!o.c[0])return E=new _(Math.pow(+G(T),d?o.s*(2-At(o)):+G(o))),l?E.mod(l):E;if(y=o.s<0,l){if(l.c?!l.c[0]:!l.s)return new _(NaN);m=!y&&T.isInteger()&&l.isInteger(),m&&(T=T.mod(l))}else{if(o.e>9&&(T.e>0||T.e<-1||(T.e==0?T.c[0]>1||d&&T.c[1]>=24e7:T.c[0]<8e13||d&&T.c[0]<=9999975e7)))return v=T.s<0&&At(o)?-0:0,T.e>-1&&(v=1/v),new _(y?1/v:v);N&&(v=$t(N/U+2))}for(d?(f=new _(.5),y&&(o.s=1),w=At(o)):(c=Math.abs(+G(o)),w=c%2),E=new _(u);;){if(w){if(E=E.times(T),!E.c)break;v?E.c.length>v&&(E.c.length=v):m&&(E=E.mod(l))}if(c){if(c=Ne(c/2),c===0)break;w=c%2}else if(o=o.times(f),D(o,o.e+1,1),o.e>14)w=At(o);else{if(c=+G(o),c===0)break;w=c%2}T=T.times(T),v?T.c&&T.c.length>v&&(T.c.length=v):m&&(T=T.mod(l))}return m?E:(y&&(E=u.div(E)),l?E.mod(l):v?D(E,N,s,p):E)},r.integerValue=function(o){var l=new _(this);return o==null?o=s:oe(o,0,8),D(l,l.e+1,o)},r.isEqualTo=r.eq=function(o,l){return rt(this,new _(o,l))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(o,l){return rt(this,new _(o,l))>0},r.isGreaterThanOrEqualTo=r.gte=function(o,l){return(l=rt(this,new _(o,l)))===1||l===0},r.isInteger=function(){return!!this.c&&Ce(this.e/U)>this.c.length-2},r.isLessThan=r.lt=function(o,l){return rt(this,new _(o,l))<0},r.isLessThanOrEqualTo=r.lte=function(o,l){return(l=rt(this,new _(o,l)))===-1||l===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(o,l){var f,m,c,v,p=this,d=p.s;if(o=new _(o,l),l=o.s,!d||!l)return new _(NaN);if(d!=l)return o.s=-l,p.plus(o);var y=p.e/U,w=o.e/U,E=p.c,T=o.c;if(!y||!w){if(!E||!T)return E?(o.s=-l,o):new _(T?p:NaN);if(!E[0]||!T[0])return T[0]?(o.s=-l,o):new _(E[0]?p:s==3?-0:0)}if(y=Ce(y),w=Ce(w),E=E.slice(),d=y-w){for((v=d<0)?(d=-d,c=E):(w=y,c=T),c.reverse(),l=d;l--;c.push(0));c.reverse()}else for(m=(v=(d=E.length)<(l=T.length))?d:l,d=l=0;l<m;l++)if(E[l]!=T[l]){v=E[l]<T[l];break}if(v&&(c=E,E=T,T=c,o.s=-o.s),l=(m=T.length)-(f=E.length),l>0)for(;l--;E[f++]=0);for(l=Pe-1;m>d;){if(E[--m]<T[m]){for(f=m;f&&!E[--f];E[f]=l);--E[f],E[m]+=Pe}E[m]-=T[m]}for(;E[0]==0;E.splice(0,1),--w);return E[0]?K(o,E,w):(o.s=s==3?-1:1,o.c=[o.e=0],o)},r.modulo=r.mod=function(o,l){var f,m,c=this;return o=new _(o,l),!c.c||!o.s||o.c&&!o.c[0]?new _(NaN):!o.c||c.c&&!c.c[0]?new _(c):(k==9?(m=o.s,o.s=1,f=e(c,o,0,3),o.s=m,f.s*=m):f=e(c,o,0,k),o=c.minus(f.times(o)),!o.c[0]&&k==1&&(o.s=c.s),o)},r.multipliedBy=r.times=function(o,l){var f,m,c,v,p,d,y,w,E,T,I,B,j,Y,ne,V=this,Z=V.c,ge=(o=new _(o,l)).c;if(!Z||!ge||!Z[0]||!ge[0])return!V.s||!o.s||Z&&!Z[0]&&!ge||ge&&!ge[0]&&!Z?o.c=o.e=o.s=null:(o.s*=V.s,!Z||!ge?o.c=o.e=null:(o.c=[0],o.e=0)),o;for(m=Ce(V.e/U)+Ce(o.e/U),o.s*=V.s,y=Z.length,T=ge.length,y<T&&(j=Z,Z=ge,ge=j,c=y,y=T,T=c),c=y+T,j=[];c--;j.push(0));for(Y=Pe,ne=Xe,c=T;--c>=0;){for(f=0,I=ge[c]%ne,B=ge[c]/ne|0,p=y,v=c+p;v>c;)w=Z[--p]%ne,E=Z[p]/ne|0,d=B*w+E*I,w=I*w+d%ne*ne+j[v]+f,f=(w/Y|0)+(d/ne|0)+B*E,j[v--]=w%Y;j[v]=f}return f?++m:j.splice(0,1),K(o,j,m)},r.negated=function(){var o=new _(this);return o.s=-o.s||null,o},r.plus=function(o,l){var f,m=this,c=m.s;if(o=new _(o,l),l=o.s,!c||!l)return new _(NaN);if(c!=l)return o.s=-l,m.minus(o);var v=m.e/U,p=o.e/U,d=m.c,y=o.c;if(!v||!p){if(!d||!y)return new _(c/0);if(!d[0]||!y[0])return y[0]?o:new _(d[0]?m:c*0)}if(v=Ce(v),p=Ce(p),d=d.slice(),c=v-p){for(c>0?(p=v,f=y):(c=-c,f=d),f.reverse();c--;f.push(0));f.reverse()}for(c=d.length,l=y.length,c-l<0&&(f=y,y=d,d=f,l=c),c=0;l;)c=(d[--l]=d[l]+y[l]+c)/Pe|0,d[l]=Pe===d[l]?0:d[l]%Pe;return c&&(d=[c].concat(d),++p),K(o,d,p)},r.precision=r.sd=function(o,l){var f,m,c,v=this;if(o!=null&&o!==!!o)return oe(o,1,Le),l==null?l=s:oe(l,0,8),D(new _(v),o,l);if(!(f=v.c))return null;if(c=f.length-1,m=c*U+1,c=f[c]){for(;c%10==0;c/=10,m--);for(c=f[0];c>=10;c/=10,m++);}return o&&v.e+1>m&&(m=v.e+1),m},r.shiftedBy=function(o){return oe(o,-9007199254740991,ji),this.times("1e"+o)},r.squareRoot=r.sqrt=function(){var o,l,f,m,c,v=this,p=v.c,d=v.s,y=v.e,w=a+4,E=new _("0.5");if(d!==1||!p||!p[0])return new _(!d||d<0&&(!p||p[0])?NaN:p?v:1/0);if(d=Math.sqrt(+G(v)),d==0||d==1/0?(l=ke(p),(l.length+y)%2==0&&(l+="0"),d=Math.sqrt(+l),y=Ce((y+1)/2)-(y<0||y%2),d==1/0?l="5e"+y:(l=d.toExponential(),l=l.slice(0,l.indexOf("e")+1)+y),f=new _(l)):f=new _(d+""),f.c[0]){for(y=f.e,d=y+w,d<3&&(d=0);;)if(c=f,f=E.times(c.plus(e(v,c,w,1))),ke(c.c).slice(0,d)===(l=ke(f.c)).slice(0,d))if(f.e<y&&--d,l=l.slice(d-3,d+1),l=="9999"||!m&&l=="4999"){if(!m&&(D(c,c.e+a+2,0),c.times(c).eq(v))){f=c;break}w+=4,d+=4,m=1}else{(!+l||!+l.slice(1)&&l.charAt(0)=="5")&&(D(f,f.e+a+2,1),o=!f.times(f).eq(v));break}}return D(f,f.e+a+1,s,o)},r.toExponential=function(o,l){return o!=null&&(oe(o,0,Le),o++),R(this,o,l,1)},r.toFixed=function(o,l){return o!=null&&(oe(o,0,Le),o=o+this.e+1),R(this,o,l)},r.toFormat=function(o,l,f){var m,c=this;if(f==null)o!=null&&l&&typeof l=="object"?(f=l,l=null):o&&typeof o=="object"?(f=o,o=l=null):f=C;else if(typeof f!="object")throw Error(we+"Argument not an object: "+f);if(m=c.toFixed(o,l),c.c){var v,p=m.split("."),d=+f.groupSize,y=+f.secondaryGroupSize,w=f.groupSeparator||"",E=p[0],T=p[1],I=c.s<0,B=I?E.slice(1):E,j=B.length;if(y&&(v=d,d=y,y=v,j-=v),d>0&&j>0){for(v=j%d||d,E=B.substr(0,v);v<j;v+=d)E+=w+B.substr(v,d);y>0&&(E+=w+B.slice(v)),I&&(E="-"+E)}m=T?E+(f.decimalSeparator||"")+((y=+f.fractionGroupSize)?T.replace(new RegExp("\\d{"+y+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):T):E}return(f.prefix||"")+m+(f.suffix||"")},r.toFraction=function(o){var l,f,m,c,v,p,d,y,w,E,T,I,B=this,j=B.c;if(o!=null&&(d=new _(o),!d.isInteger()&&(d.c||d.s!==1)||d.lt(u)))throw Error(we+"Argument "+(d.isInteger()?"out of range: ":"not an integer: ")+G(d));if(!j)return new _(B);for(l=new _(u),w=f=new _(u),m=y=new _(u),I=ke(j),v=l.e=I.length-B.e-1,l.c[0]=ei[(p=v%U)<0?U+p:p],o=!o||d.comparedTo(l)>0?v>0?l:w:d,p=S,S=1/0,d=new _(I),y.c[0]=0;E=e(d,l,0,1),c=f.plus(E.times(m)),c.comparedTo(o)!=1;)f=m,m=c,w=y.plus(E.times(c=w)),y=c,l=d.minus(E.times(c=l)),d=c;return c=e(o.minus(f),m,0,1),y=y.plus(c.times(w)),f=f.plus(c.times(m)),y.s=w.s=B.s,v=v*2,T=e(w,m,v,s).minus(B).abs().comparedTo(e(y,f,v,s).minus(B).abs())<1?[w,m]:[y,f],S=p,T},r.toNumber=function(){return+G(this)},r.toPrecision=function(o,l){return o!=null&&oe(o,1,Le),R(this,o,l,2)},r.toString=function(o){var l,f=this,m=f.s,c=f.e;return c===null?m?(l="Infinity",m<0&&(l="-"+l)):l="NaN":(o==null?l=c<=g||c>=h?Gt(ke(f.c),c):Ve(ke(f.c),c,"0"):o===10&&A?(f=D(new _(f),a+c+1,s),l=Ve(ke(f.c),f.e,"0")):(oe(o,2,O.length,"Base"),l=t(Ve(ke(f.c),c,"0"),10,o,m,!0)),m<0&&f.c[0]&&(l="-"+l)),l},r.valueOf=r.toJSON=function(){return G(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,i!=null&&_.set(i),_}function Ce(i){var e=i|0;return i>0||i===e?e:e-1}function ke(i){for(var e,t,n=1,r=i.length,u=i[0]+"";n<r;){for(e=i[n++]+"",t=U-e.length;t--;e="0"+e);u+=e}for(r=u.length;u.charCodeAt(--r)===48;);return u.slice(0,r+1||1)}function rt(i,e){var t,n,r=i.c,u=e.c,a=i.s,s=e.s,g=i.e,h=e.e;if(!a||!s)return null;if(t=r&&!r[0],n=u&&!u[0],t||n)return t?n?0:-s:a;if(a!=s)return a;if(t=a<0,n=g==h,!r||!u)return n?0:!r^t?1:-1;if(!n)return g>h^t?1:-1;for(s=(g=r.length)<(h=u.length)?g:h,a=0;a<s;a++)if(r[a]!=u[a])return r[a]>u[a]^t?1:-1;return g==h?0:g>h^t?1:-1}function oe(i,e,t,n){if(i<e||i>t||i!==Ne(i))throw Error(we+(n||"Argument")+(typeof i=="number"?i<e||i>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function At(i){var e=i.c.length-1;return Ce(i.e/U)==e&&i.c[e]%2!=0}function Gt(i,e){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(e<0?"e":"e+")+e}function Ve(i,e,t){var n,r;if(e<0){for(r=t+".";++e;r+=t);i=r+i}else if(n=i.length,++e>n){for(r=t,e-=n;--e;r+=t);i+=r}else e<n&&(i=i.slice(0,e)+"."+i.slice(e));return i}var Ie=Hi(),zr=class{constructor(i){P(this,"key");P(this,"left",null);P(this,"right",null);this.key=i}},wt=class extends zr{constructor(i){super(i)}},Wr=class{constructor(){P(this,"size",0);P(this,"modificationCount",0);P(this,"splayCount",0)}splay(i){const e=this.root;if(e==null)return this.compare(i,i),-1;let t=null,n=null,r=null,u=null,a=e;const s=this.compare;let g;for(;;)if(g=s(a.key,i),g>0){let h=a.left;if(h==null||(g=s(h.key,i),g>0&&(a.left=h.right,h.right=a,a=h,h=a.left,h==null)))break;t==null?n=a:t.left=a,t=a,a=h}else if(g<0){let h=a.right;if(h==null||(g=s(h.key,i),g<0&&(a.right=h.left,h.left=a,a=h,h=a.right,h==null)))break;r==null?u=a:r.right=a,r=a,a=h}else break;return r!=null&&(r.right=a.left,a.left=u),t!=null&&(t.left=a.right,a.right=n),this.root!==a&&(this.root=a,this.splayCount++),g}splayMin(i){let e=i,t=e.left;for(;t!=null;){const n=t;e.left=n.right,n.right=e,e=n,t=e.left}return e}splayMax(i){let e=i,t=e.right;for(;t!=null;){const n=t;e.right=n.left,n.left=e,e=n,t=e.right}return e}_delete(i){if(this.root==null||this.splay(i)!=0)return null;let t=this.root;const n=t,r=t.left;if(this.size--,r==null)this.root=t.right;else{const u=t.right;t=this.splayMax(r),t.right=u,this.root=t}return this.modificationCount++,n}addNewRoot(i,e){this.size++,this.modificationCount++;const t=this.root;if(t==null){this.root=i;return}e<0?(i.left=t,i.right=t.right,t.right=null):(i.right=t,i.left=t.left,t.left=null),this.root=i}_first(){const i=this.root;return i==null?null:(this.root=this.splayMin(i),this.root)}_last(){const i=this.root;return i==null?null:(this.root=this.splayMax(i),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(i){return this.validKey(i)&&this.splay(i)==0}defaultCompare(){return(i,e)=>i<e?-1:i>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:i=>{this.root=i},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:i=>{this.splayCount=i},splay:i=>this.splay(i),has:i=>this.has(i)}}},Bt=class Mt extends Wr{constructor(t,n){super();P(this,"root",null);P(this,"compare");P(this,"validKey");P(this,dn,"[object Set]");this.compare=t??this.defaultCompare(),this.validKey=n??(r=>r!=null&&r!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(const n of t)this.delete(n)}forEach(t){const n=this[Symbol.iterator]();let r;for(;r=n.next(),!r.done;)t(r.value,r.value,this)}add(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new wt(t),n),this}addAndReturn(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new wt(t),n),this.root.key}addAll(t){for(const n of t)this.add(n)}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(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<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(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>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(t){const n=new Mt(this.compare,this.validKey),r=this.modificationCount;for(const u of t){if(r!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(u)&&this.splay(u)==0&&n.add(this.root.key)}n.size!=this.size&&(this.root=n.root,this.size=n.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){const n=new Mt(this.compare,this.validKey);for(const r of this)t.has(r)&&n.add(r);return n}difference(t){const n=new Mt(this.compare,this.validKey);for(const r of this)t.has(r)||n.add(r);return n}union(t){const n=this.clone();return n.addAll(t),n}clone(){const t=new Mt(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function n(u,a){let s,g;do{if(s=u.left,g=u.right,s!=null){const h=new wt(s.key);a.left=h,n(s,h)}if(g!=null){const h=new wt(g.key);a.right=h,u=g,a=h}}while(g!=null)}const r=new wt(t.key);return n(t,r),r}toSet(){return this.clone()}entries(){return new Dr(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(gn=Symbol.iterator,dn=Symbol.toStringTag,gn)](){return new Fr(this.wrap())}},Zi=class{constructor(i){P(this,"tree");P(this,"path",new Array);P(this,"modificationCount",null);P(this,"splayCount");this.tree=i,this.splayCount=i.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 i=this.path[this.path.length-1];return this.getValue(i)}rebuildPath(i){this.path.splice(0,this.path.length),this.tree.splay(i),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(i){for(;i!=null;)this.path.push(i),i=i.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let t=this.tree.getRoot();for(;t!=null;)this.path.push(t),t=t.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 i=this.path[this.path.length-1],e=i.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===i;)i=this.path.pop();return this.path.length>0}},Fr=class extends Zi{getValue(i){return i.key}},Dr=class extends Zi{getValue(i){return[i.key,i.key]}},Ki=i=>()=>i,ti=i=>{const e=i?(t,n)=>n.minus(t).abs().isLessThanOrEqualTo(i):Ki(!1);return(t,n)=>e(t,n)?0:t.comparedTo(n)};function Ur(i){const e=i?(t,n,r,u,a)=>t.exponentiatedBy(2).isLessThanOrEqualTo(u.minus(n).exponentiatedBy(2).plus(a.minus(r).exponentiatedBy(2)).times(i)):Ki(!1);return(t,n,r)=>{const u=t.x,a=t.y,s=r.x,g=r.y,h=a.minus(g).times(n.x.minus(s)).minus(u.minus(s).times(n.y.minus(g)));return e(h,u,a,s,g)?0:h.comparedTo(0)}}var qr=i=>i,Vr=i=>{if(i){const e=new Bt(ti(i)),t=new Bt(ti(i)),n=(u,a)=>a.addAndReturn(u),r=u=>({x:n(u.x,e),y:n(u.y,t)});return r({x:new Ie(0),y:new Ie(0)}),r}return qr},ii=i=>({set:e=>{je=ii(e)},reset:()=>ii(i),compare:ti(i),snap:Vr(i),orient:Ur(i)}),je=ii(),Et=(i,e)=>i.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(i.ur.x)&&i.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(i.ur.y),ni=(i,e)=>{if(e.ur.x.isLessThan(i.ll.x)||i.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(i.ll.y)||i.ur.y.isLessThan(e.ll.y))return null;const t=i.ll.x.isLessThan(e.ll.x)?e.ll.x:i.ll.x,n=i.ur.x.isLessThan(e.ur.x)?i.ur.x:e.ur.x,r=i.ll.y.isLessThan(e.ll.y)?e.ll.y:i.ll.y,u=i.ur.y.isLessThan(e.ur.y)?i.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:n,y:u}}},zt=(i,e)=>i.x.times(e.y).minus(i.y.times(e.x)),Yi=(i,e)=>i.x.times(e.x).plus(i.y.times(e.y)),Wt=i=>Yi(i,i).sqrt(),jr=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return zt(r,n).div(Wt(r)).div(Wt(n))},Hr=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return Yi(r,n).div(Wt(r)).div(Wt(n))},Qi=(i,e,t)=>e.y.isZero()?null:{x:i.x.plus(e.x.div(e.y).times(t.minus(i.y))),y:t},Xi=(i,e,t)=>e.x.isZero()?null:{x:t,y:i.y.plus(e.y.div(e.x).times(t.minus(i.x)))},Zr=(i,e,t,n)=>{if(e.x.isZero())return Xi(t,n,i.x);if(n.x.isZero())return Xi(i,e,t.x);if(e.y.isZero())return Qi(t,n,i.y);if(n.y.isZero())return Qi(i,e,t.y);const r=zt(e,n);if(r.isZero())return null;const u={x:t.x.minus(i.x),y:t.y.minus(i.y)},a=zt(u,e).div(r),s=zt(u,n).div(r),g=i.x.plus(s.times(e.x)),h=t.x.plus(a.times(n.x)),b=i.y.plus(s.times(e.y)),S=t.y.plus(a.times(n.y)),M=g.plus(h).div(2),k=b.plus(S).div(2);return{x:M,y:k}},Ae=class _n{constructor(e,t){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=t}static compare(e,t){const n=_n.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Dt.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x.isLessThan(t.x)?-1:e.x.isGreaterThan(t.x)?1:e.y.isLessThan(t.y)?-1:e.y.isGreaterThan(t.y)?1:0}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,r=t.length;n<r;n++){const u=t[n];this.point.events.push(u),u.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const u=this.point.events[r];u.consumedBy===void 0&&n.otherSE.point.events===u.otherSE.point.events&&n.segment.consume(u.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,n=r=>{const u=r.otherSE;t.set(r,{sine:jr(this.point,e.point,u.point),cosine:Hr(this.point,e.point,u.point)})};return(r,u)=>{t.has(r)||n(r),t.has(u)||n(u);const{sine:a,cosine:s}=t.get(r),{sine:g,cosine:h}=t.get(u);return a.isGreaterThanOrEqualTo(0)&&g.isGreaterThanOrEqualTo(0)?s.isLessThan(h)?1:s.isGreaterThan(h)?-1:0:a.isLessThan(0)&&g.isLessThan(0)?s.isLessThan(h)?-1:s.isGreaterThan(h)?1:0:g.isLessThan(a)?-1:g.isGreaterThan(a)?1:0}}},Kr=class gi{constructor(e){P(this,"events");P(this,"poly");P(this,"_isExteriorRing");P(this,"_enclosingRing");this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const u=e[n];if(!u.isInResult()||u.ringOut)continue;let a=null,s=u.leftSE,g=u.rightSE;const h=[s],b=s.point,S=[];for(;a=s,s=g,h.push(s),s.point!==b;)for(;;){const M=s.getAvailableLinkedEvents();if(M.length===0){const C=h[0].point,O=h[h.length-1].point;throw new Error(`Unable to complete output ring starting at [${C.x}, ${C.y}]. Last matching segment found ends at [${O.x}, ${O.y}].`)}if(M.length===1){g=M[0].otherSE;break}let k=null;for(let C=0,O=S.length;C<O;C++)if(S[C].point===s.point){k=C;break}if(k!==null){const C=S.splice(k)[0],O=h.splice(C.index);O.unshift(O[0].otherSE),t.push(new gi(O.reverse()));continue}S.push({index:h.length,point:s.point});const N=s.getLeftmostComparator(a);g=M.sort(N)[0].otherSE;break}t.push(new gi(h))}return t}getGeom(){let e=this.events[0].point;const t=[e];for(let h=1,b=this.events.length-1;h<b;h++){const S=this.events[h].point,M=this.events[h+1].point;je.orient(S,e,M)!==0&&(t.push(S),e=S)}if(t.length===1)return null;const n=t[0],r=t[1];je.orient(n,e,r)===0&&t.shift(),t.push(t[0]);const u=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,g=[];for(let h=a;h!=s;h+=u)g.push([t[h].x.toNumber(),t[h].y.toNumber()]);return g}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,s=this.events.length;a<s;a++){const g=this.events[a];Ae.compare(e,g)>0&&(e=g)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return((r=n.ringOut)==null?void 0:r.enclosingRing())!==t.ringOut?t.ringOut:(u=t.ringOut)==null?void 0:u.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}},Ji=class{constructor(i){P(this,"exteriorRing");P(this,"interiorRings");this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=this.exteriorRing.getGeom();if(i===null)return null;const e=[i];for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}},Yr=class{constructor(i){P(this,"rings");P(this,"polys");this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getGeom();n!==null&&i.push(n)}return i}_composePolys(i){var t;const e=[];for(let n=0,r=i.length;n<r;n++){const u=i[n];if(!u.poly)if(u.isExteriorRing())e.push(new Ji(u));else{const a=u.enclosingRing();a!=null&&a.poly||e.push(new Ji(a)),(t=a==null?void 0:a.poly)==null||t.addInterior(u)}}return e}},Qr=class{constructor(i,e=Dt.compare){P(this,"queue");P(this,"tree");P(this,"segments");this.queue=i,this.tree=new Bt(e),this.segments=[]}process(i){const e=i.segment,t=[];if(i.consumedBy)return i.isLeft?this.queue.delete(i.otherSE):this.tree.delete(e),t;i.isLeft&&this.tree.add(e);let n=e,r=e;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do r=this.tree.firstAfter(r);while(r!=null&&r.consumedBy!=null);if(i.isLeft){let u=null;if(n){const s=n.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(u=s),!n.isAnEndpoint(s))){const g=this._splitSafely(n,s);for(let h=0,b=g.length;h<b;h++)t.push(g[h])}}let a=null;if(r){const s=r.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(a=s),!r.isAnEndpoint(s))){const g=this._splitSafely(r,s);for(let h=0,b=g.length;h<b;h++)t.push(g[h])}}if(u!==null||a!==null){let s=null;u===null?s=a:a===null?s=u:s=Ae.comparePoints(u,a)<=0?u:a,this.queue.delete(e.rightSE),t.push(e.rightSE);const g=e.split(s);for(let h=0,b=g.length;h<b;h++)t.push(g[h])}t.length>0?(this.tree.delete(e),t.push(i)):(this.segments.push(e),e.prev=n)}else{if(n&&r){const u=n.getIntersection(r);if(u!==null){if(!n.isAnEndpoint(u)){const a=this._splitSafely(n,u);for(let s=0,g=a.length;s<g;s++)t.push(a[s])}if(!r.isAnEndpoint(u)){const a=this._splitSafely(r,u);for(let s=0,g=a.length;s<g;s++)t.push(a[s])}}}this.tree.delete(e)}return t}_splitSafely(i,e){this.tree.delete(i);const t=i.rightSE;this.queue.delete(t);const n=i.split(e);return n.push(t),i.consumedBy===void 0&&this.tree.add(i),n}},Xr=class{constructor(){P(this,"type");P(this,"numMultiPolys")}run(i,e,t){Lt.type=i;const n=[new en(e,!0)];for(let h=0,b=t.length;h<b;h++)n.push(new en(t[h],!1));if(Lt.numMultiPolys=n.length,Lt.type==="difference"){const h=n[0];let b=1;for(;b<n.length;)ni(n[b].bbox,h.bbox)!==null?b++:n.splice(b,1)}if(Lt.type==="intersection")for(let h=0,b=n.length;h<b;h++){const S=n[h];for(let M=h+1,k=n.length;M<k;M++)if(ni(S.bbox,n[M].bbox)===null)return[]}const r=new Bt(Ae.compare);for(let h=0,b=n.length;h<b;h++){const S=n[h].getSweepEvents();for(let M=0,k=S.length;M<k;M++)r.add(S[M])}const u=new Qr(r);let a=null;for(r.size!=0&&(a=r.first(),r.delete(a));a;){const h=u.process(a);for(let b=0,S=h.length;b<S;b++){const M=h[b];M.consumedBy===void 0&&r.add(M)}r.size!=0?(a=r.first(),r.delete(a)):a=null}je.reset();const s=Kr.factory(u.segments);return new Yr(s).getGeom()}},Lt=new Xr,Ft=Lt,Jr=0,Dt=class Vt{constructor(e,t,n,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=++Jr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,u=e.rightSE.point.x,a=t.rightSE.point.x;if(a.isLessThan(n))return 1;if(u.isLessThan(r))return-1;const s=e.leftSE.point.y,g=t.leftSE.point.y,h=e.rightSE.point.y,b=t.rightSE.point.y;if(n.isLessThan(r)){if(g.isLessThan(s)&&g.isLessThan(h))return 1;if(g.isGreaterThan(s)&&g.isGreaterThan(h))return-1;const S=e.comparePoint(t.leftSE.point);if(S<0)return 1;if(S>0)return-1;const M=t.comparePoint(e.rightSE.point);return M!==0?M:-1}if(n.isGreaterThan(r)){if(s.isLessThan(g)&&s.isLessThan(b))return-1;if(s.isGreaterThan(g)&&s.isGreaterThan(b))return 1;const S=t.comparePoint(e.leftSE.point);if(S!==0)return S;const M=e.comparePoint(t.rightSE.point);return M<0?1:M>0?-1:1}if(s.isLessThan(g))return-1;if(s.isGreaterThan(g))return 1;if(u.isLessThan(a)){const S=t.comparePoint(e.rightSE.point);if(S!==0)return S}if(u.isGreaterThan(a)){const S=e.comparePoint(t.rightSE.point);if(S<0)return 1;if(S>0)return-1}if(!u.eq(a)){const S=h.minus(s),M=u.minus(n),k=b.minus(g),N=a.minus(r);if(S.isGreaterThan(M)&&k.isLessThan(N))return 1;if(S.isLessThan(M)&&k.isGreaterThan(N))return-1}return u.isGreaterThan(a)?1:u.isLessThan(a)||h.isLessThan(b)?-1:h.isGreaterThan(b)?1:e.id<t.id?-1:e.id>t.id?1:0}static fromRing(e,t,n){let r,u,a;const s=Ae.comparePoints(e,t);if(s<0)r=e,u=t,a=1;else if(s>0)r=t,u=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const g=new Ae(r,!0),h=new Ae(u,!1);return new Vt(g,h,[n],[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,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e.isLessThan(t)?e:t},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(t)?e:t}}}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 je.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=ni(t,n);if(r===null)return null;const u=this.leftSE.point,a=this.rightSE.point,s=e.leftSE.point,g=e.rightSE.point,h=Et(t,s)&&this.comparePoint(s)===0,b=Et(n,u)&&e.comparePoint(u)===0,S=Et(t,g)&&this.comparePoint(g)===0,M=Et(n,a)&&e.comparePoint(a)===0;if(b&&h)return M&&!S?a:!M&&S?g:null;if(b)return S&&u.x.eq(g.x)&&u.y.eq(g.y)?null:u;if(h)return M&&a.x.eq(s.x)&&a.y.eq(s.y)?null:s;if(M&&S)return null;if(M)return a;if(S)return g;const k=Zr(u,this.vector(),s,e.vector());return k===null||!Et(r,k)?null:je.snap(k)}split(e){const t=[],n=e.events!==void 0,r=new Ae(e,!0),u=new Ae(e,!1),a=this.rightSE;this.replaceRightSE(u),t.push(u),t.push(r);const s=new Vt(r,a,this.rings.slice(),this.windings.slice());return Ae.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Ae.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),u.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=Vt.compare(t,n);if(r!==0){if(r>0){const u=t;t=n,n=u}if(t.prev===n){const u=t;t=n,n=u}for(let u=0,a=n.rings.length;u<a;u++){const s=n.rings[u],g=n.windings[u],h=t.rings.indexOf(s);h===-1?(t.rings.push(s),t.windings.push(g)):t.windings[h]+=g}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.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 t=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,g=this.rings.length;s<g;s++){const h=this.rings[s],b=this.windings[s],S=t.indexOf(h);S===-1?(t.push(h),n.push(b)):n[S]+=b}const u=[],a=[];for(let s=0,g=t.length;s<g;s++){if(n[s]===0)continue;const h=t[s],b=h.poly;if(a.indexOf(b)===-1)if(h.isExterior)u.push(b);else{a.indexOf(b)===-1&&a.push(b);const S=u.indexOf(h.poly);S!==-1&&u.splice(S,1)}}for(let s=0,g=u.length;s<g;s++){const h=u[s].multiPoly;r.indexOf(h)===-1&&r.push(h)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(Ft.type){case"union":{const n=e.length===0,r=t.length===0;this._isInResult=n!==r;break}case"intersection":{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===Ft.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=r=>r.length===1&&r[0].isSubject;this._isInResult=n(e)!==n(t);break}}return this._isInResult}},$i=class{constructor(i,e,t){P(this,"poly");P(this,"isExterior");P(this,"segments");P(this,"bbox");if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=t,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const n=je.snap({x:new Ie(i[0][0]),y:new Ie(i[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let r=n;for(let u=1,a=i.length;u<a;u++){if(typeof i[u][0]!="number"||typeof i[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const s=je.snap({x:new Ie(i[u][0]),y:new Ie(i[u][1])});s.x.eq(r.x)&&s.y.eq(r.y)||(this.segments.push(Dt.fromRing(r,s,this)),s.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.x),s.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.y),s.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.x),s.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.y),r=s)}(!n.x.eq(r.x)||!n.y.eq(r.y))&&this.segments.push(Dt.fromRing(r,n,this))}getSweepEvents(){const i=[];for(let e=0,t=this.segments.length;e<t;e++){const n=this.segments[e];i.push(n.leftSE),i.push(n.rightSE)}return i}},$r=class{constructor(i,e){P(this,"multiPoly");P(this,"exteriorRing");P(this,"interiorRings");P(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new $i(i[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 t=1,n=i.length;t<n;t++){const r=new $i(i[t],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 i=this.exteriorRing.getSweepEvents();for(let e=0,t=this.interiorRings.length;e<t;e++){const n=this.interiorRings[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},en=class{constructor(i,e){P(this,"isSubject");P(this,"polys");P(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}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 t=0,n=i.length;t<n;t++){const r=new $r(i[t],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 i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},es=(i,...e)=>Ft.run("union",i,e),ts=(i,...e)=>Ft.run("difference",i,e);je.set;function is(i){const e=[];if(Jt(i,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=i.features[0].properties||{},n=ts(e[0],...e.slice(1));return n.length===0?null:n.length===1?Qt(n[0],t):Di(n,t)}var ns=is;function rs(i){if(!i)throw new Error("geojson is required");var e=[];return Ar(i,function(t){e.push(t)}),Xt(e)}var ss=rs;function os(i,e={}){const t=[];if(Jt(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=es(t[0],...t.slice(1));return n.length===0?null:n.length===1?Qt(n[0],e.properties):Di(n,e.properties)}var ls=os;function tn(i,e){const t=ns(Xt([Qt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=Rt(qi(i)),r=(n[2]-n[0])/360/1e3,u=n[0]<-180,a=n[2]>180,s=ss(i);if(s.features.length>1&&(u||a))for(const g of s.features){const h=Rt(qi(g));if(a&&h[0]<-180+r)for(const b of g.geometry.coordinates)for(const S of b)S[0]+=360-r;if(u&&h[2]>180-r)for(const b of g.geometry.coordinates)for(const S of b)S[0]-=360-r}e(Xt([s.features.length<2?i:ls(s)??i,t]))}const nn="EPSG:4326";function us(i){var u;const e=i.getProperties(),{isMask:t}=e,n=(u=i.getGeometry())==null?void 0:u.getType(),r=t?0:n==="LineString"||n==="MultiLineString"?3:2;return new Nn({stroke:t?void 0:new pi({color:"#3170fe",lineDash:[r,r],width:r,lineCap:"butt"}),fill:t?new mi({color:"#00000020"}):void 0,image:new Mn({src:`/icons/marker_${e.isReverse?"reverse":e.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:e.isSelected?2:e.isReverse?0:1,text:e.isSelected&&e.tooltip?new Cn({backgroundFill:new mi({color:"white"}),text:e.tooltip,offsetY:-40,backgroundStroke:new pi({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})}function rn(i,e={},t={},n=us){let r=-1,u,a,s,g=!1;const h=new xn({updateWhileAnimating:!0});i.addLayer(h);const b=new Tn({});h.setSource(b),h.setStyle(n),i.on("click",N=>{i.forEachFeatureAtPixel(N.pixel,C=>{const O=C.getId();if(O)return N.stopPropagation(),a==null||a({type:"markerClick",id:O}),C})}),i.on("pointermove",N=>{const C=i.forEachFeatureAtPixel(N.pixel,O=>O.getId());u!==C&&(u&&(a==null||a({type:"markerMouseLeave",id:u})),C&&(a==null||a({type:"markerMouseEnter",id:C})),i.getTargetElement().style.cursor=C?"pointer":g?"crosshair":"",u=C)});function S(){return Ke.getUserProjection()??i.getView().getProjection()}function M(N){return N.transform(nn,S())}const k=N=>{a==null||a({type:"mapClick",coordinates:Ke.toLonLat(N.coordinate,S())})};return{setEventHandler(N){N?(a=N,i.on("click",k)):(a=void 0,i.un("click",k))},flyTo(N,C){i.getView().animate({center:Ke.fromLonLat(N,S()),...C?{zoom:C}:{},duration:2e3,...e})},fitBounds(N,C,O){i.getView().fit(Ke.transformExtent(N,nn,S()),{padding:[C,C,C,C],...O?{maxZoom:O}:{},duration:2e3,...t})},indicateReverse(N){g=N,i.getTargetElement().style.cursor=N?"crosshair":""},setReverseMarker(N){s?N?s.getGeometry().setCoordinates(Ke.fromLonLat(N,S())):(b.removeFeature(s),s.dispose(),s=void 0):N&&(s=new Te.Feature(new Me.Point(Ke.fromLonLat(N,S()))),s.setProperties({isReverse:!0}),b.addFeature(s))},setFeatures(N,C,O){function A(_){var R;if(_)for(const F of _.features){const K=F.geometry.type==="Polygon"?new Me.Polygon(F.geometry.coordinates):F.geometry.type==="MultiPolygon"?new Me.MultiPolygon(F.geometry.coordinates):null;K&&b.addFeature(new Te.Feature({isMask:!!((R=F.properties)!=null&&R.isMask),geometry:M(K)}))}}b.clear(),s&&b.addFeature(s);e:if(C){let _=!1;if(C.geometry.type==="GeometryCollection"){const R=C.geometry.geometries.map(F=>F.type==="Polygon"?new Me.Polygon(F.coordinates):F.type==="MultiPolygon"?new Me.MultiPolygon(F.coordinates):null).filter(F=>!!F);if(R.length>0)b.addFeature(new Te.Feature(M(new Me.GeometryCollection(R)))),_=!0;else for(const F of C.geometry.geometries)F.type==="LineString"?(b.addFeature(new Te.Feature(M(new Me.LineString(F.coordinates)))),_=!0):F.type==="MultiLineString"&&b.addFeature(new Te.Feature(M(new Me.MultiLineString(F.coordinates)))),_=!0}if(!_){if(C.geometry.type==="Polygon")tn(C,A);else if(C.geometry.type==="MultiPolygon")tn(C,A);else if(C.geometry.type==="LineString"){b.addFeature(new Te.Feature(M(new Me.LineString(C.geometry.coordinates))));break e}else if(C.geometry.type==="MultiLineString"){b.addFeature(new Te.Feature(M(new Me.MultiLineString(C.geometry.coordinates))));break e}}if(!O&&C.geometry.type!=="Point")break e;b.addFeature(new Te.Feature(M(new Me.Point(C.center))))}for(const _ of N??[]){if(_===C)continue;const R=new Te.Feature(new Me.Point(Ke.fromLonLat(_.center,S())));R.setId(_.id),R.setProperties({fuzzy:!!_.matching_text,tooltip:_.place_type[0]==="reverse"?_.place_name:_.place_name.replace(/,.*/,"")}),b.addFeature(R)}},setSelectedMarker(N){var A,_,R;const C=b.getFeatures(),O=(A=C[0])!=null&&A.getProperties().isReverse?1:0;r>-1&&((_=C[r+O])==null||_.setProperties({isSelected:!1})),N>-1&&((R=C[N+O])==null||R.setProperties({isSelected:!0})),r=N},getCenterAndZoom(){const N=i.getView(),C=N.getCenter(),O=N.getZoom();if(!(!C||O===void 0))return[O,...Ke.toLonLat(C,S())]}}}class as extends $.Control{constructor(t){const n=document.createElement("div");n.className="ol-search";super({element:n,target:t.target});hi(this,fe);hi(this,st);const{flyTo:r,fullGeometryStyle:u,...a}=t;di(this,fe,new Ir({target:n,props:{flyTo:r===void 0?!0:!!r,...a}})),he(this,fe).$on("select",s=>{this.dispatchEvent(new sn(s.detail.feature))}),he(this,fe).$on("pick",s=>{this.dispatchEvent(new an(s.detail.feature))}),he(this,fe).$on("featureslisted",s=>{this.dispatchEvent(new on(s.detail.features))}),he(this,fe).$on("featuresmarked",s=>{this.dispatchEvent(new ln(s.detail.features))}),he(this,fe).$on("response",s=>{this.dispatchEvent(new cn(s.detail.url,s.detail.featureCollection))}),he(this,fe).$on("optionsvisibilitychange",s=>{this.dispatchEvent(new un(s.detail.optionsVisible))}),he(this,fe).$on("reversetoggle",s=>{this.dispatchEvent(new hn(s.detail.reverse))}),he(this,fe).$on("querychange",s=>{this.dispatchEvent(new fn(s.detail.query))}),di(this,st,t)}setMap(t){var n;if(super.setMap(t),t){const{flyTo:r,fullGeometryStyle:u}=he(this,st),a=rn(t,typeof r=="boolean"?void 0:r,typeof r=="boolean"?void 0:r,u);(n=he(this,fe))==null||n.$set({mapController:a})}}setOptions(t){var a;Object.assign(he(this,st),t);const{flyTo:n,fullGeometryStyle:r,...u}=he(this,st);(a=he(this,fe))==null||a.$set({...u,flyTo:n===void 0?!0:!!n})}setQuery(t,n=!0){var r;(r=he(this,fe))==null||r.setQuery(t,n)}clearMap(){var t;(t=he(this,fe))==null||t.clearMap()}clearList(){var t;(t=he(this,fe))==null||t.clearList()}setReverseMode(t){var n;(n=he(this,fe))==null||n.$set({reverseActive:t})}focus(t){var n;(n=he(this,fe))==null||n.focus(t)}blur(){var t;(t=he(this,fe))==null||t.blur()}}fe=new WeakMap,st=new WeakMap;class sn extends te{constructor(t){super("select");P(this,"feature");this.feature=t}}class on extends te{constructor(t){super("featureslisted");P(this,"features");this.features=t}}class ln extends te{constructor(t){super("featuresmarked");P(this,"features");this.features=t}}class un extends te{constructor(t){super("optionsvisibilitychange");P(this,"optionsVisible");this.optionsVisible=t}}class an extends te{constructor(t){super("pick");P(this,"feature");this.feature=t}}class fn extends te{constructor(t){super("querychange");P(this,"query");this.query=t}}class cn extends te{constructor(t,n){super("response");P(this,"url");P(this,"featureCollection");this.url=t,this.featureCollection=n}}class hn extends te{constructor(t){super("reversetoggle");P(this,"reverse");this.reverse=t}}W.FeaturesListedEvent=on,W.FeaturesMarkedEvent=ln,W.GeocodingControl=as,W.OptionsVisibilityChangeEvent=un,W.PickEvent=an,W.QueryChangeEvent=fn,W.ResponseEvent=cn,W.ReverseToggleEvent=hn,W.SelectEvent=sn,W.createOpenLayersMapController=rn,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(F,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("ol/control"),require("ol/events/Event"),require("ol"),require("ol/geom"),require("ol/layer/Vector"),require("ol/proj"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Icon"),require("ol/style/Stroke"),require("ol/style/Style"),require("ol/style/Text")):typeof define=="function"&&define.amd?define(["exports","ol/control","ol/events/Event","ol","ol/geom","ol/layer/Vector","ol/proj","ol/source/Vector","ol/style/Fill","ol/style/Icon","ol/style/Stroke","ol/style/Style","ol/style/Text"],$):(F=typeof globalThis<"u"?globalThis:F||self,$(F.openlayersMaptilerGeocoder={},F.ol.control,F.ol.events.Event,F.ol,F.ol.geom,F.ol.layer.Vector,F.ol.proj,F.ol.source.Vector,F.ol.style.Fill,F.ol.style.Icon,F.ol.style.Stroke,F.ol.style.Style,F.ol.style.Text))})(this,function(F,$,ne,xe,Te,Pn,Ye,In,Ei,An,Li,Gn,Bn){"use strict";var qs=Object.defineProperty;var kn=F=>{throw TypeError(F)};var Vs=(F,$,ne)=>$ in F?qs(F,$,{enumerable:!0,configurable:!0,writable:!0,value:ne}):F[$]=ne;var R=(F,$,ne)=>Vs(F,typeof $!="symbol"?$+"":$,ne),On=(F,$,ne)=>$.has(F)||kn("Cannot "+ne);var ge=(F,$,ne)=>(On(F,$,"read from private field"),ne?ne.call(F):$.get(F)),vi=(F,$,ne)=>$.has(F)?kn("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(F):$.set(F,ne),bi=(F,$,ne,xe)=>(On(F,$,"write to private field"),xe?xe.call(F,ne):$.set(F,ne),ne);var wn,En,fe,at;function se(){}function Wn(i,e){for(const t in e)i[t]=e[t];return i}function Si(i){return i()}function _i(){return Object.create(null)}function Ue(i){i.forEach(Si)}function xi(i){return typeof i=="function"}function rt(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Rt;function be(i,e){return i===e?!0:(Rt||(Rt=document.createElement("a")),Rt.href=e,i===Rt.href)}function Fn(i){return Object.keys(i).length===0}function zn(i,e,t,n){if(i){const r=Ti(i,e,t,n);return i[0](r)}}function Ti(i,e,t,n){return i[1]&&n?Wn(t.ctx.slice(),i[1](n(e))):t.ctx}function Dn(i,e,t,n){return i[2],e.dirty}function Un(i,e,t,n,r,u){if(r){const a=Ti(e,t,n,u);i.p(a,r)}}function qn(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function Pt(i){return i??""}function j(i,e){i.appendChild(e)}function re(i,e,t){i.insertBefore(e,t||null)}function ie(i){i.parentNode&&i.parentNode.removeChild(i)}function Y(i){return document.createElement(i)}function qe(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Qe(i){return document.createTextNode(i)}function Se(){return Qe(" ")}function Vn(){return Qe("")}function me(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function jn(i){return function(e){return e.preventDefault(),i.call(this,e)}}function x(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Hn(i){return Array.from(i.childNodes)}function vt(i,e){e=""+e,i.data!==e&&(i.data=e)}function Mi(i,e){i.value=e??""}function dt(i,e,t){i.classList.toggle(e,!!t)}function Zn(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let bt;function wt(i){bt=i}function Ni(){if(!bt)throw new Error("Function called outside component initialization");return bt}function Kn(i){Ni().$$.on_destroy.push(i)}function Ci(){const i=Ni();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const u=Zn(e,t,{cancelable:n});return r.slice().forEach(a=>{a.call(i,u)}),!u.defaultPrevented}return!0}}function Yn(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const gt=[],Qt=[];let mt=[];const ki=[],Qn=Promise.resolve();let Xt=!1;function Xn(){Xt||(Xt=!0,Qn.then(Oi))}function Jt(i){mt.push(i)}const $t=new Set;let yt=0;function Oi(){if(yt!==0)return;const i=bt;do{try{for(;yt<gt.length;){const e=gt[yt];yt++,wt(e),Jn(e.$$)}}catch(e){throw gt.length=0,yt=0,e}for(wt(null),gt.length=0,yt=0;Qt.length;)Qt.pop()();for(let e=0;e<mt.length;e+=1){const t=mt[e];$t.has(t)||($t.add(t),t())}mt.length=0}while(gt.length);for(;ki.length;)ki.pop()();Xt=!1,$t.clear(),wt(i)}function Jn(i){if(i.fragment!==null){i.update(),Ue(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Jt)}}function $n(i){const e=[],t=[];mt.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),mt=e}const It=new Set;let st;function At(){st={r:0,c:[],p:st}}function Gt(){st.r||Ue(st.c),st=st.p}function ue(i,e){i&&i.i&&(It.delete(i),i.i(e))}function ye(i,e,t,n){if(i&&i.o){if(It.has(i))return;It.add(i),st.c.push(()=>{It.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function Ri(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function er(i,e){ye(i,1,1,()=>{e.delete(i.key)})}function tr(i,e,t,n,r,u,a,o,g,h,b,S){let M=i.length,k=u.length,N=M;const C={};for(;N--;)C[i[N].key]=N;const O=[],I=new Map,_=new Map,P=[];for(N=k;N--;){const B=S(r,u,N),s=t(B);let l=a.get(s);l?P.push(()=>l.p(B,e)):(l=h(s,B),l.c()),I.set(s,O[N]=l),s in C&&_.set(s,Math.abs(N-C[s]))}const z=new Set,Q=new Set;function Z(B){ue(B,1),B.m(o,b),a.set(B.key,B),b=B.first,k--}for(;M&&k;){const B=O[k-1],s=i[M-1],l=B.key,f=s.key;B===s?(b=B.first,M--,k--):I.has(f)?!a.has(l)||z.has(l)?Z(B):Q.has(f)?M--:_.get(l)>_.get(f)?(Q.add(l),Z(B)):(z.add(f),M--):(g(s,a),M--)}for(;M--;){const B=i[M];I.has(B.key)||g(B,a)}for(;k;)Z(O[k-1]);return Ue(P),O}function Xe(i){i&&i.c()}function Ve(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),Jt(()=>{const u=i.$$.on_mount.map(Si).filter(xi);i.$$.on_destroy?i.$$.on_destroy.push(...u):Ue(u),i.$$.on_mount=[]}),r.forEach(Jt)}function je(i,e){const t=i.$$;t.fragment!==null&&($n(t.after_update),Ue(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function ir(i,e){i.$$.dirty[0]===-1&&(gt.push(i),Xn(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function ot(i,e,t,n,r,u,a=null,o=[-1]){const g=bt;wt(i);const h=i.$$={fragment:null,ctx:[],props:u,update:se,not_equal:r,bound:_i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(g?g.$$.context:[])),callbacks:_i(),dirty:o,skip_bound:!1,root:e.target||g.$$.root};a&&a(h.root);let b=!1;if(h.ctx=t?t(i,e.props||{},(S,M,...k)=>{const N=k.length?k[0]:M;return h.ctx&&r(h.ctx[S],h.ctx[S]=N)&&(!h.skip_bound&&h.bound[S]&&h.bound[S](N),b&&ir(i,S)),M}):[],h.update(),b=!0,Ue(h.before_update),h.fragment=n?n(h.ctx):!1,e.target){if(e.hydrate){const S=Hn(e.target);h.fragment&&h.fragment.l(S),S.forEach(ie)}else h.fragment&&h.fragment.c();e.intro&&ue(i.$$.fragment),Ve(i,e.target,e.anchor),Oi()}wt(g)}class lt{constructor(){R(this,"$$");R(this,"$$set")}$destroy(){je(this,1),this.$destroy=se}$on(e,t){if(!xi(t))return se;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!Fn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const nr="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(nr);function rr(i){let e,t;return{c(){e=qe("svg"),t=qe("path"),x(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),x(e,"viewBox","0 0 14 14"),x(e,"width","13"),x(e,"height","13"),x(e,"class","svelte-en2qvf")},m(n,r){re(n,e,r),j(e,t)},p:se,i:se,o:se,d(n){n&&ie(e)}}}class Pi extends lt{constructor(e){super(),ot(this,e,null,rr,rt,{})}}function sr(i){let e,t;return{c(){e=qe("svg"),t=qe("path"),x(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),x(e,"viewBox","0 0 30 30"),x(e,"fill","none"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"class","svelte-d2loi5")},m(n,r){re(n,e,r),j(e,t)},p:se,i:se,o:se,d(n){n&&ie(e)}}}class Ii extends lt{constructor(e){super(),ot(this,e,null,sr,rt,{})}}function or(i){let e,t;return{c(){e=Y("img"),be(e.src,t=i[3]+"area.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!be(e.src,t=n[3]+"area.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ie(e)}}}function lr(i){let e,t;return{c(){e=Y("img"),be(e.src,t=i[3]+"reverse.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!be(e.src,t=n[3]+"reverse.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ie(e)}}}function ur(i){let e,t;return{c(){e=Y("img"),be(e.src,t=i[3]+"poi.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!be(e.src,t=n[3]+"poi.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ie(e)}}}function ar(i){let e,t;return{c(){e=Y("img"),be(e.src,t=i[3]+"postal_code.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!be(e.src,t=n[3]+"postal_code.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ie(e)}}}function fr(i){let e,t;return{c(){e=Y("img"),be(e.src,t=i[3]+"street.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!be(e.src,t=n[3]+"street.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ie(e)}}}function cr(i){let e,t;return{c(){e=Y("img"),be(e.src,t=i[3]+"road.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!be(e.src,t=n[3]+"road.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ie(e)}}}function hr(i){let e,t;return{c(){e=Y("img"),be(e.src,t=i[3]+"housenumber.svg")||x(e,"src",t),x(e,"alt",i[7]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(n,r){re(n,e,r)},p(n,r){r&8&&!be(e.src,t=n[3]+"housenumber.svg")&&x(e,"src",t),r&128&&x(e,"alt",n[7]),r&128&&x(e,"title",n[7])},d(n){n&&ie(e)}}}function dr(i){let e,t,n,r;return{c(){e=Y("img"),be(e.src,t=i[5])||x(e,"src",t),x(e,"alt",i[4]),x(e,"title",i[7]),x(e,"class","svelte-w9y5n9")},m(u,a){re(u,e,a),n||(r=me(e,"error",i[14]),n=!0)},p(u,a){a&32&&!be(e.src,t=u[5])&&x(e,"src",t),a&16&&x(e,"alt",u[4]),a&128&&x(e,"title",u[7])},d(u){u&&ie(e),n=!1,r()}}}function gr(i){let e,t;return{c(){e=Y("div"),x(e,"class","sprite-icon svelte-w9y5n9"),x(e,"style",t=`
|
|
2
|
+
width: ${i[6].width/Me}px;
|
|
3
|
+
height: ${i[6].height/Me}px;
|
|
4
|
+
background-image: url(${i[3]}sprite${ei}.png);
|
|
5
|
+
background-position: -${i[6].x/Me}px -${i[6].y/Me}px;
|
|
6
|
+
background-size: ${Pe.width/Me}px ${Pe.height/Me}px;
|
|
7
|
+
`),x(e,"title",i[7])},m(n,r){re(n,e,r)},p(n,r){r&72&&t!==(t=`
|
|
8
|
+
width: ${n[6].width/Me}px;
|
|
9
|
+
height: ${n[6].height/Me}px;
|
|
10
|
+
background-image: url(${n[3]}sprite${ei}.png);
|
|
11
|
+
background-position: -${n[6].x/Me}px -${n[6].y/Me}px;
|
|
12
|
+
background-size: ${Pe.width/Me}px ${Pe.height/Me}px;
|
|
13
|
+
`)&&x(e,"style",t),r&128&&x(e,"title",n[7])},d(n){n&&ie(e)}}}function Ai(i){let e,t;return{c(){e=Y("span"),t=Qe(i[7]),x(e,"class","secondary svelte-w9y5n9")},m(n,r){re(n,e,r),j(e,t)},p(n,r){r&128&&vt(t,n[7])},d(n){n&&ie(e)}}}function mr(i){let e,t,n,r,u,a,o,g,h,b=(i[8]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",S,M,k=i[2]==="always"||i[2]!=="never"&&!i[0].address&&!i[0].id.startsWith("road.")&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[8],N,C,O=(i[8]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",I,_,P,z,Q,Z;function B(m,c){return c&1&&(t=null),c&1&&(n=null),c&1&&(r=null),c&1&&(u=null),Pe&&m[6]?gr:m[5]?dr:m[0].address?hr:(t==null&&(t=!!m[0].id.startsWith("road.")),t?cr:(n==null&&(n=!!m[0].id.startsWith("address.")),n?fr:(r==null&&(r=!!m[0].id.startsWith("postal_code.")),r?ar:(u==null&&(u=!!m[0].id.startsWith("poi.")),u?ur:m[8]?lr:or))))}let s=B(i,-1),l=s(i),f=k&&Ai(i);return{c(){e=Y("li"),l.c(),a=Se(),o=Y("span"),g=Y("span"),h=Y("span"),S=Qe(b),M=Se(),f&&f.c(),N=Se(),C=Y("span"),I=Qe(O),x(h,"class","primary svelte-w9y5n9"),x(g,"class","svelte-w9y5n9"),x(C,"class","line2 svelte-w9y5n9"),x(o,"class","texts svelte-w9y5n9"),x(e,"tabindex","-1"),x(e,"role","option"),x(e,"aria-selected",_=i[1]==="selected"),x(e,"aria-checked",P=i[1]==="picked"),x(e,"class",z=Pt(i[1])+" svelte-w9y5n9")},m(m,c){re(m,e,c),l.m(e,null),j(e,a),j(e,o),j(o,g),j(g,h),j(h,S),j(g,M),f&&f.m(g,null),j(o,N),j(o,C),j(C,I),Q||(Z=[me(e,"mouseenter",i[13]),me(e,"focus",i[15]),me(e,"click",i[16])],Q=!0)},p(m,[c]){s===(s=B(m,c))&&l?l.p(m,c):(l.d(1),l=s(m),l&&(l.c(),l.m(e,a))),c&257&&b!==(b=(m[8]?m[0].place_name:m[0].place_name.replace(/,.*/,""))+"")&&vt(S,b),c&293&&(k=m[2]==="always"||m[2]!=="never"&&!m[0].address&&!m[0].id.startsWith("road.")&&!m[0].id.startsWith("address.")&&!m[0].id.startsWith("postal_code.")&&(!m[0].id.startsWith("poi.")||!m[5])&&!m[8]),k?f?f.p(m,c):(f=Ai(m),f.c(),f.m(g,null)):f&&(f.d(1),f=null),c&257&&O!==(O=(m[8]?"":m[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&vt(I,O),c&2&&_!==(_=m[1]==="selected")&&x(e,"aria-selected",_),c&2&&P!==(P=m[1]==="picked")&&x(e,"aria-checked",P),c&2&&z!==(z=Pt(m[1])+" svelte-w9y5n9")&&x(e,"class",z)},i:se,o:se,d(m){m&&ie(e),l.d(),f&&f.d(),Q=!1,Ue(Z)}}}const Gi=devicePixelRatio>1.25,ei=Gi?"@2x":"",Me=Gi?2:1;let Pe,Bt;function yr(i,e,t){let n,r,u,{feature:a}=e,{style:o="default"}=e,{showPlaceType:g}=e,{missingIconsCache:h}=e,{iconsBaseUrl:b}=e;const S=Ci();let M,k,N,C;function O(){Bt??(Bt=fetch(`${b}/sprite${ei}.json`).then(s=>s.json()).then(s=>{Pe=s}).catch(()=>{Pe=null}))}function I(){k&&h.add(k),_()}function _(){Pe!==void 0?P():(O(),Bt==null||Bt.then(P))}function P(){do{if(C--,t(4,M=n==null?void 0:n[C]),t(6,N=M?Pe==null?void 0:Pe.icons[M]:void 0),N)break;t(5,k=M?b+M.replace(/ /g,"_")+".svg":void 0)}while(C>-1&&(!k||h.has(k)))}function z(s){Yn.call(this,i,s)}const Q=()=>I(),Z=()=>S("select",void 0),B=s=>{document.activeElement!==s.target&&S("select",void 0)};return i.$$set=s=>{"feature"in s&&t(0,a=s.feature),"style"in s&&t(1,o=s.style),"showPlaceType"in s&&t(2,g=s.showPlaceType),"missingIconsCache"in s&&t(11,h=s.missingIconsCache),"iconsBaseUrl"in s&&t(3,b=s.iconsBaseUrl)},i.$$.update=()=>{var s,l,f,m,c;i.$$.dirty&1&&t(12,n=(s=a.properties)==null?void 0:s.categories),i.$$.dirty&1&&t(8,r=a.place_type[0]==="reverse"),i.$$.dirty&1&&t(7,u=((f=(l=a.properties)==null?void 0:l.categories)==null?void 0:f.join(", "))??((c=(m=a.properties)==null?void 0:m.place_type_name)==null?void 0:c[0])??a.place_type[0]),i.$$.dirty&4096&&(C=(n==null?void 0:n.length)??0,_())},[a,o,g,b,M,k,N,u,r,S,I,h,n,z,Q,Z,B]}class pr extends lt{constructor(e){super(),ot(this,e,yr,mr,rt,{feature:0,style:1,showPlaceType:2,missingIconsCache:11,iconsBaseUrl:3})}}function vr(i){let e;return{c(){e=Y("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',x(e,"class","svelte-7cmwmc")},m(t,n){re(t,e,n)},p:se,i:se,o:se,d(t){t&&ie(e)}}}class br extends lt{constructor(e){super(),ot(this,e,null,vr,rt,{})}}function wr(i){let e,t;return{c(){e=qe("svg"),t=qe("path"),x(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),x(e,"viewBox","0 0 60.006 21.412"),x(e,"width","14"),x(e,"height","20"),x(e,"class","svelte-en2qvf")},m(n,r){re(n,e,r),j(e,t)},p:se,i:se,o:se,d(n){n&&ie(e)}}}class Er extends lt{constructor(e){super(),ot(this,e,null,wr,rt,{})}}function Lr(i){let e,t,n;return{c(){e=qe("svg"),t=qe("circle"),n=qe("path"),x(t,"cx","4.789"),x(t,"cy","4.787"),x(t,"r","3.85"),x(t,"class","svelte-1aq105l"),x(n,"d","M12.063 12.063 7.635 7.635"),x(n,"class","svelte-1aq105l"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"width","13"),x(e,"height","13"),x(e,"viewBox","0 0 13 13"),x(e,"class","svelte-1aq105l")},m(r,u){re(r,e,u),j(e,t),j(e,n)},p:se,i:se,o:se,d(r){r&&ie(e)}}}class Sr extends lt{constructor(e){super(),ot(this,e,null,Lr,rt,{})}}function _r(i,e,t){const n=e[1],r=e[0],u=n-r;return i===n&&t?i:((i-r)%u+u)%u+r}function Wt(i){const e=[...i];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}let Et;async function xr(i,e,t){const n=i==null?void 0:i.getCenterAndZoom();for(const r of e??[])if(!(n&&(r.minZoom!=null&&r.minZoom>n[0]||r.maxZoom!=null&&r.maxZoom<n[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(Et&&r.cachedLocationExpiry&&Et.time+r.cachedLocationExpiry>Date.now()){if(!Et.coords)break e;return Et.coords}let u;try{return u=await new Promise((a,o)=>{t.signal.addEventListener("abort",()=>{o(Error("aborted"))}),navigator.geolocation.getCurrentPosition(g=>{a([g.coords.longitude,g.coords.latitude].map(h=>h.toFixed(6)).join(","))},g=>{o(g)},r)}),u}catch{}finally{r.cachedLocationExpiry&&(Et={time:Date.now(),coords:u})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(n&&r.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const Tr=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,Bi=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,Wi=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,Fi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,zi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,Di=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function Mr(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(k=>Number(k.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),u=Math.abs(n),a=t>0?"N":"S",o=n>0?"E":"W";let g;i=="DD"&&(g=`${r}° ${a}, ${u}° ${o}`);const h=Math.floor(r),b=Math.floor(u),S=(r-h)*60,M=(u-b)*60;if(i=="DM"){let k=Ui(S,3).toFixed(3).padStart(6,"0"),N=Ui(M,3).toFixed(3).padStart(6,"0");k.endsWith(".000")&&N.endsWith(".000")&&(k=k.replace(/\.000$/,""),N=N.replace(/\.000$/,"")),g=`${h}° ${k}' ${a}, ${b}° ${N}' ${o}`}if(i=="DMS"){const k=Math.floor(S),N=Math.floor(M);let C=((S-k)*60).toFixed(1).padStart(4,"0"),O=((M-N)*60).toFixed(1).padStart(4,"0");const I=k.toString().padStart(2,"0"),_=N.toString().padStart(2,"0");C.endsWith(".0")&&O.endsWith(".0")&&(C=C.replace(/\.0$/,""),O=O.replace(/\.0$/,"")),g=`${h}° ${I}' ${C}" ${a}, ${b}° ${_}' ${O}" ${o}`}return g}else throw new Error("no decimal coordinates to convert")}function Ui(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function ti(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",u="",a=null,o=[],g=!1;if(Tr.test(i))throw new Error("invalid coordinate value");if(Bi.test(i))if(o=Bi.exec(i),g=Lt(o),g)t=Math.abs(o[1])+o[2]/60,Number(o[1])<0&&(t*=-1),n=Math.abs(o[3])+o[4]/60,Number(o[3])<0&&(n*=-1),a="DM";else throw new Error("invalid coordinate format");else if(Wi.test(i))if(o=Wi.exec(i),g=Lt(o),g){if(t=o[2],n=o[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),a="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");o[1]?(r=o[1],u=o[5]):o[4]&&(r=o[4],u=o[8])}else throw new Error("invalid decimal coordinate format");else if(Fi.test(i))if(o=Fi.exec(i),g=Lt(o),g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,a="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,a="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[9])),o[11]&&(n+=o[11]/60),o[13]&&(n+=o[13].replace(",",".")/3600),parseInt(o[9])<0&&(n=-1*n),o[1]?(r=o[1],u=o[8]):o[7]&&(r=o[7],u=o[14]);else throw new Error("invalid DMS coordinates format");else if(zi.test(i))if(o=zi.exec(i),g=Lt(o),g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,a="DM"),o[6]&&(t+=o[6]/3600,a="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12]/60),o[14]&&(n+=o[14]/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],u=o[9]):o[8]&&(r=o[8],u=o[16]);else throw new Error("invalid DMS coordinates format");else if(Di.test(i)){if(o=Di.exec(i),g=Lt(o),o.filter(h=>h).length<=5)throw new Error("invalid coordinates format");if(g)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4].replace(",",".")/60,a="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,a="DMS"),parseInt(o[2])<0&&(t=-1*t),n=Math.abs(parseInt(o[10])),o[12]&&(n+=o[12].replace(",",".")/60),o[14]&&(n+=o[14].replace(",",".")/3600),parseInt(o[10])<0&&(n=-1*n),o[1]?(r=o[1],u=o[9]):o[8]&&(r=o[8],u=o[16]);else throw new Error("invalid coordinates format")}if(g){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!u||!r&&u)throw new Error("invalid coordinates value");if(r&&r==u)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let h=/S|SOUTH/i;h.test(r)&&t>0&&(t=-1*t),h=/W|WEST/i,h.test(u)&&n>0&&(n=-1*n);const b=o[0].trim();let S,M;const k=/[,/;\u0020]/g,N=b.match(k);if(N==null){const I=Math.floor(i.length/2);S=b.substring(0,I).trim(),M=b.substring(I).trim()}else{let I;N.length%2==1?I=Math.floor(N.length/2):I=N.length/2-1;let _=0;if(I==0)_=b.indexOf(N[0]),S=b.substring(0,_).trim(),M=b.substring(_+1).trim();else{let P=0,z=0;for(;P<=I;)_=b.indexOf(N[P],z),z=_+1,P++;S=b.substring(0,_).trim(),M=b.substring(_+1).trim()}}const C=S.split(".");if(C.length==2&&C[1]==0&&C[1].length!=2)throw new Error("invalid coordinates format");const O=M.split(".");if(O.length==2&&O[1]==0&&O[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(S)||/^\d+$/.test(M))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:b,verbatimLatitude:S,verbatimLongitude:M,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:a,closeEnough:Nr,toCoordinateFormat:Mr})}else throw new Error("coordinates pattern match failed")}function Lt(i){if(!isNaN(i[0]))return!1;const e=[...i];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,r=e.length/2;for(let u=0;u<r;u++){const a=e[u],o=e[u+r],g=t.test(a)&&t.test(o),h=n.test(a)&&n.test(o),b=a==o;if(!(a==null&&o==null)){if(a==null||o==null)return!1;if(g||h||b)continue;return!1}}return!0}function qi(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function Nr(i){if(!i)throw new Error("coords must be provided");if(i.includes(",")){const e=i.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return qi(this.decimalLatitude,Number(e[0]))&&qi(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Cr=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});ti.to=Cr;const kr=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],Or={decimalLatitude:40.123,decimalLongitude:-74.123},Rr=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],Pr=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function Ir(){const i=[];return kr.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...Or})}),[...i,...Rr,...Pr]}const Ar=Ir();ti.formats=Ar.map(i=>i.verbatimCoordinates);const Gr=ti;function Vi(i,e,t){const n=i.slice();return n[100]=e[t],n[102]=t,n}function ji(i){let e,t;return e=new br({}),{c(){Xe(e.$$.fragment)},m(n,r){Ve(e,n,r),t=!0},i(n){t||(ue(e.$$.fragment,n),t=!0)},o(n){ye(e.$$.fragment,n),t=!1},d(n){je(e,n)}}}function Hi(i){let e,t,n,r,u;return t=new Er({}),{c(){e=Y("button"),Xe(t.$$.fragment),x(e,"type","button"),x(e,"title",i[10]),x(e,"class","svelte-bz0zu3"),dt(e,"active",i[0])},m(a,o){re(a,e,o),Ve(t,e,null),n=!0,r||(u=me(e,"click",i[81]),r=!0)},p(a,o){(!n||o[0]&1024)&&x(e,"title",a[10]),(!n||o[0]&1)&&dt(e,"active",a[0])},i(a){n||(ue(t.$$.fragment,a),n=!0)},o(a){ye(t.$$.fragment,a),n=!1},d(a){a&&ie(e),je(t),r=!1,u()}}}function Br(i){let e,t=[],n=new Map,r,u,a,o=Ri(i[13]);const g=h=>h[100].id+(h[100].address?","+h[100].address:"");for(let h=0;h<o.length;h+=1){let b=Vi(i,o,h),S=g(b);n.set(S,t[h]=Zi(S,b))}return{c(){e=Y("ul");for(let h=0;h<t.length;h+=1)t[h].c();x(e,"class","options svelte-bz0zu3"),x(e,"role","listbox")},m(h,b){re(h,e,b);for(let S=0;S<t.length;S+=1)t[S]&&t[S].m(e,null);r=!0,u||(a=[me(e,"mouseleave",i[27]),me(e,"blur",i[85]),me(e,"keydown",i[23])],u=!0)},p(h,b){b[0]&102823936&&(o=Ri(h[13]),At(),t=tr(t,b,g,1,h,o,n,e,er,Zi,null,Vi),Gt())},i(h){if(!r){for(let b=0;b<o.length;b+=1)ue(t[b]);r=!0}},o(h){for(let b=0;b<t.length;b+=1)ye(t[b]);r=!1},d(h){h&&ie(e);for(let b=0;b<t.length;b+=1)t[b].d();u=!1,Ue(a)}}}function Wr(i){let e,t,n,r,u,a;return t=new Ii({}),{c(){e=Y("div"),Xe(t.$$.fragment),n=Se(),r=Y("div"),u=Qe(i[8]),x(r,"class","svelte-bz0zu3"),x(e,"class","no-results svelte-bz0zu3")},m(o,g){re(o,e,g),Ve(t,e,null),j(e,n),j(e,r),j(r,u),a=!0},p(o,g){(!a||g[0]&256)&&vt(u,o[8])},i(o){a||(ue(t.$$.fragment,o),a=!0)},o(o){ye(t.$$.fragment,o),a=!1},d(o){o&&ie(e),je(t)}}}function Fr(i){let e="",t;return{c(){t=Qe(e)},m(n,r){re(n,t,r)},p:se,i:se,o:se,d(n){n&&ie(t)}}}function zr(i){let e,t,n,r,u,a,o,g,h,b,S;return t=new Ii({}),g=new Pi({}),{c(){e=Y("div"),Xe(t.$$.fragment),n=Se(),r=Y("div"),u=Qe(i[7]),a=Se(),o=Y("button"),Xe(g.$$.fragment),x(r,"class","svelte-bz0zu3"),x(o,"class","svelte-bz0zu3"),x(e,"class","error svelte-bz0zu3")},m(M,k){re(M,e,k),Ve(t,e,null),j(e,n),j(e,r),j(r,u),j(e,a),j(e,o),Ve(g,o,null),h=!0,b||(S=me(o,"click",i[82]),b=!0)},p(M,k){(!h||k[0]&128)&&vt(u,M[7])},i(M){h||(ue(t.$$.fragment,M),ue(g.$$.fragment,M),h=!0)},o(M){ye(t.$$.fragment,M),ye(g.$$.fragment,M),h=!1},d(M){M&&ie(e),je(t),je(g),b=!1,S()}}}function Zi(i,e){var o;let t,n,r;function u(){return e[83](e[102])}function a(){return e[84](e[100])}return n=new pr({props:{feature:e[100],showPlaceType:e[11],style:e[15]===e[102]?"selected":((o=e[14])==null?void 0:o.id)===e[100].id?"picked":"default",missingIconsCache:e[21],iconsBaseUrl:e[12]}}),n.$on("mouseenter",u),n.$on("select",a),{key:i,first:null,c(){t=Vn(),Xe(n.$$.fragment),this.first=t},m(g,h){re(g,t,h),Ve(n,g,h),r=!0},p(g,h){var S;e=g;const b={};h[0]&8192&&(b.feature=e[100]),h[0]&2048&&(b.showPlaceType=e[11]),h[0]&57344&&(b.style=e[15]===e[102]?"selected":((S=e[14])==null?void 0:S.id)===e[100].id?"picked":"default"),h[0]&4096&&(b.iconsBaseUrl=e[12]),n.$set(b)},i(g){r||(ue(n.$$.fragment,g),r=!0)},o(g){ye(n.$$.fragment,g),r=!1},d(g){g&&ie(t),je(n,g)}}}function Dr(i){let e,t,n,r,u,a,o,g,h,b,S,M,k,N,C,O,I,_,P,z,Q,Z=!1;u=new Sr({}),S=new Pi({});let B=i[20]&&ji(),s=i[6]==="button"&&Hi(i);const l=i[72].default,f=zn(l,i,i[71],null),m=[zr,Fr,Wr,Br],c=[];function v(y,d){var p,w;return y[19]?0:!y[16]&&!y[4]?1:((p=y[13])==null?void 0:p.length)===0?2:(w=y[13])!=null&&w.length&&(y[16]||y[4])?3:-1}return~(O=v(i))&&(I=c[O]=m[O](i)),{c(){e=Se(),t=Y("form"),n=Y("div"),r=Y("button"),Xe(u.$$.fragment),a=Se(),o=Y("input"),g=Se(),h=Y("div"),b=Y("button"),Xe(S.$$.fragment),M=Se(),B&&B.c(),k=Se(),s&&s.c(),N=Se(),f&&f.c(),C=Se(),I&&I.c(),x(r,"class","search-button svelte-bz0zu3"),x(r,"type","button"),x(o,"placeholder",i[9]),x(o,"aria-label",i[9]),x(o,"class","svelte-bz0zu3"),x(b,"type","button"),x(b,"title",i[3]),x(b,"class","svelte-bz0zu3"),x(h,"class","clear-button-container svelte-bz0zu3"),dt(h,"displayable",i[1]!==""),x(n,"class","input-group svelte-bz0zu3"),x(t,"class",_=Pt(i[2])+" svelte-bz0zu3"),dt(t,"can-collapse",i[5]&&i[1]==="")},m(y,d){re(y,e,d),re(y,t,d),j(t,n),j(n,r),Ve(u,r,null),j(n,a),j(n,o),i[74](o),Mi(o,i[1]),j(n,g),j(n,h),j(h,b),Ve(S,b,null),j(h,M),B&&B.m(h,null),j(n,k),s&&s.m(n,null),j(n,N),f&&f.m(n,null),j(t,C),~O&&c[O].m(t,null),P=!0,z||(Q=[me(r,"click",i[73]),me(o,"input",i[75]),me(o,"focus",i[76]),me(o,"blur",i[77]),me(o,"click",i[78]),me(o,"keydown",i[23]),me(o,"input",i[24]),me(o,"change",i[79]),me(b,"click",i[80]),me(t,"submit",jn(i[22]))],z=!0)},p(y,d){(!P||d[0]&512)&&x(o,"placeholder",y[9]),(!P||d[0]&512)&&x(o,"aria-label",y[9]),d[0]&2&&o.value!==y[1]&&Mi(o,y[1]),(!P||d[0]&8)&&x(b,"title",y[3]),y[20]?B?d[0]&1048576&&ue(B,1):(B=ji(),B.c(),ue(B,1),B.m(h,null)):B&&(At(),ye(B,1,1,()=>{B=null}),Gt()),(!P||d[0]&2)&&dt(h,"displayable",y[1]!==""),y[6]==="button"?s?(s.p(y,d),d[0]&64&&ue(s,1)):(s=Hi(y),s.c(),ue(s,1),s.m(n,N)):s&&(At(),ye(s,1,1,()=>{s=null}),Gt()),f&&f.p&&(!P||d[2]&512)&&Un(f,l,y,y[71],P?Dn(l,y[71],d,null):qn(y[71]),null);let p=O;O=v(y),O===p?~O&&c[O].p(y,d):(I&&(At(),ye(c[p],1,1,()=>{c[p]=null}),Gt()),~O?(I=c[O],I?I.p(y,d):(I=c[O]=m[O](y),I.c()),ue(I,1),I.m(t,null)):I=null),(!P||d[0]&4&&_!==(_=Pt(y[2])+" svelte-bz0zu3"))&&x(t,"class",_),(!P||d[0]&38)&&dt(t,"can-collapse",y[5]&&y[1]==="")},i(y){P||(ue(Z),ue(u.$$.fragment,y),ue(S.$$.fragment,y),ue(B),ue(s),ue(f,y),ue(I),P=!0)},o(y){ye(Z),ye(u.$$.fragment,y),ye(S.$$.fragment,y),ye(B),ye(s),ye(f,y),ye(I),P=!1},d(y){y&&(ie(e),ie(t)),je(u),i[74](null),je(S),B&&B.d(),s&&s.d(),f&&f.d(y),~O&&c[O].d(),z=!1,Ue(Q)}}}function Ur(i,e,t){let n,r,u,{$$slots:a={},$$scope:o}=e;const g={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:h=void 0}=e,{apiKey:b}=e,{bbox:S=void 0}=e,{clearButtonTitle:M="clear"}=e,{clearOnBlur:k=!1}=e,{clearListOnPick:N=!1}=e,{keepListOpen:C=!1}=e,{collapsed:O=!1}=e,{country:I=void 0}=e,{debounceSearch:_=200}=e,{enableReverse:P="never"}=e,{errorMessage:z="Something went wrong…"}=e,{filter:Q=()=>!0}=e,{flyTo:Z=!0}=e,{fuzzyMatch:B=!0}=e,{language:s=void 0}=e,{limit:l=void 0}=e;const f=41415112612;let{reverseGeocodingLimit:m=f}=e,{mapController:c=void 0}=e,{minLength:v=2}=e,{noResultsMessage:y="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:d="Search"}=e,{proximity:p=[{type:"server-geolocation"}]}=e,{reverseActive:w=P==="always"}=e,{reverseButtonTitle:E="toggle reverse geocoding"}=e,{searchValue:T=""}=e,{pickedResultStyle:A="full-geometry"}=e,{showPlaceType:G="if-needed"}=e,{showResultsWhileTyping:V=!0}=e,{autocompleteTimeout:ee=void 0}=e,{selectFirst:J=!0}=e,{flyToSelected:q=!1}=e,{markerOnSelected:H=!0}=e,{types:ce=void 0}=e;const ft=[];let{reverseGeocodingTypes:$e=ft}=e,{exhaustiveReverseGeocoding:ct=!1}=e,{excludeTypes:Le=!1}=e;const et=void 0;let{reverseGeocodingExcludeTypes:pe=et}=e,{zoom:he=g}=e,{apiUrl:te="https://api.maptiler.com/geocoding"}=e,{fetchParameters:fi={}}=e,{iconsBaseUrl:Ln="https://cdn.maptiler.com/maptiler-geocoding-control/v2.1.3-rc1/icons/"}=e,{adjustUrlQuery:ci=()=>{}}=e,{adjustUrl:hi=()=>{}}=e;function bs(L){Ae.focus(L)}function ws(){Ae.blur()}function Sn(L,le=!0,ae=!1){t(1,T=L),le?(t(15,K=-1),xn()):(Tn(void 0,!ae,ae),setTimeout(()=>{Ae.focus(),Ae.select()}))}function Es(){t(13,U=void 0),t(14,W=void 0),t(15,K=-1)}function Ls(){t(65,de=[]),t(14,W=void 0)}let U,de,W,_n="",Ae,K=-1,Fe,Zt=[],ht,tt,Oe,pt,di,Ke=!1;const Ss=new Set,it=Ci();function _s(){return!!Oe}Kn(()=>{c&&(c.setEventHandler(void 0),c.indicateReverse(!1),c.setSelectedMarker(-1),c.setFeatures(void 0,void 0,!1))});function xn(L){if(t(17,Ke=!1),tt&&(window.clearTimeout(tt),tt=void 0),Oe){window.clearTimeout(Oe),t(66,Oe=void 0),Tt(T,{appendSpace:!0});return}if(K>-1&&U)t(14,W=U[K]),t(1,T=W.place_type[0]==="reverse"?W.place_name:W.place_name.replace(/,.*/,"")),t(19,Fe=void 0),t(65,de=void 0),t(15,K=-1);else if(T){const le=L||!gi(T);Tt(T,{exact:!0}).then(()=>{t(65,de=U),t(14,W=void 0),le&&xs()}).catch(ae=>t(19,Fe=ae))}}function gi(L){try{return Gr(L,6)}catch{return!1}}async function Tt(L,{byId:le=!1,exact:ae=!1,appendSpace:Ge=!1}={}){var ze,nt,Nn;t(19,Fe=void 0),ht==null||ht.abort();const ve=new AbortController;t(20,ht=ve);try{const X=gi(L),Nt=new URL(te+"/"+encodeURIComponent(X?X.decimalLongitude+","+X.decimalLatitude:L+(Ge?" ":""))+".json"),Re=Nt.searchParams;s!==void 0&&Re.set("language",Array.isArray(s)?s.join(","):s??"");const[pi]=(c==null?void 0:c.getCenterAndZoom())??[];let De=(ze=!X||$e===ft?ce:$e)==null?void 0:ze.map(we=>typeof we=="string"?we:pi===void 0||(we[0]??0)<=pi&&pi<(we[1]??1/0)?we[2]:void 0).filter(we=>we!==void 0);De&&(De=[...new Set(De)],Re.set("types",De.join(",")));const Cn=!X||pe===et?Le:pe;if(Cn&&Re.set("excludeTypes",String(Cn)),S&&Re.set("bbox",S.map(we=>we.toFixed(6)).join(",")),I&&Re.set("country",Array.isArray(I)?I.join(","):I),!le&&!X){const we=await xr(c,p,ve);we&&Re.set("proximity",we),(ae||!V)&&Re.set("autocomplete","false"),Re.set("fuzzyMatch",String(B))}const Ct=m===f?l:m;Ct!==void 0&&Ct>1&&(De==null?void 0:De.length)!==1&&console.warn("For reverse geocoding when limit > 1 then types must contain single value."),X?(Ct===1||Ct!==void 0&&(ct||(De==null?void 0:De.length)===1))&&Re.set("limit",String(Ct)):l!==void 0&&Re.set("limit",String(l)),Re.set("key",b),ci(Re),hi(Nt);const Us=Nt.searchParams.get("types")===""&&Nt.searchParams.get("excludeTypes")!=="true",Kt=Nt.toString();if(Kt===_n){le?(N&&t(13,U=void 0),t(14,W=Zt[0])):(t(13,U=Zt),((nt=U[K])==null?void 0:nt.id)!==(r==null?void 0:r.id)&&t(15,K=-1));return}_n=Kt;let kt;if(Us)kt={type:"FeatureCollection",features:[]};else{const we=await fetch(Kt,{signal:ve.signal,...fi});if(!we.ok)throw new Error(await we.text());kt=await we.json()}it("response",{url:Kt,featureCollection:kt}),le?(N&&t(13,U=void 0),t(14,W=kt.features[0]),Zt=[W]):(t(13,U=kt.features.filter(Q)),X&&U.unshift({type:"Feature",properties:{},id:"reverse_"+X.decimalLongitude+"_"+X.decimalLatitude,text:X.decimalLatitude+", "+X.decimalLongitude,place_name:X.decimalLatitude+", "+X.decimalLongitude,place_type:["reverse"],center:[X.decimalLongitude,X.decimalLatitude],bbox:[X.decimalLongitude,X.decimalLatitude,X.decimalLongitude,X.decimalLatitude],geometry:{type:"Point",coordinates:[X.decimalLongitude,X.decimalLatitude]}}),Zt=U,((Nn=U[K])==null?void 0:Nn.id)!==(r==null?void 0:r.id)&&t(15,K=-1),X&&Ae.focus())}catch(X){if(X&&typeof X=="object"&&"name"in X&&X.name==="AbortError")return;throw X}finally{ve===ht&&t(20,ht=void 0)}}function xs(){var Ge;if(!(de!=null&&de.length)||!Z)return;const L=[180,90,-180,-90],le=!de.some(ve=>!ve.matching_text);let ae;for(const ve of de){const ze=Mt(ve);if(ae=ae===void 0?ze:ze===void 0?ae:Math.max(ae,ze),le||!ve.matching_text)for(const nt of[0,1,2,3])L[nt]=Math[nt<2?"min":"max"](L[nt],((Ge=ve.bbox)==null?void 0:Ge[nt])??ve.center[nt%2])}c&&de.length>0&&(W&&L[0]===L[2]&&L[1]===L[3]?c.flyTo(W.center,Mt(W)):c.fitBounds(Wt(L),50,ae))}function mi(){!W||!c||(!W.bbox||W.bbox[0]===W.bbox[2]&&W.bbox[1]===W.bbox[3]?c.flyTo(W.center,Mt(W)):c.fitBounds(Wt(W.bbox),50,Mt(W)))}function Mt(L){var ae;if(!L.bbox||L.bbox[0]!==L.bbox[2]&&L.bbox[1]!==L.bbox[3])return;const le=L.id.replace(/\..*/,"");return(Array.isArray((ae=L.properties)==null?void 0:ae.categories)?L.properties.categories.reduce((Ge,ve)=>{const ze=he[le+"."+ve];return Ge===void 0?ze:ze===void 0?Ge:Math.max(Ge,ze)},void 0):void 0)??he[le]}function Ts(L){t(0,w=P==="always"),t(13,U=void 0),t(14,W=void 0),t(15,K=-1),Sn(L[1].toFixed(6)+", "+_r(L[0],[-180,180],!0).toFixed(6),!1,!0)}function Ms(L){if(!U)return;let le=L.key==="ArrowDown"?1:L.key==="ArrowUp"?-1:0;le&&(Ae.focus(),t(17,Ke=!0),L.preventDefault(),W&&K===-1&&t(15,K=U.findIndex(ae=>ae.id===(W==null?void 0:W.id))),K===(W||J?0:-1)&&le===-1&&t(15,K=U.length),t(15,K+=le),K>=U.length&&t(15,K=-1),K<0&&(W||J)&&t(15,K=0))}function Tn(L,le=!0,ae=!1){if(t(19,Fe=void 0),t(14,W=void 0),t(17,Ke=!0),tt&&(window.clearTimeout(tt),tt=void 0),Oe&&(window.clearTimeout(Oe),t(66,Oe=void 0)),!V&&!ae||T.length<v){t(13,U=void 0);return}const Ge=T;tt=window.setTimeout(()=>{tt=void 0,Tt(Ge).catch(ve=>t(19,Fe=ve))},le?_:0),T.endsWith(" ")||t(66,Oe=window.setTimeout(()=>{t(66,Oe=void 0),Tt(Ge,{appendSpace:!0}).catch(ve=>t(19,Fe=ve))},ee))}function yi(L){W&&(W==null?void 0:W.id)===(L==null?void 0:L.id)?mi():(t(14,W=L),t(1,T=L.place_name))}function Mn(L){t(15,K=L)}function Ns(){(!J||W)&&t(15,K=-1),q&&mi()}const Cs=()=>Ae.focus();function ks(L){Qt[L?"unshift":"push"](()=>{Ae=L,t(18,Ae)})}function Os(){T=this.value,t(1,T),t(17,Ke),t(31,k),t(16,pt)}const Rs=()=>t(17,Ke=!0),Ps=()=>t(17,Ke=!1),Is=()=>t(17,Ke=!0),As=()=>t(14,W=void 0),Gs=()=>{t(1,T=""),t(14,W=void 0),Ae.focus()},Bs=()=>t(0,w=!w),Ws=()=>t(19,Fe=void 0),Fs=L=>Mn(L),zs=L=>yi(L),Ds=()=>{};return i.$$set=L=>{"class"in L&&t(2,h=L.class),"apiKey"in L&&t(29,b=L.apiKey),"bbox"in L&&t(30,S=L.bbox),"clearButtonTitle"in L&&t(3,M=L.clearButtonTitle),"clearOnBlur"in L&&t(31,k=L.clearOnBlur),"clearListOnPick"in L&&t(32,N=L.clearListOnPick),"keepListOpen"in L&&t(4,C=L.keepListOpen),"collapsed"in L&&t(5,O=L.collapsed),"country"in L&&t(33,I=L.country),"debounceSearch"in L&&t(34,_=L.debounceSearch),"enableReverse"in L&&t(6,P=L.enableReverse),"errorMessage"in L&&t(7,z=L.errorMessage),"filter"in L&&t(35,Q=L.filter),"flyTo"in L&&t(36,Z=L.flyTo),"fuzzyMatch"in L&&t(37,B=L.fuzzyMatch),"language"in L&&t(38,s=L.language),"limit"in L&&t(39,l=L.limit),"reverseGeocodingLimit"in L&&t(40,m=L.reverseGeocodingLimit),"mapController"in L&&t(41,c=L.mapController),"minLength"in L&&t(42,v=L.minLength),"noResultsMessage"in L&&t(8,y=L.noResultsMessage),"placeholder"in L&&t(9,d=L.placeholder),"proximity"in L&&t(43,p=L.proximity),"reverseActive"in L&&t(0,w=L.reverseActive),"reverseButtonTitle"in L&&t(10,E=L.reverseButtonTitle),"searchValue"in L&&t(1,T=L.searchValue),"pickedResultStyle"in L&&t(44,A=L.pickedResultStyle),"showPlaceType"in L&&t(11,G=L.showPlaceType),"showResultsWhileTyping"in L&&t(45,V=L.showResultsWhileTyping),"autocompleteTimeout"in L&&t(46,ee=L.autocompleteTimeout),"selectFirst"in L&&t(47,J=L.selectFirst),"flyToSelected"in L&&t(48,q=L.flyToSelected),"markerOnSelected"in L&&t(49,H=L.markerOnSelected),"types"in L&&t(50,ce=L.types),"reverseGeocodingTypes"in L&&t(51,$e=L.reverseGeocodingTypes),"exhaustiveReverseGeocoding"in L&&t(52,ct=L.exhaustiveReverseGeocoding),"excludeTypes"in L&&t(53,Le=L.excludeTypes),"reverseGeocodingExcludeTypes"in L&&t(54,pe=L.reverseGeocodingExcludeTypes),"zoom"in L&&t(55,he=L.zoom),"apiUrl"in L&&t(56,te=L.apiUrl),"fetchParameters"in L&&t(57,fi=L.fetchParameters),"iconsBaseUrl"in L&&t(12,Ln=L.iconsBaseUrl),"adjustUrlQuery"in L&&t(58,ci=L.adjustUrlQuery),"adjustUrl"in L&&t(59,hi=L.adjustUrl),"$$scope"in L&&t(71,o=L.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&64&&t(0,w=P==="always"),i.$$.dirty[0]&16384|i.$$.dirty[1]&8192&&A!=="marker-only"&&W&&!W.address&&W.geometry.type==="Point"&&W.place_type[0]!=="reverse"&&Tt(W.id,{byId:!0}).catch(L=>t(19,Fe=L)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1058|i.$$.dirty[2]&32&&(c&&W&&W.id!==di&&Z&&(mi(),N&&t(13,U=void 0),t(65,de=void 0),t(15,K=-1)),t(67,di=W==null?void 0:W.id)),i.$$.dirty[0]&196608|i.$$.dirty[1]&1&&setTimeout(()=>{t(16,pt=Ke),k&&!pt&&t(1,T="")}),i.$$.dirty[0]&8194|i.$$.dirty[1]&2048&&T.length<v&&(t(13,U=void 0),t(19,Fe=void 0),t(65,de=U)),i.$$.dirty[0]&8192|i.$$.dirty[1]&65536&&J&&U!=null&&U.length&&(_s()||t(15,K=0)),i.$$.dirty[0]&57344|i.$$.dirty[1]&65536&&J&&U!=null&&U.length&&K==-1&&!W&&t(15,K=0),i.$$.dirty[0]&8192|i.$$.dirty[2]&8&&de!==U&&t(65,de=void 0),i.$$.dirty[0]&73729|i.$$.dirty[1]&1024|i.$$.dirty[2]&8&&c&&c.setEventHandler(L=>{switch(L.type){case"mapClick":w&&Ts(L.coordinates);break;case"markerClick":{const le=U==null?void 0:U.find(ae=>ae.id===L.id);le&&yi(le)}break;case"markerMouseEnter":de&&t(15,K=pt?(U==null?void 0:U.findIndex(le=>le.id===L.id))??-1:-1);break;case"markerMouseLeave":de&&t(15,K=-1);break}}),i.$$.dirty[0]&40960&&t(68,r=U==null?void 0:U[K]),i.$$.dirty[1]&132128|i.$$.dirty[2]&64&&c&&r&&Z&&q&&c.flyTo(r.center,Mt(r)),i.$$.dirty[1]&8192&&t(70,n=A==="full-geometry-including-polygon-center-marker"),i.$$.dirty[1]&263168|i.$$.dirty[2]&256&&(H||c==null||c.setFeatures(void 0,void 0,n)),i.$$.dirty[0]&16384|i.$$.dirty[1]&263168|i.$$.dirty[2]&328&&c&&H&&!de&&(c.setFeatures(r?[r]:void 0,W,n),c.setSelectedMarker(r?0:-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1024|i.$$.dirty[2]&264&&c&&c.setFeatures(de,W,n),i.$$.dirty[0]&32768|i.$$.dirty[1]&1024|i.$$.dirty[2]&8&&de&&c&&c.setSelectedMarker(K),i.$$.dirty[2]&80&&r&&(window.clearTimeout(Oe),t(66,Oe=void 0)),i.$$.dirty[0]&2|i.$$.dirty[1]&1024&&c){const L=gi(T);c.setReverseMarker(L?[L.decimalLongitude,L.decimalLatitude]:void 0)}i.$$.dirty[2]&64&&it("select",{feature:r}),i.$$.dirty[0]&16384&&it("pick",{feature:W}),i.$$.dirty[0]&73744&&t(69,u=!!(U!=null&&U.length)&&(pt||C)),i.$$.dirty[2]&128&&it("optionsvisibilitychange",{optionsVisible:u}),i.$$.dirty[0]&8192&&it("featureslisted",{features:U}),i.$$.dirty[2]&8&&it("featuresmarked",{features:de}),i.$$.dirty[0]&1&&it("reversetoggle",{reverse:w}),i.$$.dirty[0]&2&&it("querychange",{query:T}),i.$$.dirty[0]&1|i.$$.dirty[1]&1024&&c&&c.indicateReverse(w)},[w,T,h,M,C,O,P,z,y,d,E,G,Ln,U,W,K,pt,Ke,Ae,Fe,ht,Ss,xn,Ms,Tn,yi,Mn,Ns,g,b,S,k,N,I,_,Q,Z,B,s,l,m,c,v,p,A,V,ee,J,q,H,ce,$e,ct,Le,pe,he,te,fi,ci,hi,bs,ws,Sn,Es,Ls,de,Oe,di,r,u,n,o,a,Cs,ks,Os,Rs,Ps,Is,As,Gs,Bs,Ws,Fs,zs,Ds]}let qr=class extends lt{constructor(e){super(),ot(this,e,Ur,Dr,rt,{ZOOM_DEFAULTS:28,class:2,apiKey:29,bbox:30,clearButtonTitle:3,clearOnBlur:31,clearListOnPick:32,keepListOpen:4,collapsed:5,country:33,debounceSearch:34,enableReverse:6,errorMessage:7,filter:35,flyTo:36,fuzzyMatch:37,language:38,limit:39,reverseGeocodingLimit:40,mapController:41,minLength:42,noResultsMessage:8,placeholder:9,proximity:43,reverseActive:0,reverseButtonTitle:10,searchValue:1,pickedResultStyle:44,showPlaceType:11,showResultsWhileTyping:45,autocompleteTimeout:46,selectFirst:47,flyToSelected:48,markerOnSelected:49,types:50,reverseGeocodingTypes:51,exhaustiveReverseGeocoding:52,excludeTypes:53,reverseGeocodingExcludeTypes:54,zoom:55,apiUrl:56,fetchParameters:57,iconsBaseUrl:12,adjustUrlQuery:58,adjustUrl:59,focus:60,blur:61,setQuery:62,clearList:63,clearMap:64},null,[-1,-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[28]}get focus(){return this.$$.ctx[60]}get blur(){return this.$$.ctx[61]}get setQuery(){return this.$$.ctx[62]}get clearList(){return this.$$.ctx[63]}get clearMap(){return this.$$.ctx[64]}};function Ft(i,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=i,n}function ii(i,e,t={}){for(const r of i){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 Ft({type:"Polygon",coordinates:i},e,t)}function ni(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function Ki(i,e,t={}){return Ft({type:"MultiPolygon",coordinates:i},e,t)}function Yi(i,e,t){if(i!==null)for(var n,r,u,a,o,g,h,b=0,S=0,M,k=i.type,N=k==="FeatureCollection",C=k==="Feature",O=N?i.features.length:1,I=0;I<O;I++){h=N?i.features[I].geometry:C?i.geometry:i,M=h?h.type==="GeometryCollection":!1,o=M?h.geometries.length:1;for(var _=0;_<o;_++){var P=0,z=0;if(a=M?h.geometries[_]:h,a!==null){g=a.coordinates;var Q=a.type;switch(b=0,Q){case null:break;case"Point":if(e(g,S,I,P,z)===!1)return!1;S++,P++;break;case"LineString":case"MultiPoint":for(n=0;n<g.length;n++){if(e(g[n],S,I,P,z)===!1)return!1;S++,Q==="MultiPoint"&&P++}Q==="LineString"&&P++;break;case"Polygon":case"MultiLineString":for(n=0;n<g.length;n++){for(r=0;r<g[n].length-b;r++){if(e(g[n][r],S,I,P,z)===!1)return!1;S++}Q==="MultiLineString"&&P++,Q==="Polygon"&&z++}Q==="Polygon"&&P++;break;case"MultiPolygon":for(n=0;n<g.length;n++){for(z=0,r=0;r<g[n].length;r++){for(u=0;u<g[n][r].length-b;u++){if(e(g[n][r][u],S,I,P,z)===!1)return!1;S++}z++}P++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(Yi(a.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ri(i,e){var t,n,r,u,a,o,g,h,b,S,M=0,k=i.type==="FeatureCollection",N=i.type==="Feature",C=k?i.features.length:1;for(t=0;t<C;t++){for(o=k?i.features[t].geometry:N?i.geometry:i,h=k?i.features[t].properties:N?i.properties:{},b=k?i.features[t].bbox:N?i.bbox:void 0,S=k?i.features[t].id:N?i.id:void 0,g=o?o.type==="GeometryCollection":!1,a=g?o.geometries.length:1,r=0;r<a;r++){if(u=g?o.geometries[r]:o,u===null){if(e(null,M,h,b,S)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(u,M,h,b,S)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<u.geometries.length;n++)if(e(u.geometries[n],M,h,b,S)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function Vr(i,e){ri(i,function(t,n,r,u,a){var o=t===null?null:t.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return e(Ft(t,r,{bbox:u,id:a}),n,0)===!1?!1:void 0}var g;switch(o){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var h=0;h<t.coordinates.length;h++){var b=t.coordinates[h],S={type:g,coordinates:b};if(e(Ft(S,r),n,h)===!1)return!1}})}function jr(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return Yi(i,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}var Qi=jr,Hr=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,si=Math.ceil,Ne=Math.floor,Ee="[BigNumber Error] ",Xi=Ee+"Number primitive has more than 15 significant digits: ",Ie=1e14,D=14,Ji=9007199254740991,oi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Je=1e7,_e=1e9;function $i(i){var e,t,n,r=_.prototype={constructor:_,toString:null,valueOf:null},u=new _(1),a=20,o=4,g=-7,h=21,b=-1e7,S=1e7,M=!1,k=1,N=0,C={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},O="0123456789abcdefghijklmnopqrstuvwxyz",I=!0;function _(s,l){var f,m,c,v,y,d,p,w,E=this;if(!(E instanceof _))return new _(s,l);if(l==null){if(s&&s._isBigNumber===!0){E.s=s.s,!s.c||s.e>S?E.c=E.e=null:s.e<b?E.c=[E.e=0]:(E.e=s.e,E.c=s.c.slice());return}if((d=typeof s=="number")&&s*0==0){if(E.s=1/s<0?(s=-s,-1):1,s===~~s){for(v=0,y=s;y>=10;y/=10,v++);v>S?E.c=E.e=null:(E.e=v,E.c=[s]);return}w=String(s)}else{if(!Hr.test(w=String(s)))return n(E,w,d);E.s=w.charCodeAt(0)==45?(w=w.slice(1),-1):1}(v=w.indexOf("."))>-1&&(w=w.replace(".","")),(y=w.search(/e/i))>0?(v<0&&(v=y),v+=+w.slice(y+1),w=w.substring(0,y)):v<0&&(v=w.length)}else{if(oe(l,2,O.length,"Base"),l==10&&I)return E=new _(s),Z(E,a+E.e+1,o);if(w=String(s),d=typeof s=="number"){if(s*0!=0)return n(E,w,d,l);if(E.s=1/s<0?(w=w.slice(1),-1):1,_.DEBUG&&w.replace(/^0\.0*|\./,"").length>15)throw Error(Xi+s)}else E.s=w.charCodeAt(0)===45?(w=w.slice(1),-1):1;for(f=O.slice(0,l),v=y=0,p=w.length;y<p;y++)if(f.indexOf(m=w.charAt(y))<0){if(m=="."){if(y>v){v=p;continue}}else if(!c&&(w==w.toUpperCase()&&(w=w.toLowerCase())||w==w.toLowerCase()&&(w=w.toUpperCase()))){c=!0,y=-1,v=0;continue}return n(E,String(s),d,l)}d=!1,w=t(w,l,10,E.s),(v=w.indexOf("."))>-1?w=w.replace(".",""):v=w.length}for(y=0;w.charCodeAt(y)===48;y++);for(p=w.length;w.charCodeAt(--p)===48;);if(w=w.slice(y,++p)){if(p-=y,d&&_.DEBUG&&p>15&&(s>Ji||s!==Ne(s)))throw Error(Xi+E.s*s);if((v=v-y-1)>S)E.c=E.e=null;else if(v<b)E.c=[E.e=0];else{if(E.e=v,E.c=[],y=(v+1)%D,v<0&&(y+=D),y<p){for(y&&E.c.push(+w.slice(0,y)),p-=D;y<p;)E.c.push(+w.slice(y,y+=D));y=D-(w=w.slice(y)).length}else y-=p;for(;y--;w+="0");E.c.push(+w)}}else E.c=[E.e=0]}_.clone=$i,_.ROUND_UP=0,_.ROUND_DOWN=1,_.ROUND_CEIL=2,_.ROUND_FLOOR=3,_.ROUND_HALF_UP=4,_.ROUND_HALF_DOWN=5,_.ROUND_HALF_EVEN=6,_.ROUND_HALF_CEIL=7,_.ROUND_HALF_FLOOR=8,_.EUCLID=9,_.config=_.set=function(s){var l,f;if(s!=null)if(typeof s=="object"){if(s.hasOwnProperty(l="DECIMAL_PLACES")&&(f=s[l],oe(f,0,_e,l),a=f),s.hasOwnProperty(l="ROUNDING_MODE")&&(f=s[l],oe(f,0,8,l),o=f),s.hasOwnProperty(l="EXPONENTIAL_AT")&&(f=s[l],f&&f.pop?(oe(f[0],-1e9,0,l),oe(f[1],0,_e,l),g=f[0],h=f[1]):(oe(f,-1e9,_e,l),g=-(h=f<0?-f:f))),s.hasOwnProperty(l="RANGE"))if(f=s[l],f&&f.pop)oe(f[0],-1e9,-1,l),oe(f[1],1,_e,l),b=f[0],S=f[1];else if(oe(f,-1e9,_e,l),f)b=-(S=f<0?-f:f);else throw Error(Ee+l+" cannot be zero: "+f);if(s.hasOwnProperty(l="CRYPTO"))if(f=s[l],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))M=f;else throw M=!f,Error(Ee+"crypto unavailable");else M=f;else throw Error(Ee+l+" not true or false: "+f);if(s.hasOwnProperty(l="MODULO_MODE")&&(f=s[l],oe(f,0,9,l),k=f),s.hasOwnProperty(l="POW_PRECISION")&&(f=s[l],oe(f,0,_e,l),N=f),s.hasOwnProperty(l="FORMAT"))if(f=s[l],typeof f=="object")C=f;else throw Error(Ee+l+" not an object: "+f);if(s.hasOwnProperty(l="ALPHABET"))if(f=s[l],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))I=f.slice(0,10)=="0123456789",O=f;else throw Error(Ee+l+" invalid: "+f)}else throw Error(Ee+"Object expected: "+s);return{DECIMAL_PLACES:a,ROUNDING_MODE:o,EXPONENTIAL_AT:[g,h],RANGE:[b,S],CRYPTO:M,MODULO_MODE:k,POW_PRECISION:N,FORMAT:C,ALPHABET:O}},_.isBigNumber=function(s){if(!s||s._isBigNumber!==!0)return!1;if(!_.DEBUG)return!0;var l,f,m=s.c,c=s.e,v=s.s;e:if({}.toString.call(m)=="[object Array]"){if((v===1||v===-1)&&c>=-1e9&&c<=_e&&c===Ne(c)){if(m[0]===0){if(c===0&&m.length===1)return!0;break e}if(l=(c+1)%D,l<1&&(l+=D),String(m[0]).length==l){for(l=0;l<m.length;l++)if(f=m[l],f<0||f>=Ie||f!==Ne(f))break e;if(f!==0)return!0}}}else if(m===null&&c===null&&(v===null||v===1||v===-1))return!0;throw Error(Ee+"Invalid BigNumber: "+s)},_.maximum=_.max=function(){return z(arguments,-1)},_.minimum=_.min=function(){return z(arguments,1)},_.random=function(){var s=9007199254740992,l=Math.random()*s&2097151?function(){return Ne(Math.random()*s)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var m,c,v,y,d,p=0,w=[],E=new _(u);if(f==null?f=a:oe(f,0,_e),y=si(f/D),M)if(crypto.getRandomValues){for(m=crypto.getRandomValues(new Uint32Array(y*=2));p<y;)d=m[p]*131072+(m[p+1]>>>11),d>=9e15?(c=crypto.getRandomValues(new Uint32Array(2)),m[p]=c[0],m[p+1]=c[1]):(w.push(d%1e14),p+=2);p=y/2}else if(crypto.randomBytes){for(m=crypto.randomBytes(y*=7);p<y;)d=(m[p]&31)*281474976710656+m[p+1]*1099511627776+m[p+2]*4294967296+m[p+3]*16777216+(m[p+4]<<16)+(m[p+5]<<8)+m[p+6],d>=9e15?crypto.randomBytes(7).copy(m,p):(w.push(d%1e14),p+=7);p=y/7}else throw M=!1,Error(Ee+"crypto unavailable");if(!M)for(;p<y;)d=l(),d<9e15&&(w[p++]=d%1e14);for(y=w[--p],f%=D,y&&f&&(d=oi[D-f],w[p]=Ne(y/d)*d);w[p]===0;w.pop(),p--);if(p<0)w=[v=0];else{for(v=-1;w[0]===0;w.splice(0,1),v-=D);for(p=1,d=w[0];d>=10;d/=10,p++);p<D&&(v-=D-p)}return E.e=v,E.c=w,E}}(),_.sum=function(){for(var s=1,l=arguments,f=new _(l[0]);s<l.length;)f=f.plus(l[s++]);return f},t=function(){var s="0123456789";function l(f,m,c,v){for(var y,d=[0],p,w=0,E=f.length;w<E;){for(p=d.length;p--;d[p]*=m);for(d[0]+=v.indexOf(f.charAt(w++)),y=0;y<d.length;y++)d[y]>c-1&&(d[y+1]==null&&(d[y+1]=0),d[y+1]+=d[y]/c|0,d[y]%=c)}return d.reverse()}return function(f,m,c,v,y){var d,p,w,E,T,A,G,V,ee=f.indexOf("."),J=a,q=o;for(ee>=0&&(E=N,N=0,f=f.replace(".",""),V=new _(m),A=V.pow(f.length-ee),N=E,V.c=l(He(ke(A.c),A.e,"0"),10,c,s),V.e=V.c.length),G=l(f,m,c,y?(d=O,s):(d=s,O)),w=E=G.length;G[--E]==0;G.pop());if(!G[0])return d.charAt(0);if(ee<0?--w:(A.c=G,A.e=w,A.s=v,A=e(A,V,J,q,c),G=A.c,T=A.r,w=A.e),p=w+J+1,ee=G[p],E=c/2,T=T||p<0||G[p+1]!=null,T=q<4?(ee!=null||T)&&(q==0||q==(A.s<0?3:2)):ee>E||ee==E&&(q==4||T||q==6&&G[p-1]&1||q==(A.s<0?8:7)),p<1||!G[0])f=T?He(d.charAt(1),-J,d.charAt(0)):d.charAt(0);else{if(G.length=p,T)for(--c;++G[--p]>c;)G[p]=0,p||(++w,G=[1].concat(G));for(E=G.length;!G[--E];);for(ee=0,f="";ee<=E;f+=d.charAt(G[ee++]));f=He(f,w,d.charAt(0))}return f}}(),e=function(){function s(m,c,v){var y,d,p,w,E=0,T=m.length,A=c%Je,G=c/Je|0;for(m=m.slice();T--;)p=m[T]%Je,w=m[T]/Je|0,y=G*p+w*A,d=A*p+y%Je*Je+E,E=(d/v|0)+(y/Je|0)+G*w,m[T]=d%v;return E&&(m=[E].concat(m)),m}function l(m,c,v,y){var d,p;if(v!=y)p=v>y?1:-1;else for(d=p=0;d<v;d++)if(m[d]!=c[d]){p=m[d]>c[d]?1:-1;break}return p}function f(m,c,v,y){for(var d=0;v--;)m[v]-=d,d=m[v]<c[v]?1:0,m[v]=d*y+m[v]-c[v];for(;!m[0]&&m.length>1;m.splice(0,1));}return function(m,c,v,y,d){var p,w,E,T,A,G,V,ee,J,q,H,ce,ft,$e,ct,Le,et,pe=m.s==c.s?1:-1,he=m.c,te=c.c;if(!he||!he[0]||!te||!te[0])return new _(!m.s||!c.s||(he?te&&he[0]==te[0]:!te)?NaN:he&&he[0]==0||!te?pe*0:pe/0);for(ee=new _(pe),J=ee.c=[],w=m.e-c.e,pe=v+w+1,d||(d=Ie,w=Ce(m.e/D)-Ce(c.e/D),pe=pe/D|0),E=0;te[E]==(he[E]||0);E++);if(te[E]>(he[E]||0)&&w--,pe<0)J.push(1),T=!0;else{for($e=he.length,Le=te.length,E=0,pe+=2,A=Ne(d/(te[0]+1)),A>1&&(te=s(te,A,d),he=s(he,A,d),Le=te.length,$e=he.length),ft=Le,q=he.slice(0,Le),H=q.length;H<Le;q[H++]=0);et=te.slice(),et=[0].concat(et),ct=te[0],te[1]>=d/2&&ct++;do{if(A=0,p=l(te,q,Le,H),p<0){if(ce=q[0],Le!=H&&(ce=ce*d+(q[1]||0)),A=Ne(ce/ct),A>1)for(A>=d&&(A=d-1),G=s(te,A,d),V=G.length,H=q.length;l(G,q,V,H)==1;)A--,f(G,Le<V?et:te,V,d),V=G.length,p=1;else A==0&&(p=A=1),G=te.slice(),V=G.length;if(V<H&&(G=[0].concat(G)),f(q,G,H,d),H=q.length,p==-1)for(;l(te,q,Le,H)<1;)A++,f(q,Le<H?et:te,H,d),H=q.length}else p===0&&(A++,q=[0]);J[E++]=A,q[0]?q[H++]=he[ft]||0:(q=[he[ft]],H=1)}while((ft++<$e||q[0]!=null)&&pe--);T=q[0]!=null,J[0]||J.splice(0,1)}if(d==Ie){for(E=1,pe=J[0];pe>=10;pe/=10,E++);Z(ee,v+(ee.e=E+w*D-1)+1,y,T)}else ee.e=w,ee.r=+T;return ee}}();function P(s,l,f,m){var c,v,y,d,p;if(f==null?f=o:oe(f,0,8),!s.c)return s.toString();if(c=s.c[0],y=s.e,l==null)p=ke(s.c),p=m==1||m==2&&(y<=g||y>=h)?Dt(p,y):He(p,y,"0");else if(s=Z(new _(s),l,f),v=s.e,p=ke(s.c),d=p.length,m==1||m==2&&(l<=v||v<=g)){for(;d<l;p+="0",d++);p=Dt(p,v)}else if(l-=y,p=He(p,v,"0"),v+1>d){if(--l>0)for(p+=".";l--;p+="0");}else if(l+=v-d,l>0)for(v+1==d&&(p+=".");l--;p+="0");return s.s<0&&c?"-"+p:p}function z(s,l){for(var f,m,c=1,v=new _(s[0]);c<s.length;c++)m=new _(s[c]),(!m.s||(f=ut(v,m))===l||f===0&&v.s===l)&&(v=m);return v}function Q(s,l,f){for(var m=1,c=l.length;!l[--c];l.pop());for(c=l[0];c>=10;c/=10,m++);return(f=m+f*D-1)>S?s.c=s.e=null:f<b?s.c=[s.e=0]:(s.e=f,s.c=l),s}n=function(){var s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,f=/^\.([^.]+)$/,m=/^-?(Infinity|NaN)$/,c=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(v,y,d,p){var w,E=d?y:y.replace(c,"");if(m.test(E))v.s=isNaN(E)?null:E<0?-1:1;else{if(!d&&(E=E.replace(s,function(T,A,G){return w=(G=G.toLowerCase())=="x"?16:G=="b"?2:8,!p||p==w?A:T}),p&&(w=p,E=E.replace(l,"$1").replace(f,"0.$1")),y!=E))return new _(E,w);if(_.DEBUG)throw Error(Ee+"Not a"+(p?" base "+p:"")+" number: "+y);v.s=null}v.c=v.e=null}}();function Z(s,l,f,m){var c,v,y,d,p,w,E,T=s.c,A=oi;if(T){e:{for(c=1,d=T[0];d>=10;d/=10,c++);if(v=l-c,v<0)v+=D,y=l,p=T[w=0],E=Ne(p/A[c-y-1]%10);else if(w=si((v+1)/D),w>=T.length)if(m){for(;T.length<=w;T.push(0));p=E=0,c=1,v%=D,y=v-D+1}else break e;else{for(p=d=T[w],c=1;d>=10;d/=10,c++);v%=D,y=v-D+c,E=y<0?0:Ne(p/A[c-y-1]%10)}if(m=m||l<0||T[w+1]!=null||(y<0?p:p%A[c-y-1]),m=f<4?(E||m)&&(f==0||f==(s.s<0?3:2)):E>5||E==5&&(f==4||m||f==6&&(v>0?y>0?p/A[c-y]:0:T[w-1])%10&1||f==(s.s<0?8:7)),l<1||!T[0])return T.length=0,m?(l-=s.e+1,T[0]=A[(D-l%D)%D],s.e=-l||0):T[0]=s.e=0,s;if(v==0?(T.length=w,d=1,w--):(T.length=w+1,d=A[D-v],T[w]=y>0?Ne(p/A[c-y]%A[y])*d:0),m)for(;;)if(w==0){for(v=1,y=T[0];y>=10;y/=10,v++);for(y=T[0]+=d,d=1;y>=10;y/=10,d++);v!=d&&(s.e++,T[0]==Ie&&(T[0]=1));break}else{if(T[w]+=d,T[w]!=Ie)break;T[w--]=0,d=1}for(v=T.length;T[--v]===0;T.pop());}s.e>S?s.c=s.e=null:s.e<b&&(s.c=[s.e=0])}return s}function B(s){var l,f=s.e;return f===null?s.toString():(l=ke(s.c),l=f<=g||f>=h?Dt(l,f):He(l,f,"0"),s.s<0?"-"+l:l)}return r.absoluteValue=r.abs=function(){var s=new _(this);return s.s<0&&(s.s=1),s},r.comparedTo=function(s,l){return ut(this,new _(s,l))},r.decimalPlaces=r.dp=function(s,l){var f,m,c,v=this;if(s!=null)return oe(s,0,_e),l==null?l=o:oe(l,0,8),Z(new _(v),s+v.e+1,l);if(!(f=v.c))return null;if(m=((c=f.length-1)-Ce(this.e/D))*D,c=f[c])for(;c%10==0;c/=10,m--);return m<0&&(m=0),m},r.dividedBy=r.div=function(s,l){return e(this,new _(s,l),a,o)},r.dividedToIntegerBy=r.idiv=function(s,l){return e(this,new _(s,l),0,1)},r.exponentiatedBy=r.pow=function(s,l){var f,m,c,v,y,d,p,w,E,T=this;if(s=new _(s),s.c&&!s.isInteger())throw Error(Ee+"Exponent not an integer: "+B(s));if(l!=null&&(l=new _(l)),d=s.e>14,!T.c||!T.c[0]||T.c[0]==1&&!T.e&&T.c.length==1||!s.c||!s.c[0])return E=new _(Math.pow(+B(T),d?s.s*(2-zt(s)):+B(s))),l?E.mod(l):E;if(p=s.s<0,l){if(l.c?!l.c[0]:!l.s)return new _(NaN);m=!p&&T.isInteger()&&l.isInteger(),m&&(T=T.mod(l))}else{if(s.e>9&&(T.e>0||T.e<-1||(T.e==0?T.c[0]>1||d&&T.c[1]>=24e7:T.c[0]<8e13||d&&T.c[0]<=9999975e7)))return v=T.s<0&&zt(s)?-0:0,T.e>-1&&(v=1/v),new _(p?1/v:v);N&&(v=si(N/D+2))}for(d?(f=new _(.5),p&&(s.s=1),w=zt(s)):(c=Math.abs(+B(s)),w=c%2),E=new _(u);;){if(w){if(E=E.times(T),!E.c)break;v?E.c.length>v&&(E.c.length=v):m&&(E=E.mod(l))}if(c){if(c=Ne(c/2),c===0)break;w=c%2}else if(s=s.times(f),Z(s,s.e+1,1),s.e>14)w=zt(s);else{if(c=+B(s),c===0)break;w=c%2}T=T.times(T),v?T.c&&T.c.length>v&&(T.c.length=v):m&&(T=T.mod(l))}return m?E:(p&&(E=u.div(E)),l?E.mod(l):v?Z(E,N,o,y):E)},r.integerValue=function(s){var l=new _(this);return s==null?s=o:oe(s,0,8),Z(l,l.e+1,s)},r.isEqualTo=r.eq=function(s,l){return ut(this,new _(s,l))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(s,l){return ut(this,new _(s,l))>0},r.isGreaterThanOrEqualTo=r.gte=function(s,l){return(l=ut(this,new _(s,l)))===1||l===0},r.isInteger=function(){return!!this.c&&Ce(this.e/D)>this.c.length-2},r.isLessThan=r.lt=function(s,l){return ut(this,new _(s,l))<0},r.isLessThanOrEqualTo=r.lte=function(s,l){return(l=ut(this,new _(s,l)))===-1||l===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,l){var f,m,c,v,y=this,d=y.s;if(s=new _(s,l),l=s.s,!d||!l)return new _(NaN);if(d!=l)return s.s=-l,y.plus(s);var p=y.e/D,w=s.e/D,E=y.c,T=s.c;if(!p||!w){if(!E||!T)return E?(s.s=-l,s):new _(T?y:NaN);if(!E[0]||!T[0])return T[0]?(s.s=-l,s):new _(E[0]?y:o==3?-0:0)}if(p=Ce(p),w=Ce(w),E=E.slice(),d=p-w){for((v=d<0)?(d=-d,c=E):(w=p,c=T),c.reverse(),l=d;l--;c.push(0));c.reverse()}else for(m=(v=(d=E.length)<(l=T.length))?d:l,d=l=0;l<m;l++)if(E[l]!=T[l]){v=E[l]<T[l];break}if(v&&(c=E,E=T,T=c,s.s=-s.s),l=(m=T.length)-(f=E.length),l>0)for(;l--;E[f++]=0);for(l=Ie-1;m>d;){if(E[--m]<T[m]){for(f=m;f&&!E[--f];E[f]=l);--E[f],E[m]+=Ie}E[m]-=T[m]}for(;E[0]==0;E.splice(0,1),--w);return E[0]?Q(s,E,w):(s.s=o==3?-1:1,s.c=[s.e=0],s)},r.modulo=r.mod=function(s,l){var f,m,c=this;return s=new _(s,l),!c.c||!s.s||s.c&&!s.c[0]?new _(NaN):!s.c||c.c&&!c.c[0]?new _(c):(k==9?(m=s.s,s.s=1,f=e(c,s,0,3),s.s=m,f.s*=m):f=e(c,s,0,k),s=c.minus(f.times(s)),!s.c[0]&&k==1&&(s.s=c.s),s)},r.multipliedBy=r.times=function(s,l){var f,m,c,v,y,d,p,w,E,T,A,G,V,ee,J,q=this,H=q.c,ce=(s=new _(s,l)).c;if(!H||!ce||!H[0]||!ce[0])return!q.s||!s.s||H&&!H[0]&&!ce||ce&&!ce[0]&&!H?s.c=s.e=s.s=null:(s.s*=q.s,!H||!ce?s.c=s.e=null:(s.c=[0],s.e=0)),s;for(m=Ce(q.e/D)+Ce(s.e/D),s.s*=q.s,p=H.length,T=ce.length,p<T&&(V=H,H=ce,ce=V,c=p,p=T,T=c),c=p+T,V=[];c--;V.push(0));for(ee=Ie,J=Je,c=T;--c>=0;){for(f=0,A=ce[c]%J,G=ce[c]/J|0,y=p,v=c+y;v>c;)w=H[--y]%J,E=H[y]/J|0,d=G*w+E*A,w=A*w+d%J*J+V[v]+f,f=(w/ee|0)+(d/J|0)+G*E,V[v--]=w%ee;V[v]=f}return f?++m:V.splice(0,1),Q(s,V,m)},r.negated=function(){var s=new _(this);return s.s=-s.s||null,s},r.plus=function(s,l){var f,m=this,c=m.s;if(s=new _(s,l),l=s.s,!c||!l)return new _(NaN);if(c!=l)return s.s=-l,m.minus(s);var v=m.e/D,y=s.e/D,d=m.c,p=s.c;if(!v||!y){if(!d||!p)return new _(c/0);if(!d[0]||!p[0])return p[0]?s:new _(d[0]?m:c*0)}if(v=Ce(v),y=Ce(y),d=d.slice(),c=v-y){for(c>0?(y=v,f=p):(c=-c,f=d),f.reverse();c--;f.push(0));f.reverse()}for(c=d.length,l=p.length,c-l<0&&(f=p,p=d,d=f,l=c),c=0;l;)c=(d[--l]=d[l]+p[l]+c)/Ie|0,d[l]=Ie===d[l]?0:d[l]%Ie;return c&&(d=[c].concat(d),++y),Q(s,d,y)},r.precision=r.sd=function(s,l){var f,m,c,v=this;if(s!=null&&s!==!!s)return oe(s,1,_e),l==null?l=o:oe(l,0,8),Z(new _(v),s,l);if(!(f=v.c))return null;if(c=f.length-1,m=c*D+1,c=f[c]){for(;c%10==0;c/=10,m--);for(c=f[0];c>=10;c/=10,m++);}return s&&v.e+1>m&&(m=v.e+1),m},r.shiftedBy=function(s){return oe(s,-9007199254740991,Ji),this.times("1e"+s)},r.squareRoot=r.sqrt=function(){var s,l,f,m,c,v=this,y=v.c,d=v.s,p=v.e,w=a+4,E=new _("0.5");if(d!==1||!y||!y[0])return new _(!d||d<0&&(!y||y[0])?NaN:y?v:1/0);if(d=Math.sqrt(+B(v)),d==0||d==1/0?(l=ke(y),(l.length+p)%2==0&&(l+="0"),d=Math.sqrt(+l),p=Ce((p+1)/2)-(p<0||p%2),d==1/0?l="5e"+p:(l=d.toExponential(),l=l.slice(0,l.indexOf("e")+1)+p),f=new _(l)):f=new _(d+""),f.c[0]){for(p=f.e,d=p+w,d<3&&(d=0);;)if(c=f,f=E.times(c.plus(e(v,c,w,1))),ke(c.c).slice(0,d)===(l=ke(f.c)).slice(0,d))if(f.e<p&&--d,l=l.slice(d-3,d+1),l=="9999"||!m&&l=="4999"){if(!m&&(Z(c,c.e+a+2,0),c.times(c).eq(v))){f=c;break}w+=4,d+=4,m=1}else{(!+l||!+l.slice(1)&&l.charAt(0)=="5")&&(Z(f,f.e+a+2,1),s=!f.times(f).eq(v));break}}return Z(f,f.e+a+1,o,s)},r.toExponential=function(s,l){return s!=null&&(oe(s,0,_e),s++),P(this,s,l,1)},r.toFixed=function(s,l){return s!=null&&(oe(s,0,_e),s=s+this.e+1),P(this,s,l)},r.toFormat=function(s,l,f){var m,c=this;if(f==null)s!=null&&l&&typeof l=="object"?(f=l,l=null):s&&typeof s=="object"?(f=s,s=l=null):f=C;else if(typeof f!="object")throw Error(Ee+"Argument not an object: "+f);if(m=c.toFixed(s,l),c.c){var v,y=m.split("."),d=+f.groupSize,p=+f.secondaryGroupSize,w=f.groupSeparator||"",E=y[0],T=y[1],A=c.s<0,G=A?E.slice(1):E,V=G.length;if(p&&(v=d,d=p,p=v,V-=v),d>0&&V>0){for(v=V%d||d,E=G.substr(0,v);v<V;v+=d)E+=w+G.substr(v,d);p>0&&(E+=w+G.slice(v)),A&&(E="-"+E)}m=T?E+(f.decimalSeparator||"")+((p=+f.fractionGroupSize)?T.replace(new RegExp("\\d{"+p+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):T):E}return(f.prefix||"")+m+(f.suffix||"")},r.toFraction=function(s){var l,f,m,c,v,y,d,p,w,E,T,A,G=this,V=G.c;if(s!=null&&(d=new _(s),!d.isInteger()&&(d.c||d.s!==1)||d.lt(u)))throw Error(Ee+"Argument "+(d.isInteger()?"out of range: ":"not an integer: ")+B(d));if(!V)return new _(G);for(l=new _(u),w=f=new _(u),m=p=new _(u),A=ke(V),v=l.e=A.length-G.e-1,l.c[0]=oi[(y=v%D)<0?D+y:y],s=!s||d.comparedTo(l)>0?v>0?l:w:d,y=S,S=1/0,d=new _(A),p.c[0]=0;E=e(d,l,0,1),c=f.plus(E.times(m)),c.comparedTo(s)!=1;)f=m,m=c,w=p.plus(E.times(c=w)),p=c,l=d.minus(E.times(c=l)),d=c;return c=e(s.minus(f),m,0,1),p=p.plus(c.times(w)),f=f.plus(c.times(m)),p.s=w.s=G.s,v=v*2,T=e(w,m,v,o).minus(G).abs().comparedTo(e(p,f,v,o).minus(G).abs())<1?[w,m]:[p,f],S=y,T},r.toNumber=function(){return+B(this)},r.toPrecision=function(s,l){return s!=null&&oe(s,1,_e),P(this,s,l,2)},r.toString=function(s){var l,f=this,m=f.s,c=f.e;return c===null?m?(l="Infinity",m<0&&(l="-"+l)):l="NaN":(s==null?l=c<=g||c>=h?Dt(ke(f.c),c):He(ke(f.c),c,"0"):s===10&&I?(f=Z(new _(f),a+c+1,o),l=He(ke(f.c),f.e,"0")):(oe(s,2,O.length,"Base"),l=t(He(ke(f.c),c,"0"),10,s,m,!0)),m<0&&f.c[0]&&(l="-"+l)),l},r.valueOf=r.toJSON=function(){return B(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,i!=null&&_.set(i),_}function Ce(i){var e=i|0;return i>0||i===e?e:e-1}function ke(i){for(var e,t,n=1,r=i.length,u=i[0]+"";n<r;){for(e=i[n++]+"",t=D-e.length;t--;e="0"+e);u+=e}for(r=u.length;u.charCodeAt(--r)===48;);return u.slice(0,r+1||1)}function ut(i,e){var t,n,r=i.c,u=e.c,a=i.s,o=e.s,g=i.e,h=e.e;if(!a||!o)return null;if(t=r&&!r[0],n=u&&!u[0],t||n)return t?n?0:-o:a;if(a!=o)return a;if(t=a<0,n=g==h,!r||!u)return n?0:!r^t?1:-1;if(!n)return g>h^t?1:-1;for(o=(g=r.length)<(h=u.length)?g:h,a=0;a<o;a++)if(r[a]!=u[a])return r[a]>u[a]^t?1:-1;return g==h?0:g>h^t?1:-1}function oe(i,e,t,n){if(i<e||i>t||i!==Ne(i))throw Error(Ee+(n||"Argument")+(typeof i=="number"?i<e||i>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function zt(i){var e=i.c.length-1;return Ce(i.e/D)==e&&i.c[e]%2!=0}function Dt(i,e){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(e<0?"e":"e+")+e}function He(i,e,t){var n,r;if(e<0){for(r=t+".";++e;r+=t);i=r+i}else if(n=i.length,++e>n){for(r=t,e-=n;--e;r+=t);i+=r}else e<n&&(i=i.slice(0,e)+"."+i.slice(e));return i}var Be=$i(),Zr=class{constructor(i){R(this,"key");R(this,"left",null);R(this,"right",null);this.key=i}},St=class extends Zr{constructor(i){super(i)}},Kr=class{constructor(){R(this,"size",0);R(this,"modificationCount",0);R(this,"splayCount",0)}splay(i){const e=this.root;if(e==null)return this.compare(i,i),-1;let t=null,n=null,r=null,u=null,a=e;const o=this.compare;let g;for(;;)if(g=o(a.key,i),g>0){let h=a.left;if(h==null||(g=o(h.key,i),g>0&&(a.left=h.right,h.right=a,a=h,h=a.left,h==null)))break;t==null?n=a:t.left=a,t=a,a=h}else if(g<0){let h=a.right;if(h==null||(g=o(h.key,i),g<0&&(a.right=h.left,h.left=a,a=h,h=a.right,h==null)))break;r==null?u=a:r.right=a,r=a,a=h}else break;return r!=null&&(r.right=a.left,a.left=u),t!=null&&(t.left=a.right,a.right=n),this.root!==a&&(this.root=a,this.splayCount++),g}splayMin(i){let e=i,t=e.left;for(;t!=null;){const n=t;e.left=n.right,n.right=e,e=n,t=e.left}return e}splayMax(i){let e=i,t=e.right;for(;t!=null;){const n=t;e.right=n.left,n.left=e,e=n,t=e.right}return e}_delete(i){if(this.root==null||this.splay(i)!=0)return null;let t=this.root;const n=t,r=t.left;if(this.size--,r==null)this.root=t.right;else{const u=t.right;t=this.splayMax(r),t.right=u,this.root=t}return this.modificationCount++,n}addNewRoot(i,e){this.size++,this.modificationCount++;const t=this.root;if(t==null){this.root=i;return}e<0?(i.left=t,i.right=t.right,t.right=null):(i.right=t,i.left=t.left,t.left=null),this.root=i}_first(){const i=this.root;return i==null?null:(this.root=this.splayMin(i),this.root)}_last(){const i=this.root;return i==null?null:(this.root=this.splayMax(i),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(i){return this.validKey(i)&&this.splay(i)==0}defaultCompare(){return(i,e)=>i<e?-1:i>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:i=>{this.root=i},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:i=>{this.splayCount=i},splay:i=>this.splay(i),has:i=>this.has(i)}}},Ut=class Ot extends Kr{constructor(t,n){super();R(this,"root",null);R(this,"compare");R(this,"validKey");R(this,wn,"[object Set]");this.compare=t??this.defaultCompare(),this.validKey=n??(r=>r!=null&&r!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(const n of t)this.delete(n)}forEach(t){const n=this[Symbol.iterator]();let r;for(;r=n.next(),!r.done;)t(r.value,r.value,this)}add(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new St(t),n),this}addAndReturn(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new St(t),n),this.root.key}addAll(t){for(const n of t)this.add(n)}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(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<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(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>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(t){const n=new Ot(this.compare,this.validKey),r=this.modificationCount;for(const u of t){if(r!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(u)&&this.splay(u)==0&&n.add(this.root.key)}n.size!=this.size&&(this.root=n.root,this.size=n.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){const n=new Ot(this.compare,this.validKey);for(const r of this)t.has(r)&&n.add(r);return n}difference(t){const n=new Ot(this.compare,this.validKey);for(const r of this)t.has(r)||n.add(r);return n}union(t){const n=this.clone();return n.addAll(t),n}clone(){const t=new Ot(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function n(u,a){let o,g;do{if(o=u.left,g=u.right,o!=null){const h=new St(o.key);a.left=h,n(o,h)}if(g!=null){const h=new St(g.key);a.right=h,u=g,a=h}}while(g!=null)}const r=new St(t.key);return n(t,r),r}toSet(){return this.clone()}entries(){return new Qr(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(En=Symbol.iterator,wn=Symbol.toStringTag,En)](){return new Yr(this.wrap())}},en=class{constructor(i){R(this,"tree");R(this,"path",new Array);R(this,"modificationCount",null);R(this,"splayCount");this.tree=i,this.splayCount=i.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 i=this.path[this.path.length-1];return this.getValue(i)}rebuildPath(i){this.path.splice(0,this.path.length),this.tree.splay(i),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(i){for(;i!=null;)this.path.push(i),i=i.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let t=this.tree.getRoot();for(;t!=null;)this.path.push(t),t=t.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 i=this.path[this.path.length-1],e=i.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===i;)i=this.path.pop();return this.path.length>0}},Yr=class extends en{getValue(i){return i.key}},Qr=class extends en{getValue(i){return[i.key,i.key]}},tn=i=>()=>i,li=i=>{const e=i?(t,n)=>n.minus(t).abs().isLessThanOrEqualTo(i):tn(!1);return(t,n)=>e(t,n)?0:t.comparedTo(n)};function Xr(i){const e=i?(t,n,r,u,a)=>t.exponentiatedBy(2).isLessThanOrEqualTo(u.minus(n).exponentiatedBy(2).plus(a.minus(r).exponentiatedBy(2)).times(i)):tn(!1);return(t,n,r)=>{const u=t.x,a=t.y,o=r.x,g=r.y,h=a.minus(g).times(n.x.minus(o)).minus(u.minus(o).times(n.y.minus(g)));return e(h,u,a,o,g)?0:h.comparedTo(0)}}var Jr=i=>i,$r=i=>{if(i){const e=new Ut(li(i)),t=new Ut(li(i)),n=(u,a)=>a.addAndReturn(u),r=u=>({x:n(u.x,e),y:n(u.y,t)});return r({x:new Be(0),y:new Be(0)}),r}return Jr},ui=i=>({set:e=>{Ze=ui(e)},reset:()=>ui(i),compare:li(i),snap:$r(i),orient:Xr(i)}),Ze=ui(),_t=(i,e)=>i.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(i.ur.x)&&i.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(i.ur.y),ai=(i,e)=>{if(e.ur.x.isLessThan(i.ll.x)||i.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(i.ll.y)||i.ur.y.isLessThan(e.ll.y))return null;const t=i.ll.x.isLessThan(e.ll.x)?e.ll.x:i.ll.x,n=i.ur.x.isLessThan(e.ur.x)?i.ur.x:e.ur.x,r=i.ll.y.isLessThan(e.ll.y)?e.ll.y:i.ll.y,u=i.ur.y.isLessThan(e.ur.y)?i.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:n,y:u}}},qt=(i,e)=>i.x.times(e.y).minus(i.y.times(e.x)),nn=(i,e)=>i.x.times(e.x).plus(i.y.times(e.y)),Vt=i=>nn(i,i).sqrt(),es=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return qt(r,n).div(Vt(r)).div(Vt(n))},ts=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return nn(r,n).div(Vt(r)).div(Vt(n))},rn=(i,e,t)=>e.y.isZero()?null:{x:i.x.plus(e.x.div(e.y).times(t.minus(i.y))),y:t},sn=(i,e,t)=>e.x.isZero()?null:{x:t,y:i.y.plus(e.y.div(e.x).times(t.minus(i.x)))},is=(i,e,t,n)=>{if(e.x.isZero())return sn(t,n,i.x);if(n.x.isZero())return sn(i,e,t.x);if(e.y.isZero())return rn(t,n,i.y);if(n.y.isZero())return rn(i,e,t.y);const r=qt(e,n);if(r.isZero())return null;const u={x:t.x.minus(i.x),y:t.y.minus(i.y)},a=qt(u,e).div(r),o=qt(u,n).div(r),g=i.x.plus(o.times(e.x)),h=t.x.plus(a.times(n.x)),b=i.y.plus(o.times(e.y)),S=t.y.plus(a.times(n.y)),M=g.plus(h).div(2),k=b.plus(S).div(2);return{x:M,y:k}},We=class Rn{constructor(e,t){R(this,"point");R(this,"isLeft");R(this,"segment");R(this,"otherSE");R(this,"consumedBy");e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}static compare(e,t){const n=Rn.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Ht.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x.isLessThan(t.x)?-1:e.x.isGreaterThan(t.x)?1:e.y.isLessThan(t.y)?-1:e.y.isGreaterThan(t.y)?1:0}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,r=t.length;n<r;n++){const u=t[n];this.point.events.push(u),u.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const u=this.point.events[r];u.consumedBy===void 0&&n.otherSE.point.events===u.otherSE.point.events&&n.segment.consume(u.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,n=r=>{const u=r.otherSE;t.set(r,{sine:es(this.point,e.point,u.point),cosine:ts(this.point,e.point,u.point)})};return(r,u)=>{t.has(r)||n(r),t.has(u)||n(u);const{sine:a,cosine:o}=t.get(r),{sine:g,cosine:h}=t.get(u);return a.isGreaterThanOrEqualTo(0)&&g.isGreaterThanOrEqualTo(0)?o.isLessThan(h)?1:o.isGreaterThan(h)?-1:0:a.isLessThan(0)&&g.isLessThan(0)?o.isLessThan(h)?-1:o.isGreaterThan(h)?1:0:g.isLessThan(a)?-1:g.isGreaterThan(a)?1:0}}},ns=class wi{constructor(e){R(this,"events");R(this,"poly");R(this,"_isExteriorRing");R(this,"_enclosingRing");this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const u=e[n];if(!u.isInResult()||u.ringOut)continue;let a=null,o=u.leftSE,g=u.rightSE;const h=[o],b=o.point,S=[];for(;a=o,o=g,h.push(o),o.point!==b;)for(;;){const M=o.getAvailableLinkedEvents();if(M.length===0){const C=h[0].point,O=h[h.length-1].point;throw new Error(`Unable to complete output ring starting at [${C.x}, ${C.y}]. Last matching segment found ends at [${O.x}, ${O.y}].`)}if(M.length===1){g=M[0].otherSE;break}let k=null;for(let C=0,O=S.length;C<O;C++)if(S[C].point===o.point){k=C;break}if(k!==null){const C=S.splice(k)[0],O=h.splice(C.index);O.unshift(O[0].otherSE),t.push(new wi(O.reverse()));continue}S.push({index:h.length,point:o.point});const N=o.getLeftmostComparator(a);g=M.sort(N)[0].otherSE;break}t.push(new wi(h))}return t}getGeom(){let e=this.events[0].point;const t=[e];for(let h=1,b=this.events.length-1;h<b;h++){const S=this.events[h].point,M=this.events[h+1].point;Ze.orient(S,e,M)!==0&&(t.push(S),e=S)}if(t.length===1)return null;const n=t[0],r=t[1];Ze.orient(n,e,r)===0&&t.shift(),t.push(t[0]);const u=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,o=this.isExteriorRing()?t.length:-1,g=[];for(let h=a;h!=o;h+=u)g.push([t[h].x.toNumber(),t[h].y.toNumber()]);return g}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,o=this.events.length;a<o;a++){const g=this.events[a];We.compare(e,g)>0&&(e=g)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return((r=n.ringOut)==null?void 0:r.enclosingRing())!==t.ringOut?t.ringOut:(u=t.ringOut)==null?void 0:u.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}},on=class{constructor(i){R(this,"exteriorRing");R(this,"interiorRings");this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=this.exteriorRing.getGeom();if(i===null)return null;const e=[i];for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}},rs=class{constructor(i){R(this,"rings");R(this,"polys");this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getGeom();n!==null&&i.push(n)}return i}_composePolys(i){var t;const e=[];for(let n=0,r=i.length;n<r;n++){const u=i[n];if(!u.poly)if(u.isExteriorRing())e.push(new on(u));else{const a=u.enclosingRing();a!=null&&a.poly||e.push(new on(a)),(t=a==null?void 0:a.poly)==null||t.addInterior(u)}}return e}},ss=class{constructor(i,e=Ht.compare){R(this,"queue");R(this,"tree");R(this,"segments");this.queue=i,this.tree=new Ut(e),this.segments=[]}process(i){const e=i.segment,t=[];if(i.consumedBy)return i.isLeft?this.queue.delete(i.otherSE):this.tree.delete(e),t;i.isLeft&&this.tree.add(e);let n=e,r=e;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do r=this.tree.firstAfter(r);while(r!=null&&r.consumedBy!=null);if(i.isLeft){let u=null;if(n){const o=n.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(u=o),!n.isAnEndpoint(o))){const g=this._splitSafely(n,o);for(let h=0,b=g.length;h<b;h++)t.push(g[h])}}let a=null;if(r){const o=r.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(a=o),!r.isAnEndpoint(o))){const g=this._splitSafely(r,o);for(let h=0,b=g.length;h<b;h++)t.push(g[h])}}if(u!==null||a!==null){let o=null;u===null?o=a:a===null?o=u:o=We.comparePoints(u,a)<=0?u:a,this.queue.delete(e.rightSE),t.push(e.rightSE);const g=e.split(o);for(let h=0,b=g.length;h<b;h++)t.push(g[h])}t.length>0?(this.tree.delete(e),t.push(i)):(this.segments.push(e),e.prev=n)}else{if(n&&r){const u=n.getIntersection(r);if(u!==null){if(!n.isAnEndpoint(u)){const a=this._splitSafely(n,u);for(let o=0,g=a.length;o<g;o++)t.push(a[o])}if(!r.isAnEndpoint(u)){const a=this._splitSafely(r,u);for(let o=0,g=a.length;o<g;o++)t.push(a[o])}}}this.tree.delete(e)}return t}_splitSafely(i,e){this.tree.delete(i);const t=i.rightSE;this.queue.delete(t);const n=i.split(e);return n.push(t),i.consumedBy===void 0&&this.tree.add(i),n}},os=class{constructor(){R(this,"type");R(this,"numMultiPolys")}run(i,e,t){xt.type=i;const n=[new un(e,!0)];for(let h=0,b=t.length;h<b;h++)n.push(new un(t[h],!1));if(xt.numMultiPolys=n.length,xt.type==="difference"){const h=n[0];let b=1;for(;b<n.length;)ai(n[b].bbox,h.bbox)!==null?b++:n.splice(b,1)}if(xt.type==="intersection")for(let h=0,b=n.length;h<b;h++){const S=n[h];for(let M=h+1,k=n.length;M<k;M++)if(ai(S.bbox,n[M].bbox)===null)return[]}const r=new Ut(We.compare);for(let h=0,b=n.length;h<b;h++){const S=n[h].getSweepEvents();for(let M=0,k=S.length;M<k;M++)r.add(S[M])}const u=new ss(r);let a=null;for(r.size!=0&&(a=r.first(),r.delete(a));a;){const h=u.process(a);for(let b=0,S=h.length;b<S;b++){const M=h[b];M.consumedBy===void 0&&r.add(M)}r.size!=0?(a=r.first(),r.delete(a)):a=null}Ze.reset();const o=ns.factory(u.segments);return new rs(o).getGeom()}},xt=new os,jt=xt,ls=0,Ht=class Yt{constructor(e,t,n,r){R(this,"id");R(this,"leftSE");R(this,"rightSE");R(this,"rings");R(this,"windings");R(this,"ringOut");R(this,"consumedBy");R(this,"prev");R(this,"_prevInResult");R(this,"_beforeState");R(this,"_afterState");R(this,"_isInResult");this.id=++ls,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,u=e.rightSE.point.x,a=t.rightSE.point.x;if(a.isLessThan(n))return 1;if(u.isLessThan(r))return-1;const o=e.leftSE.point.y,g=t.leftSE.point.y,h=e.rightSE.point.y,b=t.rightSE.point.y;if(n.isLessThan(r)){if(g.isLessThan(o)&&g.isLessThan(h))return 1;if(g.isGreaterThan(o)&&g.isGreaterThan(h))return-1;const S=e.comparePoint(t.leftSE.point);if(S<0)return 1;if(S>0)return-1;const M=t.comparePoint(e.rightSE.point);return M!==0?M:-1}if(n.isGreaterThan(r)){if(o.isLessThan(g)&&o.isLessThan(b))return-1;if(o.isGreaterThan(g)&&o.isGreaterThan(b))return 1;const S=t.comparePoint(e.leftSE.point);if(S!==0)return S;const M=e.comparePoint(t.rightSE.point);return M<0?1:M>0?-1:1}if(o.isLessThan(g))return-1;if(o.isGreaterThan(g))return 1;if(u.isLessThan(a)){const S=t.comparePoint(e.rightSE.point);if(S!==0)return S}if(u.isGreaterThan(a)){const S=e.comparePoint(t.rightSE.point);if(S<0)return 1;if(S>0)return-1}if(!u.eq(a)){const S=h.minus(o),M=u.minus(n),k=b.minus(g),N=a.minus(r);if(S.isGreaterThan(M)&&k.isLessThan(N))return 1;if(S.isLessThan(M)&&k.isGreaterThan(N))return-1}return u.isGreaterThan(a)?1:u.isLessThan(a)||h.isLessThan(b)?-1:h.isGreaterThan(b)?1:e.id<t.id?-1:e.id>t.id?1:0}static fromRing(e,t,n){let r,u,a;const o=We.comparePoints(e,t);if(o<0)r=e,u=t,a=1;else if(o>0)r=t,u=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const g=new We(r,!0),h=new We(u,!1);return new Yt(g,h,[n],[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,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e.isLessThan(t)?e:t},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(t)?e:t}}}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 Ze.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=ai(t,n);if(r===null)return null;const u=this.leftSE.point,a=this.rightSE.point,o=e.leftSE.point,g=e.rightSE.point,h=_t(t,o)&&this.comparePoint(o)===0,b=_t(n,u)&&e.comparePoint(u)===0,S=_t(t,g)&&this.comparePoint(g)===0,M=_t(n,a)&&e.comparePoint(a)===0;if(b&&h)return M&&!S?a:!M&&S?g:null;if(b)return S&&u.x.eq(g.x)&&u.y.eq(g.y)?null:u;if(h)return M&&a.x.eq(o.x)&&a.y.eq(o.y)?null:o;if(M&&S)return null;if(M)return a;if(S)return g;const k=is(u,this.vector(),o,e.vector());return k===null||!_t(r,k)?null:Ze.snap(k)}split(e){const t=[],n=e.events!==void 0,r=new We(e,!0),u=new We(e,!1),a=this.rightSE;this.replaceRightSE(u),t.push(u),t.push(r);const o=new Yt(r,a,this.rings.slice(),this.windings.slice());return We.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),We.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),u.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=Yt.compare(t,n);if(r!==0){if(r>0){const u=t;t=n,n=u}if(t.prev===n){const u=t;t=n,n=u}for(let u=0,a=n.rings.length;u<a;u++){const o=n.rings[u],g=n.windings[u],h=t.rings.indexOf(o);h===-1?(t.rings.push(o),t.windings.push(g)):t.windings[h]+=g}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.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 t=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let o=0,g=this.rings.length;o<g;o++){const h=this.rings[o],b=this.windings[o],S=t.indexOf(h);S===-1?(t.push(h),n.push(b)):n[S]+=b}const u=[],a=[];for(let o=0,g=t.length;o<g;o++){if(n[o]===0)continue;const h=t[o],b=h.poly;if(a.indexOf(b)===-1)if(h.isExterior)u.push(b);else{a.indexOf(b)===-1&&a.push(b);const S=u.indexOf(h.poly);S!==-1&&u.splice(S,1)}}for(let o=0,g=u.length;o<g;o++){const h=u[o].multiPoly;r.indexOf(h)===-1&&r.push(h)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(jt.type){case"union":{const n=e.length===0,r=t.length===0;this._isInResult=n!==r;break}case"intersection":{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===jt.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=r=>r.length===1&&r[0].isSubject;this._isInResult=n(e)!==n(t);break}}return this._isInResult}},ln=class{constructor(i,e,t){R(this,"poly");R(this,"isExterior");R(this,"segments");R(this,"bbox");if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=t,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const n=Ze.snap({x:new Be(i[0][0]),y:new Be(i[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let r=n;for(let u=1,a=i.length;u<a;u++){if(typeof i[u][0]!="number"||typeof i[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Ze.snap({x:new Be(i[u][0]),y:new Be(i[u][1])});o.x.eq(r.x)&&o.y.eq(r.y)||(this.segments.push(Ht.fromRing(r,o,this)),o.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=o.x),o.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=o.y),o.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=o.x),o.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=o.y),r=o)}(!n.x.eq(r.x)||!n.y.eq(r.y))&&this.segments.push(Ht.fromRing(r,n,this))}getSweepEvents(){const i=[];for(let e=0,t=this.segments.length;e<t;e++){const n=this.segments[e];i.push(n.leftSE),i.push(n.rightSE)}return i}},us=class{constructor(i,e){R(this,"multiPoly");R(this,"exteriorRing");R(this,"interiorRings");R(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new ln(i[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 t=1,n=i.length;t<n;t++){const r=new ln(i[t],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 i=this.exteriorRing.getSweepEvents();for(let e=0,t=this.interiorRings.length;e<t;e++){const n=this.interiorRings[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},un=class{constructor(i,e){R(this,"isSubject");R(this,"polys");R(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:new Be(Number.POSITIVE_INFINITY),y:new Be(Number.POSITIVE_INFINITY)},ur:{x:new Be(Number.NEGATIVE_INFINITY),y:new Be(Number.NEGATIVE_INFINITY)}};for(let t=0,n=i.length;t<n;t++){const r=new us(i[t],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 i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},as=(i,...e)=>jt.run("union",i,e),fs=(i,...e)=>jt.run("difference",i,e);Ze.set;function cs(i){const e=[];if(ri(i,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=i.features[0].properties||{},n=fs(e[0],...e.slice(1));return n.length===0?null:n.length===1?ii(n[0],t):Ki(n,t)}var hs=cs;function ds(i){if(!i)throw new Error("geojson is required");var e=[];return Vr(i,function(t){e.push(t)}),ni(e)}var gs=ds;function ms(i,e={}){const t=[];if(ri(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=as(t[0],...t.slice(1));return n.length===0?null:n.length===1?ii(n[0],e.properties):Ki(n,e.properties)}var ys=ms;function an(i,e){const t=hs(ni([ii([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=Wt(Qi(i)),r=(n[2]-n[0])/360/1e3,u=n[0]<-180,a=n[2]>180,o=gs(i);if(o.features.length>1&&(u||a))for(const g of o.features){const h=Wt(Qi(g));if(a&&h[0]<-180+r)for(const b of g.geometry.coordinates)for(const S of b)S[0]+=360-r;if(u&&h[2]>180-r)for(const b of g.geometry.coordinates)for(const S of b)S[0]-=360-r}e(ni([o.features.length<2?i:ys(o)??i,t]))}const fn="EPSG:4326";function ps(i){var u;const e=i.getProperties(),{isMask:t}=e,n=(u=i.getGeometry())==null?void 0:u.getType(),r=t?0:n==="LineString"||n==="MultiLineString"?3:2;return new Gn({stroke:t?void 0:new Li({color:"#3170fe",lineDash:[r,r],width:r,lineCap:"butt"}),fill:t?new Ei({color:"#00000020"}):void 0,image:new An({src:`/icons/marker_${e.isReverse?"reverse":e.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:e.isSelected?2:e.isReverse?0:1,text:e.isSelected&&e.tooltip?new Bn({backgroundFill:new Ei({color:"white"}),text:e.tooltip,offsetY:-40,backgroundStroke:new Li({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})}function cn(i,e={},t={},n=ps){let r=-1,u,a,o,g=!1;const h=new Pn({updateWhileAnimating:!0});i.addLayer(h);const b=new In({});h.setSource(b),h.setStyle(n),i.on("click",N=>{i.forEachFeatureAtPixel(N.pixel,C=>{const O=C.getId();if(O)return N.stopPropagation(),a==null||a({type:"markerClick",id:O}),C})}),i.on("pointermove",N=>{const C=i.forEachFeatureAtPixel(N.pixel,O=>O.getId());u!==C&&(u&&(a==null||a({type:"markerMouseLeave",id:u})),C&&(a==null||a({type:"markerMouseEnter",id:C})),i.getTargetElement().style.cursor=C?"pointer":g?"crosshair":"",u=C)});function S(){return Ye.getUserProjection()??i.getView().getProjection()}function M(N){return N.transform(fn,S())}const k=N=>{a==null||a({type:"mapClick",coordinates:Ye.toLonLat(N.coordinate,S())})};return{setEventHandler(N){N?(a=N,i.on("click",k)):(a=void 0,i.un("click",k))},flyTo(N,C){i.getView().animate({center:Ye.fromLonLat(N,S()),...C?{zoom:C}:{},duration:2e3,...e})},fitBounds(N,C,O){i.getView().fit(Ye.transformExtent(N,fn,S()),{padding:[C,C,C,C],...O?{maxZoom:O}:{},duration:2e3,...t})},indicateReverse(N){g=N,i.getTargetElement().style.cursor=N?"crosshair":""},setReverseMarker(N){o?N?o.getGeometry().setCoordinates(Ye.fromLonLat(N,S())):(b.removeFeature(o),o.dispose(),o=void 0):N&&(o=new xe.Feature(new Te.Point(Ye.fromLonLat(N,S()))),o.setProperties({isReverse:!0}),b.addFeature(o))},setFeatures(N,C,O){function I(_){var P;if(_)for(const z of _.features){const Q=z.geometry.type==="Polygon"?new Te.Polygon(z.geometry.coordinates):z.geometry.type==="MultiPolygon"?new Te.MultiPolygon(z.geometry.coordinates):null;Q&&b.addFeature(new xe.Feature({isMask:!!((P=z.properties)!=null&&P.isMask),geometry:M(Q)}))}}b.clear(),o&&b.addFeature(o);e:if(C){let _=!1;if(C.geometry.type==="GeometryCollection"){const P=C.geometry.geometries.map(z=>z.type==="Polygon"?new Te.Polygon(z.coordinates):z.type==="MultiPolygon"?new Te.MultiPolygon(z.coordinates):null).filter(z=>!!z);if(P.length>0)b.addFeature(new xe.Feature(M(new Te.GeometryCollection(P)))),_=!0;else for(const z of C.geometry.geometries)z.type==="LineString"?(b.addFeature(new xe.Feature(M(new Te.LineString(z.coordinates)))),_=!0):z.type==="MultiLineString"&&b.addFeature(new xe.Feature(M(new Te.MultiLineString(z.coordinates)))),_=!0}if(!_){if(C.geometry.type==="Polygon")an(C,I);else if(C.geometry.type==="MultiPolygon")an(C,I);else if(C.geometry.type==="LineString"){b.addFeature(new xe.Feature(M(new Te.LineString(C.geometry.coordinates))));break e}else if(C.geometry.type==="MultiLineString"){b.addFeature(new xe.Feature(M(new Te.MultiLineString(C.geometry.coordinates))));break e}}if(!O&&C.geometry.type!=="Point")break e;b.addFeature(new xe.Feature(M(new Te.Point(C.center))))}for(const _ of N??[]){if(_===C)continue;const P=new xe.Feature(new Te.Point(Ye.fromLonLat(_.center,S())));P.setId(_.id),P.setProperties({fuzzy:!!_.matching_text,tooltip:_.place_type[0]==="reverse"?_.place_name:_.place_name.replace(/,.*/,"")}),b.addFeature(P)}},setSelectedMarker(N){var I,_,P;const C=b.getFeatures(),O=(I=C[0])!=null&&I.getProperties().isReverse?1:0;r>-1&&((_=C[r+O])==null||_.setProperties({isSelected:!1})),N>-1&&((P=C[N+O])==null||P.setProperties({isSelected:!0})),r=N},getCenterAndZoom(){const N=i.getView(),C=N.getCenter(),O=N.getZoom();if(!(!C||O===void 0))return[O,...Ye.toLonLat(C,S())]}}}class vs extends $.Control{constructor(t){const n=document.createElement("div");n.className="ol-search";super({element:n,target:t.target});vi(this,fe);vi(this,at);const{flyTo:r,fullGeometryStyle:u,...a}=t;bi(this,fe,new qr({target:n,props:{flyTo:r===void 0?!0:!!r,...a}})),ge(this,fe).$on("select",o=>{this.dispatchEvent(new hn(o.detail.feature))}),ge(this,fe).$on("pick",o=>{this.dispatchEvent(new yn(o.detail.feature))}),ge(this,fe).$on("featureslisted",o=>{this.dispatchEvent(new dn(o.detail.features))}),ge(this,fe).$on("featuresmarked",o=>{this.dispatchEvent(new gn(o.detail.features))}),ge(this,fe).$on("response",o=>{this.dispatchEvent(new vn(o.detail.url,o.detail.featureCollection))}),ge(this,fe).$on("optionsvisibilitychange",o=>{this.dispatchEvent(new mn(o.detail.optionsVisible))}),ge(this,fe).$on("reversetoggle",o=>{this.dispatchEvent(new bn(o.detail.reverse))}),ge(this,fe).$on("querychange",o=>{this.dispatchEvent(new pn(o.detail.query))}),bi(this,at,t)}setMap(t){var n;if(super.setMap(t),t){const{flyTo:r,fullGeometryStyle:u}=ge(this,at),a=cn(t,typeof r=="boolean"?void 0:r,typeof r=="boolean"?void 0:r,u);(n=ge(this,fe))==null||n.$set({mapController:a})}}setOptions(t){var a;Object.assign(ge(this,at),t);const{flyTo:n,fullGeometryStyle:r,...u}=ge(this,at);(a=ge(this,fe))==null||a.$set({...u,flyTo:n===void 0?!0:!!n})}setQuery(t,n=!0){var r;(r=ge(this,fe))==null||r.setQuery(t,n)}clearMap(){var t;(t=ge(this,fe))==null||t.clearMap()}clearList(){var t;(t=ge(this,fe))==null||t.clearList()}setReverseMode(t){var n;(n=ge(this,fe))==null||n.$set({reverseActive:t})}focus(t){var n;(n=ge(this,fe))==null||n.focus(t)}blur(){var t;(t=ge(this,fe))==null||t.blur()}}fe=new WeakMap,at=new WeakMap;class hn extends ne{constructor(t){super("select");R(this,"feature");this.feature=t}}class dn extends ne{constructor(t){super("featureslisted");R(this,"features");this.features=t}}class gn extends ne{constructor(t){super("featuresmarked");R(this,"features");this.features=t}}class mn extends ne{constructor(t){super("optionsvisibilitychange");R(this,"optionsVisible");this.optionsVisible=t}}class yn extends ne{constructor(t){super("pick");R(this,"feature");this.feature=t}}class pn extends ne{constructor(t){super("querychange");R(this,"query");this.query=t}}class vn extends ne{constructor(t,n){super("response");R(this,"url");R(this,"featureCollection");this.url=t,this.featureCollection=n}}class bn extends ne{constructor(t){super("reversetoggle");R(this,"reverse");this.reverse=t}}F.FeaturesListedEvent=dn,F.FeaturesMarkedEvent=gn,F.GeocodingControl=vs,F.OptionsVisibilityChangeEvent=mn,F.PickEvent=yn,F.QueryChangeEvent=pn,F.ResponseEvent=vn,F.ReverseToggleEvent=bn,F.SelectEvent=hn,F.createOpenLayersMapController=cn,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
|
|
2
14
|
//# sourceMappingURL=openlayers.umd.js.map
|