UNPKG

@maptiler/geocoding-control

Version:

The Javascript & TypeScript Map Control component for MapTiler Geocoding service. Easy to be integrated into any JavaScript mapping application.

177 lines (169 loc) 130 kB
(function($,ne){typeof exports=="object"&&typeof module<"u"?ne(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],ne):($=typeof globalThis<"u"?globalThis:$||self,ne($.maptilerGeocoder={},$.L))})(this,(function($,ne){"use strict";/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const lt=globalThis,Ct=lt.ShadowRoot&&(lt.ShadyCSS===void 0||lt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),hi=new WeakMap;let ui=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==At)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Ct&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=hi.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&hi.set(t,e))}return e}toString(){return this.cssText}};const at=i=>new ui(typeof i=="string"?i:i+"",void 0,At),Le=(i,...e)=>{const t=i.length===1?i[0]:e.reduce(((r,s,n)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[n+1]),i[0]);return new ui(t,i,At)},Sr=(i,e)=>{if(Ct)i.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const r=document.createElement("style"),s=lt.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=t.cssText,i.appendChild(r)}},di=Ct?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return at(t)})(i):i;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const{is:Lr,defineProperty:_r,getOwnPropertyDescriptor:$r,getOwnPropertyNames:Mr,getOwnPropertySymbols:Cr,getPrototypeOf:Ar}=Object,ct=globalThis,fi=ct.trustedTypes,Tr=fi?fi.emptyScript:"",Or=ct.reactiveElementPolyfillSupport,Be=(i,e)=>i,ht={toAttribute(i,e){switch(e){case Boolean:i=i?Tr:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Tt=(i,e)=>!Lr(i,e),pi={attribute:!0,type:String,converter:ht,reflect:!1,useDefault:!1,hasChanged:Tt};Symbol.metadata??=Symbol("metadata"),ct.litPropertyMetadata??=new WeakMap;let Pe=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=pi){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(e,r,t);s!==void 0&&_r(this.prototype,e,s)}}static getPropertyDescriptor(e,t,r){const{get:s,set:n}=$r(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){const l=s?.call(this);n?.call(this,o),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??pi}static _$Ei(){if(this.hasOwnProperty(Be("elementProperties")))return;const e=Ar(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Be("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Be("properties"))){const t=this.properties,r=[...Mr(t),...Cr(t)];for(const s of r)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,s]of t)this.elementProperties.set(r,s)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const s=this._$Eu(t,r);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const s of r)t.unshift(di(s))}else e!==void 0&&t.push(di(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Sr(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){const r=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,r);if(s!==void 0&&r.reflect===!0){const n=(r.converter?.toAttribute!==void 0?r.converter:ht).toAttribute(t,r.type);this._$Em=e,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){const r=this.constructor,s=r._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const n=r.getPropertyOptions(s),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:ht;this._$Em=s;const l=o.fromAttribute(t,n.type);this[s]=l??this._$Ej?.get(s)??l,this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){const s=this.constructor,n=this[e];if(r??=s.getPropertyOptions(e),!((r.hasChanged??Tt)(n,t)||r.useDefault&&r.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:s,wrapped:n},o){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),n!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[s,n]of this._$Ep)this[s]=n;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[s,n]of r){const{wrapped:o}=n,l=this[s];o!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,n,l)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((r=>r.hostUpdate?.())),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Pe.elementStyles=[],Pe.shadowRootOptions={mode:"open"},Pe[Be("elementProperties")]=new Map,Pe[Be("finalized")]=new Map,Or?.({ReactiveElement:Pe}),(ct.reactiveElementVersions??=[]).push("2.1.1");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const Ot=globalThis,ut=Ot.trustedTypes,mi=ut?ut.createPolicy("lit-html",{createHTML:i=>i}):void 0,gi="$lit$",_e=`lit$${Math.random().toFixed(9).slice(2)}$`,yi="?"+_e,kr=`<${yi}>`,Ae=document,De=()=>Ae.createComment(""),We=i=>i===null||typeof i!="object"&&typeof i!="function",kt=Array.isArray,Ir=i=>kt(i)||typeof i?.[Symbol.iterator]=="function",It=`[ \f\r]`,ze=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vi=/-->/g,bi=/>/g,Te=RegExp(`>|${It}(?:([^\\s"'>=/]+)(${It}*=${It}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ei=/'/g,wi=/"/g,xi=/^(?:script|style|textarea|title)$/i,Si=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Z=Si(1),qe=Si(2),Ee=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),Li=new WeakMap,Oe=Ae.createTreeWalker(Ae,129);function _i(i,e){if(!kt(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return mi!==void 0?mi.createHTML(e):e}const Nr=(i,e)=>{const t=i.length-1,r=[];let s,n=e===2?"<svg>":e===3?"<math>":"",o=ze;for(let l=0;l<t;l++){const u=i[l];let f,x,w=-1,_=0;for(;_<u.length&&(o.lastIndex=_,x=o.exec(u),x!==null);)_=o.lastIndex,o===ze?x[1]==="!--"?o=vi:x[1]!==void 0?o=bi:x[2]!==void 0?(xi.test(x[2])&&(s=RegExp("</"+x[2],"g")),o=Te):x[3]!==void 0&&(o=Te):o===Te?x[0]===">"?(o=s??ze,w=-1):x[1]===void 0?w=-2:(w=o.lastIndex-x[2].length,f=x[1],o=x[3]===void 0?Te:x[3]==='"'?wi:Ei):o===wi||o===Ei?o=Te:o===vi||o===bi?o=ze:(o=Te,s=void 0);const M=o===Te&&i[l+1].startsWith("/>")?" ":"";n+=o===ze?u+kr:w>=0?(r.push(f),u.slice(0,w)+gi+u.slice(w)+_e+M):u+_e+(w===-2?l:M)}return[_i(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};class He{constructor({strings:e,_$litType$:t},r){let s;this.parts=[];let n=0,o=0;const l=e.length-1,u=this.parts,[f,x]=Nr(e,t);if(this.el=He.createElement(f,r),Oe.currentNode=this.el.content,t===2||t===3){const w=this.el.content.firstChild;w.replaceWith(...w.childNodes)}for(;(s=Oe.nextNode())!==null&&u.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(const w of s.getAttributeNames())if(w.endsWith(gi)){const _=x[o++],M=s.getAttribute(w).split(_e),C=/([.?@])?(.*)/.exec(_);u.push({type:1,index:n,name:C[2],strings:M,ctor:C[1]==="."?Rr:C[1]==="?"?Gr:C[1]==="@"?Fr:dt}),s.removeAttribute(w)}else w.startsWith(_e)&&(u.push({type:6,index:n}),s.removeAttribute(w));if(xi.test(s.tagName)){const w=s.textContent.split(_e),_=w.length-1;if(_>0){s.textContent=ut?ut.emptyScript:"";for(let M=0;M<_;M++)s.append(w[M],De()),Oe.nextNode(),u.push({type:2,index:++n});s.append(w[_],De())}}}else if(s.nodeType===8)if(s.data===yi)u.push({type:2,index:n});else{let w=-1;for(;(w=s.data.indexOf(_e,w+1))!==-1;)u.push({type:7,index:n}),w+=_e.length-1}n++}}static createElement(e,t){const r=Ae.createElement("template");return r.innerHTML=e,r}}function Re(i,e,t=i,r){if(e===Ee)return e;let s=r!==void 0?t._$Co?.[r]:t._$Cl;const n=We(e)?void 0:e._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),n===void 0?s=void 0:(s=new n(i),s._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=s:t._$Cl=s),s!==void 0&&(e=Re(i,s._$AS(i,e.values),s,r)),e}let Pr=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,s=(e?.creationScope??Ae).importNode(t,!0);Oe.currentNode=s;let n=Oe.nextNode(),o=0,l=0,u=r[0];for(;u!==void 0;){if(o===u.index){let f;u.type===2?f=new Ge(n,n.nextSibling,this,e):u.type===1?f=new u.ctor(n,u.name,u.strings,this,e):u.type===6&&(f=new Ur(n,this,e)),this._$AV.push(f),u=r[++l]}o!==u?.index&&(n=Oe.nextNode(),o++)}return Oe.currentNode=Ae,s}p(e){let t=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}};class Ge{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,s){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Re(this,e,t),We(e)?e===V||e==null||e===""?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==Ee&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ir(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==V&&We(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ae.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,s=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=He.createElement(_i(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(t);else{const n=new Pr(s,this),o=n.u(this.options);n.p(t),this.T(o),this._$AH=n}}_$AC(e){let t=Li.get(e.strings);return t===void 0&&Li.set(e.strings,t=new He(e)),t}k(e){kt(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,s=0;for(const n of e)s===t.length?t.push(r=new Ge(this.O(De()),this.O(De()),this,this.options)):r=t[s],r._$AI(n),s++;s<t.length&&(this._$AR(r&&r._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class dt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,s,n){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=V}_$AI(e,t=this,r,s){const n=this.strings;let o=!1;if(n===void 0)e=Re(this,e,t,0),o=!We(e)||e!==this._$AH&&e!==Ee,o&&(this._$AH=e);else{const l=e;let u,f;for(e=n[0],u=0;u<n.length-1;u++)f=Re(this,l[r+u],t,u),f===Ee&&(f=this._$AH[u]),o||=!We(f)||f!==this._$AH[u],f===V?e=V:e!==V&&(e+=(f??"")+n[u+1]),this._$AH[u]=f}o&&!s&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Rr extends dt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class Gr extends dt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class Fr extends dt{constructor(e,t,r,s,n){super(e,t,r,s,n),this.type=5}_$AI(e,t=this){if((e=Re(this,e,t,0)??V)===Ee)return;const r=this._$AH,s=e===V&&r!==V||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==V&&(r===V||s);s&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Ur{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Re(this,e)}}const Br={I:Ge},Dr=Ot.litHtmlPolyfillSupport;Dr?.(He,Ge),(Ot.litHtmlVersions??=[]).push("3.3.1");const Wr=(i,e,t)=>{const r=t?.renderBefore??e;let s=r._$litPart$;if(s===void 0){const n=t?.renderBefore??null;r._$litPart$=s=new Ge(e.insertBefore(De(),n),n,void 0,t??{})}return s._$AI(i),s};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const Nt=globalThis;let oe=class extends Pe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Wr(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ee}};oe._$litElement$=!0,oe.finalized=!0,Nt.litElementHydrateSupport?.({LitElement:oe});const zr=Nt.litElementPolyfillSupport;zr?.({LitElement:oe}),(Nt.litElementVersions??=[]).push("4.2.1");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const $e=i=>(e,t)=>{t!==void 0?t.addInitializer((()=>{customElements.define(i,e)})):customElements.define(i,e)};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const qr={attribute:!0,type:String,converter:ht,reflect:!1,hasChanged:Tt},Hr=(i=qr,e,t)=>{const{kind:r,metadata:s}=t;let n=globalThis.litPropertyMetadata.get(s);if(n===void 0&&globalThis.litPropertyMetadata.set(s,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){const{name:o}=t;return{set(l){const u=e.get.call(this);e.set.call(this,l),this.requestUpdate(o,u,i)},init(l){return l!==void 0&&this.C(o,void 0,i,l),l}}}if(r==="setter"){const{name:o}=t;return function(l){const u=this[o];e.call(this,l),this.requestUpdate(o,u,i)}}throw Error("Unsupported decorator location: "+r)};function N(i){return(e,t)=>typeof t=="object"?Hr(i,e,t):((r,s,n)=>{const o=s.hasOwnProperty(n);return s.constructor.createProperty(n,r),o?Object.getOwnPropertyDescriptor(s,n):void 0})(i,e,t)}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function ee(i){return N({...i,state:!0,attribute:!1})}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const jr=(i,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(i,e,t),t);/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function Vr(i,e){return(t,r,s)=>{const n=o=>o.renderRoot?.querySelector(i)??null;return jr(t,r,{get(){return n(this)}})}}var Zr=Object.getOwnPropertyDescriptor,Kr=(i,e,t,r)=>{for(var s=r>1?void 0:r?Zr(e,t):e,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=o(s)||s);return s};$.MaptilerGeocodeClearIconElement=class extends oe{render(){return qe` <svg viewBox="0 0 14 14" width="13" height="13"> <path 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" /> </svg> `}},$.MaptilerGeocodeClearIconElement.styles=Le` svg { display: block; fill: var(--color-icon-button); } `,$.MaptilerGeocodeClearIconElement=Kr([$e("maptiler-geocode-clear-icon")],$.MaptilerGeocodeClearIconElement);var Yr=Object.getOwnPropertyDescriptor,Xr=(i,e,t,r)=>{for(var s=r>1?void 0:r?Yr(e,t):e,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=o(s)||s);return s};$.MaptilerGeocodeFailIconElement=class extends oe{render(){return qe` <svg viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"> <path 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" /> </svg> `}},$.MaptilerGeocodeFailIconElement.styles=Le` svg { display: block; fill: #e15042; } `,$.MaptilerGeocodeFailIconElement=Xr([$e("maptiler-geocode-fail-icon")],$.MaptilerGeocodeFailIconElement);var Qr=Object.getOwnPropertyDescriptor,Jr=(i,e,t,r)=>{for(var s=r>1?void 0:r?Qr(e,t):e,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=o(s)||s);return s};$.MaptilerGeocodeLoadingIconElement=class extends oe{render(){return Z` <div> <svg viewBox="0 0 18 18" width="24" height="24" class="loading-icon"> <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 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" /> </svg> </div> `}},$.MaptilerGeocodeLoadingIconElement.styles=Le` div { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; display: flex; align-items: center; } .loading-icon { animation: rotate 0.8s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95); } @keyframes rotate { from { -webkit-transform: rotate(0); transform: rotate(0); } to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } `,$.MaptilerGeocodeLoadingIconElement=Jr([$e("maptiler-geocode-loading-icon")],$.MaptilerGeocodeLoadingIconElement);var es=Object.getOwnPropertyDescriptor,ts=(i,e,t,r)=>{for(var s=r>1?void 0:r?es(e,t):e,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=o(s)||s);return s};$.MaptilerGeocodeReverseGeocodingIconElement=class extends oe{render(){return qe` <svg viewBox="0 0 60.006 21.412" width="14" height="20"> <path 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" /> </svg> `}},$.MaptilerGeocodeReverseGeocodingIconElement.styles=Le` svg { display: block; fill: var(--color-icon-button); } `,$.MaptilerGeocodeReverseGeocodingIconElement=ts([$e("maptiler-geocode-reverse-geocoding-icon")],$.MaptilerGeocodeReverseGeocodingIconElement);var is=Object.getOwnPropertyDescriptor,rs=(i,e,t,r)=>{for(var s=r>1?void 0:r?is(e,t):e,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=o(s)||s);return s};$.MaptilerGeocodeSearchIconElement=class extends oe{render(){return qe` <svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 13 13" > <circle cx="4.789" cy="4.787" r="3.85" /> <path d="M12.063 12.063 7.635 7.635" /> </svg> `}},$.MaptilerGeocodeSearchIconElement.styles=Le` circle { stroke-width: 1.875; fill: none; } path { stroke-width: 1.875; stroke-linecap: round; } svg { display: block; stroke: var(--color-icon-button); } `,$.MaptilerGeocodeSearchIconElement=rs([$e("maptiler-geocode-search-icon")],$.MaptilerGeocodeSearchIconElement);const ss=/^(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,$i=/^([+-]?[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,})$/,Mi=/^(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,Ci=/^(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,Ai=/^(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,Ti=/^(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 ns(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(M=>Number(M.trim())),t=Number(e[0]),r=Number(e[1]),s=Math.abs(t),n=Math.abs(r),o=t>0?"N":"S",l=r>0?"E":"W";let u;i=="DD"&&(u=`${s}° ${o}, ${n}° ${l}`);const f=Math.floor(s),x=Math.floor(n),w=(s-f)*60,_=(n-x)*60;if(i=="DM"){let M=Oi(w,3).toFixed(3).padStart(6,"0"),C=Oi(_,3).toFixed(3).padStart(6,"0");M.endsWith(".000")&&C.endsWith(".000")&&(M=M.replace(/\.000$/,""),C=C.replace(/\.000$/,"")),u=`${f}° ${M}' ${o}, ${x}° ${C}' ${l}`}if(i=="DMS"){const M=Math.floor(w),C=Math.floor(_);let R=((w-M)*60).toFixed(1).padStart(4,"0"),F=((_-C)*60).toFixed(1).padStart(4,"0");const G=M.toString().padStart(2,"0"),L=C.toString().padStart(2,"0");R.endsWith(".0")&&F.endsWith(".0")&&(R=R.replace(/\.0$/,""),F=F.replace(/\.0$/,"")),u=`${f}° ${G}' ${R}" ${o}, ${x}° ${L}' ${F}" ${l}`}return u}else throw new Error("no decimal coordinates to convert")}function Oi(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function Pt(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,r=null,s="",n="",o=null,l=[],u=!1;if(ss.test(i))throw new Error("invalid coordinate value");if($i.test(i))if(l=$i.exec(i),u=je(l),u)t=Math.abs(l[1])+l[2]/60,Number(l[1])<0&&(t*=-1),r=Math.abs(l[3])+l[4]/60,Number(l[3])<0&&(r*=-1),o="DM";else throw new Error("invalid coordinate format");else if(Mi.test(i))if(l=Mi.exec(i),u=je(l),u){if(t=l[2],r=l[6],t.includes(",")&&(t=t.replace(",",".")),r.includes(",")&&(r=r.replace(",",".")),o="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(r))==Number(r))throw new Error("integer only coordinate provided");l[1]?(s=l[1],n=l[5]):l[4]&&(s=l[4],n=l[8])}else throw new Error("invalid decimal coordinate format");else if(Ci.test(i))if(l=Ci.exec(i),u=je(l),u)t=Math.abs(parseInt(l[2])),l[4]&&(t+=l[4]/60,o="DM"),l[6]&&(t+=l[6].replace(",",".")/3600,o="DMS"),parseInt(l[2])<0&&(t=-1*t),r=Math.abs(parseInt(l[9])),l[11]&&(r+=l[11]/60),l[13]&&(r+=l[13].replace(",",".")/3600),parseInt(l[9])<0&&(r=-1*r),l[1]?(s=l[1],n=l[8]):l[7]&&(s=l[7],n=l[14]);else throw new Error("invalid DMS coordinates format");else if(Ai.test(i))if(l=Ai.exec(i),u=je(l),u)t=Math.abs(parseInt(l[2])),l[4]&&(t+=l[4]/60,o="DM"),l[6]&&(t+=l[6]/3600,o="DMS"),parseInt(l[2])<0&&(t=-1*t),r=Math.abs(parseInt(l[10])),l[12]&&(r+=l[12]/60),l[14]&&(r+=l[14]/3600),parseInt(l[10])<0&&(r=-1*r),l[1]?(s=l[1],n=l[9]):l[8]&&(s=l[8],n=l[16]);else throw new Error("invalid DMS coordinates format");else if(Ti.test(i)){if(l=Ti.exec(i),u=je(l),l.filter(f=>f).length<=5)throw new Error("invalid coordinates format");if(u)t=Math.abs(parseInt(l[2])),l[4]&&(t+=l[4].replace(",",".")/60,o="DM"),l[6]&&(t+=l[6].replace(",",".")/3600,o="DMS"),parseInt(l[2])<0&&(t=-1*t),r=Math.abs(parseInt(l[10])),l[12]&&(r+=l[12].replace(",",".")/60),l[14]&&(r+=l[14].replace(",",".")/3600),parseInt(l[10])<0&&(r=-1*r),l[1]?(s=l[1],n=l[9]):l[8]&&(s=l[8],n=l[16]);else throw new Error("invalid coordinates format")}if(u){if(Math.abs(r)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(s&&!n||!s&&n)throw new Error("invalid coordinates value");if(s&&s==n)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),r.toString().includes(",")&&(r=r.replace(",","."));let f=/S|SOUTH/i;f.test(s)&&t>0&&(t=-1*t),f=/W|WEST/i,f.test(n)&&r>0&&(r=-1*r);const x=l[0].trim();let w,_;const M=/[,/;\u0020]/g,C=x.match(M);if(C==null){const G=Math.floor(i.length/2);w=x.substring(0,G).trim(),_=x.substring(G).trim()}else{let G;C.length%2==1?G=Math.floor(C.length/2):G=C.length/2-1;let L=0;if(G==0)L=x.indexOf(C[0]),w=x.substring(0,L).trim(),_=x.substring(L+1).trim();else{let Q=0,se=0;for(;Q<=G;)L=x.indexOf(C[Q],se),se=L+1,Q++;w=x.substring(0,L).trim(),_=x.substring(L+1).trim()}}const R=w.split(".");if(R.length==2&&R[1]==0&&R[1].length!=2)throw new Error("invalid coordinates format");const F=_.split(".");if(F.length==2&&F[1]==0&&F[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(w)||/^\d+$/.test(_))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),r=Number(Number(r).toFixed(e)),Object.freeze({verbatimCoordinates:x,verbatimLatitude:w,verbatimLongitude:_,decimalLatitude:t,decimalLongitude:r,decimalCoordinates:`${t},${r}`,originalFormat:o,closeEnough:os,toCoordinateFormat:ns})}else throw new Error("coordinates pattern match failed")}function je(i){if(!isNaN(i[0]))return!1;const e=[...i];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,r=/[eastsouthnorthwest]+/i,s=e.length/2;for(let n=0;n<s;n++){const o=e[n],l=e[n+s],u=t.test(o)&&t.test(l),f=r.test(o)&&r.test(l),x=o==l;if(!(o==null&&l==null)){if(o==null||l==null)return!1;if(u||f||x)continue;return!1}}return!0}function ki(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function os(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 ki(this.decimalLatitude,Number(e[0]))&&ki(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const ls=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Pt.to=ls;const as=[{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"}],cs={decimalLatitude:40.123,decimalLongitude:-74.123},hs=[{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}],us=[{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 ds(){const i=[];return as.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...cs})}),[...i,...hs,...us]}const fs=ds();Pt.formats=fs.map(i=>i.verbatimCoordinates);const ps=Pt;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const Rt={ATTRIBUTE:1,CHILD:2},Gt=i=>(...e)=>({_$litDirective$:i,values:e});let Ft=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const ft=Gt(class extends Ft{constructor(i){if(super(i),i.type!==Rt.ATTRIBUTE||i.name!=="class"||i.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter((e=>i[e])).join(" ")+" "}update(i,[e]){if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter((r=>r!==""))));for(const r in e)e[r]&&!this.nt?.has(r)&&this.st.add(r);return this.render(e)}const t=i.element.classList;for(const r of this.st)r in e||(t.remove(r),this.st.delete(r));for(const r in e){const s=!!e[r];s===this.st.has(r)||this.nt?.has(r)||(s?(t.add(r),this.st.add(r)):(t.remove(r),this.st.delete(r)))}return Ee}});/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const{I:ms}=Br,Ii=()=>document.createComment(""),Ve=(i,e,t)=>{const r=i._$AA.parentNode,s=e===void 0?i._$AB:e._$AA;if(t===void 0){const n=r.insertBefore(Ii(),s),o=r.insertBefore(Ii(),s);t=new ms(n,o,i,i.options)}else{const n=t._$AB.nextSibling,o=t._$AM,l=o!==i;if(l){let u;t._$AQ?.(i),t._$AM=i,t._$AP!==void 0&&(u=i._$AU)!==o._$AU&&t._$AP(u)}if(n!==s||l){let u=t._$AA;for(;u!==n;){const f=u.nextSibling;r.insertBefore(u,s),u=f}}}return t},ke=(i,e,t=i)=>(i._$AI(e,t),i),gs={},ys=(i,e=gs)=>i._$AH=e,vs=i=>i._$AH,Ut=i=>{i._$AR(),i._$AA.remove()};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const Ni=(i,e,t)=>{const r=new Map;for(let s=e;s<=t;s++)r.set(i[s],s);return r},bs=Gt(class extends Ft{constructor(i){if(super(i),i.type!==Rt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);const s=[],n=[];let o=0;for(const l of i)s[o]=r?r(l,o):o,n[o]=t(l,o),o++;return{values:n,keys:s}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,r]){const s=vs(i),{values:n,keys:o}=this.dt(e,t,r);if(!Array.isArray(s))return this.ut=o,n;const l=this.ut??=[],u=[];let f,x,w=0,_=s.length-1,M=0,C=n.length-1;for(;w<=_&&M<=C;)if(s[w]===null)w++;else if(s[_]===null)_--;else if(l[w]===o[M])u[M]=ke(s[w],n[M]),w++,M++;else if(l[_]===o[C])u[C]=ke(s[_],n[C]),_--,C--;else if(l[w]===o[C])u[C]=ke(s[w],n[C]),Ve(i,u[C+1],s[w]),w++,C--;else if(l[_]===o[M])u[M]=ke(s[_],n[M]),Ve(i,s[w],s[_]),_--,M++;else if(f===void 0&&(f=Ni(o,M,C),x=Ni(l,w,_)),f.has(l[w]))if(f.has(l[_])){const R=x.get(o[M]),F=R!==void 0?s[R]:null;if(F===null){const G=Ve(i,s[w]);ke(G,n[M]),u[M]=G}else u[M]=ke(F,n[M]),Ve(i,s[w],F),s[R]=null;M++}else Ut(s[_]),_--;else Ut(s[w]),w++;for(;M<=C;){const R=Ve(i,u[C+1]);ke(R,n[M]),u[M++]=R}for(;w<=_;){const R=s[w++];R!==null&&Ut(R)}return this.ut=o,ys(i,u),Ee}});function Es(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return Pi(i);case"FeatureCollection":return ws(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Bt(i);default:throw new Error("unknown GeoJSON type")}}function Pi(i){const e={type:"Feature"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"properties":case"geometry":return;default:e[t]=i[t]}}),e.properties=Ri(i.properties),i.geometry==null?e.geometry=null:e.geometry=Bt(i.geometry),e}function Ri(i){const e={};return i&&Object.keys(i).forEach(t=>{const r=i[t];typeof r=="object"?r===null?e[t]=null:Array.isArray(r)?e[t]=r.map(s=>s):e[t]=Ri(r):e[t]=r}),e}function ws(i){const e={type:"FeatureCollection"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"features":return;default:e[t]=i[t]}}),e.features=i.features.map(t=>Pi(t)),e}function Bt(i){const e={type:i.type};return i.bbox&&(e.bbox=i.bbox),i.type==="GeometryCollection"?(e.geometries=i.geometries.map(t=>Bt(t)),e):(e.coordinates=Gi(i.coordinates),e)}function Gi(i){const e=i;return typeof e[0]!="object"?e.slice():e.map(t=>Gi(t))}var xs=Es;function Ss(i,e,t){const r=e[1],s=e[0],n=r-s;return i===r&&t?i:((i-s)%n+n)%n+s}function Ze(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}function Fi(i,e){const t=xs(i);for(const r of t.features)if(r.geometry.type=="MultiPolygon")for(const s of r.geometry.coordinates)Ui(s,e);else Ui(r.geometry.coordinates,e);return t}function Ui(i,e){for(const t of i)for(const r of t)r[0]+=e}let Ke;async function Ls(i,e,t){for(const r of e??[])if(!(i&&(r.minZoom!=null&&r.minZoom>i[0]||r.maxZoom!=null&&r.maxZoom<i[0]))){if(r.type==="fixed")return r.coordinates.join(",");if(r.type==="client-geolocation")if(Ke&&r.cachedLocationExpiry&&Ke.time+r.cachedLocationExpiry>Date.now()){if(Ke.coords)return Ke.coords}else{let s;try{return s=await new Promise((n,o)=>{t.signal.addEventListener("abort",()=>{o(Error("aborted"))}),navigator.geolocation.getCurrentPosition(l=>{n([l.coords.longitude,l.coords.latitude].map(u=>u.toFixed(6)).join(","))},l=>{o(l)},r)}),s}catch{}finally{r.cachedLocationExpiry&&(Ke={time:Date.now(),coords:s})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(i&&r.type==="map-center")return i[1].toFixed(6)+","+i[2].toFixed(6)}}/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const Bi="important",_s=" !"+Bi,$s=Gt(class extends Ft{constructor(i){if(super(i),i.type!==Rt.ATTRIBUTE||i.name!=="style"||i.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce(((e,t)=>{const r=i[t];return r==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(i,[e]){const{style:t}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const r of this.ft)e[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(const r in e){const s=e[r];if(s!=null){this.ft.add(r);const n=typeof s=="string"&&s.endsWith(_s);r.includes("-")||n?t.setProperty(r,n?s.slice(0,-11):s,n?Bi:""):t[r]=s}}return Ee}}),Ms=".sprite-icon{align-self:center;justify-self:center;opacity:.75;background-repeat:no-repeat}li{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content;outline:0}li:first-child{padding-top:10px}li:last-child{padding-bottom:10px}li.picked{background-color:#e7edff}li.picked .secondary{color:#96a4c7;padding-left:4px}li.picked .line2{color:#96a4c7}li.selected{background-color:#f3f6ff;animation:backAndForth 5s linear infinite}li.selected .primary{color:#2b8bfb}li.selected .secondary{color:#a2adc7;padding-left:4px}li.selected .line2{color:#a2adc7}li>img{align-self:center;justify-self:center;opacity:.75}.texts{padding:0 17px 0 0}.texts>*{white-space:nowrap;display:block;min-width:fit-content}.primary{font-weight:600}.secondary{color:#aeb6c7;padding-left:4px}.line2{color:#aeb6c7}@keyframes backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}";var Cs=Object.defineProperty,As=Object.getOwnPropertyDescriptor,Di=i=>{throw TypeError(i)},me=(i,e,t,r)=>{for(var s=r>1?void 0:r?As(e,t):e,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=(r?o(e,t,s):o(s))||s);return r&&s&&Cs(e,t,s),s},Wi=(i,e,t)=>e.has(i)||Di("Cannot "+t),z=(i,e,t)=>(Wi(i,e,"read from private field"),t?t.call(i):e.get(i)),Ts=(i,e,t)=>e.has(i)?Di("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Fe=(i,e,t)=>(Wi(i,e,"access private method"),t),B,pt,Ye,Y,zi,qi,Dt,Wt;const Hi=typeof devicePixelRatio>"u"||devicePixelRatio>1.25,ji=Hi?"@2x":"",Ue=Hi?2:1;let Ie,Vi,le=class extends oe{constructor(){super(...arguments),Ts(this,B),this.itemStyle="default",this.showPlaceType="if-needed",this.missingIconsCache=new Set,this.iconsBaseUrl="",this.index=0}willUpdate(i){i.has("feature")&&z(this,B,pt)&&(this.index=z(this,B,pt).length,Fe(this,B,Dt).call(this))}render(){return Z` <li tabindex="-1" role="option" aria-selected=${this.itemStyle==="selected"} aria-checked=${this.itemStyle==="picked"} class=${this.itemStyle} @click=${()=>this.dispatchEvent(new CustomEvent("select"))} > ${Ie&&this.spriteIcon?Z` <div class="sprite-icon" style=${$s({width:`${this.spriteIcon.width/Ue}px`,height:`${this.spriteIcon.height/Ue}px`,backgroundImage:`url(${this.iconsBaseUrl}sprite${ji}.png)`,backgroundPosition:`-${this.spriteIcon.x/Ue}px -${this.spriteIcon.y/Ue}px`,backgroundSize:`${Ie.width/Ue}px ${Ie.height/Ue}px`})} title=${z(this,B,Y)} /> `:this.imageUrl?Z` <img src=${this.imageUrl} alt=${this.category} title=${z(this,B,Y)} @error=${Fe(this,B,qi)} />`:this.feature?.address?Z` <img src=${this.iconsBaseUrl+"housenumber.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("road.")?Z` <img src=${this.iconsBaseUrl+"road.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("address.")?Z` <img src=${this.iconsBaseUrl+"street.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("postal_code.")?Z` <img src=${this.iconsBaseUrl+"postal_code.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:this.feature?.id.startsWith("poi.")?Z` <img src=${this.iconsBaseUrl+"poi.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:z(this,B,Ye)?Z` <img src=${this.iconsBaseUrl+"reverse.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `:Z` <img src=${this.iconsBaseUrl+"area.svg"} alt=${z(this,B,Y)} title=${z(this,B,Y)} /> `} <span class="texts"> <span> <span class="primary"> ${z(this,B,Ye)?this.feature?.place_name:this.feature?.place_name.replace(/,.*/,"")} </span> ${this.showPlaceType==="always"||this.showPlaceType!=="never"&&!this.feature?.address&&!this.feature?.id.startsWith("road.")&&!this.feature?.id.startsWith("address.")&&!this.feature?.id.startsWith("postal_code.")&&(!this.feature?.id.startsWith("poi.")||!this.imageUrl)&&!z(this,B,Ye)?Z` <span class="secondary"> ${z(this,B,Y)} </span> `:V} </span> <span class="line2"> ${z(this,B,Ye)?this.feature?.text:this.feature?.place_name.replace(/[^,]*,?s*/,"")} </span> </span> </li> `}};B=new WeakSet,pt=function(){return this.feature?.properties?.categories},Ye=function(){return this.feature?.place_type[0]==="reverse"},Y=function(){return this.feature?.properties?.categories?.join(", ")??this.feature?.place_type_name?.[0]??this.feature?.place_type[0]},zi=function(){Vi??=fetch(`${this.iconsBaseUrl}sprite${ji}.json`).then(i=>i.json()).then(i=>{Ie=i}).catch(()=>{Ie=null})},qi=function(){this.imageUrl&&this.missingIconsCache.add(this.imageUrl),Fe(this,B,Dt).call(this)},Dt=function(){Ie!==void 0?Fe(this,B,Wt).call(this):(Fe(this,B,zi).call(this),