UNPKG

@maptiler/geocoding-control

Version:

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

179 lines (171 loc) 128 kB
(function($,Te){typeof exports=="object"&&typeof module<"u"?Te(exports,require("maplibre-gl")):typeof define=="function"&&define.amd?define(["exports","maplibre-gl"],Te):($=typeof globalThis<"u"?globalThis:$||self,Te($.maptilerGeocoder={},$.maplibregl))})(this,(function($,Te){"use strict";/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const lt=globalThis,At=lt.ShadowRoot&&(lt.ShadyCSS===void 0||lt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ct=Symbol(),ui=new WeakMap;let di=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Ct)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(At&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=ui.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&ui.set(t,e))}return e}toString(){return this.cssText}};const at=i=>new di(typeof i=="string"?i:i+"",void 0,Ct),Se=(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 di(t,i,Ct)},br=(i,e)=>{if(At)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)}},fi=At?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:Er,defineProperty:wr,getOwnPropertyDescriptor:xr,getOwnPropertyNames:Sr,getOwnPropertySymbols:Lr,getPrototypeOf:_r}=Object,ct=globalThis,pi=ct.trustedTypes,$r=pi?pi.emptyScript:"",Mr=ct.reactiveElementPolyfillSupport,Be=(i,e)=>i,ht={toAttribute(i,e){switch(e){case Boolean:i=i?$r: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}},kt=(i,e)=>!Er(i,e),mi={attribute:!0,type:String,converter:ht,reflect:!1,useDefault:!1,hasChanged:kt};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=mi){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&&wr(this.prototype,e,s)}}static getPropertyDescriptor(e,t,r){const{get:s,set:n}=xr(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)??mi}static _$Ei(){if(this.hasOwnProperty(Be("elementProperties")))return;const e=_r(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=[...Sr(t),...Lr(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(fi(s))}else e!==void 0&&t.push(fi(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 br(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??kt)(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,Mr?.({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,gi=ut?ut.createPolicy("lit-html",{createHTML:i=>i}):void 0,yi="$lit$",Le=`lit$${Math.random().toFixed(9).slice(2)}$`,vi="?"+Le,Tr=`<${vi}>`,Ae=document,De=()=>Ae.createComment(""),We=i=>i===null||typeof i!="object"&&typeof i!="function",It=Array.isArray,Ar=i=>It(i)||typeof i?.[Symbol.iterator]=="function",Nt=`[ \f\r]`,ze=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,bi=/-->/g,Ei=/>/g,Ce=RegExp(`>|${Nt}(?:([^\\s"'>=/]+)(${Nt}*=${Nt}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),wi=/'/g,xi=/"/g,Si=/^(?:script|style|textarea|title)$/i,Li=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Z=Li(1),qe=Li(2),be=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),_i=new WeakMap,ke=Ae.createTreeWalker(Ae,129);function $i(i,e){if(!It(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return gi!==void 0?gi.createHTML(e):e}const Cr=(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=bi:x[1]!==void 0?o=Ei:x[2]!==void 0?(Si.test(x[2])&&(s=RegExp("</"+x[2],"g")),o=Ce):x[3]!==void 0&&(o=Ce):o===Ce?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?Ce:x[3]==='"'?xi:wi):o===xi||o===wi?o=Ce:o===bi||o===Ei?o=ze:(o=Ce,s=void 0);const M=o===Ce&&i[l+1].startsWith("/>")?" ":"";n+=o===ze?u+Tr:w>=0?(r.push(f),u.slice(0,w)+yi+u.slice(w)+Le+M):u+Le+(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]=Cr(e,t);if(this.el=He.createElement(f,r),ke.currentNode=this.el.content,t===2||t===3){const w=this.el.content.firstChild;w.replaceWith(...w.childNodes)}for(;(s=ke.nextNode())!==null&&u.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(const w of s.getAttributeNames())if(w.endsWith(yi)){const _=x[o++],M=s.getAttribute(w).split(Le),T=/([.?@])?(.*)/.exec(_);u.push({type:1,index:n,name:T[2],strings:M,ctor:T[1]==="."?Or:T[1]==="?"?Ir:T[1]==="@"?Nr:dt}),s.removeAttribute(w)}else w.startsWith(Le)&&(u.push({type:6,index:n}),s.removeAttribute(w));if(Si.test(s.tagName)){const w=s.textContent.split(Le),_=w.length-1;if(_>0){s.textContent=ut?ut.emptyScript:"";for(let M=0;M<_;M++)s.append(w[M],De()),ke.nextNode(),u.push({type:2,index:++n});s.append(w[_],De())}}}else if(s.nodeType===8)if(s.data===vi)u.push({type:2,index:n});else{let w=-1;for(;(w=s.data.indexOf(Le,w+1))!==-1;)u.push({type:7,index:n}),w+=Le.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===be)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 kr=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);ke.currentNode=s;let n=ke.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 Pr(n,this,e)),this._$AV.push(f),u=r[++l]}o!==u?.index&&(n=ke.nextNode(),o++)}return ke.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!==be&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ar(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 kr(s,this),o=n.u(this.options);n.p(t),this.T(o),this._$AH=n}}_$AC(e){let t=_i.get(e.strings);return t===void 0&&_i.set(e.strings,t=new He(e)),t}k(e){It(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!==be,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===be&&(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 Or extends dt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class Ir extends dt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class Nr 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)===be)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 Pr{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 Rr={I:Ge},Gr=Ot.litHtmlPolyfillSupport;Gr?.(He,Ge),(Ot.litHtmlVersions??=[]).push("3.3.1");const Ur=(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 Pt=globalThis;let ne=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=Ur(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return be}};ne._$litElement$=!0,ne.finalized=!0,Pt.litElementHydrateSupport?.({LitElement:ne});const Fr=Pt.litElementPolyfillSupport;Fr?.({LitElement:ne}),(Pt.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 Br={attribute:!0,type:String,converter:ht,reflect:!1,hasChanged:kt},Dr=(i=Br,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"?Dr(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 Wr=(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 zr(i,e){return(t,r,s)=>{const n=o=>o.renderRoot?.querySelector(i)??null;return Wr(t,r,{get(){return n(this)}})}}var qr=Object.getOwnPropertyDescriptor,Hr=(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};$.MaptilerGeocodeClearIconElement=class extends ne{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=Se` svg { display: block; fill: var(--color-icon-button); } `,$.MaptilerGeocodeClearIconElement=Hr([_e("maptiler-geocode-clear-icon")],$.MaptilerGeocodeClearIconElement);var jr=Object.getOwnPropertyDescriptor,Vr=(i,e,t,r)=>{for(var s=r>1?void 0:r?jr(e,t):e,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=o(s)||s);return s};$.MaptilerGeocodeFailIconElement=class extends ne{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=Se` svg { display: block; fill: #e15042; } `,$.MaptilerGeocodeFailIconElement=Vr([_e("maptiler-geocode-fail-icon")],$.MaptilerGeocodeFailIconElement);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};$.MaptilerGeocodeLoadingIconElement=class extends ne{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=Se` 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=Kr([_e("maptiler-geocode-loading-icon")],$.MaptilerGeocodeLoadingIconElement);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};$.MaptilerGeocodeReverseGeocodingIconElement=class extends ne{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=Se` svg { display: block; fill: var(--color-icon-button); } `,$.MaptilerGeocodeReverseGeocodingIconElement=Xr([_e("maptiler-geocode-reverse-geocoding-icon")],$.MaptilerGeocodeReverseGeocodingIconElement);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};$.MaptilerGeocodeSearchIconElement=class extends ne{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=Se` circle { stroke-width: 1.875; fill: none; } path { stroke-width: 1.875; stroke-linecap: round; } svg { display: block; stroke: var(--color-icon-button); } `,$.MaptilerGeocodeSearchIconElement=Jr([_e("maptiler-geocode-search-icon")],$.MaptilerGeocodeSearchIconElement);const es=/^(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,Mi=/^([+-]?[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,})$/,Ti=/^(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,Ai=/^(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,Ci=/^(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,ki=/^(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 ts(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"),T=Oi(_,3).toFixed(3).padStart(6,"0");M.endsWith(".000")&&T.endsWith(".000")&&(M=M.replace(/\.000$/,""),T=T.replace(/\.000$/,"")),u=`${f}° ${M}' ${o}, ${x}° ${T}' ${l}`}if(i=="DMS"){const M=Math.floor(w),T=Math.floor(_);let R=((w-M)*60).toFixed(1).padStart(4,"0"),U=((_-T)*60).toFixed(1).padStart(4,"0");const G=M.toString().padStart(2,"0"),L=T.toString().padStart(2,"0");R.endsWith(".0")&&U.endsWith(".0")&&(R=R.replace(/\.0$/,""),U=U.replace(/\.0$/,"")),u=`${f}° ${G}' ${R}" ${o}, ${x}° ${L}' ${U}" ${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 Rt(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,r=null,s="",n="",o=null,l=[],u=!1;if(es.test(i))throw new Error("invalid coordinate value");if(Mi.test(i))if(l=Mi.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(Ti.test(i))if(l=Ti.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(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].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(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]/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(ki.test(i)){if(l=ki.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,T=x.match(M);if(T==null){const G=Math.floor(i.length/2);w=x.substring(0,G).trim(),_=x.substring(G).trim()}else{let G;T.length%2==1?G=Math.floor(T.length/2):G=T.length/2-1;let L=0;if(G==0)L=x.indexOf(T[0]),w=x.substring(0,L).trim(),_=x.substring(L+1).trim();else{let Q=0,se=0;for(;Q<=G;)L=x.indexOf(T[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 U=_.split(".");if(U.length==2&&U[1]==0&&U[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:is,toCoordinateFormat:ts})}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 Ii(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function is(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 Ii(this.decimalLatitude,Number(e[0]))&&Ii(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const rs=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Rt.to=rs;const ss=[{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"}],ns={decimalLatitude:40.123,decimalLongitude:-74.123},os=[{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}],ls=[{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 as(){const i=[];return ss.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...ns})}),[...i,...os,...ls]}const cs=as();Rt.formats=cs.map(i=>i.verbatimCoordinates);const hs=Rt;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const Gt={ATTRIBUTE:1,CHILD:2},Ut=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=Ut(class extends Ft{constructor(i){if(super(i),i.type!==Gt.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 be}});/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const{I:us}=Rr,Ni=()=>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(Ni(),s),o=r.insertBefore(Ni(),s);t=new us(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},Oe=(i,e,t=i)=>(i._$AI(e,t),i),ds={},fs=(i,e=ds)=>i._$AH=e,ps=i=>i._$AH,Bt=i=>{i._$AR(),i._$AA.remove()};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const Pi=(i,e,t)=>{const r=new Map;for(let s=e;s<=t;s++)r.set(i[s],s);return r},ms=Ut(class extends Ft{constructor(i){if(super(i),i.type!==Gt.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=ps(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,T=n.length-1;for(;w<=_&&M<=T;)if(s[w]===null)w++;else if(s[_]===null)_--;else if(l[w]===o[M])u[M]=Oe(s[w],n[M]),w++,M++;else if(l[_]===o[T])u[T]=Oe(s[_],n[T]),_--,T--;else if(l[w]===o[T])u[T]=Oe(s[w],n[T]),Ve(i,u[T+1],s[w]),w++,T--;else if(l[_]===o[M])u[M]=Oe(s[_],n[M]),Ve(i,s[w],s[_]),_--,M++;else if(f===void 0&&(f=Pi(o,M,T),x=Pi(l,w,_)),f.has(l[w]))if(f.has(l[_])){const R=x.get(o[M]),U=R!==void 0?s[R]:null;if(U===null){const G=Ve(i,s[w]);Oe(G,n[M]),u[M]=G}else u[M]=Oe(U,n[M]),Ve(i,s[w],U),s[R]=null;M++}else Bt(s[_]),_--;else Bt(s[w]),w++;for(;M<=T;){const R=Ve(i,u[T+1]);Oe(R,n[M]),u[M++]=R}for(;w<=_;){const R=s[w++];R!==null&&Bt(R)}return this.ut=o,fs(i,u),be}});function gs(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 pt(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 Ze;async function ys(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(Ze&&r.cachedLocationExpiry&&Ze.time+r.cachedLocationExpiry>Date.now()){if(Ze.coords)return Ze.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&&(Ze={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 Ri="important",vs=" !"+Ri,bs=Ut(class extends Ft{constructor(i){if(super(i),i.type!==Gt.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(vs);r.includes("-")||n?t.setProperty(r,n?s.slice(0,-11):s,n?Ri:""):t[r]=s}}return be}}),Es=".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 ws=Object.defineProperty,xs=Object.getOwnPropertyDescriptor,Gi=i=>{throw TypeError(i)},pe=(i,e,t,r)=>{for(var s=r>1?void 0:r?xs(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&&ws(e,t,s),s},Ui=(i,e,t)=>e.has(i)||Gi("Cannot "+t),z=(i,e,t)=>(Ui(i,e,"read from private field"),t?t.call(i):e.get(i)),Ss=(i,e,t)=>e.has(i)?Gi("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ue=(i,e,t)=>(Ui(i,e,"access private method"),t),B,mt,Ke,Y,Fi,Bi,Dt,Wt;const Di=typeof devicePixelRatio>"u"||devicePixelRatio>1.25,Wi=Di?"@2x":"",Fe=Di?2:1;let Ie,zi,oe=class extends ne{constructor(){super(...arguments),Ss(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,mt)&&(this.index=z(this,B,mt).length,Ue(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=${bs({width:`${this.spriteIcon.width/Fe}px`,height:`${this.spriteIcon.height/Fe}px`,backgroundImage:`url(${this.iconsBaseUrl}sprite${Wi}.png)`,backgroundPosition:`-${this.spriteIcon.x/Fe}px -${this.spriteIcon.y/Fe}px`,backgroundSize:`${Ie.width/Fe}px ${Ie.height/Fe}px`})} title=${z(this,B,Y)} /> `:this.imageUrl?Z` <img src=${this.imageUrl} alt=${this.category} title=${z(this,B,Y)} @error=${Ue(this,B,Bi)} />`: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,Ke)?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,Ke)?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,Ke)?Z` <span class="secondary"> ${z(this,B,Y)} </span> `:V} </span> <span class="line2"> ${z(this,B,Ke)?this.feature?.text:this.feature?.place_name.replace(/[^,]*,?s*/,"")} </span> </span> </li> `}};B=new WeakSet,mt=function(){return this.feature?.properties?.categories},Ke=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]},Fi=function(){zi??=fetch(`${this.iconsBaseUrl}sprite${Wi}.json`).then(i=>i.json()).then(i=>{Ie=i}).catch(()=>{Ie=null})},Bi=function(){this.imageUrl&&this.missingIconsCache.add(this.imageUrl),Ue(this,B,Dt).call(this)},Dt=function(){Ie!==void 0?Ue(this,B,Wt).call(this):(Ue(this,B,Fi).call(this),zi?.then(()=>{Ue(this,B,Wt).call(this)}))},Wt=function(){do{if(this.index--,this.category=z(this,B,mt)?.[this.index],this.spriteIcon=this.category?Ie?.icons[this.category]:void 0,this.spriteIcon)break;this.imageUrl=this.category?this.iconsBaseUrl+this.category.replace(/ /g,"_")+".svg":void 0}while(this.index>-1&&(!this.imageUrl||this.missingIconsCache.has(this.imageUrl)))},oe.styles=Se` ${at(Es)} `,pe([N({type:Object})],oe.prototype,"feature",2),pe([N({type:String})],oe.prototype,"itemStyle",2),pe([N({type:String})],oe.prototype,"showPlaceType",2),pe([N({attribute:!1})],oe.prototype,"missingIconsCache",2),pe([N({type:String})],oe.prototype,"iconsBaseUrl",2),pe([ee()],oe.prototype,"category",2),pe([ee()],oe.prototype,"imageUrl",2),pe([ee()],oe.prototype,"spriteIcon",2),pe([ee()],oe.prototype,"index",2),oe=pe([_e("maptiler-geocoder-feature-item")],oe);const Ls="form{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;margin:0;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text: #444952;--color-icon-button: #444952;pointer-events:all}form,form *,form *:after,form *:before{box-sizing:border-box}form.can-collapse{max-width:29px}form.can-collapse input::placeholder{transition:opacity .25s;opacity:0}form{width:270px;max-width:270px}form:focus-within,form:hover{width:270px;max-width:270px}form i