@mapbox/search-js-web
Advanced tools
Comparing version 1.0.0-beta.6 to 1.0.0-beta.7
@@ -14,3 +14,4 @@ /* eslint-disable */ | ||
'.gif': 'image/gif', | ||
'.jpg': 'image/jpeg' | ||
'.jpg': 'image/jpeg', | ||
'.map': 'application/json' | ||
}; | ||
@@ -17,0 +18,0 @@ |
@@ -1,19 +0,32 @@ | ||
import { AutofillOptions } from '@mapbox/search-js-core'; | ||
import { MapboxAddressAutofill } from './components/MapboxAddressAutofill'; | ||
import { AutofillOptions, AutofillRetrieveResponse, AutofillSuggestionResponse, Evented, MapboxAutofill } from '@mapbox/search-js-core'; | ||
import { MapboxSearchListboxAutofillType } from './components/MapboxAddressAutofill'; | ||
import { MapboxHTMLEvent } from './MapboxHTMLEvent'; | ||
import { Theme } from './theme'; | ||
/** | ||
* @class AutofillInstance | ||
*/ | ||
export declare class AutofillInstance { | ||
#private; | ||
listbox: MapboxSearchListboxAutofillType; | ||
constructor(collection: AutofillCollectionType, input: HTMLInputElement, autofillRef: MapboxAutofill); | ||
remove(): void; | ||
} | ||
interface AutofillCollectionOptions { | ||
accessToken: string; | ||
accessToken?: string; | ||
options?: Partial<AutofillOptions>; | ||
} | ||
interface ShowConfirmAddressOptions { | ||
theme?: Theme; | ||
sections?: string[]; | ||
} | ||
interface EventTypes<AutofillSuggestionResponse, AutofillRetrieveResponse> { | ||
suggest: MapboxHTMLEvent<AutofillSuggestionResponse>; | ||
suggesterror: MapboxHTMLEvent<Error>; | ||
retrieve: MapboxHTMLEvent<AutofillRetrieveResponse>; | ||
} | ||
declare type AutofillCollectionType = AutofillCollection<AutofillSuggestionResponse, AutofillRetrieveResponse>; | ||
/** | ||
* @class AutofillCollection | ||
*/ | ||
declare class AutofillCollection { | ||
export declare class AutofillCollection<AutofillSuggestionResponse, AutofillRetrieveResponse> extends Evented<EventTypes<AutofillSuggestionResponse, AutofillRetrieveResponse>> { | ||
#private; | ||
autofillInstances: MapboxAddressAutofill[]; | ||
constructor({ accessToken, options }: AutofillCollectionOptions); | ||
instances: AutofillInstance[]; | ||
constructor({ accessToken, options, theme }: AutofillCollectionOptions); | ||
/** | ||
@@ -43,4 +56,3 @@ * The [Mapbox access token](https://docs.mapbox.com/help/glossary/access-token/) to use for all requests. | ||
/** | ||
* The {@link Theme} to use for styling the autofill and confirmation dialog | ||
* components. | ||
* The {@link Theme} to use for styling the autofill component. | ||
* | ||
@@ -58,4 +70,2 @@ * @example | ||
set theme(newTheme: Theme); | ||
get minimapOnConfirm(): boolean; | ||
set minimapOnConfirm(val: boolean); | ||
/** @section {Methods} */ | ||
@@ -82,11 +92,2 @@ /** | ||
unobserve(): void; | ||
/** | ||
* Display a confirmation dialog for one or more addresses filled out in a form. | ||
* @param form - The form element to show the confirmation dialog for. This can contain multiple address sections, e.g. billing and shipping. | ||
* @param options - Options to customize the dialog and confirmation behavior. | ||
* @param {Theme} [options.theme] | ||
* @param {string[]} [options.sections] - The sections to show in the confirmation dialog. If not provided, all sections will be shown. | ||
* @returns A promise that resolves to true if the user accepts the standardized address(es), otherwise false. | ||
*/ | ||
showConfirmAddress(form: HTMLFormElement, options?: ShowConfirmAddressOptions): Promise<boolean>; | ||
} | ||
@@ -129,3 +130,3 @@ /** | ||
*/ | ||
export declare function autofill(optionsArg: AutofillCollectionOptions): AutofillCollection; | ||
export declare function autofill(optionsArg: AutofillCollectionOptions): AutofillCollectionType; | ||
export {}; |
@@ -126,4 +126,3 @@ import { AutofillOptions, AutofillRetrieveResponse, AutofillSuggestion, AutofillSuggestionResponse } from '@mapbox/search-js-core'; | ||
/** | ||
* The {@link Theme} to use for styling the autofill and confirmation dialog | ||
* components. | ||
* The {@link Theme} to use for styling the autofill component. | ||
* | ||
@@ -153,32 +152,2 @@ * @name theme | ||
focus(): void; | ||
/** | ||
* `showConfirm` is a helper method to show the confirmation | ||
* dialog on form submit. | ||
* | ||
* The confirmation dialog will only be shown if the form values have | ||
* changed since the last autofill. | ||
* | ||
* The confirmation dialog can be themed by setting the {@link MapboxAddressAutofill#theme} | ||
* attribute. | ||
* | ||
* @returns `true` if the form values were changed, `false` otherwise. | ||
* @example | ||
* ```typescript | ||
* const form = document.querySelector('form'); | ||
* const autofill = document.querySelector('mapbox-address-autofill'); | ||
* | ||
* form.addEventListener('submit', async (e) => { | ||
* e.preventDefault(); | ||
* try { | ||
* await autofill.showConfirm(); | ||
* form.submit(); | ||
* } catch (e) { | ||
* // This means a network error occurred, | ||
* // or no suggestions could be found. | ||
* console.error(e.message || e); | ||
* } | ||
* }); | ||
* ``` | ||
*/ | ||
showConfirm(): Promise<boolean>; | ||
} | ||
@@ -185,0 +154,0 @@ declare global { |
@@ -0,4 +1,43 @@ | ||
import { AutofillFeatureSuggestion, AutofillOptions } from '@mapbox/search-js-core'; | ||
import { HTMLScopedElement } from './HTMLScopedElement'; | ||
import { AutofillValueMap } from '../utils/autofill'; | ||
import { AddressConfirmShowResult } from '../utils/confirmation'; | ||
import { MapboxHTMLEvent } from '../MapboxHTMLEvent'; | ||
import { Theme } from '../theme'; | ||
import { AutofillFeatureSuggestion } from '@mapbox/search-js-core'; | ||
export interface AddressConfirmOptions { | ||
/** | ||
* Mapbox access token used for the Autofill and Static Image APIs | ||
*/ | ||
accessToken?: string; | ||
/** | ||
* CSS variables and icons | ||
*/ | ||
theme?: Theme; | ||
/** | ||
* Autofill API configuration options | ||
* {@link AutofillOptions} | ||
*/ | ||
options?: Partial<AutofillOptions>; | ||
/** | ||
* If true, a static minimap showing the suggested address location will be displayed in the modal dialog. | ||
*/ | ||
minimap?: boolean; | ||
/** | ||
* An array of section names used within form element `autocomplete` attributes to identify and group one address section from another, e.g. "section-shipping" or "section-billing". | ||
* These are often used when a single <form> contains multiple logical sections. | ||
* If left undefined, all discoverable sections will be processed. | ||
*/ | ||
sections?: string[]; | ||
/** | ||
* A callback used to pre-confirm an address and skip the UI modal. | ||
* The feature argument contains all address components, as well as an {@link AutofillMatchCode} object, | ||
* which are used to express the confidence of an address match. | ||
* The callback must return a boolean, with `true` indicating that the address has been pre-confirmed, | ||
* and the UI modal will be skipped and will not be presented to the end-user. | ||
*/ | ||
skipConfirmModal?: (feature: AutofillFeatureSuggestion) => boolean; | ||
} | ||
export declare type AddressConfirmationEventTypes = { | ||
result: MapboxHTMLEvent<AddressConfirmShowResult['type']>; | ||
}; | ||
/** | ||
@@ -13,3 +52,3 @@ * {@link MapboxAddressConfirmation} is a custom element that | ||
*/ | ||
export declare class MapboxAddressConfirmation extends HTMLScopedElement { | ||
export declare class MapboxAddressConfirmation extends HTMLScopedElement<AddressConfirmationEventTypes> { | ||
#private; | ||
@@ -21,8 +60,13 @@ get template(): HTMLTemplateElement; | ||
set theme(theme: Theme); | ||
approve: () => void; | ||
reject: () => void; | ||
connectedCallback(): void; | ||
disconnectedCallback(): void; | ||
hide(): void; | ||
show(approveAddress: string, rejectAddress: string, feature?: AutofillFeatureSuggestion | null, accessToken?: string, minimapOnConfirm?: boolean): void; | ||
show(autofillValues: AutofillValueMap, optionsArg: AddressConfirmOptions, feature?: AutofillFeatureSuggestion): Promise<AddressConfirmShowResult>; | ||
/** | ||
* Attempts to show an address confirmation dialog by comparing form input values with the closest match via the Autofill API. | ||
* @param autofillValues - Map of form `<input>` values for each address component | ||
* @param optionsArg - Options object defining API options, UI controls, and callback defining when to bypass the dialog | ||
* @returns A promise indicating the action taken from the confirmation dialog | ||
*/ | ||
tryShow(autofillValues: AutofillValueMap, optionsArg: AddressConfirmOptions): Promise<AddressConfirmShowResult>; | ||
} | ||
@@ -29,0 +73,0 @@ declare global { |
@@ -41,3 +41,3 @@ import { HTMLScopedElement } from './HTMLScopedElement'; | ||
* When editable, the marker can be moved around the map and the updated | ||
* location is sent back to the Mapbox Contribute workflow. | ||
* location can be referenced from the {@link MapboxAddressMinimap#onSaveMarkerLocation} callback. | ||
* | ||
@@ -70,4 +70,16 @@ * @name canAdjustMarker | ||
/** | ||
* A client-defined callback that is triggered when the "Save" button is clicked in the editing interface, | ||
* and gives access to the adjusted marker coordinate. | ||
* | ||
* @name onSaveMarkerLocation | ||
* @instance | ||
* @memberof MapboxAddressMinimap | ||
* @type {function} | ||
*/ | ||
onSaveMarkerLocation: (coordinate: [number, number]) => void; | ||
/** | ||
* The [Mapbox access token](https://docs.mapbox.com/help/glossary/access-token/) to use for all requests. | ||
* | ||
* If not explicitly set on the component, this will reference the value in the global config object. | ||
* | ||
* @name accessToken | ||
@@ -161,3 +173,2 @@ * @instance | ||
hide(): void; | ||
onSaveMarkerLocation: (coordinate: [number, number]) => void; | ||
connectedCallback(): void; | ||
@@ -164,0 +175,0 @@ attributeChangedCallback(name: string, oldValue: string, newValue: string): void; |
@@ -1,6 +0,8 @@ | ||
import { Options, RetrieveResponse, SuggestionResponse } from '@mapbox/search-js-core'; | ||
import { Options, RetrieveResponse, Suggestion, SuggestionResponse } from '@mapbox/search-js-core'; | ||
import mapboxgl from 'mapbox-gl'; | ||
import { MapboxSearchListbox } from './MapboxSearchListbox'; | ||
import { HTMLScopedElement } from './HTMLScopedElement'; | ||
import { Theme } from '../theme'; | ||
import { MapboxHTMLEvent } from '../MapboxHTMLEvent'; | ||
export declare type MapboxSearchListboxSearchType = MapboxSearchListbox<Options, Suggestion, SuggestionResponse, RetrieveResponse>; | ||
declare type SearchEventTypes = { | ||
@@ -7,0 +9,0 @@ /** |
export declare const STATIC_BASE_URL_SATELLITE: string; | ||
export declare const AUTOFILL_SKU_TOKEN_PREFIX = "20d01"; |
/// <reference path="../src/types/custom_elements.d.ts" /> | ||
/// <reference path="../src/types/typehead.d.ts" /> | ||
import './components/MapboxSearchListbox'; | ||
import './components/MapboxAddressConfirmation'; | ||
import './components/MapboxAddressConfirmationFeature'; | ||
import './components/MapboxAddressConfirmationNoFeature'; | ||
export { MapboxAddressConfirmation, AddressConfirmOptions } from './components/MapboxAddressConfirmation'; | ||
export { MapboxAddressAutofill } from './components/MapboxAddressAutofill'; | ||
@@ -11,2 +13,6 @@ export { MapboxSearchBox } from './components/MapboxSearchBox'; | ||
export { autofill } from './autofill'; | ||
export { confirmAddress } from './confirmAddress'; | ||
export { MapStyleMode, Anchor } from './utils/minimap'; | ||
export { AddressConfirmShowResult } from './utils/confirmation'; | ||
export { getFormAutofillValues, getAutofillSearchText } from './utils/autofill'; | ||
export { config } from './config'; |
@@ -1,11 +0,11 @@ | ||
var Ai=Object.create;var Me=Object.defineProperty,Li=Object.defineProperties,ki=Object.getOwnPropertyDescriptor,Ci=Object.getOwnPropertyDescriptors,wi=Object.getOwnPropertyNames,$t=Object.getOwnPropertySymbols,Ii=Object.getPrototypeOf,Vt=Object.prototype.hasOwnProperty,Hi=Object.prototype.propertyIsEnumerable;var Wt=(r,e,i)=>e in r?Me(r,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[e]=i,h=(r,e)=>{for(var i in e||(e={}))Vt.call(e,i)&&Wt(r,i,e[i]);if($t)for(var i of $t(e))Hi.call(e,i)&&Wt(r,i,e[i]);return r},qt=(r,e)=>Li(r,Ci(e)),Gt=r=>Me(r,"__esModule",{value:!0});var Bi=(r,e)=>{for(var i in e)Me(r,i,{get:e[i],enumerable:!0})},Kt=(r,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of wi(e))!Vt.call(r,n)&&(i||n!=="default")&&Me(r,n,{get:()=>e[n],enumerable:!(s=ki(e,n))||s.enumerable});return r},mt=(r,e)=>Kt(Gt(Me(r!=null?Ai(Ii(r)):{},"default",!e&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r),Ri=(r=>(e,i)=>r&&r.get(e)||(i=Kt(Gt({}),e,1),r&&r.set(e,i),i))(typeof WeakMap!="undefined"?new WeakMap:0);var wt=(r,e,i)=>{if(!e.has(r))throw TypeError("Cannot "+i)};var t=(r,e,i)=>(wt(r,e,"read from private field"),i?i.call(r):e.get(r)),a=(r,e,i)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,i)},d=(r,e,i,s)=>(wt(r,e,"write to private field"),s?s.call(r,i):e.set(r,i),i);var x=(r,e,i)=>(wt(r,e,"access private method"),i);var j=(r,e,i)=>new Promise((s,n)=>{var o=u=>{try{c(i.next(u))}catch(m){n(m)}},l=u=>{try{c(i.throw(u))}catch(m){n(m)}},c=u=>u.done?s(u.value):Promise.resolve(u.value).then(o,l);c((i=i.apply(r,e)).next())});var cs={};Bi(cs,{MapboxAddressAutofill:()=>z,MapboxAddressMinimap:()=>fe,MapboxHTMLEvent:()=>b,MapboxSearchBox:()=>me,autofill:()=>Si});var Ft=require("@popperjs/core/lib/popper-lite");var Zt=document.implementation.createHTMLDocument();function re(r,e){let i={};for(let[s,n]of Object.entries(e))i[s]=r.querySelector(n);return i}function Jt(r){return Array.from(r.childNodes||[]).filter(e=>e.nodeType===Node.ELEMENT_NODE)}function E(r){let e=document.createElement("template");return e.innerHTML=r,e.content.firstElementChild}function Qt(r){let e=Zt.createElement("style");return e.textContent=r,Zt.head.appendChild(e),e.sheet}function ei(r){return window.getComputedStyle(r).display!=="none"}function L(r,e){if(!r)return;Object.getOwnPropertyDescriptor(r.constructor.prototype,"value").set.call(r,e);let s=r;s._valueTracker&&s._valueTracker.setValue("");let n=new Event("input",{bubbles:!0});n.simulated=!0,r.dispatchEvent(n);let o=new Event("change",{bubbles:!0});o.simulated=!0,r.dispatchEvent(o)}function pt(r,e=!1){let i,s,n=r.getBoundingClientRect();if(r.style.display==="none"||n.height===0&&n.width===0){let o=r.cloneNode(e);r.parentElement.appendChild(o),o.style.setProperty("display","block","important");let l=o.getBoundingClientRect();i=l.width,s=l.height,o.style.setProperty("display","none"),o.remove()}else i=n.width,s=n.height;return{height:Math.floor(s),width:Math.floor(i)}}var Pi=new RegExp("[_a-zA-Z]+[_a-zA-Z0-9-]*","g"),Oi=new RegExp(`\\.${Pi.source}`,"g"),Fi=new RegExp("^\\s*(@(?:media|supports)[^{]*){(.*)}\\s*$");function xe(r,e){return r.replace(Oi,i=>"."+e(i.slice(1)))}function It(r,e){let s=Qt(r).cssRules;function n(l){if(l instanceof CSSStyleRule)return`${xe(l.selectorText,e)} { ${l.style.cssText} }`;let c=Fi.exec(l.cssText.split(` | ||
`).join(""));if(c&&c.length>2){let u=c[1],m=c[2];return`${u} { ${It(m,e)} }`}return l.cssText}let o="";for(let l of Array.from(s))o+=n(l)+` | ||
var Ji=Object.create;var ke=Object.defineProperty,eo=Object.defineProperties,to=Object.getOwnPropertyDescriptor,io=Object.getOwnPropertyDescriptors,oo=Object.getOwnPropertyNames,gi=Object.getOwnPropertySymbols,so=Object.getPrototypeOf,vi=Object.prototype.hasOwnProperty,no=Object.prototype.propertyIsEnumerable;var fi=(s,e,i)=>e in s?ke(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i,h=(s,e)=>{for(var i in e||(e={}))vi.call(e,i)&&fi(s,i,e[i]);if(gi)for(var i of gi(e))no.call(e,i)&&fi(s,i,e[i]);return s},Ct=(s,e)=>eo(s,io(e)),bi=s=>ke(s,"__esModule",{value:!0});var ro=(s,e)=>{for(var i in e)ke(s,i,{get:e[i],enumerable:!0})},Mi=(s,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of oo(e))!vi.call(s,n)&&(i||n!=="default")&&ke(s,n,{get:()=>e[n],enumerable:!(o=to(e,n))||o.enumerable});return s},kt=(s,e)=>Mi(bi(ke(s!=null?Ji(so(s)):{},"default",!e&&s&&s.__esModule?{get:()=>s.default,enumerable:!0}:{value:s,enumerable:!0})),s),ao=(s=>(e,i)=>s&&s.get(e)||(i=Mi(bi({}),e,1),s&&s.set(e,i),i))(typeof WeakMap!="undefined"?new WeakMap:0);var Zt=(s,e,i)=>{if(!e.has(s))throw TypeError("Cannot "+i)};var t=(s,e,i)=>(Zt(s,e,"read from private field"),i?i.call(s):e.get(s)),a=(s,e,i)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,i)},d=(s,e,i,o)=>(Zt(s,e,"write to private field"),o?o.call(s,i):e.set(s,i),i);var H=(s,e,i)=>(Zt(s,e,"access private method"),i);var D=(s,e,i)=>new Promise((o,n)=>{var r=m=>{try{c(i.next(m))}catch(u){n(u)}},l=m=>{try{c(i.throw(m))}catch(u){n(u)}},c=m=>m.done?o(m.value):Promise.resolve(m.value).then(r,l);c((i=i.apply(s,e)).next())});var Xo={};ro(Xo,{MapboxAddressAutofill:()=>ve,MapboxAddressConfirmation:()=>J,MapboxAddressMinimap:()=>Te,MapboxHTMLEvent:()=>M,MapboxSearchBox:()=>be,autofill:()=>Ki,config:()=>v,confirmAddress:()=>Zi,getAutofillSearchText:()=>Pt,getFormAutofillValues:()=>Ft});var oi=require("@popperjs/core/lib/popper-lite");var xi=document.implementation.createHTMLDocument();function R(s,e){let i={};for(let[o,n]of Object.entries(e))i[o]=s.querySelector(n);return i}function Ei(s){return Array.from(s.childNodes||[]).filter(e=>e.nodeType===Node.ELEMENT_NODE)}function b(s){let e=document.createElement("template");return e.innerHTML=s,e.content.firstElementChild}function Ti(s){let e=xi.createElement("style");return e.textContent=s,xi.head.appendChild(e),e.sheet}function yi(s){return window.getComputedStyle(s).display!=="none"}function B(s,e){if(!s)return;Object.getOwnPropertyDescriptor(s.constructor.prototype,"value").set.call(s,e);let o=s;o._valueTracker&&o._valueTracker.setValue("");let n=new Event("input",{bubbles:!0});n.simulated=!0,s.dispatchEvent(n);let r=new Event("change",{bubbles:!0});r.simulated=!0,s.dispatchEvent(r)}function wt(s,e=!1){let i,o,n=s.getBoundingClientRect();if(s.style.display==="none"||n.height===0&&n.width===0){let r=s.cloneNode(e);s.parentElement.appendChild(r),r.style.setProperty("display","block","important");let l=r.getBoundingClientRect();i=l.width,o=l.height,r.style.setProperty("display","none"),r.remove()}else i=n.width,o=n.height;return{height:Math.floor(o),width:Math.floor(i)}}var lo=new RegExp("[_a-zA-Z]+[_a-zA-Z0-9-]*","g"),co=new RegExp(`\\.${lo.source}`,"g"),mo=new RegExp("^\\s*(@(?:media|supports)[^{]*){(.*)}\\s*$");function we(s,e){return s.replace(co,i=>"."+e(i.slice(1)))}function Qt(s,e){let o=Ti(s).cssRules;function n(l){if(l instanceof CSSStyleRule)return`${we(l.selectorText,e)} { ${l.style.cssText} }`;let c=mo.exec(l.cssText.split(` | ||
`).join(""));if(c&&c.length>2){let m=c[1],u=c[2];return`${m} { ${Qt(u,e)} }`}return l.cssText}let r="";for(let l of Array.from(o))r+=n(l)+` | ||
`;return o.trim()}function Ht(r,e){let i=Array.from(r.querySelectorAll("[class]"));i.push(r);for(let s of i){let{classList:n}=s;for(let o of Array.from(n))n.remove(o),n.add(e(o))}return r}var ti=require("@mapbox/search-js-core");function B(){return"mbx"+new ti.SessionToken().id.slice(0,8)}function ht(r){try{return JSON.parse(r)}catch(e){return null}}function Ee(r,e){if(r==null||e==null||typeof r!="object"||typeof e!="object")return r===e;let i=Object.keys(r),s=Object.keys(e);if(i.length!==s.length)return!1;for(let n of i)if(!Ee(r[n],e[n]))return!1;return!0}function Bt(r,e){let i=Math.pow(10,e);return Math.round(r*i)/i}var ne,$,W,w=class extends HTMLElement{constructor(){super(...arguments);a(this,ne,B());a(this,$,void 0);a(this,W,e=>`${t(this,ne)}--${e}`)}get template(){return null}get templateStyle(){return null}get templateUserStyle(){return null}clonedCallback(e,i){let s=o=>o.replace(e,i);Ht(this,s);let n=Array.from(this.querySelectorAll("style"));for(let o of n)o.textContent=xe(o.textContent,s);n.length&&d(this,$,n[n.length-1])}connectedCallback(){if(this.childElementCount>0){let n=this.dataset.seed,o=t(this,ne);n&&n!==o&&(this.clonedCallback(n,o),this.dataset.seed=o);return}this.dataset.seed=t(this,ne);let e=this.template;if(e){let n=this.prepareTemplate(e);this.appendChild(n)}let i=this.templateStyle;if(i){let n=document.createElement("style");n.textContent=this.prepareCSS(i),this.appendChild(n)}let s=document.createElement("style");this.templateUserStyle&&(s.textContent=this.prepareCSS(this.templateUserStyle)),this.appendChild(s),d(this,$,s)}prepareTemplate(e){let i=e.content.firstElementChild;return Ht(i.cloneNode(!0),t(this,W))}prepareCSS(e){return It(e,t(this,W))}updateTemplateUserStyle(e){!t(this,$)||(t(this,$).textContent=this.prepareCSS(e))}querySelector(e){return super.querySelector(xe(e,t(this,W)))}querySelectorAll(e){return super.querySelectorAll(xe(e,t(this,W)))}addEventListener(e,i,s){super.addEventListener(e,i,s)}removeEventListener(e,i,s){super.removeEventListener(e,i,s)}dispatchEvent(e){return super.dispatchEvent(e)}};ne=new WeakMap,$=new WeakMap,W=new WeakMap;var b=class extends CustomEvent{constructor(e,i){super(e,{composed:!0,detail:i})}clone(){return new b(this.type,this.detail)}};var ii=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
`;return r.trim()}function Jt(s,e){let i=Array.from(s.querySelectorAll("[class]"));i.push(s);for(let o of i){let{classList:n}=o;for(let r of Array.from(n))n.remove(r),n.add(e(r))}return s}var Si=require("@mapbox/search-js-core");function A(){return"mbx"+new Si.SessionToken().id.slice(0,8)}function It(s){try{return JSON.parse(s)}catch(e){return null}}function V(s,e){if(s==null||e==null||typeof s!="object"||typeof e!="object")return s===e;let i=Object.keys(s),o=Object.keys(e);if(i.length!==o.length)return!1;for(let n of i)if(!V(s[n],e[n]))return!1;return!0}function ei(s,e){let i=Math.pow(10,e);return Math.round(s*i)/i}function Ai(s){return Boolean(s.match(/localhost|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|::1|\.local|^$/gi))}var ce,G,K,T=class extends HTMLElement{constructor(){super(...arguments);a(this,ce,A());a(this,G,void 0);a(this,K,e=>`${t(this,ce)}--${e}`)}get template(){return null}get templateStyle(){return null}get templateUserStyle(){return null}clonedCallback(e,i){let o=r=>r.replace(e,i);Jt(this,o);let n=Array.from(this.querySelectorAll("style"));for(let r of n)r.textContent=we(r.textContent,o);n.length&&d(this,G,n[n.length-1])}connectedCallback(){if(this.childElementCount>0){let n=this.dataset.seed,r=t(this,ce);n&&n!==r&&(this.clonedCallback(n,r),this.dataset.seed=r);return}this.dataset.seed=t(this,ce);let e=this.template;if(e){let n=this.prepareTemplate(e);this.appendChild(n)}let i=this.templateStyle;if(i){let n=document.createElement("style");n.textContent=this.prepareCSS(i),this.appendChild(n)}let o=document.createElement("style");this.templateUserStyle&&(o.textContent=this.prepareCSS(this.templateUserStyle)),this.appendChild(o),d(this,G,o)}prepareTemplate(e){let i=e.content.firstElementChild;return Jt(i.cloneNode(!0),t(this,K))}prepareCSS(e){return Qt(e,t(this,K))}updateTemplateUserStyle(e){!t(this,G)||(t(this,G).textContent=this.prepareCSS(e))}querySelector(e){return super.querySelector(we(e,t(this,K)))}querySelectorAll(e){return super.querySelectorAll(we(e,t(this,K)))}addEventListener(e,i,o){super.addEventListener(e,i,o)}removeEventListener(e,i,o){super.removeEventListener(e,i,o)}dispatchEvent(e){return super.dispatchEvent(e)}};ce=new WeakMap,G=new WeakMap,K=new WeakMap;var M=class extends CustomEvent{constructor(e,i){super(e,{composed:!0,detail:i})}clone(e){let i=new M(this.type,this.detail);return e&&Object.defineProperty(i,"target",{value:e}),i}};var Li=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"> | ||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.79289 3.79289C4.18342 3.40237 4.81658 3.40237 5.20711 3.79289L9 7.58579L12.7929 3.79289C13.1834 3.40237 13.8166 3.40237 14.2071 3.79289C14.5976 4.18342 14.5976 4.81658 14.2071 5.20711L10.4142 9L14.2071 12.7929C14.5976 13.1834 14.5976 13.8166 14.2071 14.2071C13.8166 14.5976 13.1834 14.5976 12.7929 14.2071L9 10.4142L5.20711 14.2071C4.81658 14.5976 4.18342 14.5976 3.79289 14.2071C3.40237 13.8166 3.40237 13.1834 3.79289 12.7929L7.58579 9L3.79289 5.20711C3.40237 4.81658 3.40237 4.18342 3.79289 3.79289Z" fill="currentColor"/> | ||
</svg>`;var si=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
</svg>`;var Ci=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"> | ||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 16C12.866 16 16 12.866 16 9C16 5.13401 12.866 2 9 2C5.13401 2 2 5.13401 2 9C2 12.866 5.13401 16 9 16ZM6.88128 4.88128C7.36552 4.39704 8.02229 4.125 8.70711 4.125H9.79289C10.4777 4.125 11.1345 4.39704 11.6187 4.88128C12.103 5.36552 12.375 6.02229 12.375 6.70711V6.86762C12.375 7.8775 11.8451 8.81333 10.9792 9.33291L10.4212 9.6677C10.1547 9.82759 9.96958 10.0882 9.90264 10.3844C9.87221 10.5191 9.76307 10.6324 9.625 10.6324H8.375C8.23693 10.6324 8.12387 10.5202 8.13584 10.3826C8.21527 9.47002 8.72673 8.64354 9.52082 8.16709L10.0788 7.8323C10.4177 7.62899 10.625 7.26279 10.625 6.86762V6.70711C10.625 6.48642 10.5373 6.27477 10.3813 6.11872C10.2252 5.96267 10.0136 5.875 9.79289 5.875H8.70711C8.48642 5.875 8.27477 5.96267 8.11872 6.11872C7.96267 6.27477 7.875 6.48642 7.875 6.70711V6.8889C7.875 7.37215 7.48325 7.7639 7 7.7639C6.51675 7.7639 6.125 7.37215 6.125 6.8889V6.70711C6.125 6.02229 6.39704 5.36552 6.88128 4.88128ZM10 13C10 13.5523 9.55228 14 9 14C8.44772 14 8 13.5523 8 13C8 12.4477 8.44772 12 9 12C9.55228 12 10 12.4477 10 13Z" fill="currentColor"/> | ||
</svg>`;var ri=`<svg width="48" height="56" viewBox="0 0 48 56" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
</svg>`;var ki=`<svg width="48" height="56" viewBox="0 0 48 56" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<g filter="url(#filter0_d_17_871)"> | ||
@@ -27,3 +27,3 @@ <path d="M24 50.4L37.7887 36.2834C40.5158 33.6058 42.3729 30.1944 43.1253 26.4806C43.8777 22.7667 43.4915 18.9172 42.0156 15.4188C40.5397 11.9204 38.0403 8.9303 34.8336 6.82657C31.6268 4.72284 27.8567 3.59998 24 3.59998C20.1433 3.59998 16.3732 4.72284 13.1664 6.82657C9.95966 8.9303 7.4603 11.9204 5.98438 15.4188C4.50846 18.9172 4.12229 22.7667 4.87468 26.4806C5.62707 30.1944 7.48424 33.6058 10.2113 36.2834L24 50.4Z" fill="currentColor"/> | ||
</defs> | ||
</svg>`;var Rt="1.0.0-beta.6";var zi=`https://api.mapbox.com/search-js/v${Rt}/img/style-toggle-satellite.jpg`,Yi=`https://api.mapbox.com/search-js/v${Rt}/img/style-toggle-default.jpg`,Ui=768-1,Xi=`@media only screen and (max-width: ${Ui}px)`,Pt={variables:{unit:["mobile","16px","14px"],unitHeader:["mobile","24px","18px"],minWidth:"min(300px, 100vw)",spacing:"0.75em",padding:"0.5em 0.75em",paddingModal:"1.25em",colorText:"rgba(0, 0, 0, 0.75)",colorPrimary:"#4264FB",colorSecondary:"#667F91",colorBackground:"#fff",colorBackgroundHover:"#f5f5f5",colorBackgroundActive:"#f0f0f0",colorBackdrop:"rgba(102, 127, 145, 0.3)",border:"none",borderRadius:"4px",boxShadow:` | ||
</svg>`;var Ie="1.0.0-beta.7";var fo=`https://api.mapbox.com/search-js/v${Ie}/img/style-toggle-satellite.jpg`,vo=`https://api.mapbox.com/search-js/v${Ie}/img/style-toggle-default.jpg`,bo=768-1,Mo=`@media only screen and (max-width: ${bo}px)`,ti={variables:{unit:["mobile","16px","14px"],unitHeader:["mobile","24px","18px"],minWidth:"min(300px, 100vw)",spacing:"0.75em",padding:"0.5em 0.75em",paddingModal:"1.25em",colorText:"rgba(0, 0, 0, 0.75)",colorPrimary:"#4264FB",colorSecondary:"#667F91",colorBackground:"#fff",colorBackgroundHover:"#f5f5f5",colorBackgroundActive:"#f0f0f0",colorBackdrop:"rgba(102, 127, 145, 0.3)",border:"none",borderRadius:"4px",boxShadow:` | ||
0 0 10px 2px rgba(0, 0, 0, 0.05), | ||
@@ -38,3 +38,3 @@ 0 0 6px 1px rgba(0, 0, 0, 0.1), | ||
Ubuntu, roboto, noto, arial, sans-serif | ||
`,fontWeight:"normal",fontWeightSemibold:"600",fontWeightBold:"bold",duration:"150ms",curve:"ease-out"},icons:{close:ii,question:si,marker:ri},images:{styleToggleDefault:Yi,styleToggleSatellite:zi}};function k(r,e={}){let i=h(h({},Pt.variables),e.variables||{}),s=e.cssText||"",n="";for(let[o,l]of Object.entries(i)){if(!Array.isArray(l)){n+=`--${o}: ${l};`;continue}if(l[0]!=="mobile"){let m=JSON.stringify(l);throw new Error(`Unsupported expression in theme variables: ${o} ${m}`)}let[,c,u]=l;s+=`${Xi} { ${r} { --${o}: ${c} !important; } }`,n+=`--${o}: ${u};`}return s+`${r} { ${n} }`}function V(r,e={}){return h(h({},Pt.icons),e.icons||{})[r]}function ni(r,e={}){return h(h({},Pt.images),e.images||{})[r]}var D="*{box-sizing:border-box!important}[role=button]{cursor:pointer}.MapboxSearch{--width:100%}.Results{background-color:var(--colorBackground);border:var(--border);border-radius:var(--borderRadius);box-shadow:var(--boxShadow);color:var(--colorText);font-family:var(--fontFamily);font-size:var(--unit);font-weight:var(--fontWeight);line-height:var(--lineHeight);margin-top:var(--spacing)!important;min-width:var(--minWidth);overflow-y:auto;position:absolute;transform:translateZ(0);transition:visibility var(--duration);width:var(--width);z-index:1000}.Results:not([aria-hidden=true]){visibility:visible}.Results[aria-hidden=true]{animation:fadein var(--duration) var(--curve) reverse forwards;visibility:hidden}.Suggestion{padding:var(--padding)}.Suggestion:hover{cursor:pointer}.Suggestion[aria-selected=true]{background-color:var(--colorBackgroundHover)}.Suggestion:active{background-color:var(--colorBackgroundActive)}.SuggestionName{font-weight:var(--fontWeightBold)}.ResultsAttribution{padding:var(--padding)}.ResultsAttribution a{color:var(--colorSecondary)}.ResultsAttribution a:not(:hover){text-decoration:none}.ResultsList{list-style:none;margin:0;padding:0}.Label{display:none}.Input{background-color:var(--colorBackground);border:var(--border);border-radius:var(--borderRadius);box-shadow:var(--boxShadow);color:var(--colorText);font-family:var(--fontFamily);font-size:var(--unit);font-weight:var(--fontWeight);line-height:var(--lineHeight);padding:var(--padding);width:100%}.MapboxAddressConfirmation{align-items:center;background-color:var(--colorBackdrop);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;transform:translateZ(0);z-index:1000}.MapboxAddressConfirmation:not([aria-hidden=true]){animation:fadein var(--duration) var(--curve) forwards;visibility:visible}.MapboxAddressConfirmation[aria-hidden=true]{visibility:hidden}.Modal{background-color:var(--colorBackground);border:var(--border);border-radius:var(--borderRadius);box-shadow:var(--boxShadow);color:var(--colorText);font-family:var(--fontFamily);font-size:var(--unit);font-weight:var(--fontWeight);line-height:var(--lineHeight);padding:var(--paddingModal);width:var(--minWidth)}@media screen and (max-width:768px){.MapboxAddressConfirmation{align-items:flex-end}.Modal{border-bottom-left-radius:0;border-bottom-right-radius:0;width:100%}}.ModalHeader{align-items:center;color:var(--colorPrimary);display:flex;font-size:var(--unitHeader);font-weight:var(--fontWeightBold);margin-bottom:var(--spacing);user-select:none;width:100%}.ModalMap{height:calc(var(--minWidth) - var(--paddingModal)*2)}.ModalMap[aria-hidden=true]{display:none}.Icon{height:var(--unitHeader);width:var(--unitHeader)}.Icon.IconClose{color:var(--colorSecondary)}.ModalHeaderTitle{flex:1;margin-left:.25em}.ModalFooter{color:var(--colorSecondary);margin-top:var(--spacing);text-align:center}.ModalSubheader{font-weight:var(--fontWeightBold);user-select:none}.ModalAddress,.ModalSubheader{margin-bottom:var(--spacing)}.ModalAddress.ModalAddressApprove{color:var(--colorPrimary)}.Button{border-radius:var(--borderRadius);cursor:pointer;font-weight:var(--fontWeightSemibold);margin-top:var(--spacing);padding:var(--padding);text-align:center;user-select:none;width:100%}.Button[aria-hidden=true]{display:none}.Button.ButtonPrimary{background-color:var(--colorPrimary);color:var(--colorBackground)}.Button.ButtonSecondary{border:1px solid var(--colorSecondary);color:var(--colorSecondary)}@keyframes fadein{0%{opacity:0}to{opacity:1}}.MapboxAddressMinimap{font-family:var(--fontFamily);font-size:var(--unit);font-weight:var(--fontWeight);line-height:var(--lineHeight)}.MapboxAddressMinimap[aria-hidden=true]{display:none}.MinimapImageContainer{border-radius:var(--borderRadius);overflow:hidden}.MinimapImage{height:unset;max-height:unset;max-width:unset;position:relative;width:unset}.MinimapInnerFrame{border:var(--border);border-radius:inherit;height:inherit;left:0;overflow:hidden;position:absolute;top:0;width:inherit}.MinimapMarker{left:50%;position:absolute;top:50%}.MinimapMarker>svg{color:var(--colorPrimary);display:block!important}.MinimapAttributionLogo{bottom:0;left:0;margin:0 0 6px 6px;position:absolute}.MinimapAttributionLogo a{cursor:pointer;display:block;height:23px;width:88px}.MinimapAttributionText{background-color:hsla(0,0%,100%,.65);bottom:0;font:11px/16px Helvetica Neue,Arial,Helvetica,sans-serif;padding:0 5px;position:absolute;right:0}.MinimapAttributionText a{color:rgba(0,0,0,.75);text-decoration:none}.MinimapAttributionText a:hover{color:inherit;text-decoration:underline}.MinimapAttributionText a:not(:first-child){margin-left:3px}.MinimapStyleToggle{background-position:0;background-repeat:no-repeat;background-size:contain;border:2px solid #fff;border-radius:3px;box-shadow:var(--boxShadow);cursor:pointer;height:2em;position:absolute;right:var(--spacing);top:var(--spacing);width:2em}.MinimapFooter{color:var(--colorSecondary);font-family:var(--fontFamily);font-size:var(--unit);margin-top:var(--spacing)}.MinimapEditButtons{bottom:26px;display:flex;font-family:var(--fontFamily);position:absolute;right:var(--spacing)}.MinimapEditButtons .Button{box-shadow:var(--boxShadow)}.MinimapButtonCancel{background-color:var(--colorBackground);margin-left:var(--spacing)}.draggable{cursor:move;cursor:grab}.draggable:active{cursor:grabbing}";var Wi=E(` | ||
`,fontWeight:"normal",fontWeightSemibold:"600",fontWeightBold:"bold",duration:"150ms",curve:"ease-out"},icons:{close:Li,question:Ci,marker:ki},images:{styleToggleDefault:vo,styleToggleSatellite:fo}};function x(s,e={}){let i=h(h({},ti.variables),e.variables||{}),o=e.cssText||"",n="";for(let[r,l]of Object.entries(i)){if(!Array.isArray(l)){n+=`--${r}: ${l};`;continue}if(l[0]!=="mobile"){let u=JSON.stringify(l);throw new Error(`Unsupported expression in theme variables: ${r} ${u}`)}let[,c,m]=l;o+=`${Mo} { ${s} { --${r}: ${c} !important; } }`,n+=`--${r}: ${m};`}return o+`${s} { ${n} }`}function k(s,e={}){return h(h({},ti.icons),e.icons||{})[s]}function wi(s,e={}){return h(h({},ti.images),e.images||{})[s]}var w="*{box-sizing:border-box!important}[role=button]{cursor:pointer}.MapboxSearch{--width:100%}.Results{background-color:var(--colorBackground);border:var(--border);border-radius:var(--borderRadius);box-shadow:var(--boxShadow);color:var(--colorText);font-family:var(--fontFamily);font-size:var(--unit);font-weight:var(--fontWeight);line-height:var(--lineHeight);margin-top:var(--spacing)!important;min-width:var(--minWidth);overflow-y:auto;position:absolute;transform:translateZ(0);transition:visibility var(--duration);width:var(--width);z-index:1000}.Results:not([aria-hidden=true]){visibility:visible}.Results[aria-hidden=true]{animation:fadein var(--duration) var(--curve) reverse forwards;visibility:hidden}.Suggestion{padding:var(--padding)}.Suggestion:hover{cursor:pointer}.Suggestion[aria-selected=true]{background-color:var(--colorBackgroundHover)}.Suggestion:active{background-color:var(--colorBackgroundActive)}.SuggestionName{font-weight:var(--fontWeightBold)}.ResultsAttribution{padding:var(--padding)}.ResultsAttribution a{color:var(--colorSecondary)}.ResultsAttribution a:not(:hover){text-decoration:none}.ResultsList{list-style:none;margin:0;padding:0}.Label{display:none}.Input{background-color:var(--colorBackground);border:var(--border);border-radius:var(--borderRadius);box-shadow:var(--boxShadow);color:var(--colorText);font-family:var(--fontFamily);font-size:var(--unit);font-weight:var(--fontWeight);line-height:var(--lineHeight);padding:var(--padding);width:100%}mapbox-address-confirmation-feature[aria-hidden=true],mapbox-address-confirmation-no-feature[aria-hidden=true]{display:none}.MapboxAddressConfirmation{align-items:center;background-color:var(--colorBackdrop);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;transform:translateZ(0);z-index:1000}.MapboxAddressConfirmation:not([aria-hidden=true]){animation:fadein var(--duration) var(--curve) forwards;visibility:visible}.MapboxAddressConfirmation[aria-hidden=true]{visibility:hidden}.Modal{background-color:var(--colorBackground);border:var(--border);border-radius:var(--borderRadius);box-shadow:var(--boxShadow);color:var(--colorText);font-family:var(--fontFamily);font-size:var(--unit);font-weight:var(--fontWeight);line-height:var(--lineHeight);padding:var(--paddingModal);width:var(--minWidth)}@media screen and (max-width:768px){.MapboxAddressConfirmation{align-items:flex-end}.Modal{border-bottom-left-radius:0;border-bottom-right-radius:0;width:100%}}.ModalHeader{align-items:center;color:var(--colorPrimary);display:flex;font-size:var(--unitHeader);font-weight:var(--fontWeightBold);margin-bottom:var(--spacing);user-select:none;width:100%}.ModalMap{height:calc(var(--minWidth)*9/16);margin-left:calc(var(--paddingModal)*-1);width:calc(100% + var(--paddingModal)*2)}.ModalMap[aria-hidden=true]{display:none}.Icon{height:var(--unitHeader);width:var(--unitHeader)}.Icon.IconClose{color:var(--colorSecondary)}.ModalHeaderTitle{flex:1;margin-left:.25em}.ModalFooter{color:var(--colorSecondary);margin-top:var(--spacing);text-align:center}.ModalSubheader{font-weight:var(--fontWeightBold);user-select:none}.ModalDescription{color:var(--colorPrimary)}.ModalAddress,.ModalSubheader{margin-bottom:var(--spacing)}.ModalAddress.ModalAddressApprove{color:var(--colorPrimary)}.Button{border-radius:var(--borderRadius);cursor:pointer;font-weight:var(--fontWeightSemibold);margin-top:var(--spacing);padding:var(--padding);text-align:center;user-select:none;width:100%}.Button[aria-hidden=true]{display:none}.Button.ButtonPrimary{background-color:var(--colorPrimary);color:var(--colorBackground)}.Button.ButtonSecondary{border:1px solid var(--colorSecondary);color:var(--colorSecondary)}@keyframes fadein{0%{opacity:0}to{opacity:1}}.MapboxAddressMinimap{font-family:var(--fontFamily);font-size:var(--unit);font-weight:var(--fontWeight);line-height:var(--lineHeight)}.MapboxAddressMinimap[aria-hidden=true]{display:none}.MinimapImageContainer{border-radius:var(--borderRadius);overflow:hidden}.MinimapImage{height:unset;max-height:unset;max-width:unset;position:relative;width:unset}.MinimapInnerFrame{border:var(--border);border-radius:inherit;height:inherit;left:0;overflow:hidden;position:absolute;top:0;width:inherit}.MinimapMarker{left:50%;position:absolute;top:50%}.MinimapMarker>svg{color:var(--colorPrimary);display:block!important}.MinimapAttributionLogo{bottom:0;left:0;margin:0 0 6px 6px;position:absolute}.MinimapAttributionLogo a{cursor:pointer;display:block;height:23px;width:88px}.MinimapAttributionText{background-color:hsla(0,0%,100%,.65);bottom:0;font:11px/16px Helvetica Neue,Arial,Helvetica,sans-serif;padding:0 5px;position:absolute;right:0}.MinimapAttributionText a{color:rgba(0,0,0,.75);text-decoration:none}.MinimapAttributionText a:hover{color:inherit;text-decoration:underline}.MinimapAttributionText a:not(:first-child){margin-left:3px}.MinimapStyleToggle{background-position:0;background-repeat:no-repeat;background-size:contain;border:2px solid #fff;border-radius:3px;box-shadow:var(--boxShadow);cursor:pointer;height:2em;position:absolute;right:var(--spacing);top:var(--spacing);width:2em}.MinimapFooter{color:var(--colorSecondary);font-family:var(--fontFamily);font-size:var(--unit);margin-top:var(--spacing)}.MinimapEditButtons{bottom:26px;display:flex;font-family:var(--fontFamily);position:absolute;right:var(--spacing)}.MinimapEditButtons .Button{box-shadow:var(--boxShadow)}.MinimapButtonCancel{background-color:var(--colorBackground);margin-left:var(--spacing)}.draggable{cursor:move;cursor:grab}.draggable:active{cursor:grabbing}";var Eo=b(` | ||
<template> | ||
@@ -55,3 +55,3 @@ <div class="MapboxSearch"> | ||
</template> | ||
`),Vi=E(` | ||
`),To=b(` | ||
<template> | ||
@@ -63,5 +63,13 @@ <div class="Suggestion" role="option"> | ||
</template> | ||
`);function Ot(r,e){return`${r}-${e}`}var ae,C,v,ye,_,le,de,Te,oi,R,oe,gt,qi,Se,Ae,Le,ke,Ce,ce,q,we,G=class extends w{constructor(){super(...arguments);a(this,Te);a(this,R);a(this,gt);a(this,ae,void 0);a(this,C,null);a(this,v,void 0);a(this,ye,B());a(this,_,B());a(this,le,void 0);a(this,de,0);a(this,Se,{});a(this,Ae,{});a(this,Le,e=>{let{Results:i}=t(this,v),s=e.target;if(s.dataset.mapboxSuccess){delete s.dataset.mapboxSuccess;return}let n=s.value;i.setAttribute("aria-busy","true"),this.session.suggest(n,this.options)});a(this,ke,e=>{if(!e||!e.suggestions){x(this,R,oe).call(this);return}x(this,gt,qi).call(this),e.suggestions.length&&x(this,Te,oi).call(this),this.dispatchEvent(new b("suggest",e));let{Results:i}=t(this,v);i.setAttribute("aria-busy","false")});a(this,Ce,e=>{this.dispatchEvent(new b("suggesterror",e));let{Results:i}=t(this,v);i.setAttribute("aria-busy","false"),x(this,R,oe).call(this)});a(this,ce,()=>{let e=this.input;delete e.dataset.mapboxSuccess,x(this,Te,oi).call(this)});a(this,q,()=>{document.activeElement!==this.input&&(this.session.abort(),x(this,R,oe).call(this))});a(this,we,e=>{if(e.key==="Escape"){x(this,R,oe).call(this);return}if(e.key==="ArrowUp"){e.preventDefault(),this.selectedIndex=Math.max(0,this.selectedIndex-1);return}if(e.key==="ArrowDown"){e.preventDefault(),this.selectedIndex=Math.min(this.selectedIndex+1,this.suggestions.length-1);return}if(e.key==="Enter"){e.preventDefault(),this.retrieve(this.suggestions[this.selectedIndex]);return}})}get template(){return Wi}get templateStyle(){return D}get templateUserStyle(){return k(".MapboxSearch",this.theme)}get session(){return t(this,ae)}set session(e){t(this,ae)&&(e.removeEventListener("suggest",t(this,ke)),e.removeEventListener("suggesterror",t(this,Ce))),e&&(e.addEventListener("suggest",t(this,ke)),e.addEventListener("suggesterror",t(this,Ce))),d(this,ae,e)}get suggestions(){var e;return(e=this.session.suggestions)==null?void 0:e.suggestions}get input(){return t(this,le)}set input(e){let i=t(this,le);i&&(i.removeEventListener("input",t(this,Le)),i.removeEventListener("focus",t(this,ce)),i.removeEventListener("blur",t(this,q)),i.removeEventListener("keydown",t(this,we)),t(this,C)&&t(this,C).destroy()),e&&(e.addEventListener("input",t(this,Le)),e.addEventListener("focus",t(this,ce)),e.addEventListener("blur",t(this,q)),e.addEventListener("keydown",t(this,we)),e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-controls",t(this,_)),this.isConnected&&d(this,C,(0,Ft.createPopper)(e,t(this,v).Results,{placement:"bottom-start"}))),d(this,le,e)}get selectedIndex(){return t(this,de)}set selectedIndex(e){let i=t(this,de);d(this,de,e);let{ResultsList:s,Label:n}=t(this,v),o=Ot(t(this,_),e);if(this.input.setAttribute("aria-activedescendant",o),s.setAttribute("aria-activedescendant",o),i!==e){let l=Ot(t(this,_),i),c=s.querySelector(`#${l}`);c==null||c.removeAttribute("aria-selected");let u=s.querySelector(`#${o}`);u==null||u.setAttribute("aria-selected","true")}n.textContent=this.suggestions[e].address+`: Suggestion ${e+1} of ${this.suggestions.length}`}renderItem(e){let i=this.prepareTemplate(Vi);return i.id=Ot(t(this,_),e),i}fillItem(e,i,s){let[n,o]=Array.from(e.querySelectorAll('[role="option"] > *'));n.textContent=i.feature_name,o.textContent=i.description,s===this.selectedIndex?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected")}get options(){return t(this,Se)}set options(e){d(this,Se,e)}get theme(){return t(this,Ae)}set theme(e){d(this,Ae,e),!(!t(this,v)||!e)&&this.updateTemplateUserStyle(k(".MapboxSearch",e))}connectedCallback(){super.connectedCallback(),d(this,v,re(this,{MapboxSearch:".MapboxSearch",Results:".Results",ResultsList:".ResultsList",Label:".Label"}));let{Results:e,ResultsList:i,Label:s}=t(this,v);s.id=t(this,ye),i.id=t(this,_),i.setAttribute("aria-labelledby",t(this,ye)),e.addEventListener("blur",t(this,q)),!t(this,C)&&this.input&&d(this,C,(0,Ft.createPopper)(this.input,t(this,v).Results,{placement:"bottom-start"})),requestAnimationFrame(()=>{t(this,C)&&t(this,C).update()})}disconnectedCallback(){this.input=null;let{Results:e}=t(this,v);e.removeEventListener("blur",t(this,q))}retrieve(e){return j(this,null,function*(){let i=this.input;i&&(i.dataset.mapboxSuccess="true");let s=yield this.session.retrieve(e);x(this,R,oe).call(this),this.dispatchEvent(new b("retrieve",s))})}focus(){document.activeElement===this.input?t(this,ce).call(this):this.input.focus()}updatePopover(){t(this,C)&&t(this,C).update()}};ae=new WeakMap,C=new WeakMap,v=new WeakMap,ye=new WeakMap,_=new WeakMap,le=new WeakMap,de=new WeakMap,Te=new WeakSet,oi=function(){if(!this.suggestions||!this.suggestions.length)return;let{Results:e,MapboxSearch:i}=t(this,v),s=this.input.getBoundingClientRect();i.style.setProperty("--width",`${s.width}px`),this.input.setAttribute("aria-expanded","true"),e.removeAttribute("aria-hidden"),this.selectedIndex=0},R=new WeakSet,oe=function(){let{Results:e,ResultsList:i}=t(this,v);e.setAttribute("aria-hidden","true"),this.input.removeAttribute("aria-expanded"),i.removeAttribute("aria-activedescendant"),this.input.removeAttribute("aria-activedescendant")},gt=new WeakSet,qi=function(){let{ResultsList:e}=t(this,v),i=this.suggestions;if(!i||!i.length){e.innerHTML="",x(this,R,oe).call(this);return}let s=Jt(e);if(i.length>s.length)for(let n=s.length;n<i.length;n++){let o=this.renderItem(n);s.push(o),o.onmouseenter=()=>{this.selectedIndex=n},e.appendChild(o)}if(i.length<s.length)for(let n=i.length;n<s.length;n++)s[n].remove();for(let n of i){let o=i.indexOf(n),l=s[o];this.fillItem(l,n,o),l.onclick=()=>{this.retrieve(n)}}},Se=new WeakMap,Ae=new WeakMap,Le=new WeakMap,ke=new WeakMap,Ce=new WeakMap,ce=new WeakMap,q=new WeakMap,we=new WeakMap;window.MapboxSearchListbox=G;window.customElements.get("mapbox-search-listbox")||customElements.define("mapbox-search-listbox",G);var jt=mt(require("no-scroll")),di=require("focus-trap");function ai(r){let e=r.currentTarget;(r.key===" "||r.key==="Enter")&&(r.preventDefault(),r.stopPropagation(),e.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0})))}var Gi=E(` | ||
`);function ii(s,e){return`${s}-${e}`}var ue,I,E,He,z,pe,he,Re,Ii,j,me,Ht,yo,Be,Fe,Pe,Oe,_e,ge,Z,De,N=class extends T{constructor(){super(...arguments);a(this,Re);a(this,j);a(this,Ht);a(this,ue,void 0);a(this,I,null);a(this,E,void 0);a(this,He,A());a(this,z,A());a(this,pe,void 0);a(this,he,0);a(this,Be,{});a(this,Fe,{});a(this,Pe,e=>{let{Results:i}=t(this,E),o=e.target;if(o.dataset.mapboxSuccess){delete o.dataset.mapboxSuccess;return}let n=o.value;i.setAttribute("aria-busy","true"),this.session.suggest(n,this.options)});a(this,Oe,e=>{if(!e||!e.suggestions){H(this,j,me).call(this);return}H(this,Ht,yo).call(this),e.suggestions.length&&H(this,Re,Ii).call(this),this.dispatchEvent(new M("suggest",e));let{Results:i}=t(this,E);i.setAttribute("aria-busy","false")});a(this,_e,e=>{this.dispatchEvent(new M("suggesterror",e));let{Results:i}=t(this,E);i.setAttribute("aria-busy","false"),H(this,j,me).call(this)});a(this,ge,()=>{let e=this.input;delete e.dataset.mapboxSuccess,H(this,Re,Ii).call(this)});a(this,Z,()=>{document.activeElement!==this.input&&(this.session.abort(),H(this,j,me).call(this))});a(this,De,e=>{if(e.key==="Escape"){H(this,j,me).call(this);return}if(e.key==="ArrowUp"){e.preventDefault(),this.selectedIndex=Math.max(0,this.selectedIndex-1);return}if(e.key==="ArrowDown"){e.preventDefault(),this.selectedIndex=Math.min(this.selectedIndex+1,this.suggestions.length-1);return}if(e.key==="Enter"){e.preventDefault(),this.retrieve(this.suggestions[this.selectedIndex]);return}})}get template(){return Eo}get templateStyle(){return w}get templateUserStyle(){return x(".MapboxSearch",this.theme)}get session(){return t(this,ue)}set session(e){t(this,ue)&&(e.removeEventListener("suggest",t(this,Oe)),e.removeEventListener("suggesterror",t(this,_e))),e&&(e.addEventListener("suggest",t(this,Oe)),e.addEventListener("suggesterror",t(this,_e))),d(this,ue,e)}get suggestions(){var e;return(e=this.session.suggestions)==null?void 0:e.suggestions}get input(){return t(this,pe)}set input(e){let i=t(this,pe);i&&(i.removeEventListener("input",t(this,Pe)),i.removeEventListener("focus",t(this,ge)),i.removeEventListener("blur",t(this,Z)),i.removeEventListener("keydown",t(this,De)),t(this,I)&&t(this,I).destroy()),e&&(e.addEventListener("input",t(this,Pe)),e.addEventListener("focus",t(this,ge)),e.addEventListener("blur",t(this,Z)),e.addEventListener("keydown",t(this,De)),e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-controls",t(this,z)),this.isConnected&&d(this,I,(0,oi.createPopper)(e,t(this,E).Results,{placement:"bottom-start"}))),d(this,pe,e)}get selectedIndex(){return t(this,he)}set selectedIndex(e){let i=t(this,he);d(this,he,e);let{ResultsList:o,Label:n}=t(this,E),r=ii(t(this,z),e);if(this.input.setAttribute("aria-activedescendant",r),o.setAttribute("aria-activedescendant",r),i!==e){let l=ii(t(this,z),i),c=o.querySelector(`#${l}`);c==null||c.removeAttribute("aria-selected");let m=o.querySelector(`#${r}`);m==null||m.setAttribute("aria-selected","true")}n.textContent=this.suggestions[e].address+`: Suggestion ${e+1} of ${this.suggestions.length}`}renderItem(e){let i=this.prepareTemplate(To);return i.id=ii(t(this,z),e),i}fillItem(e,i,o){let[n,r]=Array.from(e.querySelectorAll('[role="option"] > *'));n.textContent=i.feature_name,r.textContent=i.description,o===this.selectedIndex?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected")}get options(){return t(this,Be)}set options(e){d(this,Be,e)}get theme(){return t(this,Fe)}set theme(e){d(this,Fe,e),!(!t(this,E)||!e)&&this.updateTemplateUserStyle(x(".MapboxSearch",e))}connectedCallback(){super.connectedCallback(),d(this,E,R(this,{MapboxSearch:".MapboxSearch",Results:".Results",ResultsList:".ResultsList",Label:".Label"}));let{Results:e,ResultsList:i,Label:o}=t(this,E);o.id=t(this,He),i.id=t(this,z),i.setAttribute("aria-labelledby",t(this,He)),e.addEventListener("blur",t(this,Z)),!t(this,I)&&this.input&&d(this,I,(0,oi.createPopper)(this.input,t(this,E).Results,{placement:"bottom-start"})),requestAnimationFrame(()=>{t(this,I)&&t(this,I).update()})}disconnectedCallback(){this.input=null;let{Results:e}=t(this,E);e.removeEventListener("blur",t(this,Z))}retrieve(e){return D(this,null,function*(){let i=this.input;i&&(i.dataset.mapboxSuccess="true");let o=yield this.session.retrieve(e,this.options);H(this,j,me).call(this),this.dispatchEvent(new M("retrieve",o))})}focus(){document.activeElement===this.input?t(this,ge).call(this):this.input.focus()}updatePopover(){t(this,I)&&t(this,I).update()}};ue=new WeakMap,I=new WeakMap,E=new WeakMap,He=new WeakMap,z=new WeakMap,pe=new WeakMap,he=new WeakMap,Re=new WeakSet,Ii=function(){if(!this.suggestions||!this.suggestions.length)return;let{Results:e,MapboxSearch:i}=t(this,E),o=this.input.getBoundingClientRect();i.style.setProperty("--width",`${o.width}px`),this.input.setAttribute("aria-expanded","true"),e.removeAttribute("aria-hidden"),this.selectedIndex=0},j=new WeakSet,me=function(){let{Results:e,ResultsList:i}=t(this,E);e.setAttribute("aria-hidden","true"),this.input.removeAttribute("aria-expanded"),i.removeAttribute("aria-activedescendant"),this.input.removeAttribute("aria-activedescendant")},Ht=new WeakSet,yo=function(){let{ResultsList:e}=t(this,E),i=this.suggestions;if(!i||!i.length){e.innerHTML="",H(this,j,me).call(this);return}let o=Ei(e);if(i.length>o.length)for(let n=o.length;n<i.length;n++){let r=this.renderItem(n);o.push(r),r.onmouseenter=()=>{this.selectedIndex=n},e.appendChild(r)}if(i.length<o.length)for(let n=i.length;n<o.length;n++)o[n].remove();for(let n of i){let r=i.indexOf(n),l=o[r];this.fillItem(l,n,r),l.onclick=()=>{this.retrieve(n)}}},Be=new WeakMap,Fe=new WeakMap,Pe=new WeakMap,Oe=new WeakMap,_e=new WeakMap,ge=new WeakMap,Z=new WeakMap,De=new WeakMap;window.MapboxSearchListbox=N;window.customElements.get("mapbox-search-listbox")||customElements.define("mapbox-search-listbox",N);function Rt(s){let e=s.currentTarget;(s.key===" "||s.key==="Enter")&&(s.preventDefault(),s.stopPropagation(),e.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0})))}function Bt(s,e){if(e){let i=b(` | ||
<span> | ||
<span></span> | ||
<br /> | ||
<span></span> | ||
</span> | ||
`),[o,n]=Array.from(i.querySelectorAll("span > span")),r=e.split(",");if(o.textContent=r[0].trim(),n.textContent=r.slice(1).join(",").trim(),s["address-line2"]){let l=document.createElement("span");l.textContent=s["address-line2"],i.insertBefore(l,n),i.insertBefore(document.createElement("br"),n)}if(s["address-line3"]){let l=document.createElement("span");l.textContent=s["address-line3"],i.insertBefore(l,n),i.insertBefore(document.createElement("br"),n)}return i}else{let i=s["street-address"]||s["address-line1"]||"",o=s["address-line2"],n=s["address-line3"],r=[s["address-level4"]||"",s["address-level3"]||"",s["address-level2"]||"",`${s["address-level1"]||""} ${s["postal-code"]||""}`,s.country||s["country-name"]||""].filter(Boolean).join(", "),c=[i,o,n,r].filter(Boolean).map(u=>`<span>${u}</span>`).join("<br />");return b(` | ||
<span>${c}</span> | ||
`)}}var So=b(` | ||
<template> | ||
<div class="MapboxAddressConfirmation" aria-hidden="true"> | ||
<div class="MapboxAddressConfirmationFeature"> | ||
<div class="Modal" aria-modal="true" role="dialog"> | ||
@@ -83,9 +91,3 @@ <div class="ModalHeader"> | ||
<div class="ModalAddress ModalAddressApprove"></div> | ||
<div class="ModalSubheader"> | ||
You entered | ||
</div> | ||
<div class="ModalAddress ModalAddressReject"></div> | ||
<div class="ModalMap"> | ||
@@ -119,13 +121,50 @@ <mapbox-address-minimap class="Minimap"></mapbox-address-minimap> | ||
</template> | ||
`);function li(r){let e=E(` | ||
<span> | ||
<span></span> | ||
`),F,je,Ne,Ue,$e,ze,si=class extends T{constructor(){super(...arguments);a(this,F,void 0);a(this,je,{});this.minimap=!1;this.update=(e,i)=>{let{ModalMap:o,Minimap:n,ModalAddressApprove:r}=t(this,F);this.minimap?(o.removeAttribute("aria-hidden"),n.accessToken=this.accessToken,n.feature=e):o.setAttribute("aria-hidden","true");let l=e.properties.place_name||e.properties.full_address||e.properties.address;r.innerHTML="",r.appendChild(Bt(i,l))};a(this,Ne,()=>{this.dispatchEvent(new M("result","cancel"))});this.approve=()=>{this.dispatchEvent(new M("result","change"))};this.reject=()=>{this.dispatchEvent(new M("result","nochange"))};a(this,Ue,A());a(this,$e,A());a(this,ze,A())}get template(){return So}get templateStyle(){return w}get templateUserStyle(){return x(".MapboxAddressConfirmationFeature",this.theme)}get theme(){return t(this,je)}set theme(e){if(d(this,je,e),!t(this,F)||!e)return;this.updateTemplateUserStyle(x(".MapboxAddressConfirmationFeature",e));let{IconQuestion:i,IconClose:o}=t(this,F);i.innerHTML=k("question",e),o.innerHTML=k("close",e)}connectedCallback(){super.connectedCallback(),d(this,F,R(this,{MapboxAddressConfirmationFeature:".MapboxAddressConfirmationFeature",Modal:".Modal",ModalHeaderTitle:".ModalHeaderTitle",ModalMap:".ModalMap",Minimap:".Minimap",IconQuestion:".IconQuestion",IconClose:".IconClose",ButtonApprove:".ButtonApprove",ButtonReject:".ButtonReject",ModalAddressApprove:".ModalAddressApprove"}));let{Modal:e,ModalHeaderTitle:i,IconClose:o,ButtonApprove:n,ButtonReject:r,ModalAddressApprove:l}=t(this,F);e.setAttribute("aria-labelledby",t(this,$e)),e.setAttribute("aria-describedby",t(this,ze)),o.setAttribute("aria-controls",t(this,Ue)),e.id=t(this,Ue),i.id=t(this,$e),l.id=t(this,ze);let c=Array.from(this.querySelectorAll('[role="button"]'));for(let u of c)u.addEventListener("keydown",Rt);o.addEventListener("click",t(this,Ne)),n.addEventListener("click",this.approve),r.addEventListener("click",this.reject);let m=this.theme;if(m){let{IconQuestion:u,IconClose:g}=t(this,F);u.innerHTML=k("question",m),g.innerHTML=k("close",m)}}disconnectedCallback(){let{IconClose:e,ButtonApprove:i}=t(this,F);e.removeEventListener("click",t(this,Ne)),i.removeEventListener("click",this.approve)}};F=new WeakMap,je=new WeakMap,Ne=new WeakMap,Ue=new WeakMap,$e=new WeakMap,ze=new WeakMap;window.MapboxAddressConfirmationFeature=si;window.customElements.get("mapbox-address-confirmation-feature")||customElements.define("mapbox-address-confirmation-feature",si);var Ao=b(` | ||
<template> | ||
<div class="MapboxAddressConfirmationNoFeature"> | ||
<div class="Modal" aria-modal="true" role="dialog"> | ||
<div class="ModalHeader"> | ||
<svg viewBox="0 0 18 18" class="Icon IconQuestion"></svg> | ||
<div class="ModalHeaderTitle">Confirm address</div> | ||
<svg | ||
viewBox="0 0 18 18" | ||
class="Icon IconClose" | ||
tabindex="0" | ||
role="button" | ||
title="Close" | ||
aria-label="Close" | ||
aria-expanded="true" | ||
></svg> | ||
</div> | ||
<div class="ModalDescription"> | ||
We couldn't verify this address. Please check that your information is correct before continuing. | ||
</div> | ||
<br /> | ||
<span></span> | ||
</span> | ||
`),[i,s]=Array.from(e.querySelectorAll("span > span")),n=r.split(",");return i.textContent=n[0].trim(),s.textContent=n.slice(1).join(",").trim(),e}var ue,y,K,Ie,He,Be,Re,Pe,Oe=class extends w{constructor(){super(...arguments);a(this,ue,!1);a(this,y,void 0);a(this,K,void 0);a(this,Ie,{});a(this,He,()=>{this.dispatchEvent(new b("close")),this.hide()});this.approve=()=>{this.dispatchEvent(new b("approve")),this.hide()};this.reject=()=>{this.dispatchEvent(new b("reject")),this.hide()};a(this,Be,B());a(this,Re,B());a(this,Pe,B())}get template(){return Gi}get templateStyle(){return D}get templateUserStyle(){return k(".MapboxAddressConfirmation",this.theme)}get theme(){return t(this,Ie)}set theme(e){if(d(this,Ie,e),!t(this,y)||!e)return;this.updateTemplateUserStyle(k(".MapboxAddressConfirmation",e));let{IconQuestion:i,IconClose:s}=t(this,y);i.innerHTML=V("question",e),s.innerHTML=V("close",e)}connectedCallback(){super.connectedCallback(),d(this,y,re(this,{MapboxAddressConfirmation:".MapboxAddressConfirmation",Modal:".Modal",ModalHeaderTitle:".ModalHeaderTitle",ModalMap:".ModalMap",Minimap:".Minimap",IconQuestion:".IconQuestion",IconClose:".IconClose",ButtonApprove:".ButtonApprove",ButtonReject:".ButtonReject",ModalAddressApprove:".ModalAddressApprove",ModalAddressReject:".ModalAddressReject"}));let{MapboxAddressConfirmation:e,Modal:i,ModalHeaderTitle:s,IconClose:n,ButtonApprove:o,ButtonReject:l,ModalAddressApprove:c}=t(this,y);i.setAttribute("aria-labelledby",t(this,Re)),i.setAttribute("aria-describedby",t(this,Pe)),n.setAttribute("aria-controls",t(this,Be)),i.id=t(this,Be),s.id=t(this,Re),c.id=t(this,Pe);let u=Array.from(this.querySelectorAll('[role="button"]'));for(let f of u)f.addEventListener("keydown",ai);n.addEventListener("click",t(this,He)),o.addEventListener("click",this.approve),l.addEventListener("click",this.reject),t(this,ue)?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true");let m=this.theme;if(m){let{IconQuestion:f,IconClose:A}=t(this,y);f.innerHTML=V("question",m),A.innerHTML=V("close",m)}}disconnectedCallback(){let{IconClose:e,ButtonApprove:i,ButtonReject:s}=t(this,y);e.removeEventListener("click",t(this,He)),i.removeEventListener("click",this.approve),s.removeEventListener("click",this.reject),d(this,K,null)}hide(){var i;if(d(this,ue,!1),!t(this,y))return;let{MapboxAddressConfirmation:e}=t(this,y);e.setAttribute("aria-hidden","true"),(i=t(this,K))==null||i.deactivate(),jt.default.off()}show(e,i,s=null,n="",o=!1){var F;if(d(this,ue,!0),!t(this,y))return;let{MapboxAddressConfirmation:l,Modal:c,ModalMap:u,Minimap:m,ModalAddressApprove:f,ModalAddressReject:A}=t(this,y);l.removeAttribute("aria-hidden"),o?(u.removeAttribute("aria-hidden"),m.accessToken=n,m.feature=s):u.setAttribute("aria-hidden","true"),f.innerHTML="",f.appendChild(li(e)),A.innerHTML="",A.appendChild(li(i)),jt.default.on(),d(this,K,(0,di.createFocusTrap)(l,{fallbackFocus:c,escapeDeactivates:()=>(this.hide(),!0)})),(F=t(this,K))==null||F.activate()}};ue=new WeakMap,y=new WeakMap,K=new WeakMap,Ie=new WeakMap,He=new WeakMap,Be=new WeakMap,Re=new WeakMap,Pe=new WeakMap;window.MapboxAddressConfirmation=Oe;window.customElements.get("mapbox-address-confirmation")||customElements.define("mapbox-address-confirmation",Oe);var P=require("@mapbox/search-js-core");var Ki=new Set(["street-address","address-line1","address-line2","address-line3","address-level4","address-level3","address-level2","address-level1","country","country-name","postal-code"]),Zi=new Set(["off","on","true","false"]);function Dt(r){let e=r.parentNode;for(;e;){if(e instanceof HTMLFormElement)return e;e=e.parentNode}return null}var Ji="section-",Qi=Symbol.for("section--default"),es=Symbol.for("section--shipping"),ts=Symbol.for("section--billing");function is(r){let e=Array.from(r.querySelectorAll("[autocomplete]")).filter(s=>{let n=s.tagName.toLowerCase();return n==="input"||n==="select"||n==="textarea"}),i=[];for(let s of e){if(!ei(s))continue;let n=s.getAttribute("autocomplete")||"";if(!n||Zi.has(n))continue;let o=n.toLowerCase().split(" ");if(o.length>3)continue;let l=o[o.length-1];if(!Ki.has(l))continue;o.pop();let c=Qi;if(o.length){let u=o[o.length-1];u==="shipping"&&(c=es,o.pop()),u==="billing"&&(c=ts,o.pop())}if(o.length){let u=o[o.length-1];u.startsWith(Ji)&&(c=u)}i.push({input:s,section:c,field:l})}return i}function ci(r,e){let i=[],s=[],n=is(r),o=null;for(let{input:l,section:c,field:u}of n){let m=i.length-1,f=!1;if(i.length?(s[m]!==c||i[m][u])&&(f=!0):f=!0,f){if(o)break;i.push({[u]:l}),s.push(c),m++}else i[m][u]=l;l===e&&(o=i[m])}return o!=null?o:{}}function _t(r,e,i){var l;let s=ci(r,e),n=[i.address_line1,i.address_line2,i.address_line3].filter(c=>Boolean(c)).join(", ");L(s["street-address"],n),L(s["address-line1"],i.address_line1||""),L(s["address-line2"],i.address_line2||""),L(s["address-line3"],i.address_line3||""),L(s["address-level1"],i.address_level1||""),L(s["address-level2"],i.address_level2||""),L(s["address-level3"],i.address_level3||"");let o=((l=i.metadata)==null?void 0:l.iso_3166_1)||"";if(s.country&&s.country instanceof HTMLSelectElement){let c=s.country.querySelector("option").value,u=c===c.toUpperCase();L(s.country,u?o.toUpperCase():o)}else L(s.country,o);L(s["country-name"],i.country||""),L(s["postal-code"],i.postcode||"")}function Nt(r,e){let i=ci(r,e),s={};for(let[n,o]of Object.entries(i))(o==null?void 0:o.value)&&(s[n]=o.value);return s}function ui(r){let e=[];return r["street-address"]?e.push(r["street-address"]):(e.push(r["address-line1"]||""),e.push(r["address-line2"]||""),e.push(r["address-line3"]||"")),e.push(r["address-level3"]||""),e.push(r["address-level2"]||""),e.push(r["address-level1"]||""),e.push(r["postal-code"]||""),r["country-name"]?e.push(r["country-name"]):e.push(r.country||""),e.filter(i=>Boolean(i)).join(", ")}var N,ft,T,g,I,Fe,je,De,_e,Ne,ze,Ye,z=class extends w{constructor(){super(...arguments);a(this,N,new P.MapboxAutofill);a(this,ft,new P.SearchSession(t(this,N)));a(this,T,void 0);a(this,g,new G);a(this,I,new Oe);a(this,Fe,!1);a(this,je,e=>{this.dispatchEvent(e.clone())});a(this,De,e=>{this.dispatchEvent(e.clone())});a(this,_e,null);a(this,Ne,e=>{if(this.dispatchEvent(e.clone()),!t(this,T))return;let i=e.detail;if(!i||!i.features||!i.features.length)return;let s=Dt(t(this,T));if(!s)return;let n=(0,P.featureToSuggestion)(i.features[0]);_t(s,t(this,T),n),d(this,_e,Nt(s,t(this,T)))});a(this,ze,()=>{var e;try{let i=(e=this.querySelector("input"))!=null?e:null;d(this,T,i),t(this,g).input=i}catch(i){d(this,T,null),t(this,g).input=null,console.error(i.message||i)}});a(this,Ye,new MutationObserver(t(this,ze)))}get accessToken(){return t(this,N).accessToken}set accessToken(e){t(this,N).accessToken=e}get options(){return t(this,g).options}set options(e){t(this,g).options=e}get theme(){return t(this,g).theme}set theme(e){t(this,g).theme=e,t(this,I).theme=e}connectedCallback(){super.connectedCallback(),t(this,g).session=t(this,ft),t(this,g).addEventListener("suggest",t(this,je)),t(this,g).addEventListener("suggesterror",t(this,De)),t(this,g).addEventListener("retrieve",t(this,Ne)),document.body.appendChild(t(this,g)),document.body.appendChild(t(this,I)),t(this,Ye).observe(this,{subtree:!0,childList:!0}),t(this,ze).call(this)}disconnectedCallback(){t(this,I).remove(),t(this,g).remove(),t(this,g).removeEventListener("suggest",t(this,je)),t(this,g).removeEventListener("suggesterror",t(this,De)),t(this,g).removeEventListener("retrieve",t(this,Ne)),t(this,Ye).disconnect()}attributeChangedCallback(e,i,s){if(e==="access-token"){t(this,N).accessToken=s;return}if(e==="theme"){this.theme=ht(s);return}if(e==="minimap-on-confirm"){d(this,Fe,s==="true");return}let n=e.split("-").join("_");s||delete t(this,g).options[n],t(this,g).options[n]=s}focus(){t(this,g).focus()}showConfirm(){return j(this,null,function*(){let e=Dt(t(this,T));if(!e)throw new Error("Could not find parent form.");let i=t(this,_e),s=Nt(e,t(this,T));if(Ee(s,i))return!0;let n=t(this,N),o=ui(s),l=yield n.retrieve(o,{sessionToken:new P.SessionToken});if(!l||!l.features||!l.features.length)throw new Error("Could not find suggestion.");let c=l.features[0];return t(this,I).show(c.place_name||c.properties.full_address||c.properties.address,o,c,n.accessToken,t(this,Fe)),new Promise(u=>{let m=f=>{t(this,I).removeEventListener("approve",m),t(this,I).removeEventListener("reject",m);let A=f.type==="approve";if(A){let F=(0,P.featureToSuggestion)(c);t(this,T).dataset.mapboxSuccess="true",_t(e,t(this,T),F)}u(A)};t(this,I).addEventListener("approve",m),t(this,I).addEventListener("reject",m)})})}};N=new WeakMap,ft=new WeakMap,T=new WeakMap,g=new WeakMap,I=new WeakMap,Fe=new WeakMap,je=new WeakMap,De=new WeakMap,_e=new WeakMap,Ne=new WeakMap,ze=new WeakMap,Ye=new WeakMap,z.observedAttributes=["access-token","theme","css-text","minimap-on-confirm","language","country","bbox","limit","proximity"];window.MapboxAddressAutofill=z;window.customElements.get("mapbox-address-autofill")||customElements.define("mapbox-address-autofill",z);var O=require("@mapbox/search-js-core"),pi=mt(require("@turf/bbox")),hi=mt(require("@turf/bbox-polygon"));var zt=1.4;function Yt(r,e,i=.5){let{center:s,zoom:n}=r.cameraForBounds(e),o=Math.max(n-i,0);return{center:s,zoom:o,speed:zt}}function mi(r){switch(r){case"street":return 15;case"locality":case"oaza":return 14;case"place":case"city":return 13;case"district":return 9;case"region":case"prefecture":return 6;case"country":return 4;default:return 16}}function vt(r,e){return`https://api.mapbox.com/styles/v1/${r}/${e}/static/`}var ss=9,rs=E(` | ||
<div class="ModalSubheader"> | ||
You entered | ||
</div> | ||
<div class="ModalAddress"></div> | ||
<div | ||
class="Button ButtonPrimary" | ||
tabindex="0" | ||
role="button" | ||
aria-label="Use the address I provided" | ||
> | ||
Use the address I provided | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
`),P,Xe,Ye,We,qe,Ve,ni=class extends T{constructor(){super(...arguments);a(this,P,void 0);a(this,Xe,{});this.update=e=>{let{ModalAddress:i}=t(this,P);i.innerHTML="",i.appendChild(Bt(e))};a(this,Ye,()=>{this.dispatchEvent(new M("result","cancel"))});this.reject=()=>{this.dispatchEvent(new M("result","nochange"))};a(this,We,A());a(this,qe,A());a(this,Ve,A())}get template(){return Ao}get templateStyle(){return w}get templateUserStyle(){return x(".MapboxAddressConfirmationNoFeature",this.theme)}get theme(){return t(this,Xe)}set theme(e){if(d(this,Xe,e),!t(this,P)||!e)return;this.updateTemplateUserStyle(x(".MapboxAddressConfirmationNoFeature",e));let{IconQuestion:i,IconClose:o}=t(this,P);i.innerHTML=k("question",e),o.innerHTML=k("close",e)}connectedCallback(){super.connectedCallback(),d(this,P,R(this,{Modal:".Modal",ModalHeaderTitle:".ModalHeaderTitle",IconQuestion:".IconQuestion",IconClose:".IconClose",ModalAddress:".ModalAddress",ButtonReject:".Button"}));let{Modal:e,ModalHeaderTitle:i,IconClose:o,ModalAddress:n,ButtonReject:r}=t(this,P);e.setAttribute("aria-labelledby",t(this,qe)),e.setAttribute("aria-describedby",t(this,Ve)),o.setAttribute("aria-controls",t(this,We)),e.id=t(this,We),i.id=t(this,qe),n.id=t(this,Ve);let l=Array.from(this.querySelectorAll('[role="button"]'));for(let m of l)m.addEventListener("keydown",Rt);o.addEventListener("click",t(this,Ye)),r.addEventListener("click",this.reject);let c=this.theme;if(c){let{IconQuestion:m,IconClose:u}=t(this,P);m.innerHTML=k("question",c),u.innerHTML=k("close",c)}}disconnectedCallback(){let{IconClose:e,ButtonReject:i}=t(this,P);e.removeEventListener("click",t(this,Ye)),i.removeEventListener("click",this.reject)}};P=new WeakMap,Xe=new WeakMap,Ye=new WeakMap,We=new WeakMap,qe=new WeakMap,Ve=new WeakMap;window.MapboxAddressConfirmationNoFeature=ni;window.customElements.get("mapbox-address-confirmation-no-feature")||customElements.define("mapbox-address-confirmation-no-feature",ni);var fe=require("@mapbox/search-js-core"),li=kt(require("no-scroll")),Pi=require("focus-trap");var Hi=require("@mapbox/search-js-core");var Lo=new Set(["street-address","address-line1","address-line2","address-line3","address-level4","address-level3","address-level2","address-level1","country","country-name","postal-code"]),Co=new Set(["off","on","true","false"]);function ko(s){let e=s.parentNode;for(;e;){if(e instanceof HTMLFormElement)return e;e=e.parentNode}return null}function Ge(s){let e=s||document;return Array.from(e.querySelectorAll('input[autocomplete~="address-line1"], input[autocomplete~="street-address"]'))}var wo="section-",Io="section-default",Ho="section-shipping",Ro="section-billing";function ri(s){let e=Array.from(s.querySelectorAll("[autocomplete]")).filter(o=>{let n=o.tagName.toLowerCase();return n==="input"||n==="select"||n==="textarea"}),i=[];for(let o of e){if(!yi(o))continue;let n=o.getAttribute("autocomplete")||"";if(!n||Co.has(n))continue;let r=n.toLowerCase().split(" ");if(r.length>3)continue;let l=r[r.length-1];if(!Lo.has(l))continue;r.pop();let c=Io;if(r.length){let m=r[r.length-1];m==="shipping"&&(c=Ho,r.pop()),m==="billing"&&(c=Ro,r.pop())}if(r.length){let m=r[r.length-1];m.startsWith(wo)&&(c=m)}i.push({input:o,section:c,field:l})}return i}function Ri(s,e){let i=[],o=[],n=ri(s),r=null;for(let{input:l,section:c,field:m}of n){let u=i.length-1,g=!1;if(i.length?(o[u]!==c||i[u][m])&&(g=!0):g=!0,g){if(r)break;i.push({[m]:l}),o.push(c),u++}else i[u][m]=l;l===e&&(r=i[u])}return r!=null?r:{}}function ai(s,e,i){var l;let o=Ri(s,e),n=[i.address_line1,i.address_line2,i.address_line3].filter(c=>Boolean(c)).join(", ");B(o["street-address"],n),B(o["address-line1"],i.address_line1||""),B(o["address-level1"],i.address_level1||""),B(o["address-level2"],i.address_level2||""),B(o["address-level3"],i.address_level3||"");let r=((l=i.metadata)==null?void 0:l.iso_3166_1)||"";if(o.country&&o.country instanceof HTMLSelectElement){let c=o.country.querySelector("option").value,m=c===c.toUpperCase();B(o.country,m?r.toUpperCase():r)}else B(o.country,r);B(o["country-name"],i.country||""),B(o["postal-code"],i.postcode||"")}function Ft(s,e){let i=Ri(s,e),o={};for(let[n,r]of Object.entries(i))(r==null?void 0:r.value)&&(o[n]=r.value);return o}function Pt(s){let e=[];return s["street-address"]?e.push(s["street-address"]):(e.push(s["address-line1"]||""),e.push(s["address-line2"]||""),e.push(s["address-line3"]||"")),e.push(s["address-level3"]||""),e.push(s["address-level2"]||""),e.push(s["address-level1"]||""),e.push(s["postal-code"]||""),s["country-name"]?e.push(s["country-name"]):e.push(s.country||""),e.filter(i=>Boolean(i)).join(", ")}function Ot(s,e){let i=ko(e);if(!i)return;let o=(0,Hi.featureToSuggestion)(s);ai(i,e,o)}var Bi=require("@mapbox/search-js-core"),Fi=class{constructor(){this.feedbackEnabled=!0;this.autofillSessionToken=new Bi.SessionToken;this.autofillSessionEnabled=!1}},v=new Fi;Object.defineProperty(v,"autofillSessionToken",{configurable:!1,writable:!1});var Bo=b(` | ||
<template> | ||
<div class="MapboxAddressConfirmation" aria-hidden="true"> | ||
<mapbox-address-confirmation-feature class="ContentFeature"></mapbox-address-confirmation-feature> | ||
<mapbox-address-confirmation-no-feature class="ContentNoFeature"></mapbox-address-confirmation-no-feature> | ||
</div> | ||
</template> | ||
`),Ke,L,Q,Ze,J=class extends T{constructor(){super(...arguments);a(this,Ke,!1);a(this,L,void 0);a(this,Q,void 0);a(this,Ze,{})}get template(){return Bo}get templateStyle(){return w}get templateUserStyle(){return x(".MapboxAddressConfirmation",this.theme)}get theme(){return t(this,Ze)}set theme(e){if(d(this,Ze,e),!t(this,L)||!e)return;this.updateTemplateUserStyle(x(".MapboxAddressConfirmation",e));let{ContentFeature:i,ContentNoFeature:o}=t(this,L);i.theme=e,o.theme=e}connectedCallback(){super.connectedCallback(),d(this,L,R(this,{MapboxAddressConfirmation:".MapboxAddressConfirmation",ContentFeature:".ContentFeature",ContentNoFeature:".ContentNoFeature"}));let{MapboxAddressConfirmation:e}=t(this,L);e.setAttribute("aria-hidden","true");let i=this.theme;if(i){let{ContentFeature:o,ContentNoFeature:n}=t(this,L);o.theme=i,n.theme=i}}disconnectedCallback(){d(this,Q,null)}hide(){var i;if(d(this,Ke,!1),!t(this,L))return;let{MapboxAddressConfirmation:e}=t(this,L);e.setAttribute("aria-hidden","true"),(i=t(this,Q))==null||i.deactivate(),li.default.off()}show(e,i,o){return D(this,null,function*(){var C;if(!t(this,L))return{type:"cancel"};let{MapboxAddressConfirmation:n,ContentFeature:r,ContentNoFeature:l}=t(this,L),{accessToken:c,minimap:m=!1,theme:u}=i;this.theme=u,o?(r.removeAttribute("aria-hidden"),l.setAttribute("aria-hidden","true"),r.minimap=m,r.accessToken=c,r.update(o,e)):(r.setAttribute("aria-hidden","true"),l.removeAttribute("aria-hidden"),l.update(e)),d(this,Ke,!0),n.removeAttribute("aria-hidden"),li.default.on();let g=o?r:l;return d(this,Q,(0,Pi.createFocusTrap)(n,{fallbackFocus:g,escapeDeactivates:()=>(this.hide(),!0)})),(C=t(this,Q))==null||C.activate(),new Promise($=>{let Ce=g,pi=Qi=>{Ce.removeEventListener("result",pi);let hi=Qi.detail;this.hide(),$(hi==="change"?{type:"change",suggestion:(0,fe.featureToSuggestion)(o)}:{type:hi})};Ce.addEventListener("result",pi)})})}tryShow(e,i){return D(this,null,function*(){if(!t(this,L))return{type:"cancel"};let{accessToken:o,options:n={}}=i,r=new fe.MapboxAutofill(h({accessToken:o},n)),l=Pt(e),m=(yield r.retrieve(l,{sessionToken:v.autofillSessionToken})).features[0];if(m){let u=C=>C.properties.match_code.confidence===fe.AutofillMatchCodeConfidence.exact,{skipConfirmModal:g=u}=i;if(g(m))return{type:"nochange"}}return yield this.show(e,i,m)})}};Ke=new WeakMap,L=new WeakMap,Q=new WeakMap,Ze=new WeakMap;window.MapboxAddressConfirmation=J;window.customElements.get("mapbox-address-confirmation")||customElements.define("mapbox-address-confirmation",J);var Dt=require("@mapbox/search-js-core");var ee,_t,te,f,Qe,Je,et,tt,it,ve=class extends T{constructor(){super(...arguments);a(this,ee,new Dt.MapboxAutofill);a(this,_t,new Dt.SearchSession(t(this,ee)));a(this,te,void 0);a(this,f,new N);a(this,Qe,e=>{this.dispatchEvent(e.clone())});a(this,Je,e=>{this.dispatchEvent(e.clone())});a(this,et,e=>{if(this.dispatchEvent(e.clone()),!t(this,te))return;let i=e.detail;!i||!i.features||!i.features.length||Ot(i.features[0],t(this,te))});a(this,tt,()=>{var e;try{let i=(e=this.querySelector("input"))!=null?e:null;d(this,te,i),t(this,f).input=i}catch(i){d(this,te,null),t(this,f).input=null,console.error(i.message||i)}});a(this,it,new MutationObserver(t(this,tt)))}get accessToken(){return t(this,ee).accessToken}set accessToken(e){t(this,ee).accessToken=e}get options(){return t(this,f).options}set options(e){t(this,f).options=e}get theme(){return t(this,f).theme}set theme(e){t(this,f).theme=e}connectedCallback(){super.connectedCallback(),v.autofillSessionEnabled=!0,t(this,f).session=t(this,_t),t(this,f).session.sessionToken=v.autofillSessionToken,t(this,f).addEventListener("suggest",t(this,Qe)),t(this,f).addEventListener("suggesterror",t(this,Je)),t(this,f).addEventListener("retrieve",t(this,et)),document.body.appendChild(t(this,f)),t(this,it).observe(this,{subtree:!0,childList:!0}),t(this,tt).call(this)}disconnectedCallback(){t(this,f).remove(),t(this,f).removeEventListener("suggest",t(this,Qe)),t(this,f).removeEventListener("suggesterror",t(this,Je)),t(this,f).removeEventListener("retrieve",t(this,et)),t(this,it).disconnect()}attributeChangedCallback(e,i,o){if(e==="access-token"){t(this,ee).accessToken=o;return}if(e==="theme"){this.theme=It(o);return}let n=e.split("-").join("_");o||delete t(this,f).options[n],t(this,f).options[n]=o}focus(){t(this,f).focus()}};ee=new WeakMap,_t=new WeakMap,te=new WeakMap,f=new WeakMap,Qe=new WeakMap,Je=new WeakMap,et=new WeakMap,tt=new WeakMap,it=new WeakMap,ve.observedAttributes=["access-token","theme","css-text","language","country","bbox","limit","proximity"];window.MapboxAddressAutofill=ve;window.customElements.get("mapbox-address-autofill")||customElements.define("mapbox-address-autofill",ve);var U=require("@mapbox/search-js-core"),_i=kt(require("@turf/bbox")),Di=kt(require("@turf/bbox-polygon"));var di=1.4;function ci(s,e,i=.5){let{center:o,zoom:n}=s.cameraForBounds(e),r=Math.max(n-i,0);return{center:o,zoom:r,speed:di}}function Oi(s){switch(s){case"street":return 15;case"locality":case"oaza":return 14;case"place":case"city":return 13;case"district":return 9;case"region":case"prefecture":return 6;case"country":return 4;default:return 16}}function jt(s,e){return`https://api.mapbox.com/styles/v1/${s}/${e}/static/`}var Fo=9,Po=b(` | ||
<template> | ||
<input class="Input" type="text" /> | ||
</template> | ||
`),Z,bt,Y,U,p,Ue,Xe,$e,Mt,We,me=class extends w{constructor(){super(...arguments);a(this,Z,new O.MapboxSearch({}));a(this,bt,new O.SearchSession(t(this,Z)));a(this,Y,null);a(this,U,void 0);a(this,p,new G);a(this,Ue,e=>{this.dispatchEvent(e.clone())});a(this,Xe,e=>{this.dispatchEvent(e.clone())});a(this,$e,e=>j(this,null,function*(){var u;this.dispatchEvent(e.clone());let i=e.detail;if(!i||!i.features.length)return;let s=(0,O.featureToSuggestion)(i.features[0]);t(this,U).value=s.feature_name;let n=t(this,Y);if(!n)return;let o=i.features;if(o.length===1){let m=o[0],f=(u=m.properties.place_type)==null?void 0:u[0],A=m.bbox;if(A)n.flyTo(Yt(n,O.LngLatBounds.convert(A).toFlatArray()));else{let F=m.geometry.coordinates,Xt=mi(f);n.flyTo({center:F,zoom:Xt,speed:zt})}return}let l=i.features.map(m=>m.bbox?(0,hi.default)(O.LngLatBounds.convert(m.bbox).toFlatArray()):m),c=(0,pi.default)({type:"FeatureCollection",features:l});n.flyTo(Yt(n,c))}));a(this,Mt,e=>{let i=new b("input");Object.assign(i,h({},e)),this.dispatchEvent(i)});a(this,We,()=>{let e=t(this,Y),i=h({},t(this,p).options);if(e.getZoom()<=ss){delete i.proximity,t(this,p).options=i;return}let s=e.getCenter();t(this,p).options=qt(h({},i),{proximity:s})})}get accessToken(){return t(this,Z).accessToken}set accessToken(e){t(this,Z).accessToken=e}get value(){return t(this,U).value}set value(e){t(this,U).value=e}get template(){return rs}get templateStyle(){return D}get templateUserStyle(){return k(".Input",t(this,p).theme)}get options(){return t(this,p).options}set options(e){t(this,p).options=e}get theme(){return t(this,p).theme}set theme(e){t(this,p).theme=e,!!t(this,U)&&(this.updateTemplateUserStyle(k(".Input",e)),t(this,p).updatePopover())}connectedCallback(){super.connectedCallback();let e=this.querySelector(".Input");e.addEventListener("input",t(this,Mt)),d(this,U,e),t(this,p).session=t(this,bt),t(this,p).input=e,t(this,p).addEventListener("suggest",t(this,Ue)),t(this,p).addEventListener("suggesterror",t(this,Xe)),t(this,p).addEventListener("retrieve",t(this,$e)),document.body.appendChild(t(this,p))}disconnectedCallback(){t(this,p).remove(),t(this,p).input=null,t(this,p).removeEventListener("suggest",t(this,Ue)),t(this,p).removeEventListener("suggesterror",t(this,Xe)),t(this,p).removeEventListener("retrieve",t(this,$e))}attributeChangedCallback(e,i,s){if(e==="access-token"){t(this,Z).accessToken=s;return}if(e==="theme"){this.theme=ht(s);return}let n=e.split("-").join("_");s||delete t(this,p).options[n],t(this,p).options[n]=s}focus(){t(this,p).focus()}bindMap(e){t(this,Y)&&t(this,Y).off("moveend",t(this,We)),e&&e.on("moveend",t(this,We)),d(this,Y,e)}unbindMap(){this.bindMap(null)}onAdd(e){this.bindMap(e),this.remove();let i=document.createElement("div");return i.className="mapboxgl-ctrl",i.style.width="300px",i.appendChild(this),i}onRemove(){this.remove(),this.unbindMap()}getDefaultPosition(){return"top-right"}};Z=new WeakMap,bt=new WeakMap,Y=new WeakMap,U=new WeakMap,p=new WeakMap,Ue=new WeakMap,Xe=new WeakMap,$e=new WeakMap,Mt=new WeakMap,We=new WeakMap,me.observedAttributes=["access-token","theme","language","country","bbox","limit","navigation-profile","origin","proximity","eta-type","types"];window.MapboxSearchBox=me;window.customElements.get("mapbox-search-box")||customElements.define("mapbox-search-box",me);var Ei=require("@mapbox/search-js-core");var vi=mt(require("@mapbox/sphericalmercator"));var gi=new vi.default({size:512,antimeridian:!0}),ee=1280;function fi(r,e){let{width:i,height:s}=pt(r,!0);switch(e){case"center":return[0,0];case"top":return[0,s/2];case"bottom":return[0,-1*s/2];case"left":return[i/2,0];case"right":return[-1*i/2,0];case"top-left":return[i/2,s/2];case"top-right":return[-1*i/2,s/2];case"bottom-left":return[i/2,-1*s/2];case"bottom-right":return[-1*i/2,-1*s/2]}}var Ve,xt,J,qe,Et,Ge,Ke,yt,Ze,Je,Q,Tt,Ut=class{constructor(e,i,s,n,o){a(this,Ve,void 0);a(this,xt,()=>{[this.anchorOffsetX,this.anchorOffsetY]=fi(this.markerElement,this.anchor),this.markerTransform={anchorX:this.anchorOffsetX,anchorY:this.anchorOffsetY}});a(this,J,{anchorX:0,anchorY:0,globalX:0,globalY:0});a(this,qe,!1);a(this,Et,e=>{!this.isActive||(e.preventDefault(),e.stopPropagation(),t(this,Q).call(this,e),window.addEventListener("pointermove",t(this,Ke)),window.addEventListener("pointerup",t(this,Ge)))});a(this,Ge,()=>{window.removeEventListener("pointermove",t(this,Ke)),window.removeEventListener("pointerup",t(this,Ge))});a(this,Ke,e=>{e.preventDefault(),e.stopPropagation();let i=this.curPointerXPos-e.pageX,s=this.curPointerYPos-e.pageY;this.markerDeltaX+=i,this.markerDeltaY-=s,this.markerDeltaX=Math.max(Math.min(this.imgWidth/2,this.markerDeltaX),this.imgWidth/2*-1),this.markerDeltaY=Math.max(Math.min(this.imgHeight/2,this.markerDeltaY),this.imgHeight/2*-1);let n=this.imgCenterPx[0]-this.imgCenterAdjustedPx[0],o=this.imgCenterPx[1]-this.imgCenterAdjustedPx[1],l=this.markerDeltaX-n,c=this.markerDeltaY+o;this.markerTransform={globalX:l,globalY:c},t(this,Q).call(this,e)});a(this,yt,e=>{!this.isActive||(e.preventDefault(),e.stopPropagation(),t(this,Q).call(this,e),window.addEventListener("pointermove",t(this,Je)),window.addEventListener("pointerup",t(this,Ze)))});a(this,Ze,()=>{window.removeEventListener("pointermove",t(this,Je)),window.removeEventListener("pointerup",t(this,Ze))});a(this,Je,e=>{e.preventDefault();let i=Math.round(this.imgContainerElement.scrollTop+(this.curPointerYPos-e.pageY));i=Math.max(Math.min(this.imgHeight-this.imgContainerElement.clientHeight,i),0);let s=Math.round(this.imgContainerElement.scrollLeft+(this.curPointerXPos-e.pageX));s=Math.max(Math.min(this.imgWidth-this.imgContainerElement.clientWidth,s),0),this.imgContainerElement.scrollTop=i,this.imgContainerElement.scrollLeft=s;let n=Math.round(s-(this.imgWidth-this.imgContainerElement.clientWidth)/2),o=Math.round((this.imgHeight-this.imgContainerElement.clientHeight)/2-i);if(this.imgCenterAdjustedPx=[this.imgCenterPx[0]+n,this.imgCenterPx[1]-o],!this.keepMarkerCentered){let l=this.markerDeltaX+n,c=this.markerDeltaY+o;this.markerTransform={globalX:l,globalY:c}}t(this,Q).call(this,e)});a(this,Q,e=>{this.curPointerXPos=e.pageX,this.curPointerYPos=e.pageY});a(this,Tt,()=>{let{anchorX:e,anchorY:i,globalX:s,globalY:n}=t(this,J),o=e-s,l=i+n;this.markerElement.style.transform=`translate(calc(-50% + ${o}px), calc(-50% + ${l}px))`});this.reCenter=()=>{let e=(this.imgHeight-this.imgContainerElement.clientHeight)/2,i=(this.imgWidth-this.imgContainerElement.clientWidth)/2;this.imgContainerElement.scrollTop=e,this.imgContainerElement.scrollLeft=i,this.imgCenterAdjustedPx=this.imgCenterPx,this.markerDeltaX=this.markerDeltaY=0,this.markerTransform={globalX:0,globalY:0}};this.markerElement=i,this.imgContainerElement=e,this.keepMarkerCentered=s,this.zoom=n,this.anchor=o,this.curPointerXPos=0,this.curPointerYPos=0,this.markerDeltaX=0,this.markerDeltaY=0,this.imgContainerElement.addEventListener("pointerdown",t(this,yt)),this.keepMarkerCentered||this.markerElement.addEventListener("pointerdown",t(this,Et)),new ResizeObserver(t(this,xt)).observe(this.markerElement)}get anchor(){return t(this,Ve)}set anchor(e){d(this,Ve,e),[this.anchorOffsetX,this.anchorOffsetY]=fi(this.markerElement,e),this.markerTransform={anchorX:this.anchorOffsetX,anchorY:this.anchorOffsetY}}get markerTransform(){return t(this,J)}set markerTransform(e){d(this,J,h(h({},t(this,J)),e)),t(this,Tt).call(this)}get isActive(){return t(this,qe)}set isActive(e){this.imgContainerElement.style.touchAction=e?"none":"",d(this,qe,e)}get imgHeight(){return Math.min(this.imgContainerElement.clientHeight*2,ee)}get imgWidth(){return Math.min(this.imgContainerElement.clientWidth*2,ee)}get coordinate(){let e=this.keepMarkerCentered?this.imgCenterAdjustedPx:[this.imgCenterPx[0]-this.markerDeltaX,this.imgCenterPx[1]+this.markerDeltaY],i=gi.ll(e,this.zoom);return[Bt(i[0],6),Bt(i[1],6)]}set coordinate(e){this.imgCenterPx=this.imgCenterAdjustedPx=gi.px(e,this.zoom)}};Ve=new WeakMap,xt=new WeakMap,J=new WeakMap,qe=new WeakMap,Et=new WeakMap,Ge=new WeakMap,Ke=new WeakMap,yt=new WeakMap,Ze=new WeakMap,Je=new WeakMap,Q=new WeakMap,Tt=new WeakMap;var bi=vt("mapbox","satellite-streets-v11");var Mi=`<svg width="88" height="23" viewBox="0 0 88 23" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill-rule="evenodd"> | ||
`),ie,Nt,X,Y,p,ot,st,nt,Ut,rt,be=class extends T{constructor(){super(...arguments);a(this,ie,new U.MapboxSearch({}));a(this,Nt,new U.SearchSession(t(this,ie)));a(this,X,null);a(this,Y,void 0);a(this,p,new N);a(this,ot,e=>{this.dispatchEvent(e.clone())});a(this,st,e=>{this.dispatchEvent(e.clone())});a(this,nt,e=>D(this,null,function*(){var m;this.dispatchEvent(e.clone());let i=e.detail;if(!i||!i.features.length)return;let o=(0,U.featureToSuggestion)(i.features[0]);t(this,Y).value=o.feature_name;let n=t(this,X);if(!n)return;let r=i.features;if(r.length===1){let u=r[0],g=(m=u.properties.place_type)==null?void 0:m[0],C=u.bbox;if(C)n.flyTo(ci(n,U.LngLatBounds.convert(C).toFlatArray()));else{let $=u.geometry.coordinates,Ce=Oi(g);n.flyTo({center:$,zoom:Ce,speed:di})}return}let l=i.features.map(u=>u.bbox?(0,Di.default)(U.LngLatBounds.convert(u.bbox).toFlatArray()):u),c=(0,_i.default)({type:"FeatureCollection",features:l});n.flyTo(ci(n,c))}));a(this,Ut,e=>{let i=new M("input");Object.assign(i,h({},e)),this.dispatchEvent(i)});a(this,rt,()=>{let e=t(this,X),i=h({},t(this,p).options);if(e.getZoom()<=Fo){delete i.proximity,t(this,p).options=i;return}let o=e.getCenter();t(this,p).options=Ct(h({},i),{proximity:o})})}get accessToken(){return t(this,ie).accessToken}set accessToken(e){t(this,ie).accessToken=e}get value(){return t(this,Y).value}set value(e){t(this,Y).value=e}get template(){return Po}get templateStyle(){return w}get templateUserStyle(){return x(".Input",t(this,p).theme)}get options(){return t(this,p).options}set options(e){t(this,p).options=e}get theme(){return t(this,p).theme}set theme(e){t(this,p).theme=e,!!t(this,Y)&&(this.updateTemplateUserStyle(x(".Input",e)),t(this,p).updatePopover())}connectedCallback(){super.connectedCallback();let e=this.querySelector(".Input");e.addEventListener("input",t(this,Ut)),d(this,Y,e),t(this,p).session=t(this,Nt),t(this,p).input=e,t(this,p).addEventListener("suggest",t(this,ot)),t(this,p).addEventListener("suggesterror",t(this,st)),t(this,p).addEventListener("retrieve",t(this,nt)),document.body.appendChild(t(this,p))}disconnectedCallback(){t(this,p).remove(),t(this,p).input=null,t(this,p).removeEventListener("suggest",t(this,ot)),t(this,p).removeEventListener("suggesterror",t(this,st)),t(this,p).removeEventListener("retrieve",t(this,nt))}attributeChangedCallback(e,i,o){if(e==="access-token"){t(this,ie).accessToken=o;return}if(e==="theme"){this.theme=It(o);return}let n=e.split("-").join("_");o||delete t(this,p).options[n],t(this,p).options[n]=o}focus(){t(this,p).focus()}bindMap(e){t(this,X)&&t(this,X).off("moveend",t(this,rt)),e&&e.on("moveend",t(this,rt)),d(this,X,e)}unbindMap(){this.bindMap(null)}onAdd(e){this.bindMap(e),this.remove();let i=document.createElement("div");return i.className="mapboxgl-ctrl",i.style.width="300px",i.appendChild(this),i}onRemove(){this.remove(),this.unbindMap()}getDefaultPosition(){return"top-right"}};ie=new WeakMap,Nt=new WeakMap,X=new WeakMap,Y=new WeakMap,p=new WeakMap,ot=new WeakMap,st=new WeakMap,nt=new WeakMap,Ut=new WeakMap,rt=new WeakMap,be.observedAttributes=["access-token","theme","language","country","bbox","limit","navigation-profile","origin","proximity","eta-type","types"];window.MapboxSearchBox=be;window.customElements.get("mapbox-search-box")||customElements.define("mapbox-search-box",be);var qi=require("@mapbox/search-js-core");var Ui=kt(require("@mapbox/sphericalmercator"));var ji=new Ui.default({size:512,antimeridian:!0}),ne=1280;function Ni(s,e){let{width:i,height:o}=wt(s,!0);switch(e){case"center":return[0,0];case"top":return[0,o/2];case"bottom":return[0,-1*o/2];case"left":return[i/2,0];case"right":return[-1*i/2,0];case"top-left":return[i/2,o/2];case"top-right":return[-1*i/2,o/2];case"bottom-left":return[i/2,-1*o/2];case"bottom-right":return[-1*i/2,-1*o/2]}}var at,$t,oe,lt,dt,zt,ct,mt,Xt,ut,pt,se,Yt,mi=class{constructor(e,i,o,n,r){a(this,at,void 0);a(this,$t,()=>{[this.anchorOffsetX,this.anchorOffsetY]=Ni(this.markerElement,this.anchor),this.markerTransform={anchorX:this.anchorOffsetX,anchorY:this.anchorOffsetY}});a(this,oe,{anchorX:0,anchorY:0,globalX:0,globalY:0});a(this,lt,!1);a(this,dt,void 0);a(this,zt,e=>{!this.isActive||(e.preventDefault(),e.stopPropagation(),t(this,se).call(this,e),window.addEventListener("pointermove",t(this,mt)),window.addEventListener("pointerup",t(this,ct)))});a(this,ct,()=>{window.removeEventListener("pointermove",t(this,mt)),window.removeEventListener("pointerup",t(this,ct))});a(this,mt,e=>{e.preventDefault(),e.stopPropagation();let i=this.curPointerXPos-e.pageX,o=this.curPointerYPos-e.pageY;this.markerDeltaX+=i,this.markerDeltaY-=o,this.markerDeltaX=Math.max(Math.min(this.imgWidth/2,this.markerDeltaX),this.imgWidth/2*-1),this.markerDeltaY=Math.max(Math.min(this.imgHeight/2,this.markerDeltaY),this.imgHeight/2*-1);let n=this.imgCenterPx[0]-this.imgCenterAdjustedPx[0],r=this.imgCenterPx[1]-this.imgCenterAdjustedPx[1],l=this.markerDeltaX-n,c=this.markerDeltaY+r;this.markerTransform={globalX:l,globalY:c},t(this,se).call(this,e)});a(this,Xt,e=>{!this.isActive||(e.preventDefault(),e.stopPropagation(),t(this,se).call(this,e),window.addEventListener("pointermove",t(this,pt)),window.addEventListener("pointerup",t(this,ut)))});a(this,ut,()=>{window.removeEventListener("pointermove",t(this,pt)),window.removeEventListener("pointerup",t(this,ut))});a(this,pt,e=>{e.preventDefault();let i=Math.round(this.imgContainerElement.scrollTop+(this.curPointerYPos-e.pageY));i=Math.max(Math.min(this.imgHeight-this.imgContainerElement.clientHeight,i),0);let o=Math.round(this.imgContainerElement.scrollLeft+(this.curPointerXPos-e.pageX));o=Math.max(Math.min(this.imgWidth-this.imgContainerElement.clientWidth,o),0),this.imgContainerElement.scrollTop=i,this.imgContainerElement.scrollLeft=o;let n=Math.round(o-(this.imgWidth-this.imgContainerElement.clientWidth)/2),r=Math.round((this.imgHeight-this.imgContainerElement.clientHeight)/2-i);if(this.imgCenterAdjustedPx=[this.imgCenterPx[0]+n,this.imgCenterPx[1]-r],!this.keepMarkerCentered){let l=this.markerDeltaX+n,c=this.markerDeltaY+r;this.markerTransform={globalX:l,globalY:c}}t(this,se).call(this,e)});a(this,se,e=>{this.curPointerXPos=e.pageX,this.curPointerYPos=e.pageY});a(this,Yt,()=>{let{anchorX:e,anchorY:i,globalX:o,globalY:n}=t(this,oe),r=e-o,l=i+n;this.markerElement.style.transform=`translate(calc(-50% + ${r}px), calc(-50% + ${l}px))`});this.reCenter=()=>{let e=(this.imgHeight-this.imgContainerElement.clientHeight)/2,i=(this.imgWidth-this.imgContainerElement.clientWidth)/2;this.imgContainerElement.scrollTop=e,this.imgContainerElement.scrollLeft=i,this.imgCenterAdjustedPx=this.imgCenterPx,this.markerDeltaX=this.markerDeltaY=0,this.markerTransform={globalX:0,globalY:0}};this.markerElement=i,this.imgContainerElement=e,this.keepMarkerCentered=o,this.zoom=n,this.anchor=r,this.curPointerXPos=0,this.curPointerYPos=0,this.markerDeltaX=0,this.markerDeltaY=0,this.imgContainerElement.addEventListener("pointerdown",t(this,Xt)),this.keepMarkerCentered||this.markerElement.addEventListener("pointerdown",t(this,zt)),new ResizeObserver(t(this,$t)).observe(this.markerElement)}get anchor(){return t(this,at)}set anchor(e){d(this,at,e),[this.anchorOffsetX,this.anchorOffsetY]=Ni(this.markerElement,e),this.markerTransform={anchorX:this.anchorOffsetX,anchorY:this.anchorOffsetY}}get markerTransform(){return t(this,oe)}set markerTransform(e){d(this,oe,h(h({},t(this,oe)),e)),t(this,Yt).call(this)}get isActive(){return t(this,lt)}set isActive(e){this.imgContainerElement.style.touchAction=e?"none":"",d(this,lt,e)}get imgHeight(){return Math.min(this.imgContainerElement.clientHeight*2,ne)}get imgWidth(){return Math.min(this.imgContainerElement.clientWidth*2,ne)}get coordinate(){let e=this.keepMarkerCentered?this.imgCenterAdjustedPx:[this.imgCenterPx[0]-this.markerDeltaX,this.imgCenterPx[1]+this.markerDeltaY];if(V(e,this.imgCenterPx))return t(this,dt);{let i=ji.ll(e,this.zoom);return[ei(i[0],6),ei(i[1],6)]}}set coordinate(e){d(this,dt,e),this.imgCenterPx=this.imgCenterAdjustedPx=ji.px(e,this.zoom)}};at=new WeakMap,$t=new WeakMap,oe=new WeakMap,lt=new WeakMap,dt=new WeakMap,zt=new WeakMap,ct=new WeakMap,mt=new WeakMap,Xt=new WeakMap,ut=new WeakMap,pt=new WeakMap,se=new WeakMap,Yt=new WeakMap;var $i=jt("mapbox","satellite-streets-v11"),zi="20d01";var Xi=`<svg width="88" height="23" viewBox="0 0 88 23" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill-rule="evenodd"> | ||
<defs> | ||
@@ -150,3 +189,3 @@ <path id="logo" d="M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z" /> | ||
</svg> | ||
`;var xi=16,os=E(` | ||
`;var _o="https://contribute-api.mapbox.com/v1",Do="https://contribute-api-staging.tilestream.net/v1",jo="edit-suggestion";function Yi(s,e){if(!v.feedbackEnabled)return;let o=`${Ai(window.location.hostname)?Do:_o}/${jo}/address?access_token=${s}`,{originalCoordinate:n,originalAddress:r,changes:l}=e,c={action:"update",reason:"incorrect_address",location:{longitude:n[0],latitude:n[1]},userEmail:"no-reply-autofill@mapbox.com",changes:l,placeName:r};fetch(o,{method:"POST",headers:new Headers({"User-Agent":`mapbox-search-js.${Ie}.${navigator.userAgent}`,"Content-Type":"application/json"}),body:JSON.stringify(c)})}var Wi=16,No=b(` | ||
<template> | ||
@@ -161,3 +200,3 @@ <div class="MapboxAddressMinimap" aria-hidden="true"> | ||
<a target="_blank" rel="noopener nofollow" href="https://www.mapbox.com/" aria-label="Mapbox logo"> | ||
${Mi} | ||
${Xi} | ||
</a> | ||
@@ -173,11 +212,11 @@ </div> | ||
</template> | ||
`),as=E(` | ||
`),Uo=b(` | ||
<template> | ||
<button type="button" class="MinimapStyleToggle"></button> | ||
</template> | ||
`),ls=E(` | ||
`),$o=b(` | ||
<template> | ||
<div class="MinimapFooter">Adjust the marker on the map if it doesn't precisely match your location. This helps your delivery reach you faster.</div> | ||
</template> | ||
`),ds=E(` | ||
`),zo=b(` | ||
<template> | ||
@@ -190,3 +229,3 @@ <div class="MinimapEditButtons"> | ||
</template> | ||
`),te,Qe,H,X,ie,pe,M,S,et,se,tt,it,he,St,At,Lt,kt,Ct,st,rt,ge,nt,fe=class extends w{constructor(){super(...arguments);this.canAdjustMarker=!1;this.keepMarkerCentered=!1;this.markerAnchor="bottom";a(this,te,!1);a(this,Qe,!1);a(this,H,void 0);a(this,X,"");a(this,ie,void 0);a(this,pe,void 0);a(this,M,void 0);a(this,S,void 0);a(this,et,{});this.satelliteToggle=!1;a(this,se,"default");a(this,tt,["mapbox","streets-v11"]);a(this,it,void 0);a(this,he,()=>{let{ImageContainer:e,ButtonAdjust:i,ButtonSave:s,ButtonCancel:n}=t(this,M);t(this,te)?(e.classList.add(`${this.dataset.seed}--draggable`),t(this,S).isActive=!0,i.setAttribute("aria-hidden","true"),s.removeAttribute("aria-hidden"),n.removeAttribute("aria-hidden")):(e.classList.remove(`${this.dataset.seed}--draggable`),t(this,S).isActive=!1,i.removeAttribute("aria-hidden"),s.setAttribute("aria-hidden","true"),n.setAttribute("aria-hidden","true"))});a(this,St,()=>{d(this,te,!0),t(this,he).call(this)});a(this,At,()=>{this.onSaveMarkerLocation&&this.onSaveMarkerLocation(t(this,S).coordinate),d(this,te,!1),t(this,he).call(this)});a(this,Lt,()=>{t(this,S).reCenter(),d(this,te,!1),t(this,he).call(this)});a(this,kt,()=>{this.mapStyleMode=this.mapStyleMode==="default"?"satellite":"default"});a(this,Ct,()=>{t(this,Qe)||t(this,S).reCenter(),d(this,Qe,!0)});a(this,st,e=>{let[i,s]=this.defaultMapStyle,n=vt(i,s);return(this.mapStyleMode==="default"?n:bi)+Ei.LngLat.convert(e).toArray().join(",")+","+xi+",0/"+Math.min(t(this,ie)*2,ee)+"x"+Math.min(t(this,pe)*2,ee)+"?access_token="+this.accessToken+"&attribution=false&logo=false"});a(this,rt,()=>{if(t(this,H)){let e=t(this,H).geometry.coordinates;d(this,X,t(this,st).call(this,e));let{Image:i}=t(this,M);i.src=t(this,X)}});a(this,ge,e=>`url("${ni(e==="default"?"styleToggleDefault":"styleToggleSatellite",this.theme)}")`);a(this,nt,()=>{let{MapboxAddressMinimap:e,ImageContainer:i}=t(this,M),{width:s,height:n}=pt(this.container);d(this,ie,Math.min(s,ee)),d(this,pe,Math.min(n,ee)),e.style.setProperty("width",`${t(this,ie)}px`),i.style.setProperty("height",`${t(this,pe)}px`),i.style.setProperty("width",`${t(this,ie)}px`)})}get accessToken(){return this.getAttribute("access-token")}set accessToken(e){this.setAttribute("access-token",e)}get feature(){return t(this,H)}set feature(e){d(this,H,e),e?this.show():this.hide()}get template(){return os}get templateStyle(){return D}get templateUserStyle(){return k(".MapboxAddressMinimap",this.theme)}get theme(){return t(this,et)}set theme(e){if(d(this,et,e),!t(this,M)||!e)return;this.updateTemplateUserStyle(k(".MapboxAddressMinimap",e));let{Marker:i,MapStyleToggle:s}=t(this,M);i.innerHTML=V("marker",e),s&&(s.style.backgroundImage=t(this,ge).call(this,this.mapStyleMode==="default"?"satellite":"default"))}get mapStyleMode(){return t(this,se)}set mapStyleMode(e){let i=t(this,se);if(d(this,se,e),!t(this,M))return;let{MapStyleToggle:s}=t(this,M);!s||(s.style.backgroundImage=t(this,ge).call(this,i),s.setAttribute("title",`Switch to ${i==="satellite"?"Satellite":"Default"}`),t(this,rt).call(this))}get defaultMapStyle(){return t(this,tt)}set defaultMapStyle(e){d(this,tt,e),t(this,rt).call(this)}get container(){return t(this,it)}set container(e){e&&(e.style.position="relative",d(this,it,e))}show(){if(!t(this,H))return;let e=t(this,H).geometry.coordinates;t(this,S).coordinate=e,d(this,X,t(this,st).call(this,e));let{MapboxAddressMinimap:i,Image:s}=t(this,M);s.src=t(this,X),i.removeAttribute("aria-hidden")}hide(){let{MapboxAddressMinimap:e}=t(this,M);e.setAttribute("aria-hidden","true")}connectedCallback(){if(super.connectedCallback(),this.canAdjustMarker){let f=this.prepareTemplate(ls);this.querySelector(".MapboxAddressMinimap").appendChild(f);let F=this.prepareTemplate(ds);this.querySelector(".MinimapInnerFrame").appendChild(F)}if(this.satelliteToggle){let f=this.prepareTemplate(as);this.querySelector(".MinimapInnerFrame").appendChild(f)}d(this,M,re(this,{MapboxAddressMinimap:".MapboxAddressMinimap",ImageContainer:".MinimapImageContainer",Image:".MinimapImage",Marker:".MinimapMarker",MapStyleToggle:".MinimapStyleToggle",EditButtons:".MinimapEditButtons",ButtonAdjust:".MinimapButtonAdjust",ButtonSave:".MinimapButtonSave",ButtonCancel:".MinimapButtonCancel"}));let{MapboxAddressMinimap:e,ImageContainer:i,Image:s,Marker:n,MapStyleToggle:o,ButtonAdjust:l,ButtonSave:c,ButtonCancel:u}=t(this,M);this.mapStyleMode=t(this,se),this.theme=h({},this.theme),this.container=this.parentElement,new ResizeObserver(t(this,nt)).observe(this.container),t(this,nt).call(this),this.canAdjustMarker&&(l.addEventListener("click",t(this,St)),c.addEventListener("click",t(this,At)),u.addEventListener("click",t(this,Lt))),this.satelliteToggle&&(o.addEventListener("click",t(this,kt)),o.style.backgroundImage=t(this,ge).call(this,this.mapStyleMode==="default"?"satellite":"default"),o.setAttribute("title",`Switch to ${this.mapStyleMode==="default"?"Satellite":"Default"}`)),d(this,S,new Ut(i,n,this.keepMarkerCentered,xi,this.markerAnchor)),t(this,S).reCenter(),s.onload=t(this,Ct),s.src=t(this,X),t(this,H)?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true")}attributeChangedCallback(e,i,s){if(e==="can-adjust-marker")this.canAdjustMarker=s==="true";else if(e==="keep-marker-centered")this.keepMarkerCentered=s==="true";else if(e==="marker-anchor"){let n=s;this.markerAnchor=n,t(this,S)&&(t(this,S).anchor=n)}else e==="satellite-toggle"&&(this.satelliteToggle=s==="true")}};te=new WeakMap,Qe=new WeakMap,H=new WeakMap,X=new WeakMap,ie=new WeakMap,pe=new WeakMap,M=new WeakMap,S=new WeakMap,et=new WeakMap,se=new WeakMap,tt=new WeakMap,it=new WeakMap,he=new WeakMap,St=new WeakMap,At=new WeakMap,Lt=new WeakMap,kt=new WeakMap,Ct=new WeakMap,st=new WeakMap,rt=new WeakMap,ge=new WeakMap,nt=new WeakMap,fe.observedAttributes=["can-adjust-marker","keep-marker-centered","marker-anchor","satellite-toggle"];window.MapboxAddressMinimap=fe;window.customElements.get("mapbox-address-minimap")||customElements.define("mapbox-address-minimap",fe);var ve,ot,be,at,lt,dt,yi,ct,ut,Ti=class{constructor({accessToken:e,options:i}){a(this,dt);this.autofillInstances=[];a(this,ve,void 0);a(this,ot,void 0);a(this,be,void 0);a(this,at,void 0);a(this,lt,!1);a(this,ct,()=>{Ee(x(this,dt,yi).call(this),t(this,ve))||this.update()});a(this,ut,new MutationObserver(t(this,ct)));this.accessToken=e,i&&(this.options=i),this.update()}get accessToken(){return t(this,ot)}set accessToken(e){d(this,ot,e),this.autofillInstances.forEach(i=>{i.accessToken=e})}get options(){return t(this,be)}set options(e){d(this,be,h(h({},t(this,be)),e)),this.autofillInstances.forEach(i=>{i.options=h(h({},i.options),e)})}get theme(){return t(this,at)}set theme(e){d(this,at,e),this.autofillInstances.forEach(i=>{i.theme=e})}get minimapOnConfirm(){return t(this,lt)}set minimapOnConfirm(e){d(this,lt,e),this.autofillInstances.forEach(i=>{i.setAttribute("minimap-on-confirm",e===!0?"true":"false")})}update(){this.autofillInstances.forEach(e=>{e.replaceWith(e.children[0])}),d(this,ve,x(this,dt,yi).call(this)),t(this,ve).forEach(e=>{let i=new z;i.accessToken=this.accessToken,i.options=this.options,i.theme=this.theme,e.parentElement.replaceChild(i,e),i.appendChild(e),this.autofillInstances.push(i)})}observe(){t(this,ut).observe(document,{subtree:!0,childList:!0}),t(this,ct).call(this)}unobserve(){t(this,ut).disconnect()}showConfirmAddress(e,i){return j(this,null,function*(){let s=!0;if(i==null?void 0:i.sections)for(let n of i.sections){let o=this.autofillInstances.find(c=>c.querySelector("input").autocomplete.indexOf(n)!==-1);if(!o)continue;(yield o.showConfirm())||(s=!1)}else for(let n of this.autofillInstances)(yield n.showConfirm())||(s=!1);return s})}};ve=new WeakMap,ot=new WeakMap,be=new WeakMap,at=new WeakMap,lt=new WeakMap,dt=new WeakSet,yi=function(){return document.querySelectorAll('input[autocomplete~="address-line1"], input[autocomplete~="street-address"]')},ct=new WeakMap,ut=new WeakMap;function Si(r){let{accessToken:e,options:i}=r;return new Ti({accessToken:e,options:i})}module.exports=Ri(cs); | ||
`),re,ht,O,W,q,ae,S,y,gt,ft,le,vt,bt,Me,Wt,qt,Vt,Gt,Kt,Mt,xe,Ee,xt,Te=class extends T{constructor(){super(...arguments);this.canAdjustMarker=!1;this.keepMarkerCentered=!1;this.markerAnchor="bottom";a(this,re,!1);a(this,ht,!1);a(this,O,void 0);a(this,W,"");a(this,q,void 0);a(this,ae,void 0);a(this,S,void 0);a(this,y,void 0);a(this,gt,void 0);a(this,ft,{});this.satelliteToggle=!1;a(this,le,"default");a(this,vt,["mapbox","streets-v11"]);a(this,bt,void 0);a(this,Me,()=>{let{ImageContainer:e,ButtonAdjust:i,ButtonSave:o,ButtonCancel:n}=t(this,S);t(this,re)?(e.classList.add(`${this.dataset.seed}--draggable`),t(this,y).isActive=!0,i.setAttribute("aria-hidden","true"),o.removeAttribute("aria-hidden"),n.removeAttribute("aria-hidden")):(e.classList.remove(`${this.dataset.seed}--draggable`),t(this,y).isActive=!1,i.removeAttribute("aria-hidden"),o.setAttribute("aria-hidden","true"),n.setAttribute("aria-hidden","true"))});a(this,Wt,()=>{d(this,re,!0),t(this,Me).call(this)});a(this,qt,()=>{if(this.feature.properties.full_address&&!V(this.feature.geometry.coordinates,t(this,y).coordinate)){let[e,i]=t(this,y).coordinate;Yi(this.accessToken,{originalCoordinate:this.feature.geometry.coordinates,originalAddress:this.feature.properties.full_address,changes:{location:{longitude:e,latitude:i}}})}this.onSaveMarkerLocation&&this.onSaveMarkerLocation(t(this,y).coordinate),d(this,re,!1),t(this,Me).call(this)});a(this,Vt,()=>{t(this,y).reCenter(),d(this,re,!1),t(this,Me).call(this)});a(this,Gt,()=>{this.mapStyleMode=this.mapStyleMode==="default"?"satellite":"default"});a(this,Kt,()=>{t(this,ht)||t(this,y).reCenter(),d(this,ht,!0)});a(this,Mt,e=>{if(t(this,q)===0||t(this,ae)===0)return"";let[i,o]=this.defaultMapStyle,n=jt(i,o),r=this.mapStyleMode==="default"?n:$i,l=zi+v.autofillSessionToken.toString(),c=r+qi.LngLat.convert(e).toArray().join(",")+","+Wi+",0/"+Math.min(t(this,q)*2,ne)+"x"+Math.min(t(this,ae)*2,ne)+"?access_token="+this.accessToken+"&attribution=false&logo=false";return v.autofillSessionEnabled&&(c+=`&sku=${l}`),c});a(this,xe,()=>{if(t(this,O)){let e=t(this,O).geometry.coordinates;d(this,W,t(this,Mt).call(this,e));let{Image:i}=t(this,S);i.src=t(this,W)}});a(this,Ee,e=>`url("${wi(e==="default"?"styleToggleDefault":"styleToggleSatellite",this.theme)}")`);a(this,xt,()=>{let{MapboxAddressMinimap:e,ImageContainer:i}=t(this,S),{width:o,height:n}=wt(this.container);d(this,q,Math.min(o,ne)),d(this,ae,Math.min(n,ne)),e.style.setProperty("width",`${t(this,q)}px`),i.style.setProperty("height",`${t(this,ae)}px`),i.style.setProperty("width",`${t(this,q)}px`),t(this,xe).call(this)})}get accessToken(){return t(this,gt)||v.accessToken}set accessToken(e){d(this,gt,e)}get feature(){return t(this,O)}set feature(e){d(this,O,e),e?this.show():this.hide()}get template(){return No}get templateStyle(){return w}get templateUserStyle(){return x(".MapboxAddressMinimap",this.theme)}get theme(){return t(this,ft)}set theme(e){if(d(this,ft,e),!t(this,S)||!e)return;this.updateTemplateUserStyle(x(".MapboxAddressMinimap",e));let{Marker:i,MapStyleToggle:o}=t(this,S);i.innerHTML=k("marker",e),o&&(o.style.backgroundImage=t(this,Ee).call(this,this.mapStyleMode==="default"?"satellite":"default"))}get mapStyleMode(){return t(this,le)}set mapStyleMode(e){let i=t(this,le);if(d(this,le,e),!t(this,S))return;let{MapStyleToggle:o}=t(this,S);!o||(o.style.backgroundImage=t(this,Ee).call(this,i),o.setAttribute("title",`Switch to ${i==="satellite"?"Satellite":"Default"}`),t(this,xe).call(this))}get defaultMapStyle(){return t(this,vt)}set defaultMapStyle(e){d(this,vt,e),t(this,xe).call(this)}get container(){return t(this,bt)}set container(e){e&&(e.style.position="relative",d(this,bt,e))}show(){if(!t(this,O))return;let e=t(this,O).geometry.coordinates;t(this,y).coordinate=e,d(this,W,t(this,Mt).call(this,e));let{MapboxAddressMinimap:i,Image:o}=t(this,S);o.src=t(this,W),i.removeAttribute("aria-hidden")}hide(){let{MapboxAddressMinimap:e}=t(this,S);e.setAttribute("aria-hidden","true")}connectedCallback(){if(super.connectedCallback(),this.canAdjustMarker){let g=this.prepareTemplate($o);this.querySelector(".MapboxAddressMinimap").appendChild(g);let $=this.prepareTemplate(zo);this.querySelector(".MinimapInnerFrame").appendChild($)}if(this.satelliteToggle){let g=this.prepareTemplate(Uo);this.querySelector(".MinimapInnerFrame").appendChild(g)}d(this,S,R(this,{MapboxAddressMinimap:".MapboxAddressMinimap",ImageContainer:".MinimapImageContainer",Image:".MinimapImage",Marker:".MinimapMarker",MapStyleToggle:".MinimapStyleToggle",EditButtons:".MinimapEditButtons",ButtonAdjust:".MinimapButtonAdjust",ButtonSave:".MinimapButtonSave",ButtonCancel:".MinimapButtonCancel"}));let{MapboxAddressMinimap:e,ImageContainer:i,Image:o,Marker:n,MapStyleToggle:r,ButtonAdjust:l,ButtonSave:c,ButtonCancel:m}=t(this,S);this.mapStyleMode=t(this,le),this.theme=h({},this.theme),this.container=this.parentElement,new ResizeObserver(t(this,xt)).observe(this.container),t(this,xt).call(this),this.canAdjustMarker&&(l.addEventListener("click",t(this,Wt)),c.addEventListener("click",t(this,qt)),m.addEventListener("click",t(this,Vt))),this.satelliteToggle&&(r.addEventListener("click",t(this,Gt)),r.style.backgroundImage=t(this,Ee).call(this,this.mapStyleMode==="default"?"satellite":"default"),r.setAttribute("title",`Switch to ${this.mapStyleMode==="default"?"Satellite":"Default"}`)),d(this,y,new mi(i,n,this.keepMarkerCentered,Wi,this.markerAnchor)),t(this,y).reCenter(),o.onload=t(this,Kt),o.src=t(this,W),t(this,O)?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true")}attributeChangedCallback(e,i,o){if(e==="access-token")this.accessToken=o;else if(e==="can-adjust-marker")this.canAdjustMarker=o==="true";else if(e==="keep-marker-centered")this.keepMarkerCentered=o==="true";else if(e==="marker-anchor"){let n=o;this.markerAnchor=n,t(this,y)&&(t(this,y).anchor=n)}else e==="satellite-toggle"&&(this.satelliteToggle=o==="true")}};re=new WeakMap,ht=new WeakMap,O=new WeakMap,W=new WeakMap,q=new WeakMap,ae=new WeakMap,S=new WeakMap,y=new WeakMap,gt=new WeakMap,ft=new WeakMap,le=new WeakMap,vt=new WeakMap,bt=new WeakMap,Me=new WeakMap,Wt=new WeakMap,qt=new WeakMap,Vt=new WeakMap,Gt=new WeakMap,Kt=new WeakMap,Mt=new WeakMap,xe=new WeakMap,Ee=new WeakMap,xt=new WeakMap,Te.observedAttributes=["access-token","can-adjust-marker","keep-marker-centered","marker-anchor","satellite-toggle"];window.MapboxAddressMinimap=Te;window.customElements.get("mapbox-address-minimap")||customElements.define("mapbox-address-minimap",Te);var Le=require("@mapbox/search-js-core");var _,de,Et,Tt,yt,Vi=class{constructor(e,i,o){a(this,_,void 0);a(this,de,void 0);this.listbox=new N;a(this,Et,e=>{t(this,de).fire("suggest",e.clone(t(this,_)))});a(this,Tt,e=>{t(this,de).fire("suggesterror",e.clone(t(this,_)))});a(this,yt,e=>{if(t(this,de).fire("retrieve",e.clone(t(this,_))),!t(this,_))return;let i=e.detail;!i||!i.features||!i.features.length||Ot(i.features[0],t(this,_))});d(this,_,i),d(this,de,e),this.listbox.input=t(this,_),this.listbox.session=new Le.SearchSession(o),this.listbox.session.sessionToken=v.autofillSessionToken,this.listbox.addEventListener("suggest",t(this,Et)),this.listbox.addEventListener("suggesterror",t(this,Tt)),this.listbox.addEventListener("retrieve",t(this,yt)),document.body.appendChild(this.listbox)}remove(){this.listbox.remove(),this.listbox.removeEventListener("suggest",t(this,Et)),this.listbox.removeEventListener("suggesterror",t(this,Tt)),this.listbox.removeEventListener("retrieve",t(this,yt))}};_=new WeakMap,de=new WeakMap,Et=new WeakMap,Tt=new WeakMap,yt=new WeakMap;var ye,Se,Ae,St,At,Lt,Gi=class extends Le.Evented{constructor({accessToken:e,options:i,theme:o}){super();this.instances=[];a(this,ye,void 0);a(this,Se,new Le.MapboxAutofill);a(this,Ae,void 0);a(this,St,void 0);a(this,At,()=>{V(Ge(),t(this,ye))||this.update()});a(this,Lt,new MutationObserver(t(this,At)));v.autofillSessionEnabled=!0,this.accessToken=e||v.accessToken,i&&(this.options=i),o&&(this.theme=o),this.update()}get accessToken(){return t(this,Se).accessToken}set accessToken(e){t(this,Se).accessToken=e}get options(){return t(this,Ae)}set options(e){d(this,Ae,h(h({},t(this,Ae)),e)),this.instances.forEach(i=>{i.listbox.options=h(h({},i.listbox.options),e)})}get theme(){return t(this,St)}set theme(e){d(this,St,e),this.instances.forEach(i=>{i.listbox.theme=e})}update(){this.instances.forEach(e=>{e.remove()}),d(this,ye,Ge()),this.instances=[],t(this,ye).forEach(e=>{let i=new Vi(this,e,t(this,Se));i.listbox.options=this.options,i.listbox.theme=this.theme,this.instances.push(i)})}observe(){t(this,Lt).observe(document,{subtree:!0,childList:!0}),t(this,At).call(this)}unobserve(){t(this,Lt).disconnect()}};ye=new WeakMap,Se=new WeakMap,Ae=new WeakMap,St=new WeakMap,At=new WeakMap,Lt=new WeakMap;function Ki(s){let{accessToken:e,options:i}=s;return new Gi({accessToken:e,options:i})}var ui=new J;function Zi(i){return D(this,arguments,function*(s,e={}){let{sections:o=[]}=e;ui.parentNode||document.body.appendChild(ui);let n={type:"nochange"},r=Ge(s),l=ri(s);for(let c of r){if(o.length){let C=l.find($=>$.input===c);if(!C||!o.includes(C.section))continue}let m=Ft(s,c),u=e.accessToken||v.accessToken,g=yield ui.tryShow(m,Ct(h({},e),{accessToken:u}));g.type==="change"&&(c.dataset.mapboxSuccess="true",ai(s,c,g.suggestion)),g.type==="change"&&n.type!=="cancel"&&(n=g),g.type==="cancel"&&(n=g)}return n})}module.exports=ao(Xo); | ||
//# sourceMappingURL=index.js.map |
@@ -18,2 +18,4 @@ /** | ||
* | ||
* @param newTarget - Optional event target to assign to the clone | ||
* | ||
* @example | ||
@@ -23,3 +25,3 @@ * `MapboxSearchBox` will call `event.clone()` on the `retrieve` | ||
*/ | ||
clone(): MapboxHTMLEvent<T>; | ||
clone(newTarget?: EventTarget): MapboxHTMLEvent<T>; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { AutofillSuggestion } from '@mapbox/search-js-core'; | ||
import { AutofillFeatureSuggestion, AutofillSuggestion } from '@mapbox/search-js-core'; | ||
import { InputFormElement } from './dom'; | ||
@@ -17,5 +17,12 @@ /** | ||
export declare function findParentForm(el: Element): HTMLFormElement | null; | ||
/** | ||
* Finds input elements that are eligible to be used for Address Autofill. | ||
* Eligible inputs include those with standard WHATWG autocomplete attribute values, either 'address-line1' or 'street-address' | ||
* @param form - If specified, searches within the given form instead of the whole document | ||
* @returns Array of input elements | ||
*/ | ||
export declare function findAddressInputs(form?: HTMLFormElement): HTMLInputElement[]; | ||
declare type FormStructure = { | ||
input: InputFormElement; | ||
section: string | symbol; | ||
section: string; | ||
field: AutofillTokens; | ||
@@ -63,2 +70,23 @@ }[]; | ||
export declare function setFormAutofillValues(form: HTMLFormElement, ref: HTMLInputElement, suggestion: AutofillSuggestion): void; | ||
/** | ||
* Gets the current input values for address fields given a form and a reference input. | ||
* | ||
* @param form - HTML form that includes the autocomplete-compliant input fields | ||
* @param ref - An input element within the desired form address section | ||
* @returns A object mapping WHATWG autocomplete properties to their respective form field values | ||
* | ||
* @example | ||
* ```typescript | ||
* const form = document.querySelector(form); | ||
* const input = form.querySelector('input[autocomplete~="street-address"]') | ||
* const valueMap = getFormAutofillValues(form, input); | ||
* console.log(valueMap); | ||
* // { | ||
* // "street-address": "123 Main", | ||
* // "address-level2": "Boston", | ||
* // "address-level1": "MA", | ||
* // "postal-code": "02129" | ||
* // } | ||
* ``` | ||
*/ | ||
export declare function getFormAutofillValues(form: HTMLFormElement, ref: HTMLInputElement): AutofillValueMap; | ||
@@ -69,2 +97,5 @@ /** | ||
* | ||
* @param snapshot - An object mapping WHATWG autocomplete attribute values to their corresponding input field values | ||
* @returns A concatenated address string | ||
* | ||
* @example | ||
@@ -84,2 +115,3 @@ * ```typescript | ||
export declare function getAutofillSearchText(snapshot: AutofillValueMap): string; | ||
export declare function fillFormWithFeature(feature: AutofillFeatureSuggestion, input: HTMLInputElement): void; | ||
export {}; |
@@ -23,1 +23,7 @@ /** | ||
export declare function round(num: number, decimalPlaces: number): number; | ||
/** | ||
* Returns true if a hostname matches a local server protocol | ||
* @param hostname - A string representing window.location.hostname | ||
* @returns A boolean value | ||
*/ | ||
export declare function isLocalServer(hostname: string): boolean; |
{ | ||
"name": "@mapbox/search-js-web", | ||
"version": "1.0.0-beta.6", | ||
"version": "1.0.0-beta.7", | ||
"description": "Search web component with form autocomplete.", | ||
@@ -22,3 +22,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@mapbox/search-js-core": "^1.0.0-beta.6", | ||
"@mapbox/search-js-core": "^1.0.0-beta.7", | ||
"@mapbox/sphericalmercator": "^1.2.0", | ||
@@ -79,5 +79,5 @@ "@popperjs/core": "^2.11.2", | ||
"path": "dist/mapboxsearch.js", | ||
"limit": "30 kB" | ||
"limit": "35 kB" | ||
} | ||
] | ||
} |
@@ -7,3 +7,5 @@ import mapboxgl from 'mapbox-gl'; | ||
Theme, | ||
MapboxHTMLEvent | ||
MapboxHTMLEvent, | ||
confirmAddress, | ||
config | ||
} from '../src'; | ||
@@ -17,2 +19,4 @@ import { AutofillRetrieveResponse } from '@mapbox/search-js-core'; | ||
config.feedbackEnabled = false; | ||
// Autofilled by ESBuild. | ||
@@ -88,3 +92,7 @@ const ACCESS_TOKEN = MAPBOX_ACCESS_TOKEN; | ||
minimap.onSaveMarkerLocation = (coordinate) => { | ||
console.log(`Marker updated to ${JSON.stringify(coordinate)}.`); | ||
if ( | ||
coordinate.toString() !== minimap.feature.geometry.coordinates.toString() | ||
) { | ||
console.log(`Marker updated to ${JSON.stringify(coordinate)}.`); | ||
} | ||
}; | ||
@@ -143,5 +151,12 @@ | ||
e.preventDefault(); | ||
element.showConfirm().catch((e) => { | ||
console.warn(e); | ||
const result = await confirmAddress(form, { | ||
theme: THEMES[selectEl.value], | ||
accessToken: ACCESS_TOKEN, | ||
minimap: true, | ||
skipConfirmModal: (feature) => | ||
['exact', 'high'].includes(feature.properties.match_code.confidence) | ||
}); | ||
console.log(result); | ||
}); | ||
@@ -148,0 +163,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
2649356
62
9968
5