@stadiamaps/api
Version:
Stadia Maps Geospatial APIs
1,625 lines • 204 kB
JavaScript
const ti = "https://api.stadiamaps.com".replace(/\/+$/, "");
class ri {
constructor(i = {}) {
this.configuration = i;
}
set config(i) {
this.configuration = i;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : ti;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || _e;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const i = this.configuration.apiKey;
if (i)
return typeof i == "function" ? i : () => i;
}
get accessToken() {
const i = this.configuration.accessToken;
if (i)
return typeof i == "function" ? i : async () => i;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
}
const oi = new ri(), x = class x {
constructor(i = oi) {
this.configuration = i, this.fetchApi = async (t, n) => {
let r = { url: t, init: n };
for (const c of this.middleware)
c.pre && (r = await c.pre({
fetch: this.fetchApi,
...r
}) || r);
let o;
try {
o = await (this.configuration.fetchApi || fetch)(
r.url,
r.init
);
} catch (c) {
for (const f of this.middleware)
f.onError && (o = await f.onError({
fetch: this.fetchApi,
url: r.url,
init: r.init,
error: c,
response: o ? o.clone() : void 0
}) || o);
if (o === void 0)
throw c instanceof Error ? new di(
c,
"The request failed and the interceptors did not return an alternative response"
) : c;
}
for (const c of this.middleware)
c.post && (o = await c.post({
fetch: this.fetchApi,
url: r.url,
init: r.init,
response: o.clone()
}) || o);
return o;
}, this.middleware = i.middleware;
}
withMiddleware(...i) {
const t = this.clone();
return t.middleware = t.middleware.concat(...i), t;
}
withPreMiddleware(...i) {
const t = i.map((n) => ({ pre: n }));
return this.withMiddleware(...t);
}
withPostMiddleware(...i) {
const t = i.map((n) => ({ post: n }));
return this.withMiddleware(...t);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(i) {
return i ? x.jsonRegex.test(i) : !1;
}
async request(i, t) {
const { url: n, init: r } = await this.createFetchParams(i, t), o = await this.fetchApi(n, r);
if (o && o.status >= 200 && o.status < 300)
return o;
throw new ui(o, "Response returned an error code");
}
async createFetchParams(i, t) {
let n = this.configuration.basePath + i.path;
i.query !== void 0 && Object.keys(i.query).length !== 0 && (n += "?" + this.configuration.queryParamsStringify(i.query));
const r = Object.assign(
{},
this.configuration.headers,
i.headers
);
Object.keys(r).forEach(
(de) => r[de] === void 0 ? delete r[de] : {}
);
const o = typeof t == "function" ? t : async () => t, c = {
method: i.method,
headers: r,
body: i.body,
credentials: this.configuration.credentials
}, f = {
...c,
...await o({
init: c,
context: i
})
};
let S;
ai(f.body) || f.body instanceof URLSearchParams || ci(f.body) ? S = f.body : this.isJsonMime(r["Content-Type"]) ? S = JSON.stringify(f.body) : S = f.body;
const ni = {
...f,
body: S
};
return { url: n, init: ni };
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const i = this.constructor, t = new i(this.configuration);
return t.middleware = this.middleware.slice(), t;
}
};
x.jsonRegex = new RegExp(
"^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$",
"i"
);
let b = x;
function ci(e) {
return typeof Blob < "u" && e instanceof Blob;
}
function ai(e) {
return typeof FormData < "u" && e instanceof FormData;
}
class ui extends Error {
constructor(i, t) {
super(t), this.response = i, this.name = "ResponseError";
}
}
class di extends Error {
constructor(i, t) {
super(t), this.cause = i, this.name = "FetchError";
}
}
class s extends Error {
constructor(i, t) {
super(t), this.field = i, this.name = "RequiredError";
}
}
const a = {
csv: ",",
ssv: " ",
tsv: " ",
pipes: "|"
};
function _e(e, i = "") {
return Object.keys(e).map((t) => he(t, e[t], i)).filter((t) => t.length > 0).join("&");
}
function he(e, i, t = "") {
const n = t + (t.length ? `[${e}]` : e);
if (i instanceof Array) {
const r = i.map((o) => encodeURIComponent(String(o))).join(`&${encodeURIComponent(n)}=`);
return `${encodeURIComponent(n)}=${r}`;
}
if (i instanceof Set) {
const r = Array.from(i);
return he(e, r, t);
}
return i instanceof Date ? `${encodeURIComponent(n)}=${encodeURIComponent(i.toISOString())}` : i instanceof Object ? _e(i, n) : `${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`;
}
function Du(e, i) {
const t = e[i];
return t != null;
}
function Mu(e, i) {
const t = {};
for (const n of Object.keys(e))
t[n] = i(e[n]);
return t;
}
function Lu(e) {
for (const i of e)
if (i.contentType === "multipart/form-data")
return !0;
return !1;
}
class u {
constructor(i, t = (n) => n) {
this.raw = i, this.transformer = t;
}
async value() {
return this.transformer(await this.raw.json());
}
}
class Iu {
constructor(i) {
this.raw = i;
}
async value() {
}
}
class Eu {
constructor(i) {
this.raw = i;
}
async value() {
return await this.raw.blob();
}
}
class Au {
constructor(i) {
this.raw = i;
}
async value() {
return await this.raw.text();
}
}
function Gu(e) {
return !0;
}
function li(e) {
return si(e);
}
function si(e, i) {
return e == null ? e : {
golfCart: e.golf_cart == null ? void 0 : e.golf_cart,
wheelchair: e.wheelchair == null ? void 0 : e.wheelchair,
taxi: e.taxi == null ? void 0 : e.taxi,
hOV: e.HOV == null ? void 0 : e.HOV,
truck: e.truck == null ? void 0 : e.truck,
emergency: e.emergency == null ? void 0 : e.emergency,
pedestrian: e.pedestrian == null ? void 0 : e.pedestrian,
car: e.car == null ? void 0 : e.car,
bus: e.bus == null ? void 0 : e.bus,
bicycle: e.bicycle == null ? void 0 : e.bicycle,
motorcycle: e.motorcycle == null ? void 0 : e.motorcycle,
moped: e.moped == null ? void 0 : e.moped
};
}
function fi(e) {
return pi(e, !1);
}
function pi(e, i = !1) {
return e == null ? e : {
golf_cart: e.golfCart,
wheelchair: e.wheelchair,
taxi: e.taxi,
HOV: e.hOV,
truck: e.truck,
emergency: e.emergency,
pedestrian: e.pedestrian,
car: e.car,
bus: e.bus,
bicycle: e.bicycle,
motorcycle: e.motorcycle,
moped: e.moped
};
}
function Bu(e) {
return !0;
}
function gi(e) {
return yi(e);
}
function yi(e, i) {
return e == null ? e : {
tel: e.tel == null ? void 0 : e.tel,
website: e.website == null ? void 0 : e.website
};
}
function mi(e) {
return _i(e, !1);
}
function _i(e, i = !1) {
return e == null ? e : {
tel: e.tel,
website: e.website
};
}
function Pu(e) {
return !0;
}
function hi(e) {
return Oi(e);
}
function Oi(e, i) {
return e == null ? e : {
eurographicsGiscoId: e.eurographics_gisco_id == null ? void 0 : e.eurographics_gisco_id,
faaCode: e.faa_code == null ? void 0 : e.faa_code,
factualId: e.factual_id == null ? void 0 : e.factual_id,
fifaId: e.fifa_id == null ? void 0 : e.fifa_id,
fipsCode: e.fips_code == null ? void 0 : e.fips_code,
frGovEpciCode: e.fr_gov_epci_code == null ? void 0 : e.fr_gov_epci_code,
fraInseeCode: e.fra_insee_code == null ? void 0 : e.fra_insee_code,
geonamesId: e.geonames_id == null ? void 0 : e.geonames_id,
geoplanetId: e.geoplanet_id == null ? void 0 : e.geoplanet_id,
hascId: e.hasc_id == null ? void 0 : e.hasc_id,
iataCode: e.iata_code == null ? void 0 : e.iata_code,
icaoCode: e.icao_code == null ? void 0 : e.icao_code,
ituId: e.itu_id == null ? void 0 : e.itu_id,
karmashapesId: e.karmashapes_id == null ? void 0 : e.karmashapes_id,
naturalEarthId: e.natural_earth_id == null ? void 0 : e.natural_earth_id,
nuts2021Id: e.nuts_2021_id == null ? void 0 : e.nuts_2021_id,
quattroshapesId: e.quattroshapes_id == null ? void 0 : e.quattroshapes_id,
quattroshapesPgId: e.quattroshapes_pg_id == null ? void 0 : e.quattroshapes_pg_id,
usCensusGeoId: e.us_census_geo_id == null ? void 0 : e.us_census_geo_id,
wikidataId: e.wikidata_id == null ? void 0 : e.wikidata_id,
wikipediaPage: e.wikipedia_page == null ? void 0 : e.wikipedia_page
};
}
function bi(e) {
return Si(e, !1);
}
function Si(e, i = !1) {
return e == null ? e : {
eurographics_gisco_id: e.eurographicsGiscoId,
faa_code: e.faaCode,
factual_id: e.factualId,
fifa_id: e.fifaId,
fips_code: e.fipsCode,
fr_gov_epci_code: e.frGovEpciCode,
fra_insee_code: e.fraInseeCode,
geonames_id: e.geonamesId,
geoplanet_id: e.geoplanetId,
hasc_id: e.hascId,
iata_code: e.iataCode,
icao_code: e.icaoCode,
itu_id: e.ituId,
karmashapes_id: e.karmashapesId,
natural_earth_id: e.naturalEarthId,
nuts_2021_id: e.nuts2021Id,
quattroshapes_id: e.quattroshapesId,
quattroshapes_pg_id: e.quattroshapesPgId,
us_census_geo_id: e.usCensusGeoId,
wikidata_id: e.wikidataId,
wikipedia_page: e.wikipediaPage
};
}
function Vu(e) {
return !0;
}
function Ti(e) {
return Ni(e);
}
function Ni(e, i) {
return e == null ? e : {
brand: e.brand == null ? void 0 : e.brand,
iata: e.iata == null ? void 0 : e.iata,
icao: e.icao == null ? void 0 : e.icao,
openingHours: e.opening_hours == null ? void 0 : e.opening_hours,
operator: e.operator == null ? void 0 : e.operator,
phone: e.phone == null ? void 0 : e.phone,
website: e.website == null ? void 0 : e.website,
wheelchair: e.wheelchair == null ? void 0 : e.wheelchair,
wikidata: e.wikidata == null ? void 0 : e.wikidata,
wikipedia: e.wikipedia == null ? void 0 : e.wikipedia
};
}
function wi(e) {
return Ri(e, !1);
}
function Ri(e, i = !1) {
return e == null ? e : {
brand: e.brand,
iata: e.iata,
icao: e.icao,
opening_hours: e.openingHours,
operator: e.operator,
phone: e.phone,
website: e.website,
wheelchair: e.wheelchair,
wikidata: e.wikidata,
wikipedia: e.wikipedia
};
}
function Hu(e) {
return !(!("featureCode" in e) || e.featureCode === void 0);
}
function Ji(e) {
return xi(e);
}
function xi(e, i) {
return e == null ? e : {
featureCode: e.feature_code
};
}
function Ci(e) {
return Fi(e, !1);
}
function Fi(e, i = !1) {
return e == null ? e : {
feature_code: e.featureCode
};
}
function Wu(e) {
return !0;
}
function Oe(e) {
return vi(e);
}
function vi(e, i) {
return e == null ? e : {
foursquare: e.foursquare == null ? void 0 : gi(e.foursquare),
geonames: e.geonames == null ? void 0 : Ji(e.geonames),
osm: e.osm == null ? void 0 : Ti(e.osm),
whosonfirstConcordances: e.whosonfirst_concordances == null ? void 0 : hi(e.whosonfirst_concordances)
};
}
function be(e) {
return ki(e, !1);
}
function ki(e, i = !1) {
return e == null ? e : {
foursquare: mi(e.foursquare),
geonames: Ci(e.geonames),
osm: wi(e.osm),
whosonfirst_concordances: bi(
e.whosonfirstConcordances
)
};
}
function zu(e) {
return !0;
}
function Se(e) {
return Di(e);
}
function Di(e, i) {
return e == null ? e : {
crossStreet: e.cross_street == null ? void 0 : e.cross_street,
number: e.number == null ? void 0 : e.number,
postalCode: e.postal_code == null ? void 0 : e.postal_code,
street: e.street == null ? void 0 : e.street,
unit: e.unit == null ? void 0 : e.unit
};
}
function Te(e) {
return Mi(e, !1);
}
function Mi(e, i = !1) {
return e == null ? e : {
cross_street: e.crossStreet,
number: e.number,
postal_code: e.postalCode,
street: e.street,
unit: e.unit
};
}
function Uu(e) {
return !0;
}
function Ne(e) {
return Li(e);
}
function Li(e, i) {
return e == null ? e : {
countryCode: e.country_code == null ? void 0 : e.country_code,
countryText: e.country_text == null ? void 0 : e.country_text,
stateCode: e.state_code == null ? void 0 : e.state_code,
stateText: e.state_text == null ? void 0 : e.state_text
};
}
function we(e) {
return Ii(e, !1);
}
function Ii(e, i = !1) {
return e == null ? e : {
country_code: e.countryCode,
country_text: e.countryText,
state_code: e.stateCode,
state_text: e.stateText
};
}
function Ku(e) {
return !0;
}
function Ei(e) {
return Ai(e);
}
function Ai(e, i) {
return e == null ? e : {
iso31661: e["iso_3166-1"] == null ? void 0 : e["iso_3166-1"],
country: e.country == null ? void 0 : e.country,
iso31662: e["iso_3166-2"] == null ? void 0 : e["iso_3166-2"],
state: e.state == null ? void 0 : e.state
};
}
function Gi(e) {
return Bi(e, !1);
}
function Bi(e, i = !1) {
return e == null ? e : {
"iso_3166-1": e.iso31661,
country: e.country,
"iso_3166-2": e.iso31662,
state: e.state
};
}
const Qu = {
Include: "include",
Exclude: "exclude"
}, $u = {
ShapeAttributesSpeed: "shape_attributes.speed",
ShapeAttributesSpeedLimit: "shape_attributes.speed_limit",
ShapeAttributesTime: "shape_attributes.time",
ShapeAttributesLength: "shape_attributes.length"
};
function Zu(e) {
return !0;
}
function C(e) {
return Pi(e);
}
function Pi(e, i) {
return e == null ? e : {
action: e.action == null ? void 0 : e.action,
attributes: e.attributes == null ? void 0 : e.attributes
};
}
function F(e) {
return Vi(e, !1);
}
function Vi(e, i = !1) {
return e == null ? e : {
action: e.action,
attributes: e.attributes
};
}
function Xu(e) {
return !0;
}
function v(e) {
return Hi(e);
}
function Hi(e, i) {
return e == null ? e : {
maneuverPenalty: e.maneuver_penalty == null ? void 0 : e.maneuver_penalty,
gateCost: e.gate_cost == null ? void 0 : e.gate_cost,
gatePenalty: e.gate_penalty == null ? void 0 : e.gate_penalty,
countryCrossingCost: e.country_crossing_cost == null ? void 0 : e.country_crossing_cost,
countryCrossingPenalty: e.country_crossing_penalty == null ? void 0 : e.country_crossing_penalty,
servicePenalty: e.service_penalty == null ? void 0 : e.service_penalty,
serviceFactor: e.service_factor == null ? void 0 : e.service_factor,
useLivingStreets: e.use_living_streets == null ? void 0 : e.use_living_streets,
useFerry: e.use_ferry == null ? void 0 : e.use_ferry,
ignoreRestrictions: e.ignore_restrictions == null ? void 0 : e.ignore_restrictions,
ignoreNonVehicularRestrictions: e.ignore_non_vehicular_restrictions == null ? void 0 : e.ignore_non_vehicular_restrictions,
ignoreOneways: e.ignore_oneways == null ? void 0 : e.ignore_oneways,
height: e.height == null ? void 0 : e.height,
width: e.width == null ? void 0 : e.width,
tollBoothCost: e.toll_booth_cost == null ? void 0 : e.toll_booth_cost,
tollBoothPenalty: e.toll_booth_penalty == null ? void 0 : e.toll_booth_penalty,
ferryCost: e.ferry_cost == null ? void 0 : e.ferry_cost,
useHighways: e.use_highways == null ? void 0 : e.use_highways,
useTolls: e.use_tolls == null ? void 0 : e.use_tolls,
useTracks: e.use_tracks == null ? void 0 : e.use_tracks,
topSpeed: e.top_speed == null ? void 0 : e.top_speed,
shortest: e.shortest == null ? void 0 : e.shortest,
ignoreClosures: e.ignore_closures == null ? void 0 : e.ignore_closures,
includeHov2: e.include_hov2 == null ? void 0 : e.include_hov2,
includeHov3: e.include_hov3 == null ? void 0 : e.include_hov3,
includeHot: e.include_hot == null ? void 0 : e.include_hot,
alleyFactor: e.alley_factor == null ? void 0 : e.alley_factor
};
}
function k(e) {
return Wi(e, !1);
}
function Wi(e, i = !1) {
return e == null ? e : {
maneuver_penalty: e.maneuverPenalty,
gate_cost: e.gateCost,
gate_penalty: e.gatePenalty,
country_crossing_cost: e.countryCrossingCost,
country_crossing_penalty: e.countryCrossingPenalty,
service_penalty: e.servicePenalty,
service_factor: e.serviceFactor,
use_living_streets: e.useLivingStreets,
use_ferry: e.useFerry,
ignore_restrictions: e.ignoreRestrictions,
ignore_non_vehicular_restrictions: e.ignoreNonVehicularRestrictions,
ignore_oneways: e.ignoreOneways,
height: e.height,
width: e.width,
toll_booth_cost: e.tollBoothCost,
toll_booth_penalty: e.tollBoothPenalty,
ferry_cost: e.ferryCost,
use_highways: e.useHighways,
use_tolls: e.useTolls,
use_tracks: e.useTracks,
top_speed: e.topSpeed,
shortest: e.shortest,
ignore_closures: e.ignoreClosures,
include_hov2: e.includeHov2,
include_hov3: e.includeHov3,
include_hot: e.includeHot,
alley_factor: e.alleyFactor
};
}
function Yu(e) {
return !0;
}
function qu(e) {
return zi(e);
}
function zi(e, i) {
return e == null ? e : {
maneuverPenalty: e.maneuver_penalty == null ? void 0 : e.maneuver_penalty,
gateCost: e.gate_cost == null ? void 0 : e.gate_cost,
gatePenalty: e.gate_penalty == null ? void 0 : e.gate_penalty,
countryCrossingCost: e.country_crossing_cost == null ? void 0 : e.country_crossing_cost,
countryCrossingPenalty: e.country_crossing_penalty == null ? void 0 : e.country_crossing_penalty,
servicePenalty: e.service_penalty == null ? void 0 : e.service_penalty,
serviceFactor: e.service_factor == null ? void 0 : e.service_factor,
useLivingStreets: e.use_living_streets == null ? void 0 : e.use_living_streets,
useFerry: e.use_ferry == null ? void 0 : e.use_ferry,
ignoreRestrictions: e.ignore_restrictions == null ? void 0 : e.ignore_restrictions,
ignoreNonVehicularRestrictions: e.ignore_non_vehicular_restrictions == null ? void 0 : e.ignore_non_vehicular_restrictions,
ignoreOneways: e.ignore_oneways == null ? void 0 : e.ignore_oneways
};
}
function ju(e) {
return Ui(e, !1);
}
function Ui(e, i = !1) {
return e == null ? e : {
maneuver_penalty: e.maneuverPenalty,
gate_cost: e.gateCost,
gate_penalty: e.gatePenalty,
country_crossing_cost: e.countryCrossingCost,
country_crossing_penalty: e.countryCrossingPenalty,
service_penalty: e.servicePenalty,
service_factor: e.serviceFactor,
use_living_streets: e.useLivingStreets,
use_ferry: e.useFerry,
ignore_restrictions: e.ignoreRestrictions,
ignore_non_vehicular_restrictions: e.ignoreNonVehicularRestrictions,
ignore_oneways: e.ignoreOneways
};
}
function ed(e) {
return !0;
}
function Ki(e) {
return Qi(e);
}
function Qi(e, i) {
return e == null ? e : {
maneuverPenalty: e.maneuver_penalty == null ? void 0 : e.maneuver_penalty,
gateCost: e.gate_cost == null ? void 0 : e.gate_cost,
gatePenalty: e.gate_penalty == null ? void 0 : e.gate_penalty,
countryCrossingCost: e.country_crossing_cost == null ? void 0 : e.country_crossing_cost,
countryCrossingPenalty: e.country_crossing_penalty == null ? void 0 : e.country_crossing_penalty,
servicePenalty: e.service_penalty == null ? void 0 : e.service_penalty,
serviceFactor: e.service_factor == null ? void 0 : e.service_factor,
useLivingStreets: e.use_living_streets == null ? void 0 : e.use_living_streets,
useFerry: e.use_ferry == null ? void 0 : e.use_ferry,
ignoreRestrictions: e.ignore_restrictions == null ? void 0 : e.ignore_restrictions,
ignoreNonVehicularRestrictions: e.ignore_non_vehicular_restrictions == null ? void 0 : e.ignore_non_vehicular_restrictions,
ignoreOneways: e.ignore_oneways == null ? void 0 : e.ignore_oneways,
height: e.height == null ? void 0 : e.height,
width: e.width == null ? void 0 : e.width,
tollBoothCost: e.toll_booth_cost == null ? void 0 : e.toll_booth_cost,
tollBoothPenalty: e.toll_booth_penalty == null ? void 0 : e.toll_booth_penalty,
ferryCost: e.ferry_cost == null ? void 0 : e.ferry_cost,
useHighways: e.use_highways == null ? void 0 : e.use_highways,
useTolls: e.use_tolls == null ? void 0 : e.use_tolls,
useTracks: e.use_tracks == null ? void 0 : e.use_tracks,
topSpeed: e.top_speed == null ? void 0 : e.top_speed,
shortest: e.shortest == null ? void 0 : e.shortest,
ignoreClosures: e.ignore_closures == null ? void 0 : e.ignore_closures,
includeHov2: e.include_hov2 == null ? void 0 : e.include_hov2,
includeHov3: e.include_hov3 == null ? void 0 : e.include_hov3,
includeHot: e.include_hot == null ? void 0 : e.include_hot,
alleyFactor: e.alley_factor == null ? void 0 : e.alley_factor,
usePrimary: e.use_primary == null ? void 0 : e.use_primary,
useHills: e.use_hills == null ? void 0 : e.use_hills
};
}
function $i(e) {
return Zi(e, !1);
}
function Zi(e, i = !1) {
return e == null ? e : {
maneuver_penalty: e.maneuverPenalty,
gate_cost: e.gateCost,
gate_penalty: e.gatePenalty,
country_crossing_cost: e.countryCrossingCost,
country_crossing_penalty: e.countryCrossingPenalty,
service_penalty: e.servicePenalty,
service_factor: e.serviceFactor,
use_living_streets: e.useLivingStreets,
use_ferry: e.useFerry,
ignore_restrictions: e.ignoreRestrictions,
ignore_non_vehicular_restrictions: e.ignoreNonVehicularRestrictions,
ignore_oneways: e.ignoreOneways,
height: e.height,
width: e.width,
toll_booth_cost: e.tollBoothCost,
toll_booth_penalty: e.tollBoothPenalty,
ferry_cost: e.ferryCost,
use_highways: e.useHighways,
use_tolls: e.useTolls,
use_tracks: e.useTracks,
top_speed: e.topSpeed,
shortest: e.shortest,
ignore_closures: e.ignoreClosures,
include_hov2: e.includeHov2,
include_hov3: e.includeHov3,
include_hot: e.includeHot,
alley_factor: e.alleyFactor,
use_primary: e.usePrimary,
use_hills: e.useHills
};
}
const D = {
Foot: "foot",
Blind: "blind",
Wheelchair: "wheelchair"
};
function id(e) {
for (const i in D)
if (Object.prototype.hasOwnProperty.call(D, i) && D[i] === e)
return !0;
return !1;
}
function Xi(e) {
return Yi(e);
}
function Yi(e, i) {
return e;
}
function nd(e) {
return e;
}
function td(e, i) {
return e;
}
function rd(e) {
return !0;
}
function qi(e) {
return ji(e);
}
function ji(e, i) {
return e == null ? e : {
walkingSpeed: e.walking_speed == null ? void 0 : e.walking_speed,
walkwayFactor: e.walkway_factor == null ? void 0 : e.walkway_factor,
sidewalkFactor: e.sidewalk_factor == null ? void 0 : e.sidewalk_factor,
alleyFactor: e.alley_factor == null ? void 0 : e.alley_factor,
drivewayFactor: e.driveway_factor == null ? void 0 : e.driveway_factor,
stepPenalty: e.step_penalty == null ? void 0 : e.step_penalty,
useFerry: e.use_ferry == null ? void 0 : e.use_ferry,
useLivingStreets: e.use_living_streets == null ? void 0 : e.use_living_streets,
useTracks: e.use_tracks == null ? void 0 : e.use_tracks,
useHills: e.use_hills == null ? void 0 : e.use_hills,
useLit: e.use_lit == null ? void 0 : e.use_lit,
servicePenalty: e.service_penalty == null ? void 0 : e.service_penalty,
serviceFactor: e.service_factor == null ? void 0 : e.service_factor,
maxHikingDifficulty: e.max_hiking_difficulty == null ? void 0 : e.max_hiking_difficulty,
bssRentCost: e.bss_rent_cost == null ? void 0 : e.bss_rent_cost,
bssRentPenalty: e.bss_rent_penalty == null ? void 0 : e.bss_rent_penalty,
type: e.type == null ? void 0 : Xi(e.type)
};
}
function en(e) {
return nn(e, !1);
}
function nn(e, i = !1) {
return e == null ? e : {
walking_speed: e.walkingSpeed,
walkway_factor: e.walkwayFactor,
sidewalk_factor: e.sidewalkFactor,
alley_factor: e.alleyFactor,
driveway_factor: e.drivewayFactor,
step_penalty: e.stepPenalty,
use_ferry: e.useFerry,
use_living_streets: e.useLivingStreets,
use_tracks: e.useTracks,
use_hills: e.useHills,
use_lit: e.useLit,
service_penalty: e.servicePenalty,
service_factor: e.serviceFactor,
max_hiking_difficulty: e.maxHikingDifficulty,
bss_rent_cost: e.bssRentCost,
bss_rent_penalty: e.bssRentPenalty,
type: e.type
};
}
function od(e) {
return !0;
}
function tn(e) {
return rn(e);
}
function rn(e, i) {
return e == null ? e : {
maneuverPenalty: e.maneuver_penalty == null ? void 0 : e.maneuver_penalty,
gateCost: e.gate_cost == null ? void 0 : e.gate_cost,
gatePenalty: e.gate_penalty == null ? void 0 : e.gate_penalty,
countryCrossingCost: e.country_crossing_cost == null ? void 0 : e.country_crossing_cost,
countryCrossingPenalty: e.country_crossing_penalty == null ? void 0 : e.country_crossing_penalty,
servicePenalty: e.service_penalty == null ? void 0 : e.service_penalty,
serviceFactor: e.service_factor == null ? void 0 : e.service_factor,
useLivingStreets: e.use_living_streets == null ? void 0 : e.use_living_streets,
useFerry: e.use_ferry == null ? void 0 : e.use_ferry,
ignoreRestrictions: e.ignore_restrictions == null ? void 0 : e.ignore_restrictions,
ignoreNonVehicularRestrictions: e.ignore_non_vehicular_restrictions == null ? void 0 : e.ignore_non_vehicular_restrictions,
ignoreOneways: e.ignore_oneways == null ? void 0 : e.ignore_oneways,
height: e.height == null ? void 0 : e.height,
width: e.width == null ? void 0 : e.width,
tollBoothCost: e.toll_booth_cost == null ? void 0 : e.toll_booth_cost,
tollBoothPenalty: e.toll_booth_penalty == null ? void 0 : e.toll_booth_penalty,
ferryCost: e.ferry_cost == null ? void 0 : e.ferry_cost,
useHighways: e.use_highways == null ? void 0 : e.use_highways,
useTolls: e.use_tolls == null ? void 0 : e.use_tolls,
useTracks: e.use_tracks == null ? void 0 : e.use_tracks,
topSpeed: e.top_speed == null ? void 0 : e.top_speed,
shortest: e.shortest == null ? void 0 : e.shortest,
ignoreClosures: e.ignore_closures == null ? void 0 : e.ignore_closures,
includeHov2: e.include_hov2 == null ? void 0 : e.include_hov2,
includeHov3: e.include_hov3 == null ? void 0 : e.include_hov3,
includeHot: e.include_hot == null ? void 0 : e.include_hot,
alleyFactor: e.alley_factor == null ? void 0 : e.alley_factor,
length: e.length == null ? void 0 : e.length,
weight: e.weight == null ? void 0 : e.weight,
axleLoad: e.axle_load == null ? void 0 : e.axle_load,
hazmat: e.hazmat == null ? void 0 : e.hazmat
};
}
function on(e) {
return cn(e, !1);
}
function cn(e, i = !1) {
return e == null ? e : {
maneuver_penalty: e.maneuverPenalty,
gate_cost: e.gateCost,
gate_penalty: e.gatePenalty,
country_crossing_cost: e.countryCrossingCost,
country_crossing_penalty: e.countryCrossingPenalty,
service_penalty: e.servicePenalty,
service_factor: e.serviceFactor,
use_living_streets: e.useLivingStreets,
use_ferry: e.useFerry,
ignore_restrictions: e.ignoreRestrictions,
ignore_non_vehicular_restrictions: e.ignoreNonVehicularRestrictions,
ignore_oneways: e.ignoreOneways,
height: e.height,
width: e.width,
toll_booth_cost: e.tollBoothCost,
toll_booth_penalty: e.tollBoothPenalty,
ferry_cost: e.ferryCost,
use_highways: e.useHighways,
use_tolls: e.useTolls,
use_tracks: e.useTracks,
top_speed: e.topSpeed,
shortest: e.shortest,
ignore_closures: e.ignoreClosures,
include_hov2: e.includeHov2,
include_hov3: e.includeHov3,
include_hot: e.includeHot,
alley_factor: e.alleyFactor,
length: e.length,
weight: e.weight,
axle_load: e.axleLoad,
hazmat: e.hazmat
};
}
const cd = {
Road: "Road",
Hybrid: "Hybrid",
Cross: "Cross",
Mountain: "Mountain"
};
function ad(e) {
return !0;
}
function an(e) {
return un(e);
}
function un(e, i) {
return e == null ? e : {
maneuverPenalty: e.maneuver_penalty == null ? void 0 : e.maneuver_penalty,
gateCost: e.gate_cost == null ? void 0 : e.gate_cost,
gatePenalty: e.gate_penalty == null ? void 0 : e.gate_penalty,
countryCrossingCost: e.country_crossing_cost == null ? void 0 : e.country_crossing_cost,
countryCrossingPenalty: e.country_crossing_penalty == null ? void 0 : e.country_crossing_penalty,
servicePenalty: e.service_penalty == null ? void 0 : e.service_penalty,
serviceFactor: e.service_factor == null ? void 0 : e.service_factor,
useLivingStreets: e.use_living_streets == null ? void 0 : e.use_living_streets,
useFerry: e.use_ferry == null ? void 0 : e.use_ferry,
ignoreRestrictions: e.ignore_restrictions == null ? void 0 : e.ignore_restrictions,
ignoreNonVehicularRestrictions: e.ignore_non_vehicular_restrictions == null ? void 0 : e.ignore_non_vehicular_restrictions,
ignoreOneways: e.ignore_oneways == null ? void 0 : e.ignore_oneways,
bicycleType: e.bicycle_type == null ? void 0 : e.bicycle_type,
cyclingSpeed: e.cycling_speed == null ? void 0 : e.cycling_speed,
useRoads: e.use_roads == null ? void 0 : e.use_roads,
useHills: e.use_hills == null ? void 0 : e.use_hills,
avoidBadSurfaces: e.avoid_bad_surfaces == null ? void 0 : e.avoid_bad_surfaces,
bssReturnCost: e.bss_return_cost == null ? void 0 : e.bss_return_cost,
bssReturnPenalty: e.bss_return_penalty == null ? void 0 : e.bss_return_penalty
};
}
function dn(e) {
return ln(e, !1);
}
function ln(e, i = !1) {
return e == null ? e : {
maneuver_penalty: e.maneuverPenalty,
gate_cost: e.gateCost,
gate_penalty: e.gatePenalty,
country_crossing_cost: e.countryCrossingCost,
country_crossing_penalty: e.countryCrossingPenalty,
service_penalty: e.servicePenalty,
service_factor: e.serviceFactor,
use_living_streets: e.useLivingStreets,
use_ferry: e.useFerry,
ignore_restrictions: e.ignoreRestrictions,
ignore_non_vehicular_restrictions: e.ignoreNonVehicularRestrictions,
ignore_oneways: e.ignoreOneways,
bicycle_type: e.bicycleType,
cycling_speed: e.cyclingSpeed,
use_roads: e.useRoads,
use_hills: e.useHills,
avoid_bad_surfaces: e.avoidBadSurfaces,
bss_return_cost: e.bssReturnCost,
bss_return_penalty: e.bssReturnPenalty
};
}
const ud = {
LowSpeedVehicle: "low_speed_vehicle",
GolfCart: "golf_cart"
};
function dd(e) {
return !0;
}
function sn(e) {
return fn(e);
}
function fn(e, i) {
return e == null ? e : {
maneuverPenalty: e.maneuver_penalty == null ? void 0 : e.maneuver_penalty,
gateCost: e.gate_cost == null ? void 0 : e.gate_cost,
gatePenalty: e.gate_penalty == null ? void 0 : e.gate_penalty,
countryCrossingCost: e.country_crossing_cost == null ? void 0 : e.country_crossing_cost,
countryCrossingPenalty: e.country_crossing_penalty == null ? void 0 : e.country_crossing_penalty,
servicePenalty: e.service_penalty == null ? void 0 : e.service_penalty,
serviceFactor: e.service_factor == null ? void 0 : e.service_factor,
useLivingStreets: e.use_living_streets == null ? void 0 : e.use_living_streets,
useFerry: e.use_ferry == null ? void 0 : e.use_ferry,
ignoreRestrictions: e.ignore_restrictions == null ? void 0 : e.ignore_restrictions,
ignoreNonVehicularRestrictions: e.ignore_non_vehicular_restrictions == null ? void 0 : e.ignore_non_vehicular_restrictions,
ignoreOneways: e.ignore_oneways == null ? void 0 : e.ignore_oneways,
vehicleType: e.vehicle_type == null ? void 0 : e.vehicle_type,
topSpeed: e.top_speed == null ? void 0 : e.top_speed,
maxAllowedSpeedLimit: e.max_allowed_speed_limit == null ? void 0 : e.max_allowed_speed_limit
};
}
function pn(e) {
return gn(e, !1);
}
function gn(e, i = !1) {
return e == null ? e : {
maneuver_penalty: e.maneuverPenalty,
gate_cost: e.gateCost,
gate_penalty: e.gatePenalty,
country_crossing_cost: e.countryCrossingCost,
country_crossing_penalty: e.countryCrossingPenalty,
service_penalty: e.servicePenalty,
service_factor: e.serviceFactor,
use_living_streets: e.useLivingStreets,
use_ferry: e.useFerry,
ignore_restrictions: e.ignoreRestrictions,
ignore_non_vehicular_restrictions: e.ignoreNonVehicularRestrictions,
ignore_oneways: e.ignoreOneways,
vehicle_type: e.vehicleType,
top_speed: e.topSpeed,
max_allowed_speed_limit: e.maxAllowedSpeedLimit
};
}
function ld(e) {
return !0;
}
function yn(e) {
return mn(e);
}
function mn(e, i) {
return e == null ? e : {
maneuverPenalty: e.maneuver_penalty == null ? void 0 : e.maneuver_penalty,
gateCost: e.gate_cost == null ? void 0 : e.gate_cost,
gatePenalty: e.gate_penalty == null ? void 0 : e.gate_penalty,
countryCrossingCost: e.country_crossing_cost == null ? void 0 : e.country_crossing_cost,
countryCrossingPenalty: e.country_crossing_penalty == null ? void 0 : e.country_crossing_penalty,
servicePenalty: e.service_penalty == null ? void 0 : e.service_penalty,
serviceFactor: e.service_factor == null ? void 0 : e.service_factor,
useLivingStreets: e.use_living_streets == null ? void 0 : e.use_living_streets,
useFerry: e.use_ferry == null ? void 0 : e.use_ferry,
ignoreRestrictions: e.ignore_restrictions == null ? void 0 : e.ignore_restrictions,
ignoreNonVehicularRestrictions: e.ignore_non_vehicular_restrictions == null ? void 0 : e.ignore_non_vehicular_restrictions,
ignoreOneways: e.ignore_oneways == null ? void 0 : e.ignore_oneways,
height: e.height == null ? void 0 : e.height,
width: e.width == null ? void 0 : e.width,
tollBoothCost: e.toll_booth_cost == null ? void 0 : e.toll_booth_cost,
tollBoothPenalty: e.toll_booth_penalty == null ? void 0 : e.toll_booth_penalty,
ferryCost: e.ferry_cost == null ? void 0 : e.ferry_cost,
useHighways: e.use_highways == null ? void 0 : e.use_highways,
useTolls: e.use_tolls == null ? void 0 : e.use_tolls,
useTracks: e.use_tracks == null ? void 0 : e.use_tracks,
topSpeed: e.top_speed == null ? void 0 : e.top_speed,
shortest: e.shortest == null ? void 0 : e.shortest,
ignoreClosures: e.ignore_closures == null ? void 0 : e.ignore_closures,
includeHov2: e.include_hov2 == null ? void 0 : e.include_hov2,
includeHov3: e.include_hov3 == null ? void 0 : e.include_hov3,
includeHot: e.include_hot == null ? void 0 : e.include_hot,
alleyFactor: e.alley_factor == null ? void 0 : e.alley_factor,
useTrails: e.use_trails == null ? void 0 : e.use_trails
};
}
function _n(e) {
return hn(e, !1);
}
function hn(e, i = !1) {
return e == null ? e : {
maneuver_penalty: e.maneuverPenalty,
gate_cost: e.gateCost,
gate_penalty: e.gatePenalty,
country_crossing_cost: e.countryCrossingCost,
country_crossing_penalty: e.countryCrossingPenalty,
service_penalty: e.servicePenalty,
service_factor: e.serviceFactor,
use_living_streets: e.useLivingStreets,
use_ferry: e.useFerry,
ignore_restrictions: e.ignoreRestrictions,
ignore_non_vehicular_restrictions: e.ignoreNonVehicularRestrictions,
ignore_oneways: e.ignoreOneways,
height: e.height,
width: e.width,
toll_booth_cost: e.tollBoothCost,
toll_booth_penalty: e.tollBoothPenalty,
ferry_cost: e.ferryCost,
use_highways: e.useHighways,
use_tolls: e.useTolls,
use_tracks: e.useTracks,
top_speed: e.topSpeed,
shortest: e.shortest,
ignore_closures: e.ignoreClosures,
include_hov2: e.includeHov2,
include_hov3: e.includeHov3,
include_hot: e.includeHot,
alley_factor: e.alleyFactor,
use_trails: e.useTrails
};
}
function sd(e) {
return !0;
}
function g(e) {
return On(e);
}
function On(e, i) {
return e == null ? e : {
auto: e.auto == null ? void 0 : v(e.auto),
bus: e.bus == null ? void 0 : v(e.bus),
taxi: e.taxi == null ? void 0 : v(e.taxi),
truck: e.truck == null ? void 0 : tn(e.truck),
bicycle: e.bicycle == null ? void 0 : an(e.bicycle),
motorScooter: e.motor_scooter == null ? void 0 : Ki(e.motor_scooter),
motorcycle: e.motorcycle == null ? void 0 : yn(e.motorcycle),
pedestrian: e.pedestrian == null ? void 0 : qi(e.pedestrian),
lowSpeedVehicle: e.low_speed_vehicle == null ? void 0 : sn(e.low_speed_vehicle)
};
}
function y(e) {
return bn(e, !1);
}
function bn(e, i = !1) {
return e == null ? e : {
auto: k(e.auto),
bus: k(e.bus),
taxi: k(e.taxi),
truck: on(e.truck),
bicycle: dn(e.bicycle),
motor_scooter: $i(e.motorScooter),
motorcycle: _n(e.motorcycle),
pedestrian: en(e.pedestrian),
low_speed_vehicle: pn(
e.lowSpeedVehicle
)
};
}
const M = {
Auto: "auto",
Bus: "bus",
Taxi: "taxi",
Truck: "truck",
Bicycle: "bicycle",
Bikeshare: "bikeshare",
MotorScooter: "motor_scooter",
Motorcycle: "motorcycle",
Pedestrian: "pedestrian",
LowSpeedVehicle: "low_speed_vehicle"
};
function fd(e) {
for (const i in M)
if (Object.prototype.hasOwnProperty.call(M, i) && M[i] === e)
return !0;
return !1;
}
function ie(e) {
return Sn(e);
}
function Sn(e, i) {
return e;
}
function pd(e) {
return e;
}
function gd(e, i) {
return e;
}
const L = {
Km: "km",
Mi: "mi"
};
function yd(e) {
for (const i in L)
if (Object.prototype.hasOwnProperty.call(L, i) && L[i] === e)
return !0;
return !1;
}
function m(e) {
return Tn(e);
}
function Tn(e, i) {
return e;
}
function md(e) {
return e;
}
function _d(e, i) {
return e;
}
const I = {
BgBg: "bg-BG",
CaEs: "ca-ES",
CsCz: "cs-CZ",
DaDk: "da-DK",
DeDe: "de-DE",
ElGr: "el-GR",
EnGb: "en-GB",
EnUsXPirate: "en-US-x-pirate",
EnUs: "en-US",
EsEs: "es-ES",
EtEe: "et-EE",
FiFi: "fi-FI",
FrFr: "fr-FR",
HiIn: "hi-IN",
HuHu: "hu-HU",
ItIt: "it-IT",
JaJp: "ja-JP",
NbNo: "nb-NO",
NlNl: "nl-NL",
PlPl: "pl-PL",
PtBr: "pt-BR",
PtPt: "pt-PT",
RoRo: "ro-RO",
RuRu: "ru-RU",
SkSk: "sk-SK",
SlSi: "sl-SI",
SvSe: "sv-SE",
TrTr: "tr-TR",
UkUa: "uk-UA"
};
function hd(e) {
for (const i in I)
if (Object.prototype.hasOwnProperty.call(I, i) && I[i] === e)
return !0;
return !1;
}
function p(e) {
return Nn(e);
}
function Nn(e, i) {
return e;
}
function Od(e) {
return e;
}
function bd(e, i) {
return e;
}
const Sd = {
Break: "break",
Through: "through",
Via: "via",
BreakThrough: "break_through"
};
function Td(e) {
return !(!("lat" in e) || e.lat === void 0 || !("lon" in e) || e.lon === void 0);
}
function ne(e) {
return wn(e);
}
function wn(e, i) {
return e == null ? e : {
lat: e.lat,
lon: e.lon,
type: e.type == null ? void 0 : e.type,
time: e.time == null ? void 0 : e.time
};
}
function te(e) {
return Rn(e, !1);
}
function Rn(e, i = !1) {
return e == null ? e : {
lat: e.lat,
lon: e.lon,
type: e.type,
time: e.time
};
}
const Nd = {
None: "none",
Maneuvers: "maneuvers",
Instructions: "instructions"
}, wd = {
EdgeWalk: "edge_walk",
MapSnap: "map_snap",
WalkOrSnap: "walk_or_snap"
};
function Rd(e) {
return !(!("costing" in e) || e.costing === void 0);
}
function Jd(e) {
return Jn(e);
}
function Jn(e, i) {
return e == null ? e : {
units: e.units == null ? void 0 : m(e.units),
language: e.language == null ? void 0 : p(e.language),
directionsType: e.directions_type == null ? void 0 : e.directions_type,
id: e.id == null ? void 0 : e.id,
shape: e.shape == null ? void 0 : e.shape.map(ne),
encodedPolyline: e.encoded_polyline == null ? void 0 : e.encoded_polyline,
costing: ie(e.costing),
costingOptions: e.costing_options == null ? void 0 : g(e.costing_options),
shapeMatch: e.shape_match == null ? void 0 : e.shape_match
};
}
function xd(e) {
return xn(e, !1);
}
function xn(e, i = !1) {
return e == null ? e : {
units: e.units,
language: e.language,
directions_type: e.directionsType,
id: e.id,
shape: e.shape == null ? void 0 : e.shape.map(te),
encoded_polyline: e.encodedPolyline,
costing: e.costing,
costing_options: y(e.costingOptions),
shape_match: e.shapeMatch
};
}
function Cd(e) {
return !0;
}
function Cn(e) {
return Fn(e);
}
function Fn(e, i) {
return e == null ? e : {
mountain: e.mountain == null ? void 0 : e.mountain,
local: e.local == null ? void 0 : e.local,
regional: e.regional == null ? void 0 : e.regional,
national: e.national == null ? void 0 : e.national
};
}
function vn(e) {
return kn(e, !1);
}
function kn(e, i = !1) {
return e == null ? e : {
mountain: e.mountain,
local: e.local,
regional: e.regional,
national: e.national
};
}
const E = {
Openstreetmap: "openstreetmap",
Openaddresses: "openaddresses",
Whosonfirst: "whosonfirst",
Geonames: "geonames",
Foursquare: "foursquare"
};
function Fd(e) {
for (const i in E)
if (Object.prototype.hasOwnProperty.call(E, i) && E[i] === e)
return !0;
return !1;
}
function Re(e) {
return Dn(e);
}
function Dn(e, i) {
return e;
}
function Je(e) {
return e;
}
function vd(e, i) {
return e;
}
const A = {
Venue: "venue",
Address: "address",
Street: "street",
Country: "country",
Macroregion: "macroregion",
Region: "region",
Macrocounty: "macrocounty",
County: "county",
Locality: "locality",
Localadmin: "localadmin",
Borough: "borough",
Neighbourhood: "neighbourhood",
Postalcode: "postalcode",
Coarse: "coarse",
Dependency: "dependency",
Macrohood: "macrohood",
Marinearea: "marinearea",
Disputed: "disputed",
Empire: "empire",
Continent: "continent",
Ocean: "ocean"
};
function kd(e) {
for (const i in A)
if (Object.prototype.hasOwnProperty.call(A, i) && A[i] === e)
return !0;
return !1;
}
function xe(e) {
return Mn(e);
}
function Mn(e, i) {
return e;
}
function Ce(e) {
return e;
}
function Dd(e, i) {
return e;
}
function Fe(e) {
return "text" in e;
}
function Md(e) {
return ve(e);
}
function ve(e, i) {
return e == null ? e : {
text: e.text == null ? void 0 : e.text,
focusPointLat: e["focus.point.lat"] == null ? void 0 : e["focus.point.lat"],
focusPointLon: e["focus.point.lon"] == null ? void 0 : e["focus.point.lon"],
boundaryRectMinLat: e["boundary.rect.min_lat"] == null ? void 0 : e["boundary.rect.min_lat"],
boundaryRectMaxLat: e["boundary.rect.max_lat"] == null ? void 0 : e["boundary.rect.max_lat"],
boundaryRectMinLon: e["boundary.rect.min_lon"] == null ? void 0 : e["boundary.rect.min_lon"],
boundaryRectMaxLon: e["boundary.rect.max_lon"] == null ? void 0 : e["boundary.rect.max_lon"],
boundaryCircleLat: e["boundary.circle.lat"] == null ? void 0 : e["boundary.circle.lat"],
boundaryCircleLon: e["boundary.circle.lon"] == null ? void 0 : e["boundary.circle.lon"],
boundaryCircleRadius: e["boundary.circle.radius"] == null ? void 0 : e["boundary.circle.radius"],
boundaryCountry: e["boundary.country"] == null ? void 0 : e["boundary.country"],
boundaryGid: e["boundary.gid"] == null ? void 0 : e["boundary.gid"],
layers: e.layers == null ? void 0 : e.layers.map(xe),
sources: e.sources == null ? void 0 : e.sources.map(Re),
size: e.size == null ? void 0 : e.size,
lang: e.lang == null ? void 0 : e.lang
};
}
function Ln(e) {
return In(e, !1);
}
function In(e, i = !1) {
return e == null ? e : {
text: e.text,
"focus.point.lat": e.focusPointLat,
"focus.point.lon": e.focusPointLon,
"boundary.rect.min_lat": e.boundaryRectMinLat,
"boundary.rect.max_lat": e.boundaryRectMaxLat,
"boundary.rect.min_lon": e.boundaryRectMinLon,
"boundary.rect.max_lon": e.boundaryRectMaxLon,
"boundary.circle.lat": e.boundaryCircleLat,
"boundary.circle.lon": e.boundaryCircleLon,
"boundary.circle.radius": e.boundaryCircleRadius,
"boundary.country": e.boundaryCountry,
"boundary.gid": e.boundaryGid,
layers: e.layers == null ? void 0 : e.layers.map(Ce),
sources: e.sources == null ? void 0 : e.sources.map(Je),
size: e.size,
lang: e.lang
};
}
function Ld(e) {
return !0;
}
function Id(e) {
return ke(e);
}
function ke(e, i) {
return e == null ? e : {
address: e.address == null ? void 0 : e.address,
neighbourhood: e.neighbourhood == null ? void 0 : e.neighbourhood,
borough: e.borough == null ? void 0 : e.borough,
locality: e.locality == null ? void 0 : e.locality,
county: e.county == null ? void 0 : e.county,
region: e.region == null ? void 0 : e.region,
postalcode: e.postalcode == null ? void 0 : e.postalcode,
country: e.country == null ? void 0 : e.country,
focusPointLat: e["focus.point.lat"] == null ? void 0 : e["focus.point.lat"],
focusPointLon: e["focus.point.lon"] == null ? void 0 : e["focus.point.lon"],
boundaryRectMinLat: e["boundary.rect.min_lat"] == null ? void 0 : e["boundary.rect.min_lat"],
boundaryRectMaxLat: e["boundary.rect.max_lat"] == null ? void 0 : e["boundary.rect.max_lat"],
boundaryRectMinLon: e["boundary.rect.min_lon"] == null ? void 0 : e["boundary.rect.min_lon"],
boundaryRectMaxLon: e["boundary.rect.max_lon"] == null ? void 0 : e["boundary.rect.max_lon"],
boundaryCircleLat: e["boundary.circle.lat"] == null ? void 0 : e["boundary.circle.lat"],
boundaryCircleLon: e["boundary.circle.lon"] == null ? void 0 : e["boundary.circle.lon"],
boundaryCircleRadius: e["boundary.circle.radius"] == null ? void 0 : e["boundary.circle.radius"],
boundaryCountry: e["boundary.country"] == null ? void 0 : e["boundary.country"],
boundaryGid: e["boundary.gid"] == null ? void 0 : e["boundary.gid"],
layers: e.layers == null ? void 0 : e.layers.map(xe),
sources: e.sources == null ? void 0 : e.sources.map(Re),
size: e.size == null ? void 0 : e.size,
lang: e.lang == null ? void 0 : e.lang
};
}
function En(e) {
return An(e, !1);
}
function An(e, i = !1) {
return e == null ? e : {
address: e.address,
neighbourhood: e.neighbourhood,
borough: e.borough,
locality: e.locality,
county: e.county,
region: e.region,
postalcode: e.postalcode,
country: e.country,
"focus.point.lat": e.focusPointLat,
"focus.point.lon": e.focusPointLon,
"boundary.rect.min_lat": e.boundaryRectMinLat,
"boundary.rect.max_lat": e.boundaryRectMaxLat,
"boundary.rect.min_lon": e.boundaryRectMinLon,
"boundary.rect.max_lon": e.boundaryRectMaxLon,
"boundary.circle.lat": e.boundaryCircleLat,
"boundary.circle.lon": e.boundaryCircleLon,
"boundary.circle.radius": e.boundaryCircleRadius,
"boundary.country": e.boundaryCountry,
"boundary.gid": e.boundaryGid,
layers: e.layers == null ? void 0 : e.layers.map(Ce),
sources: e.sources == null ? void 0 : e.sources.map(Je),
size: e.size,
lang: e.lang
};
}
function Gn(e) {
return Bn(e);
}
function Bn(e, i) {
return e == null || typeof e != "object" ? e : Fe(e) ? ve(e) : ke(e);
}
function Pn(e) {
return Vn(e, !1);
}
function Vn(e, i = !1) {
return e == null || typeof e != "object" ? e : Fe(e) ? Ln(e) : En(e);
}
const Ed = {
V1Search: "/v1/search",
V1SearchStructured: "/v1/search/structured"
};
function Ad(e) {
return !0;
}
function Gd(e) {
return Hn(e);
}
function Hn(e, i) {
return e == null ? e : {
endpoint: e.endpoint == null ? void 0 : e.endpoint,
query: e.query == null ? void 0 : Gn(e.query)
};
}
function Wn(e) {
return zn(e, !1);
}
function zn(e, i = !1) {
return e == null ? e : {
endpoint: e.endpoint,
query: Pn(e.query)
};
}
function Bd(e) {
return !0;
}
function Un(e) {
return Kn(e);
}
function Kn(e, i) {
return e == null ? e : {
attribution: e.attribution == null ? void 0 : e.attribution,
query: e.query == null ? void 0 : e.query,
warnings: e.warnings == null ? void 0 : e.warnings,
errors: e.errors == null ? void 0 : e.errors
};
}
function Qn(e) {
return $n(e, !1);
}
function $n(e, i = !1) {
return e == null ? e : {
attribution: e.attribution,
query: e.query,
warnings: e.warnings,
errors: e.errors
};
}
const Pd = {
Point: "Point",
MultiPoint: "MultiPoint",
LineString: "LineString",
MultiLineString: "MultiLineString",
Polygon: "Polygon",
MultiPolygon: "MultiPolygon"
};
function Vd(e) {
return !(!("type" in e) || e.type === void 0 || !("coordinates" in e) || e.coordinates === void 0);
}
function Zn(e) {
return Xn(e);
}
function Xn(e, i) {
return e == null ? e : {
type: e.type,
coordinates: e.coordinates
};
}
function Yn(e) {
return qn(e, !1);
}
function qn(e, i = !1) {
return e == null ? e : {
type: e.type,
coordinates: e.coordinates
};
}
function Hd(e) {
return !0;
}
function jn(e) {
return et(e);
}
function et(e, i) {
return e == null ? e : {
...e,
website: e.website == null ? void 0 : e.website,
wikipedia: e.wikipedia == null ? void 0 : e.wikipedia,
wikidata: e.wikidata == null ? void 0 : e.wikidata,
phone: e.phone == null ? void 0 : e.phone
};
}
function it(e) {
return nt(e, !1);
}
function nt(e, i = !1) {
return e == null ? e : {
...e,
website: e.website,
wikipedia: e.wikipedia,
wikidata: e.wikidata,
phone: e.phone
};
}
function Wd(e) {
return !0;
}
function tt(e) {
return rt(e);
}
funct