var ui = Object.defineProperty;
var ci = (i, e, t) => e in i ? ui(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
var tt = (i, e, t) => ci(i, typeof e != "symbol" ? e + "" : e, t);
import { forwardRef as di, useRef as ft, useEffect as it, useImperativeHandle as fi, createElement as mi } from "react";
function A() {
}
function gi(i, e) {
  for (const t in e) i[t] = e[t];
  return (
    /** @type {T & S} */
    i
  );
}
function Ot(i) {
  return i();
}
function mt() {
  return /* @__PURE__ */ Object.create(null);
}
function oe(i) {
  i.forEach(Ot);
}
function Ut(i) {
  return typeof i == "function";
}
function he(i, e) {
  return i != i ? e == e : i !== e || i && typeof i == "object" || typeof i == "function";
}
let Fe;
function K(i, e) {
  return i === e ? !0 : (Fe || (Fe = document.createElement("a")), Fe.href = e, i === Fe.href);
}
function hi(i) {
  return Object.keys(i).length === 0;
}
function bi(i, e, t, n) {
  if (i) {
    const r = It(i, e, t, n);
    return i[0](r);
  }
}
function It(i, e, t, n) {
  return i[1] && n ? gi(t.ctx.slice(), i[1](n(e))) : t.ctx;
}
function vi(i, e, t, n) {
  if (i[2] && n) {
    const r = i[2](n(t));
    if (e.dirty === void 0)
      return r;
    if (typeof r == "object") {
      const u = [], a = Math.max(e.dirty.length, r.length);
      for (let o = 0; o < a; o += 1)
        u[o] = e.dirty[o] | r[o];
      return u;
    }
    return e.dirty | r;
  }
  return e.dirty;
}
function Li(i, e, t, n, r, u) {
  if (r) {
    const a = It(e, t, n, u);
    i.p(a, r);
  }
}
function _i(i) {
  if (i.ctx.length > 32) {
    const e = [], t = i.ctx.length / 32;
    for (let n = 0; n < t; n++)
      e[n] = -1;
    return e;
  }
  return -1;
}
function gt(i) {
  return i ?? "";
}
function N(i, e) {
  i.appendChild(e);
}
function B(i, e, t) {
  i.insertBefore(e, t || null);
}
function O(i) {
  i.parentNode && i.parentNode.removeChild(i);
}
function W(i) {
  return document.createElement(i);
}
function ie(i) {
  return document.createElementNS("http://www.w3.org/2000/svg", i);
}
function ue(i) {
  return document.createTextNode(i);
}
function J() {
  return ue(" ");
}
function yi() {
  return ue("");
}
function V(i, e, t, n) {
  return i.addEventListener(e, t, n), () => i.removeEventListener(e, t, n);
}
function wi(i) {
  return function(e) {
    return e.preventDefault(), i.call(this, e);
  };
}
function l(i, e, t) {
  t == null ? i.removeAttribute(e) : i.getAttribute(e) !== t && i.setAttribute(e, t);
}
function Ei(i) {
  return Array.from(i.childNodes);
}
function We(i, e) {
  e = "" + e, i.data !== e && (i.data = /** @type {string} */
  e);
}
function ht(i, e) {
  i.value = e ?? "";
}
function le(i, e, t) {
  i.classList.toggle(e, !!t);
}
function Si(i, e, { bubbles: t = !1, cancelable: n = !1 } = {}) {
  return new CustomEvent(i, { detail: e, bubbles: t, cancelable: n });
}
let Re;
function Ce(i) {
  Re = i;
}
function At() {
  if (!Re) throw new Error("Function called outside component initialization");
  return Re;
}
function pi(i) {
  At().$$.on_destroy.push(i);
}
function Ti() {
  const i = At();
  return (e, t, { cancelable: n = !1 } = {}) => {
    const r = i.$$.callbacks[e];
    if (r) {
      const u = Si(
        /** @type {string} */
        e,
        t,
        { cancelable: n }
      );
      return r.slice().forEach((a) => {
        a.call(i, u);
      }), !u.defaultPrevented;
    }
    return !0;
  };
}
function bt(i, e) {
  const t = i.$$.callbacks[e.type];
  t && t.slice().forEach((n) => n.call(this, e));
}
const Ee = [], rt = [];
let Se = [];
const vt = [], Ni = /* @__PURE__ */ Promise.resolve();
let ot = !1;
function Mi() {
  ot || (ot = !0, Ni.then(Bt));
}
function st(i) {
  Se.push(i);
}
const nt = /* @__PURE__ */ new Set();
let we = 0;
function Bt() {
  if (we !== 0)
    return;
  const i = Re;
  do {
    try {
      for (; we < Ee.length; ) {
        const e = Ee[we];
        we++, Ce(e), ki(e.$$);
      }
    } catch (e) {
      throw Ee.length = 0, we = 0, e;
    }
    for (Ce(null), Ee.length = 0, we = 0; rt.length; ) rt.pop()();
    for (let e = 0; e < Se.length; e += 1) {
      const t = Se[e];
      nt.has(t) || (nt.add(t), t());
    }
    Se.length = 0;
  } while (Ee.length);
  for (; vt.length; )
    vt.pop()();
  ot = !1, nt.clear(), Ce(i);
}
function ki(i) {
  if (i.fragment !== null) {
    i.update(), oe(i.before_update);
    const e = i.dirty;
    i.dirty = [-1], i.fragment && i.fragment.p(i.ctx, e), i.after_update.forEach(st);
  }
}
function Ci(i) {
  const e = [], t = [];
  Se.forEach((n) => i.indexOf(n) === -1 ? e.push(n) : t.push(n)), t.forEach((n) => n()), Se = e;
}
const He = /* @__PURE__ */ new Set();
let ge;
function Pe() {
  ge = {
    r: 0,
    c: [],
    p: ge
    // parent group
  };
}
function je() {
  ge.r || oe(ge.c), ge = ge.p;
}
function F(i, e) {
  i && i.i && (He.delete(i), i.i(e));
}
function Q(i, e, t, n) {
  if (i && i.o) {
    if (He.has(i)) return;
    He.add(i), ge.c.push(() => {
      He.delete(i), n && (t && i.d(1), n());
    }), i.o(e);
  } else n && n();
}
function Lt(i) {
  return (i == null ? void 0 : i.length) !== void 0 ? i : Array.from(i);
}
function Wi(i, e) {
  Q(i, 1, 1, () => {
    e.delete(i.key);
  });
}
function Ri(i, e, t, n, r, u, a, o, f, c, m, v) {
  let b = i.length, y = u.length, _ = b;
  const R = {};
  for (; _--; ) R[i[_].key] = _;
  const L = [], E = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), k = [];
  for (_ = y; _--; ) {
    const d = v(r, u, _), g = t(d);
    let M = a.get(g);
    M ? k.push(() => M.p(d, e)) : (M = c(g, d), M.c()), E.set(g, L[_] = M), g in R && C.set(g, Math.abs(_ - R[g]));
  }
  const p = /* @__PURE__ */ new Set(), H = /* @__PURE__ */ new Set();
  function z(d) {
    F(d, 1), d.m(o, m), a.set(d.key, d), m = d.first, y--;
  }
  for (; b && y; ) {
    const d = L[y - 1], g = i[b - 1], M = d.key, Z = g.key;
    d === g ? (m = d.first, b--, y--) : E.has(Z) ? !a.has(M) || p.has(M) ? z(d) : H.has(Z) ? b-- : C.get(M) > C.get(Z) ? (H.add(M), z(d)) : (p.add(Z), b--) : (f(g, a), b--);
  }
  for (; b--; ) {
    const d = i[b];
    E.has(d.key) || f(d, a);
  }
  for (; y; ) z(L[y - 1]);
  return oe(k), L;
}
function ce(i) {
  i && i.c();
}
function ne(i, e, t) {
  const { fragment: n, after_update: r } = i.$$;
  n && n.m(e, t), st(() => {
    const u = i.$$.on_mount.map(Ot).filter(Ut);
    i.$$.on_destroy ? i.$$.on_destroy.push(...u) : oe(u), i.$$.on_mount = [];
  }), r.forEach(st);
}
function re(i, e) {
  const t = i.$$;
  t.fragment !== null && (Ci(t.after_update), oe(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
}
function zi(i, e) {
  i.$$.dirty[0] === -1 && (Ee.push(i), Mi(), i.$$.dirty.fill(0)), i.$$.dirty[e / 31 | 0] |= 1 << e % 31;
}
function be(i, e, t, n, r, u, a = null, o = [-1]) {
  const f = Re;
  Ce(i);
  const c = i.$$ = {
    fragment: null,
    ctx: [],
    // state
    props: u,
    update: A,
    not_equal: r,
    bound: mt(),
    // lifecycle
    on_mount: [],
    on_destroy: [],
    on_disconnect: [],
    before_update: [],
    after_update: [],
    context: new Map(e.context || (f ? f.$$.context : [])),
    // everything else
    callbacks: mt(),
    dirty: o,
    skip_bound: !1,
    root: e.target || f.$$.root
  };
  a && a(c.root);
  let m = !1;
  if (c.ctx = t ? t(i, e.props || {}, (v, b, ...y) => {
    const _ = y.length ? y[0] : b;
    return c.ctx && r(c.ctx[v], c.ctx[v] = _) && (!c.skip_bound && c.bound[v] && c.bound[v](_), m && zi(i, v)), b;
  }) : [], c.update(), m = !0, oe(c.before_update), c.fragment = n ? n(c.ctx) : !1, e.target) {
    if (e.hydrate) {
      const v = Ei(e.target);
      c.fragment && c.fragment.l(v), v.forEach(O);
    } else
      c.fragment && c.fragment.c();
    e.intro && F(i.$$.fragment), ne(i, e.target, e.anchor), Bt();
  }
  Ce(f);
}
class ve {
  constructor() {
    /**
     * ### PRIVATE API
     *
     * Do not use, may change at any time
     *
     * @type {any}
     */
    tt(this, "$$");
    /**
     * ### PRIVATE API
     *
     * Do not use, may change at any time
     *
     * @type {any}
     */
    tt(this, "$$set");
  }
  /** @returns {void} */
  $destroy() {
    re(this, 1), this.$destroy = A;
  }
  /**
   * @template {Extract<keyof Events, string>} K
   * @param {K} type
   * @param {((e: Events[K]) => void) | null | undefined} callback
   * @returns {() => void}
   */
  $on(e, t) {
    if (!Ut(t))
      return A;
    const n = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
    return n.push(t), () => {
      const r = n.indexOf(t);
      r !== -1 && n.splice(r, 1);
    };
  }
  /**
   * @param {Partial<Props>} props
   * @returns {void}
   */
  $set(e) {
    this.$$set && !hi(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
  }
}
const Di = "4";
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Di);
function Oi(i) {
  let e, t;
  return {
    c() {
      e = ie("svg"), t = ie("path"), l(t, "d", "M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"), l(e, "viewBox", "0 0 14 14"), l(e, "width", "13"), l(e, "height", "13"), l(e, "class", "svelte-en2qvf");
    },
    m(n, r) {
      B(n, e, r), N(e, t);
    },
    p: A,
    i: A,
    o: A,
    d(n) {
      n && O(e);
    }
  };
}
class Ft extends ve {
  constructor(e) {
    super(), be(this, e, null, Oi, he, {});
  }
}
function Ui(i) {
  let e, t;
  return {
    c() {
      e = ie("svg"), t = ie("path"), l(t, "d", "M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"), l(e, "viewBox", "0 0 30 30"), l(e, "fill", "none"), l(e, "xmlns", "http://www.w3.org/2000/svg"), l(e, "class", "svelte-d2loi5");
    },
    m(n, r) {
      B(n, e, r), N(e, t);
    },
    p: A,
    i: A,
    o: A,
    d(n) {
      n && O(e);
    }
  };
}
class Ht extends ve {
  constructor(e) {
    super(), be(this, e, null, Ui, he, {});
  }
}
function Ii(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "area.svg") || l(e, "src", t), l(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), l(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "area.svg") && l(e, "src", t), r & /*placeType*/
      64 && l(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Ai(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "reverse.svg") || l(e, "src", t), l(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), l(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "reverse.svg") && l(e, "src", t), r & /*placeType*/
      64 && l(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Bi(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "poi.svg") || l(e, "src", t), l(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), l(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "poi.svg") && l(e, "src", t), r & /*placeType*/
      64 && l(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Fi(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "postal_code.svg") || l(e, "src", t), l(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), l(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "postal_code.svg") && l(e, "src", t), r & /*placeType*/
      64 && l(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Hi(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "street.svg") || l(e, "src", t), l(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), l(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "street.svg") && l(e, "src", t), r & /*placeType*/
      64 && l(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Pi(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "road.svg") || l(e, "src", t), l(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), l(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "road.svg") && l(e, "src", t), r & /*placeType*/
      64 && l(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function ji(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "housenumber.svg") || l(e, "src", t), l(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), l(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "housenumber.svg") && l(e, "src", t), r & /*placeType*/
      64 && l(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Zi(i) {
  let e, t, n, r;
  return {
    c() {
      e = W("img"), K(e.src, t = /*imageUrl*/
      i[5]) || l(e, "src", t), l(
        e,
        "alt",
        /*category*/
        i[4]
      ), l(e, "class", "svelte-ltkwvy");
    },
    m(u, a) {
      B(u, e, a), n || (r = V(
        e,
        "error",
        /*error_handler*/
        i[14]
      ), n = !0);
    },
    p(u, a) {
      a & /*imageUrl*/
      32 && !K(e.src, t = /*imageUrl*/
      u[5]) && l(e, "src", t), a & /*category*/
      16 && l(
        e,
        "alt",
        /*category*/
        u[4]
      );
    },
    d(u) {
      u && O(e), n = !1, r();
    }
  };
}
function _t(i) {
  let e, t;
  return {
    c() {
      e = W("span"), t = ue(
        /*placeType*/
        i[6]
      ), l(e, "class", "secondary svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r), N(e, t);
    },
    p(n, r) {
      r & /*placeType*/
      64 && We(
        t,
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Gi(i) {
  let e, t, n, r, u, a, o, f, c, m = (
    /*isReverse*/
    (i[7] ? (
      /*feature*/
      i[0].place_name
    ) : (
      /*feature*/
      i[0].place_name.replace(/,.*/, "")
    )) + ""
  ), v, b, y = (
    /*showPlaceType*/
    i[2] === "always" || /*showPlaceType*/
    i[2] !== "never" && !/*feature*/
    i[0].address && !/*feature*/
    i[0].id.startsWith("road.") && !/*feature*/
    i[0].id.startsWith("address.") && !/*feature*/
    i[0].id.startsWith("postal_code.") && (!/*feature*/
    i[0].id.startsWith("poi.") || !/*imageUrl*/
    i[5]) && !/*isReverse*/
    i[7]
  ), _, R, L = (
    /*isReverse*/
    (i[7] ? "" : (
      /*feature*/
      i[0].place_name.replace(/[^,]*,?\s*/, "")
    )) + ""
  ), E, C, k;
  function p(g, M) {
    return M & /*feature*/
    1 && (t = null), M & /*feature*/
    1 && (n = null), M & /*feature*/
    1 && (r = null), M & /*feature*/
    1 && (u = null), /*imageUrl*/
    g[5] ? Zi : (
      /*feature*/
      g[0].address ? ji : (t == null && (t = !!/*feature*/
      g[0].id.startsWith("road.")), t ? Pi : (n == null && (n = !!/*feature*/
      g[0].id.startsWith("address.")), n ? Hi : (r == null && (r = !!/*feature*/
      g[0].id.startsWith("postal_code.")), r ? Fi : (u == null && (u = !!/*feature*/
      g[0].id.startsWith("poi.")), u ? Bi : (
        /*isReverse*/
        g[7] ? Ai : Ii
      )))))
    );
  }
  let H = p(i, -1), z = H(i), d = y && _t(i);
  return {
    c() {
      e = W("li"), z.c(), a = J(), o = W("span"), f = W("span"), c = W("span"), v = ue(m), b = J(), d && d.c(), _ = J(), R = W("span"), E = ue(L), l(c, "class", "primary svelte-ltkwvy"), l(f, "class", "svelte-ltkwvy"), l(R, "class", "line2 svelte-ltkwvy"), l(o, "class", "texts svelte-ltkwvy"), l(e, "tabindex", "0"), l(
        e,
        "data-selected",
        /*selected*/
        i[1]
      ), l(e, "class", "svelte-ltkwvy"), le(
        e,
        "selected",
        /*selected*/
        i[1]
      );
    },
    m(g, M) {
      B(g, e, M), z.m(e, null), N(e, a), N(e, o), N(o, f), N(f, c), N(c, v), N(f, b), d && d.m(f, null), N(o, _), N(o, R), N(R, E), C || (k = [
        V(
          e,
          "mouseenter",
          /*mouseenter_handler*/
          i[12]
        ),
        V(
          e,
          "focus",
          /*focus_handler*/
          i[13]
        )
      ], C = !0);
    },
    p(g, [M]) {
      H === (H = p(g, M)) && z ? z.p(g, M) : (z.d(1), z = H(g), z && (z.c(), z.m(e, a))), M & /*feature*/
      1 && m !== (m = /*isReverse*/
      (g[7] ? (
        /*feature*/
        g[0].place_name
      ) : (
        /*feature*/
        g[0].place_name.replace(/,.*/, "")
      )) + "") && We(v, m), M & /*showPlaceType, feature, imageUrl*/
      37 && (y = /*showPlaceType*/
      g[2] === "always" || /*showPlaceType*/
      g[2] !== "never" && !/*feature*/
      g[0].address && !/*feature*/
      g[0].id.startsWith("road.") && !/*feature*/
      g[0].id.startsWith("address.") && !/*feature*/
      g[0].id.startsWith("postal_code.") && (!/*feature*/
      g[0].id.startsWith("poi.") || !/*imageUrl*/
      g[5]) && !/*isReverse*/
      g[7]), y ? d ? d.p(g, M) : (d = _t(g), d.c(), d.m(f, null)) : d && (d.d(1), d = null), M & /*feature*/
      1 && L !== (L = /*isReverse*/
      (g[7] ? "" : (
        /*feature*/
        g[0].place_name.replace(/[^,]*,?\s*/, "")
      )) + "") && We(E, L), M & /*selected*/
      2 && l(
        e,
        "data-selected",
        /*selected*/
        g[1]
      ), M & /*selected*/
      2 && le(
        e,
        "selected",
        /*selected*/
        g[1]
      );
    },
    i: A,
    o: A,
    d(g) {
      g && O(e), z.d(), d && d.d(), C = !1, oe(k);
    }
  };
}
function qi(i, e, t) {
  var k;
  let n, r, { feature: u } = e, { selected: a = !1 } = e, { showPlaceType: o } = e, { missingIconsCache: f } = e, { iconsBaseUrl: c } = e;
  const m = (k = u.properties) == null ? void 0 : k.categories;
  let v, b, y = 0, _ = u.place_type[0] === "reverse";
  function R() {
    b && f.add(b), t(10, y++, y);
  }
  function L(p) {
    bt.call(this, i, p);
  }
  function E(p) {
    bt.call(this, i, p);
  }
  const C = () => R();
  return i.$$set = (p) => {
    "feature" in p && t(0, u = p.feature), "selected" in p && t(1, a = p.selected), "showPlaceType" in p && t(2, o = p.showPlaceType), "missingIconsCache" in p && t(9, f = p.missingIconsCache), "iconsBaseUrl" in p && t(3, c = p.iconsBaseUrl);
  }, i.$$.update = () => {
    var p, H, z, d;
    if (i.$$.dirty & /*loadIconAttempt, index, category, iconsBaseUrl, imageUrl, missingIconsCache*/
    3640)
      do
        t(11, n--, n), t(4, v = m == null ? void 0 : m[n]), t(5, b = v ? c + v.replace(/ /g, "_") + ".svg" : void 0);
      while (n > -1 && (!b || f.has(b)));
    i.$$.dirty & /*feature*/
    1 && t(6, r = ((H = (p = u.properties) == null ? void 0 : p.categories) == null ? void 0 : H.join(", ")) ?? ((d = (z = u.properties) == null ? void 0 : z.place_type_name) == null ? void 0 : d[0]) ?? u.place_type[0]);
  }, t(11, n = (m == null ? void 0 : m.length) ?? 0), [
    u,
    a,
    o,
    c,
    v,
    b,
    r,
    _,
    R,
    f,
    y,
    n,
    L,
    E,
    C
  ];
}
class Qi extends ve {
  constructor(e) {
    super(), be(this, e, qi, Gi, he, {
      feature: 0,
      selected: 1,
      showPlaceType: 2,
      missingIconsCache: 9,
      iconsBaseUrl: 3
    });
  }
}
function Ki(i) {
  let e;
  return {
    c() {
      e = W("div"), e.innerHTML = '<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>', l(e, "class", "svelte-7cmwmc");
    },
    m(t, n) {
      B(t, e, n);
    },
    p: A,
    i: A,
    o: A,
    d(t) {
      t && O(e);
    }
  };
}
class Vi extends ve {
  constructor(e) {
    super(), be(this, e, null, Ki, he, {});
  }
}
function xi(i) {
  let e, t;
  return {
    c() {
      e = ie("svg"), t = ie("path"), l(t, "d", "M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"), l(e, "viewBox", "0 0 60.006 21.412"), l(e, "width", "14"), l(e, "height", "20"), l(e, "class", "svelte-en2qvf");
    },
    m(n, r) {
      B(n, e, r), N(e, t);
    },
    p: A,
    i: A,
    o: A,
    d(n) {
      n && O(e);
    }
  };
}
class Ji extends ve {
  constructor(e) {
    super(), be(this, e, null, xi, he, {});
  }
}
function Xi(i) {
  let e, t, n;
  return {
    c() {
      e = ie("svg"), t = ie("circle"), n = ie("path"), l(t, "cx", "4.789"), l(t, "cy", "4.787"), l(t, "r", "3.85"), l(t, "class", "svelte-1aq105l"), l(n, "d", "M12.063 12.063 7.635 7.635"), l(n, "class", "svelte-1aq105l"), l(e, "xmlns", "http://www.w3.org/2000/svg"), l(e, "width", "13"), l(e, "height", "13"), l(e, "viewBox", "0 0 13 13"), l(e, "class", "svelte-1aq105l");
    },
    m(r, u) {
      B(r, e, u), N(e, t), N(e, n);
    },
    p: A,
    i: A,
    o: A,
    d(r) {
      r && O(e);
    }
  };
}
class Yi extends ve {
  constructor(e) {
    super(), be(this, e, null, Xi, he, {});
  }
}
function $i(i, e, t) {
  const n = e[1], r = e[0], u = n - r;
  return i === n && t ? i : ((i - r) % u + u) % u + r;
}
function yt(i) {
  const e = [...i];
  return e[2] < e[0] && (Math.abs((e[0] + e[2] + 360) / 2) > Math.abs((e[0] - 360 + e[2]) / 2) ? e[0] -= 360 : e[2] += 360), e;
}
let Me;
async function en(i, e, t) {
  const n = i == null ? void 0 : i.getCenterAndZoom();
  for (const r of e ?? [])
    if (!(n && (r.minZoom != null && r.minZoom > n[0] || r.maxZoom != null && r.maxZoom < n[0]))) {
      if (r.type === "fixed")
        return r.coordinates.join(",");
      e: if (r.type === "client-geolocation") {
        if (Me && r.cachedLocationExpiry && Me.time + r.cachedLocationExpiry > Date.now()) {
          if (!Me.coords)
            break e;
          return Me.coords;
        }
        let u;
        try {
          return u = await new Promise((a, o) => {
            t.signal.addEventListener("abort", () => {
              o(Error("aborted"));
            }), navigator.geolocation.getCurrentPosition(
              (f) => {
                a(
                  [f.coords.longitude, f.coords.latitude].map((c) => c.toFixed(6)).join(",")
                );
              },
              (f) => {
                o(f);
              },
              r
            );
          }), u;
        } catch {
        } finally {
          r.cachedLocationExpiry && (Me = {
            time: Date.now(),
            coords: u
          });
        }
        if (t.signal.aborted)
          return;
      }
      if (r.type === "server-geolocation")
        return "ip";
      if (n && r.type === "map-center")
        return n[1].toFixed(6) + "," + n[2].toFixed(6);
    }
}
const tn = /^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i, wt = /^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/, Et = /^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i, St = /^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i, pt = /^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i, Tt = /^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;
function nn(i) {
  if (!["DMS", "DM", "DD"].includes(i))
    throw new Error("invalid format specified");
  if (this.decimalCoordinates && this.decimalCoordinates.trim()) {
    const e = this.decimalCoordinates.split(",").map((y) => Number(y.trim())), t = Number(e[0]), n = Number(e[1]), r = Math.abs(t), u = Math.abs(n), a = t > 0 ? "N" : "S", o = n > 0 ? "E" : "W";
    let f;
    i == "DD" && (f = `${r}° ${a}, ${u}° ${o}`);
    const c = Math.floor(r), m = Math.floor(u), v = (r - c) * 60, b = (u - m) * 60;
    if (i == "DM") {
      let y = Nt(v, 3).toFixed(3).padStart(6, "0"), _ = Nt(b, 3).toFixed(3).padStart(6, "0");
      y.endsWith(".000") && _.endsWith(".000") && (y = y.replace(/\.000$/, ""), _ = _.replace(/\.000$/, "")), f = `${c}° ${y}' ${a}, ${m}° ${_}' ${o}`;
    }
    if (i == "DMS") {
      const y = Math.floor(v), _ = Math.floor(b);
      let R = ((v - y) * 60).toFixed(1).padStart(4, "0"), L = ((b - _) * 60).toFixed(1).padStart(4, "0");
      const E = y.toString().padStart(2, "0"), C = _.toString().padStart(2, "0");
      R.endsWith(".0") && L.endsWith(".0") && (R = R.replace(/\.0$/, ""), L = L.replace(/\.0$/, "")), f = `${c}° ${E}' ${R}" ${a}, ${m}° ${C}' ${L}" ${o}`;
    }
    return f;
  } else
    throw new Error("no decimal coordinates to convert");
}
function Nt(i, e) {
  const t = Math.pow(10, e);
  return Math.round((i + Number.EPSILON) * t) / t;
}
function at(i, e) {
  e || (e = 5), i = i.replace(/\s+/g, " ").trim();
  let t = null, n = null, r = "", u = "", a = null, o = [], f = !1;
  if (tn.test(i))
    throw new Error("invalid coordinate value");
  if (wt.test(i))
    if (o = wt.exec(i), f = ke(o), f)
      t = Math.abs(o[1]) + o[2] / 60, Number(o[1]) < 0 && (t *= -1), n = Math.abs(o[3]) + o[4] / 60, Number(o[3]) < 0 && (n *= -1), a = "DM";
    else
      throw new Error("invalid coordinate format");
  else if (Et.test(i))
    if (o = Et.exec(i), f = ke(o), f) {
      if (t = o[2], n = o[6], t.includes(",") && (t = t.replace(",", ".")), n.includes(",") && (n = n.replace(",", ".")), a = "DD", Number(Math.round(t)) == Number(t))
        throw new Error("integer only coordinate provided");
      if (Number(Math.round(n)) == Number(n))
        throw new Error("integer only coordinate provided");
      o[1] ? (r = o[1], u = o[5]) : o[4] && (r = o[4], u = o[8]);
    } else
      throw new Error("invalid decimal coordinate format");
  else if (St.test(i))
    if (o = St.exec(i), f = ke(o), f)
      t = Math.abs(parseInt(o[2])), o[4] && (t += o[4] / 60, a = "DM"), o[6] && (t += o[6].replace(",", ".") / 3600, a = "DMS"), parseInt(o[2]) < 0 && (t = -1 * t), n = Math.abs(parseInt(o[9])), o[11] && (n += o[11] / 60), o[13] && (n += o[13].replace(",", ".") / 3600), parseInt(o[9]) < 0 && (n = -1 * n), o[1] ? (r = o[1], u = o[8]) : o[7] && (r = o[7], u = o[14]);
    else
      throw new Error("invalid DMS coordinates format");
  else if (pt.test(i))
    if (o = pt.exec(i), f = ke(o), f)
      t = Math.abs(parseInt(o[2])), o[4] && (t += o[4] / 60, a = "DM"), o[6] && (t += o[6] / 3600, a = "DMS"), parseInt(o[2]) < 0 && (t = -1 * t), n = Math.abs(parseInt(o[10])), o[12] && (n += o[12] / 60), o[14] && (n += o[14] / 3600), parseInt(o[10]) < 0 && (n = -1 * n), o[1] ? (r = o[1], u = o[9]) : o[8] && (r = o[8], u = o[16]);
    else
      throw new Error("invalid DMS coordinates format");
  else if (Tt.test(i)) {
    if (o = Tt.exec(i), f = ke(o), o.filter((c) => c).length <= 5)
      throw new Error("invalid coordinates format");
    if (f)
      t = Math.abs(parseInt(o[2])), o[4] && (t += o[4].replace(",", ".") / 60, a = "DM"), o[6] && (t += o[6].replace(",", ".") / 3600, a = "DMS"), parseInt(o[2]) < 0 && (t = -1 * t), n = Math.abs(parseInt(o[10])), o[12] && (n += o[12].replace(",", ".") / 60), o[14] && (n += o[14].replace(",", ".") / 3600), parseInt(o[10]) < 0 && (n = -1 * n), o[1] ? (r = o[1], u = o[9]) : o[8] && (r = o[8], u = o[16]);
    else
      throw new Error("invalid coordinates format");
  }
  if (f) {
    if (Math.abs(n) >= 180)
      throw new Error("invalid longitude value");
    if (Math.abs(t) >= 90)
      throw new Error("invalid latitude value");
    if (r && !u || !r && u)
      throw new Error("invalid coordinates value");
    if (r && r == u)
      throw new Error("invalid coordinates format");
    t.toString().includes(",") && (t = t.replace(",", ".")), n.toString().includes(",") && (n = n.replace(",", "."));
    let c = /S|SOUTH/i;
    c.test(r) && t > 0 && (t = -1 * t), c = /W|WEST/i, c.test(u) && n > 0 && (n = -1 * n);
    const m = o[0].trim();
    let v, b;
    const y = /[,/;\u0020]/g, _ = m.match(y);
    if (_ == null) {
      const E = Math.floor(i.length / 2);
      v = m.substring(0, E).trim(), b = m.substring(E).trim();
    } else {
      let E;
      _.length % 2 == 1 ? E = Math.floor(_.length / 2) : E = _.length / 2 - 1;
      let C = 0;
      if (E == 0)
        C = m.indexOf(_[0]), v = m.substring(0, C).trim(), b = m.substring(C + 1).trim();
      else {
        let k = 0, p = 0;
        for (; k <= E; )
          C = m.indexOf(_[k], p), p = C + 1, k++;
        v = m.substring(0, C).trim(), b = m.substring(C + 1).trim();
      }
    }
    const R = v.split(".");
    if (R.length == 2 && R[1] == 0 && R[1].length != 2)
      throw new Error("invalid coordinates format");
    const L = b.split(".");
    if (L.length == 2 && L[1] == 0 && L[1].length != 2)
      throw new Error("invalid coordinates format");
    if (/^\d+$/.test(v) || /^\d+$/.test(b))
      throw new Error("degree only coordinate/s provided");
    return t = Number(Number(t).toFixed(e)), n = Number(Number(n).toFixed(e)), Object.freeze({
      verbatimCoordinates: m,
      verbatimLatitude: v,
      verbatimLongitude: b,
      decimalLatitude: t,
      decimalLongitude: n,
      decimalCoordinates: `${t},${n}`,
      originalFormat: a,
      closeEnough: rn,
      toCoordinateFormat: nn
    });
  } else
    throw new Error("coordinates pattern match failed");
}
function ke(i) {
  if (!isNaN(i[0]))
    return !1;
  const e = [...i];
  if (e.shift(), e.length % 2 > 0)
    return !1;
  const t = /^[-+]?\d+([\.,]\d+)?$/, n = /[eastsouthnorthwest]+/i, r = e.length / 2;
  for (let u = 0; u < r; u++) {
    const a = e[u], o = e[u + r], f = t.test(a) && t.test(o), c = n.test(a) && n.test(o), m = a == o;
    if (!(a == null && o == null)) {
      if (a == null || o == null)
        return !1;
      if (f || c || m)
        continue;
      return !1;
    }
  }
  return !0;
}
function Mt(i, e) {
  const t = Math.abs(i - e);
  return Number(t.toFixed(6)) <= 1e-5;
}
function rn(i) {
  if (!i)
    throw new Error("coords must be provided");
  if (i.includes(",")) {
    const e = i.split(",");
    if (Number(e[0]) == NaN || Number(e[1]) == NaN)
      throw new Error("coords are not valid decimals");
    return Mt(this.decimalLatitude, Number(e[0])) && Mt(this.decimalLongitude, e[1]);
  } else
    throw new Error("coords being tested must be separated by a comma");
}
const on = Object.freeze({
  DMS: "DMS",
  DM: "DM",
  DD: "DD"
});
at.to = on;
const sn = [
  {
    verbatimCoordinates: "40.123, -74.123",
    verbatimLatitude: "40.123",
    verbatimLongitude: "-74.123"
  },
  {
    verbatimCoordinates: "40.123° N 74.123° W",
    verbatimLatitude: "40.123° N",
    verbatimLongitude: "74.123° W"
  },
  {
    verbatimCoordinates: "40.123° N 74.123° W",
    verbatimLatitude: "40.123° N",
    verbatimLongitude: "74.123° W"
  },
  {
    verbatimCoordinates: '40° 7´ 22.8" N 74° 7´ 22.8" W',
    verbatimLatitude: '40° 7´ 22.8" N',
    verbatimLongitude: '74° 7´ 22.8" W'
  },
  {
    verbatimCoordinates: "40° 7.38’ , -74° 7.38’",
    verbatimLatitude: "40° 7.38’",
    verbatimLongitude: "-74° 7.38’"
  },
  {
    verbatimCoordinates: "N40°7’22.8’’, W74°7’22.8’’",
    verbatimLatitude: "N40°7’22.8’’",
    verbatimLongitude: "W74°7’22.8’’"
  },
  {
    verbatimCoordinates: '40°7’22.8"N, 74°7’22.8"W',
    verbatimLatitude: '40°7’22.8"N',
    verbatimLongitude: '74°7’22.8"W'
  },
  {
    verbatimCoordinates: `40°7'22.8"N, 74°7'22.8"W`,
    verbatimLatitude: `40°7'22.8"N`,
    verbatimLongitude: `74°7'22.8"W`
  },
  {
    verbatimCoordinates: "40 7 22.8, -74 7 22.8",
    verbatimLatitude: "40 7 22.8",
    verbatimLongitude: "-74 7 22.8"
  },
  {
    verbatimCoordinates: "40.123 -74.123",
    verbatimLatitude: "40.123",
    verbatimLongitude: "-74.123"
  },
  {
    verbatimCoordinates: "40.123°,-74.123°",
    verbatimLatitude: "40.123°",
    verbatimLongitude: "-74.123°"
  },
  {
    verbatimCoordinates: "40.123N74.123W",
    verbatimLatitude: "40.123N",
    verbatimLongitude: "74.123W"
  },
  {
    verbatimCoordinates: "4007.38N7407.38W",
    verbatimLatitude: "4007.38N",
    verbatimLongitude: "7407.38W"
  },
  {
    verbatimCoordinates: '40°7’22.8"N, 74°7’22.8"W',
    verbatimLatitude: '40°7’22.8"N',
    verbatimLongitude: '74°7’22.8"W'
  },
  {
    verbatimCoordinates: "400722.8N740722.8W",
    verbatimLatitude: "400722.8N",
    verbatimLongitude: "740722.8W"
  },
  {
    verbatimCoordinates: "N 40 7.38 W 74 7.38",
    verbatimLatitude: "N 40 7.38",
    verbatimLongitude: "W 74 7.38"
  },
  {
    verbatimCoordinates: "40:7:22.8N 74:7:22.8W",
    verbatimLatitude: "40:7:22.8N",
    verbatimLongitude: "74:7:22.8W"
  },
  {
    verbatimCoordinates: "40:7:23N,74:7:23W",
    verbatimLatitude: "40:7:23N",
    verbatimLongitude: "74:7:23W",
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.1230555555
  },
  {
    verbatimCoordinates: '40°7’23"N 74°7’23"W',
    verbatimLatitude: '40°7’23"N',
    verbatimLongitude: '74°7’23"W',
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.12305555555555
  },
  {
    verbatimCoordinates: '40°7’23"S 74°7’23"E',
    verbatimLatitude: '40°7’23"S',
    verbatimLongitude: '74°7’23"E',
    decimalLatitude: -40.1230555555,
    decimalLongitude: 74.12305555555555
  },
  {
    verbatimCoordinates: '40°7’23" -74°7’23"',
    verbatimLatitude: '40°7’23"',
    verbatimLongitude: '-74°7’23"',
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.123055555
  },
  {
    verbatimCoordinates: '40d 7’ 23" N 74d 7’ 23" W',
    verbatimLatitude: '40d 7’ 23" N',
    verbatimLongitude: '74d 7’ 23" W',
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.123055555
  },
  {
    verbatimCoordinates: "40.123N 74.123W",
    verbatimLatitude: "40.123N",
    verbatimLongitude: "74.123W"
  },
  {
    verbatimCoordinates: "40° 7.38, -74° 7.38",
    verbatimLatitude: "40° 7.38",
    verbatimLongitude: "-74° 7.38"
  },
  {
    verbatimCoordinates: "40° 7.38, -74° 7.38",
    verbatimLatitude: "40° 7.38",
    verbatimLongitude: "-74° 7.38"
  },
  {
    verbatimCoordinates: "40 7 22.8; -74 7 22.8",
    verbatimLatitude: "40 7 22.8",
    verbatimLongitude: "-74 7 22.8"
  }
], an = {
  decimalLatitude: 40.123,
  decimalLongitude: -74.123
}, ln = [
  {
    verbatimCoordinates: `50°4'17.698"south, 14°24'2.826"east`,
    verbatimLatitude: `50°4'17.698"south`,
    verbatimLongitude: `14°24'2.826"east`,
    decimalLatitude: -50.07158277777778,
    decimalLongitude: 14.400785
  },
  {
    verbatimCoordinates: "50d4m17.698S 14d24m2.826E",
    verbatimLatitude: "50d4m17.698S",
    verbatimLongitude: "14d24m2.826E",
    decimalLatitude: -50.07158277777778,
    decimalLongitude: 14.400785
  },
  {
    verbatimCoordinates: "40:26:46N,79:56:55W",
    verbatimLatitude: "40:26:46N",
    verbatimLongitude: "79:56:55W",
    decimalLatitude: 40.44611111111111,
    decimalLongitude: -79.9486111111111
  },
  {
    verbatimCoordinates: "40:26:46.302N 79:56:55.903W",
    verbatimLatitude: "40:26:46.302N",
    verbatimLongitude: "79:56:55.903W",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.94886194444445
  },
  {
    verbatimCoordinates: "40°26′47″N 79°58′36″W",
    verbatimLatitude: "40°26′47″N",
    verbatimLongitude: "79°58′36″W",
    decimalLatitude: 40.44638888888889,
    decimalLongitude: -79.97666666666667
  },
  {
    verbatimCoordinates: "40d 26′ 47″ N 79d 58′ 36″ W",
    verbatimLatitude: "40d 26′ 47″ N",
    verbatimLongitude: "79d 58′ 36″ W",
    decimalLatitude: 40.44638888888889,
    decimalLongitude: -79.97666666666667
  },
  {
    verbatimCoordinates: "40.446195N 79.948862W",
    verbatimLatitude: "40.446195N",
    verbatimLongitude: "79.948862W",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "40,446195° 79,948862°",
    verbatimLatitude: "40,446195°",
    verbatimLongitude: "79,948862°",
    decimalLatitude: 40.446195,
    decimalLongitude: 79.948862
  },
  {
    verbatimCoordinates: "40° 26.7717, -79° 56.93172",
    verbatimLatitude: "40° 26.7717",
    verbatimLongitude: "-79° 56.93172",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "40.446195, -79.948862",
    verbatimLatitude: "40.446195",
    verbatimLongitude: "-79.948862",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "40.123256; -74.123256",
    verbatimLatitude: "40.123256",
    verbatimLongitude: "-74.123256",
    decimalLatitude: 40.123256,
    decimalLongitude: -74.123256
  },
  {
    verbatimCoordinates: "18°24S 22°45E",
    verbatimLatitude: "18°24S",
    verbatimLongitude: "22°45E",
    decimalLatitude: -18.4,
    decimalLongitude: 22.75
  }
], un = [
  {
    verbatimCoordinates: "10.432342S 10.6345345E",
    verbatimLatitude: "10.432342S",
    verbatimLongitude: "10.6345345E",
    decimalLatitude: -10.432342,
    decimalLongitude: 10.6345345
  },
  {
    verbatimCoordinates: "10.00S 10.00E",
    verbatimLatitude: "10.00S",
    verbatimLongitude: "10.00E",
    decimalLatitude: -10,
    decimalLongitude: 10
  },
  {
    verbatimCoordinates: "00.00S 01.00E",
    verbatimLatitude: "00.00S",
    verbatimLongitude: "01.00E",
    decimalLatitude: 0,
    decimalLongitude: 1
  },
  {
    verbatimCoordinates: "18.24S 22.45E",
    verbatimLatitude: "18.24S",
    verbatimLongitude: "22.45E",
    decimalLatitude: -18.4,
    decimalLongitude: 22.75
  },
  {
    verbatimCoordinates: "27deg 15min 45.2sec S 18deg 32min 53.7sec E",
    verbatimLatitude: "27deg 15min 45.2sec S",
    verbatimLongitude: "18deg 32min 53.7sec E",
    decimalLatitude: -27.262555555555554,
    decimalLongitude: 18.54825
  },
  {
    verbatimCoordinates: "-23.3245° S / 28.2344° E",
    verbatimLatitude: "-23.3245° S",
    verbatimLongitude: "28.2344° E",
    decimalLatitude: -23.3245,
    decimalLongitude: 28.2344
  },
  {
    verbatimCoordinates: "40° 26.7717 -79° 56.93172",
    verbatimLatitude: "40° 26.7717",
    verbatimLongitude: "-79° 56.93172",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "27.15.45S 18.32.53E",
    verbatimLatitude: "27.15.45S",
    verbatimLongitude: "18.32.53E",
    decimalLatitude: -27.2625,
    decimalLongitude: 18.548055
  },
  {
    verbatimCoordinates: "-27.15.45 18.32.53",
    verbatimLatitude: "-27.15.45",
    verbatimLongitude: "18.32.53",
    decimalLatitude: -27.2625,
    decimalLongitude: 18.548055
  },
  {
    verbatimCoordinates: "27.15.45.2S 18.32.53.4E",
    verbatimLatitude: "27.15.45.2S",
    verbatimLongitude: "18.32.53.4E",
    decimalLatitude: -27.262556,
    decimalLongitude: 18.548167
  },
  {
    verbatimCoordinates: "27.15.45,2S 18.32.53,4E",
    verbatimLatitude: "27.15.45,2S",
    verbatimLongitude: "18.32.53,4E",
    decimalLatitude: -27.262556,
    decimalLongitude: 18.548167
  },
  {
    verbatimCoordinates: "S23.43563 °  E22.45634 °",
    verbatimLatitude: "S23.43563 °",
    verbatimLongitude: "E22.45634 °",
    decimalLatitude: -23.43563,
    decimalLongitude: 22.45634
  },
  {
    verbatimCoordinates: "27,71372° S 23,07771° E",
    verbatimLatitude: "27,71372° S",
    verbatimLongitude: "23,07771° E",
    decimalLatitude: -27.71372,
    decimalLongitude: 23.07771
  },
  {
    verbatimCoordinates: "27.45.34 S 23.23.23 E",
    verbatimLatitude: "27.45.34 S",
    verbatimLongitude: "23.23.23 E",
    decimalLatitude: -27.759444,
    decimalLongitude: 23.38972222
  },
  {
    verbatimCoordinates: "S 27.45.34 E 23.23.23",
    verbatimLatitude: "S 27.45.34",
    verbatimLongitude: "E 23.23.23",
    decimalLatitude: -27.759444,
    decimalLongitude: 23.38972222
  },
  {
    verbatimCoordinates: "53 16.3863,4 52.8171",
    verbatimLatitude: "53 16.3863",
    verbatimLongitude: "4 52.8171",
    decimalLatitude: 53.273105,
    decimalLongitude: 4.88029
  },
  {
    verbatimCoordinates: "50 8.2914,-5 2.4447",
    verbatimLatitude: "50 8.2914",
    verbatimLongitude: "-5 2.4447",
    decimalLatitude: 50.13819,
    decimalLongitude: -5.040745
  },
  {
    verbatimCoordinates: "N 48° 30,6410', E 18° 57,4583'",
    verbatimLatitude: "N 48° 30,6410'",
    verbatimLongitude: "E 18° 57,4583'",
    decimalLatitude: 48.51068,
    decimalLongitude: 18.95764
  },
  {
    verbatimCoordinates: "1.23456, 18.33453",
    verbatimLatitude: "1.23456",
    verbatimLongitude: "18.33453",
    decimalLatitude: 1.23456,
    decimalLongitude: 18.33453
  }
];
function cn() {
  const i = [];
  return sn.forEach((e) => {
    e.decimalLatitude ? i.push(e) : i.push({ ...e, ...an });
  }), [...i, ...ln, ...un];
}
const dn = cn();
at.formats = dn.map((i) => i.verbatimCoordinates);
const fn = at;
function kt(i, e, t) {
  const n = i.slice();
  return n[87] = e[t], n[89] = t, n;
}
function Ct(i) {
  let e, t;
  return e = new Vi({}), {
    c() {
      ce(e.$$.fragment);
    },
    m(n, r) {
      ne(e, n, r), t = !0;
    },
    i(n) {
      t || (F(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Q(e.$$.fragment, n), t = !1;
    },
    d(n) {
      re(e, n);
    }
  };
}
function Wt(i) {
  let e, t, n, r, u;
  return t = new Ji({}), {
    c() {
      e = W("button"), ce(t.$$.fragment), l(e, "type", "button"), l(
        e,
        "title",
        /*reverseButtonTitle*/
        i[9]
      ), l(e, "class", "svelte-bz0zu3"), le(
        e,
        "active",
        /*reverseActive*/
        i[0]
      );
    },
    m(a, o) {
      B(a, e, o), ne(t, e, null), n = !0, r || (u = V(
        e,
        "click",
        /*click_handler_2*/
        i[71]
      ), r = !0);
    },
    p(a, o) {
      (!n || o[0] & /*reverseButtonTitle*/
      512) && l(
        e,
        "title",
        /*reverseButtonTitle*/
        a[9]
      ), (!n || o[0] & /*reverseActive*/
      1) && le(
        e,
        "active",
        /*reverseActive*/
        a[0]
      );
    },
    i(a) {
      n || (F(t.$$.fragment, a), n = !0);
    },
    o(a) {
      Q(t.$$.fragment, a), n = !1;
    },
    d(a) {
      a && O(e), re(t), r = !1, u();
    }
  };
}
function mn(i) {
  let e, t = [], n = /* @__PURE__ */ new Map(), r, u, a, o = Lt(
    /*listFeatures*/
    i[14]
  );
  const f = (c) => (
    /*feature*/
    c[87].id + /*feature*/
    (c[87].address ? "," + /*feature*/
    c[87].address : "")
  );
  for (let c = 0; c < o.length; c += 1) {
    let m = kt(i, o, c), v = f(m);
    n.set(v, t[c] = Rt(v, m));
  }
  return {
    c() {
      e = W("ul");
      for (let c = 0; c < t.length; c += 1)
        t[c].c();
      l(e, "class", "options svelte-bz0zu3");
    },
    m(c, m) {
      B(c, e, m);
      for (let v = 0; v < t.length; v += 1)
        t[v] && t[v].m(e, null);
      r = !0, u || (a = [
        V(
          e,
          "mouseleave",
          /*mouseleave_handler*/
          i[75]
        ),
        V(
          e,
          "blur",
          /*blur_handler_1*/
          i[76]
        )
      ], u = !0);
    },
    p(c, m) {
      m[0] & /*listFeatures, showPlaceType, selectedItemIndex, missingIconsCache, iconsBaseUrl, pick*/
      17880064 && (o = Lt(
        /*listFeatures*/
        c[14]
      ), Pe(), t = Ri(t, m, f, 1, c, o, n, e, Wi, Rt, null, kt), je());
    },
    i(c) {
      if (!r) {
        for (let m = 0; m < o.length; m += 1)
          F(t[m]);
        r = !0;
      }
    },
    o(c) {
      for (let m = 0; m < t.length; m += 1)
        Q(t[m]);
      r = !1;
    },
    d(c) {
      c && O(e);
      for (let m = 0; m < t.length; m += 1)
        t[m].d();
      u = !1, oe(a);
    }
  };
}
function gn(i) {
  let e, t, n, r, u, a;
  return t = new Ht({}), {
    c() {
      e = W("div"), ce(t.$$.fragment), n = J(), r = W("div"), u = ue(
        /*noResultsMessage*/
        i[7]
      ), l(r, "class", "svelte-bz0zu3"), l(e, "class", "no-results svelte-bz0zu3");
    },
    m(o, f) {
      B(o, e, f), ne(t, e, null), N(e, n), N(e, r), N(r, u), a = !0;
    },
    p(o, f) {
      (!a || f[0] & /*noResultsMessage*/
      128) && We(
        u,
        /*noResultsMessage*/
        o[7]
      );
    },
    i(o) {
      a || (F(t.$$.fragment, o), a = !0);
    },
    o(o) {
      Q(t.$$.fragment, o), a = !1;
    },
    d(o) {
      o && O(e), re(t);
    }
  };
}
function hn(i) {
  let e = "", t;
  return {
    c() {
      t = ue(e);
    },
    m(n, r) {
      B(n, t, r);
    },
    p: A,
    i: A,
    o: A,
    d(n) {
      n && O(t);
    }
  };
}
function bn(i) {
  let e, t, n, r, u, a, o, f, c, m, v;
  return t = new Ht({}), f = new Ft({}), {
    c() {
      e = W("div"), ce(t.$$.fragment), n = J(), r = W("div"), u = ue(
        /*errorMessage*/
        i[6]
      ), a = J(), o = W("button"), ce(f.$$.fragment), l(r, "class", "svelte-bz0zu3"), l(o, "class", "svelte-bz0zu3"), l(e, "class", "error svelte-bz0zu3");
    },
    m(b, y) {
      B(b, e, y), ne(t, e, null), N(e, n), N(e, r), N(r, u), N(e, a), N(e, o), ne(f, o, null), c = !0, m || (v = V(
        o,
        "click",
        /*click_handler_3*/
        i[72]
      ), m = !0);
    },
    p(b, y) {
      (!c || y[0] & /*errorMessage*/
      64) && We(
        u,
        /*errorMessage*/
        b[6]
      );
    },
    i(b) {
      c || (F(t.$$.fragment, b), F(f.$$.fragment, b), c = !0);
    },
    o(b) {
      Q(t.$$.fragment, b), Q(f.$$.fragment, b), c = !1;
    },
    d(b) {
      b && O(e), re(t), re(f), m = !1, v();
    }
  };
}
function Rt(i, e) {
  let t, n, r;
  function u() {
    return (
      /*mouseenter_handler*/
      e[73](
        /*i*/
        e[89]
      )
    );
  }
  function a() {
    return (
      /*focus_handler_1*/
      e[74](
        /*feature*/
        e[87]
      )
    );
  }
  return n = new Qi({
    props: {
      feature: (
        /*feature*/
        e[87]
      ),
      showPlaceType: (
        /*showPlaceType*/
        e[10]
      ),
      selected: (
        /*selectedItemIndex*/
        e[15] === /*i*/
        e[89]
      ),
      missingIconsCache: (
        /*missingIconsCache*/
        e[20]
      ),
      iconsBaseUrl: (
        /*iconsBaseUrl*/
        e[12]
      )
    }
  }), n.$on("mouseenter", u), n.$on("focus", a), {
    key: i,
    first: null,
    c() {
      t = yi(), ce(n.$$.fragment), this.first = t;
    },
    m(o, f) {
      B(o, t, f), ne(n, o, f), r = !0;
    },
    p(o, f) {
      e = o;
      const c = {};
      f[0] & /*listFeatures*/
      16384 && (c.feature = /*feature*/
      e[87]), f[0] & /*showPlaceType*/
      1024 && (c.showPlaceType = /*showPlaceType*/
      e[10]), f[0] & /*selectedItemIndex, listFeatures*/
      49152 && (c.selected = /*selectedItemIndex*/
      e[15] === /*i*/
      e[89]), f[0] & /*iconsBaseUrl*/
      4096 && (c.iconsBaseUrl = /*iconsBaseUrl*/
      e[12]), n.$set(c);
    },
    i(o) {
      r || (F(n.$$.fragment, o), r = !0);
    },
    o(o) {
      Q(n.$$.fragment, o), r = !1;
    },
    d(o) {
      o && O(t), re(n, o);
    }
  };
}
function vn(i) {
  let e, t, n, r, u, a, o, f, c, m, v, b, y, _, R, L, E, C, k, p, H, z = !1;
  u = new Yi({}), v = new Ft({});
  let d = (
    /*abortController*/
    i[19] && Ct()
  ), g = (
    /*enableReverse*/
    i[5] === "button" && Wt(i)
  );
  const M = (
    /*#slots*/
    i[63].default
  ), Z = bi(
    M,
    i,
    /*$$scope*/
    i[62],
    null
  ), Le = [bn, hn, gn, mn], G = [];
  function pe(h, U) {
    var te, de;
    return (
      /*error*/
      h[18] ? 0 : (
        /*focusedDelayed*/
        h[16] ? (
          /*listFeatures*/
          ((te = h[14]) == null ? void 0 : te.length) === 0 ? 2 : (
            /*focusedDelayed*/
            h[16] && /*listFeatures*/
            ((de = h[14]) != null && de.length) ? 3 : -1
          )
        ) : 1
      )
    );
  }
  return ~(L = pe(i)) && (E = G[L] = Le[L](i)), {
    c() {
      e = J(), t = W("form"), n = W("div"), r = W("button"), ce(u.$$.fragment), a = J(), o = W("input"), f = J(), c = W("div"), m = W("button"), ce(v.$$.fragment), b = J(), d && d.c(), y = J(), g && g.c(), _ = J(), Z && Z.c(), R = J(), E && E.c(), l(r, "class", "search-button svelte-bz0zu3"), l(r, "type", "button"), l(
        o,
        "placeholder",
        /*placeholder*/
        i[8]
      ), l(
        o,
        "aria-label",
        /*placeholder*/
        i[8]
      ), l(o, "class", "svelte-bz0zu3"), l(m, "type", "button"), l(
        m,
        "title",
        /*clearButtonTitle*/
        i[3]
      ), l(m, "class", "svelte-bz0zu3"), l(c, "class", "clear-button-container svelte-bz0zu3"), le(
        c,
        "displayable",
        /*searchValue*/
        i[1] !== ""
      ), l(n, "class", "input-group svelte-bz0zu3"), l(t, "tabindex", "0"), l(t, "class", C = gt(
        /*className*/
        i[2]
      ) + " svelte-bz0zu3"), le(
        t,
        "can-collapse",
        /*collapsed*/
        i[4] && /*searchValue*/
        i[1] === ""
      );
    },
    m(h, U) {
      B(h, e, U), B(h, t, U), N(t, n), N(n, r), ne(u, r, null), N(n, a), N(n, o), i[65](o), ht(
        o,
        /*searchValue*/
        i[1]
      ), N(n, f), N(n, c), N(c, m), ne(v, m, null), N(c, b), d && d.m(c, null), N(n, y), g && g.m(n, null), N(n, _), Z && Z.m(n, null), N(t, R), ~L && G[L].m(t, null), k = !0, p || (H = [
        V(
          r,
          "click",
          /*click_handler*/
          i[64]
        ),
        V(
          o,
          "input",
          /*input_1_input_handler*/
          i[66]
        ),
        V(
          o,
          "focus",
          /*focus_handler*/
          i[67]
        ),
        V(
          o,
          "blur",
          /*blur_handler*/
          i[68]
        ),
        V(
          o,
          "keydown",
          /*handleKeyDown*/
          i[22]
        ),
        V(
          o,
          "input",
          /*input_handler*/
          i[69]
        ),
        V(
          m,
          "click",
          /*click_handler_1*/
          i[70]
        ),
        V(t, "submit", wi(
          /*handleSubmit*/
          i[21]
        ))
      ], p = !0);
    },
    p(h, U) {
      (!k || U[0] & /*placeholder*/
      256) && l(
        o,
        "placeholder",
        /*placeholder*/
        h[8]
      ), (!k || U[0] & /*placeholder*/
      256) && l(
        o,
        "aria-label",
        /*placeholder*/
        h[8]
      ), U[0] & /*searchValue*/
      2 && o.value !== /*searchValue*/
      h[1] && ht(
        o,
        /*searchValue*/
        h[1]
      ), (!k || U[0] & /*clearButtonTitle*/
      8) && l(
        m,
        "title",
        /*clearButtonTitle*/
        h[3]
      ), /*abortController*/
      h[19] ? d ? U[0] & /*abortController*/
      524288 && F(d, 1) : (d = Ct(), d.c(), F(d, 1), d.m(c, null)) : d && (Pe(), Q(d, 1, 1, () => {
        d = null;
      }), je()), (!k || U[0] & /*searchValue*/
      2) && le(
        c,
        "displayable",
        /*searchValue*/
        h[1] !== ""
      ), /*enableReverse*/
      h[5] === "button" ? g ? (g.p(h, U), U[0] & /*enableReverse*/
      32 && F(g, 1)) : (g = Wt(h), g.c(), F(g, 1), g.m(n, _)) : g && (Pe(), Q(g, 1, 1, () => {
        g = null;
      }), je()), Z && Z.p && (!k || U[2] & /*$$scope*/
      1) && Li(
        Z,
        M,
        h,
        /*$$scope*/
        h[62],
        k ? vi(
          M,
          /*$$scope*/
          h[62],
          U,
          null
        ) : _i(
          /*$$scope*/
          h[62]
        ),
        null
      );
      let te = L;
      L = pe(h), L === te ? ~L && G[L].p(h, U) : (E && (Pe(), Q(G[te], 1, 1, () => {
        G[te] = null;
      }), je()), ~L ? (E = G[L], E ? E.p(h, U) : (E = G[L] = Le[L](h), E.c()), F(E, 1), E.m(t, null)) : E = null), (!k || U[0] & /*className*/
      4 && C !== (C = gt(
        /*className*/
        h[2]
      ) + " svelte-bz0zu3")) && l(t, "class", C), (!k || U[0] & /*className, collapsed, searchValue*/
      22) && le(
        t,
        "can-collapse",
        /*collapsed*/
        h[4] && /*searchValue*/
        h[1] === ""
      );
    },
    i(h) {
      k || (F(z), F(u.$$.fragment, h), F(v.$$.fragment, h), F(d), F(g), F(Z, h), F(E), k = !0);
    },
    o(h) {
      Q(z), Q(u.$$.fragment, h), Q(v.$$.fragment, h), Q(d), Q(g), Q(Z, h), Q(E), k = !1;
    },
    d(h) {
      h && (O(e), O(t)), re(u), i[65](null), re(v), d && d.d(), g && g.d(), Z && Z.d(h), ~L && G[L].d(), p = !1, oe(H);
    }
  };
}
function Ln(i, e, t) {
  let n, r, { $$slots: u = {}, $$scope: a } = e;
  const o = {
    continental_marine: 4,
    country: 4,
    major_landform: 8,
    region: 5,
    subregion: 6,
    county: 7,
    joint_municipality: 8,
    joint_submunicipality: 9,
    municipality: 10,
    municipal_district: 11,
    locality: 12,
    neighbourhood: 13,
    place: 14,
    postal_code: 14,
    road: 16,
    poi: 17,
    address: 18,
    "poi.peak": 15,
    "poi.shop": 18,
    "poi.cafe": 18,
    "poi.restaurant": 18,
    "poi.aerodrome": 13
  };
  let { class: f = void 0 } = e, { apiKey: c } = e, { bbox: m = void 0 } = e, { clearButtonTitle: v = "clear" } = e, { clearOnBlur: b = !1 } = e, { collapsed: y = !1 } = e, { country: _ = void 0 } = e, { debounceSearch: R = 200 } = e, { enableReverse: L = "never" } = e, { errorMessage: E = "Something went wrong…" } = e, { filter: C = () => !0 } = e, { flyTo: k = !0 } = e, { fuzzyMatch: p = !0 } = e, { language: H = void 0 } = e, { limit: z = void 0 } = e, { mapController: d = void 0 } = e, { minLength: g = 2 } = e, { noResultsMessage: M = "Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!" } = e, { placeholder: Z = "Search" } = e, { proximity: Le = [{ type: "server-geolocation" }] } = e, { reverseActive: G = L === "always" } = e, { reverseButtonTitle: pe = "toggle reverse geocoding" } = e, { searchValue: h = "" } = e, { pickedResultStyle: U = "full-geometry" } = e, { showPlaceType: te = "if-needed" } = e, { showResultsWhileTyping: de = !0 } = e, { autocompleteTimeout: Ze = void 0 } = e, { selectFirst: _e = !0 } = e, { flyToSelected: Ge = !1 } = e, { markerOnSelected: ze = !0 } = e, { types: fe = void 0 } = e, { exhaustiveReverseGeocoding: qe = !1 } = e, { excludeTypes: De = !1 } = e, { zoom: Oe = o } = e, { apiUrl: Qe = "https://api.maptiler.com/geocoding" } = e, { fetchParameters: Ke = {} } = e, { iconsBaseUrl: lt = "https://cdn.maptiler.com/maptiler-geocoding-control/v2.0.0-rc.9/icons/" } = e, { adjustUrlQuery: Ve = () => {
  } } = e;
  function Pt() {
    $.focus();
  }
  function jt() {
    $.blur();
  }
  function ut(s, I = !0, j = !1) {
    t(1, h = s), I ? (t(15, D = -1), dt()) : (Xe(!j, j), setTimeout(() => {
      $.focus(), $.select();
    }));
  }
  function Zt() {
    t(14, T = void 0), t(57, w = void 0), t(15, D = -1);
  }
  function Gt() {
    t(56, P = []), t(57, w = void 0);
  }
  let ye = !1, T, P, w, ct = "", $, D = -1, ee, Ue = [], me, se, X, Ie, xe;
  const qt = /* @__PURE__ */ new Set(), ae = Ti();
  function Qt() {
    return !!X;
  }
  pi(() => {
    d && (d.setEventHandler(void 0), d.indicateReverse(!1), d.setSelectedMarker(-1), d.setFeatures(void 0, void 0, !1));
  });
  function dt(s) {
    if (se && (window.clearTimeout(se), se = void 0), X) {
      window.clearTimeout(X), t(58, X = void 0), Te(h, { appendSpace: !0 });
      return;
    }
    if (D > -1 && T)
      t(57, w = T[D]), t(1, h = w.place_type[0] === "reverse" ? w.place_name : w.place_name.replace(/,.*/, "")), t(18, ee = void 0), t(56, P = void 0), t(15, D = -1);
    else if (h) {
      const I = s || !Je(h);
      Te(h, { exact: !0 }).then(() => {
        t(56, P = T), t(57, w = void 0), I && Kt();
      }).catch((j) => t(18, ee = j));
    }
  }
  function Je(s) {
    try {
      return fn(s, 6);
    } catch {
      return !1;
    }
  }
  async function Te(s, { byId: I = !1, exact: j = !1, appendSpace: Y = !1 } = {}) {
    t(18, ee = void 0), me == null || me.abort();
    const x = new AbortController();
    t(19, me = x);
    try {
      const S = Je(s), q = new URLSearchParams();
      if (H !== void 0 && q.set("language", Array.isArray(H) ? H.join(",") : H ?? ""), fe && q.set("types", fe.join(",")), De && q.set("excludeTypes", String(De)), m && q.set("bbox", m.map((Be) => Be.toFixed(6)).join(",")), _ && q.set("country", Array.isArray(_) ? _.join(",") : _), !I && !S) {
        const Be = await en(d, Le, x);
        Be && q.set("proximity", Be), (j || !de) && q.set("autocomplete", "false"), q.set("fuzzyMatch", String(p));
      }
      z !== void 0 && (qe || !S || (fe == null ? void 0 : fe.length) === 1) && q.set("limit", String(z)), q.set("key", c), Ve(q);
      const Ae = Qe + "/" + encodeURIComponent(S ? S.decimalLongitude + "," + S.decimalLatitude : s + (Y ? " " : "")) + ".json?" + q.toString();
      if (Ae === ct) {
        I ? (t(14, T = void 0), t(57, w = Ue[0])) : t(14, T = Ue);
        return;
      }
      ct = Ae;
      const $e = await fetch(Ae, { signal: x.signal, ...Ke });
      if (!$e.ok)
        throw new Error(await $e.text());
      const et = await $e.json();
      ae("response", { url: Ae, featureCollection: et }), I ? (t(14, T = void 0), t(57, w = et.features[0]), Ue = [w]) : (t(14, T = et.features.filter(C)), S && T.unshift({
        type: "Feature",
        properties: {},
        id: "reverse_" + S.decimalLongitude + "_" + S.decimalLatitude,
        text: S.decimalLatitude + ", " + S.decimalLongitude,
        place_name: S.decimalLatitude + ", " + S.decimalLongitude,
        place_type: ["reverse"],
        center: [S.decimalLongitude, S.decimalLatitude],
        bbox: [
          S.decimalLongitude,
          S.decimalLatitude,
          S.decimalLongitude,
          S.decimalLatitude
        ],
        geometry: {
          type: "Point",
          coordinates: [S.decimalLongitude, S.decimalLatitude]
        }
      }), Ue = T, S && $.focus());
    } catch (S) {
      if (S && typeof S == "object" && "name" in S && S.name === "AbortError")
        return;
      throw S;
    } finally {
      x === me && t(19, me = void 0);
    }
  }
  function Kt() {
    var Y;
    if (!(P != null && P.length) || !k)
      return;
    const s = [180, 90, -180, -90], I = !P.some((x) => !x.matching_text);
    let j;
    for (const x of P) {
      const S = Ne(x);
      if (j = j === void 0 ? S : S === void 0 ? j : Math.max(j, S), I || !x.matching_text)
        for (const q of [0, 1, 2, 3])
          s[q] = Math[q < 2 ? "min" : "max"](s[q], ((Y = x.bbox) == null ? void 0 : Y[q]) ?? x.center[q % 2]);
    }
    d && P.length > 0 && (w && s[0] === s[2] && s[1] === s[3] ? d.flyTo(w.center, Ne(w)) : d.fitBounds(yt(s), 50, j));
  }
  function Ne(s) {
    var j;
    if (!s.bbox || s.bbox[0] !== s.bbox[2] && s.bbox[1] !== s.bbox[3])
      return;
    const I = s.id.replace(/\..*/, "");
    return (Array.isArray((j = s.properties) == null ? void 0 : j.categories) ? s.properties.categories.reduce(
      (Y, x) => {
        const S = Oe[I + "." + x];
        return Y === void 0 ? S : S === void 0 ? Y : Math.max(Y, S);
      },
      void 0
    ) : void 0) ?? Oe[I];
  }
  function Vt(s) {
    t(0, G = L === "always"), t(14, T = void 0), t(57, w = void 0), t(15, D = -1), ut(s[1].toFixed(6) + ", " + $i(s[0], [-180, 180], !0).toFixed(6), !1, !0);
  }
  function xt(s) {
    if (!T)
      return;
    let I = s.key === "ArrowDown" ? 1 : s.key === "ArrowUp" ? -1 : 0;
    I && (D === (_e ? 0 : -1) && I === -1 && t(15, D = T.length), t(15, D += I), D >= T.length && t(15, D = -1), D < 0 && _e && t(15, D = 0), s.preventDefault());
  }
  function Xe(s = !0, I = !1) {
    if (t(18, ee = void 0), se && (window.clearTimeout(se), se = void 0), X && (window.clearTimeout(X), t(58, X = void 0)), !de && !I || h.length < g) {
      t(14, T = void 0);
      return;
    }
    const j = h;
    se = window.setTimeout(
      () => {
        se = void 0, Te(j).catch((Y) => t(18, ee = Y));
      },
      s ? R : 0
    ), h.endsWith(" ") || t(58, X = window.setTimeout(
      () => {
        t(58, X = void 0), Te(j, { appendSpace: !0 }).catch((Y) => t(18, ee = Y));
      },
      Ze
    ));
  }
  function Ye(s) {
    t(57, w = s), t(1, h = s.place_name), t(15, D = -1);
  }
  const Jt = () => $.focus();
  function Xt(s) {
    rt[s ? "unshift" : "push"](() => {
      $ = s, t(17, $);
    });
  }
  function Yt() {
    h = this.value, t(1, h), t(13, ye), t(28, b);
  }
  const $t = () => t(13, ye = !0), ei = () => t(13, ye = !1), ti = () => Xe(), ii = () => {
    t(1, h = ""), $.focus();
  }, ni = () => t(0, G = !G), ri = () => t(18, ee = void 0), oi = (s) => t(15, D = s), si = (s) => Ye(s), ai = () => {
    _e || t(15, D = -1);
  }, li = () => {
  };
  return i.$$set = (s) => {
    "class" in s && t(2, f = s.class), "apiKey" in s && t(26, c = s.apiKey), "bbox" in s && t(27, m = s.bbox), "clearButtonTitle" in s && t(3, v = s.clearButtonTitle), "clearOnBlur" in s && t(28, b = s.clearOnBlur), "collapsed" in s && t(4, y = s.collapsed), "country" in s && t(29, _ = s.country), "debounceSearch" in s && t(30, R = s.debounceSearch), "enableReverse" in s && t(5, L = s.enableReverse), "errorMessage" in s && t(6, E = s.errorMessage), "filter" in s && t(31, C = s.filter), "flyTo" in s && t(32, k = s.flyTo), "fuzzyMatch" in s && t(33, p = s.fuzzyMatch), "language" in s && t(34, H = s.language), "limit" in s && t(35, z = s.limit), "mapController" in s && t(36, d = s.mapController), "minLength" in s && t(37, g = s.minLength), "noResultsMessage" in s && t(7, M = s.noResultsMessage), "placeholder" in s && t(8, Z = s.placeholder), "proximity" in s && t(38, Le = s.proximity), "reverseActive" in s && t(0, G = s.reverseActive), "reverseButtonTitle" in s && t(9, pe = s.reverseButtonTitle), "searchValue" in s && t(1, h = s.searchValue), "pickedResultStyle" in s && t(39, U = s.pickedResultStyle), "showPlaceType" in s && t(10, te = s.showPlaceType), "showResultsWhileTyping" in s && t(40, de = s.showResultsWhileTyping), "autocompleteTimeout" in s && t(41, Ze = s.autocompleteTimeout), "selectFirst" in s && t(11, _e = s.selectFirst), "flyToSelected" in s && t(42, Ge = s.flyToSelected), "markerOnSelected" in s && t(43, ze = s.markerOnSelected), "types" in s && t(44, fe = s.types), "exhaustiveReverseGeocoding" in s && t(45, qe = s.exhaustiveReverseGeocoding), "excludeTypes" in s && t(46, De = s.excludeTypes), "zoom" in s && t(47, Oe = s.zoom), "apiUrl" in s && t(48, Qe = s.apiUrl), "fetchParameters" in s && t(49, Ke = s.fetchParameters), "iconsBaseUrl" in s && t(12, lt = s.iconsBaseUrl), "adjustUrlQuery" in s && t(50, Ve = s.adjustUrlQuery), "$$scope" in s && t(62, a = s.$$scope);
  }, i.$$.update = () => {
    if (i.$$.dirty[0] & /*enableReverse*/
    32 && t(0, G = L === "always"), i.$$.dirty[0] & /*focused, clearOnBlur*/
    268443648 && setTimeout(() => {
      t(16, Ie = ye), b && !ye && t(1, h = "");
    }), i.$$.dirty[0] & /*searchValue, listFeatures*/
    16386 | i.$$.dirty[1] & /*minLength*/
    64 && h.length < g && (t(57, w = void 0), t(14, T = void 0), t(18, ee = void 0), t(56, P = T)), i.$$.dirty[1] & /*pickedResultStyle, picked*/
    67109120 && U !== "marker-only" && w && !w.address && w.geometry.type === "Point" && w.place_type[0] !== "reverse" && Te(w.id, { byId: !0 }).catch((s) => t(18, ee = s)), i.$$.dirty[1] & /*mapController, picked, prevIdToFly, flyTo*/
    335544354 && (d && w && w.id !== xe && k && (!w.bbox || w.bbox[0] === w.bbox[2] && w.bbox[1] === w.bbox[3] ? d.flyTo(w.center, Ne(w)) : d.fitBounds(yt(w.bbox), 50, Ne(w)), t(14, T = void 0), t(56, P = void 0), t(15, D = -1)), t(59, xe = w == null ? void 0 : w.id)), i.$$.dirty[0] & /*selectFirst, listFeatures*/
    18432 && _e && T != null && T.length && (Qt() || t(15, D = 0)), i.$$.dirty[0] & /*searchValue*/
    2 && t(15, D = -1), i.$$.dirty[0] & /*listFeatures*/
    16384 | i.$$.dirty[1] & /*markedFeatures*/
    33554432 && P !== T && t(56, P = void 0), i.$$.dirty[0] & /*reverseActive, listFeatures, focusedDelayed*/
    81921 | i.$$.dirty[1] & /*mapController, markedFeatures*/
    33554464 && d && d.setEventHandler((s) => {
      switch (s.type) {
        case "mapClick":
          G && Vt(s.coordinates);
          break;
        case "markerClick":
          {
            const I = T == null ? void 0 : T.find((j) => j.id === s.id);
            I && Ye(I);
          }
          break;
        case "markerMouseEnter":
          P && t(15, D = Ie ? (T == null ? void 0 : T.findIndex((I) => I.id === s.id)) ?? -1 : -1);
          break;
        case "markerMouseLeave":
          P && t(15, D = -1);
          break;
      }
    }), i.$$.dirty[0] & /*listFeatures, selectedItemIndex*/
    49152 && t(60, r = T == null ? void 0 : T[D]), i.$$.dirty[1] & /*mapController, selected, flyTo, flyToSelected*/
    536872994 && d && r && k && Ge && d.flyTo(r.center, Ne(r)), i.$$.dirty[1] & /*pickedResultStyle*/
    256 && t(61, n = U === "full-geometry-including-polygon-center-marker"), i.$$.dirty[1] & /*markerOnSelected, mapController, showPolygonMarker*/
    1073745952 && (ze || d == null || d.setFeatures(void 0, void 0, n)), i.$$.dirty[1] & /*mapController, markerOnSelected, markedFeatures, selected, showPolygonMarker*/
    1644171296 && d && ze && !P && (d.setFeatures(r ? [r] : void 0, void 0, n), d.setSelectedMarker(r ? 0 : -1)), i.$$.dirty[1] & /*mapController, markedFeatures, picked, showPolygonMarker*/
    1174405152 && d && d.setFeatures(P, w, n), i.$$.dirty[0] & /*selectedItemIndex*/
    32768 | i.$$.dirty[1] & /*markedFeatures, mapController*/
    33554464 && P && d && d.setSelectedMarker(D), i.$$.dirty[1] & /*selected, autocompleteTimeoutRef*/
    671088640 && r && (window.clearTimeout(X), t(58, X = void 0)), i.$$.dirty[0] & /*searchValue*/
    2 | i.$$.dirty[1] & /*mapController*/
    32 && d) {
      const s = Je(h);
      d.setReverseMarker(s ? [s.decimalLongitude, s.decimalLatitude] : void 0);
    }
    i.$$.dirty[1] & /*selected*/
    536870912 && ae("select", { feature: r }), i.$$.dirty[1] & /*picked*/
    67108864 && ae("pick", { feature: w }), i.$$.dirty[0] & /*focusedDelayed, listFeatures*/
    81920 && ae("optionsvisibilitychange", {
      optionsVisible: Ie && !!T
    }), i.$$.dirty[0] & /*listFeatures*/
    16384 && ae("featureslisted", { features: T }), i.$$.dirty[1] & /*markedFeatures*/
    33554432 && ae("featuresmarked", { features: P }), i.$$.dirty[0] & /*reverseActive*/
    1 && ae("reversetoggle", { reverse: G }), i.$$.dirty[0] & /*searchValue*/
    2 && ae("querychange", { query: h }), i.$$.dirty[0] & /*reverseActive*/
    1 | i.$$.dirty[1] & /*mapController*/
    32 && d && d.indicateReverse(G);
  }, [
    G,
    h,
    f,
    v,
    y,
    L,
    E,
    M,
    Z,
    pe,
    te,
    _e,
    lt,
    ye,
    T,
    D,
    Ie,
    $,
    ee,
    me,
    qt,
    dt,
    xt,
    Xe,
    Ye,
    o,
    c,
    m,
    b,
    _,
    R,
    C,
    k,
    p,
    H,
    z,
    d,
    g,
    Le,
    U,
    de,
    Ze,
    Ge,
    ze,
    fe,
    qe,
    De,
    Oe,
    Qe,
    Ke,
    Ve,
    Pt,
    jt,
    ut,
    Zt,
    Gt,
    P,
    w,
    X,
    xe,
    r,
    n,
    a,
    u,
    Jt,
    Xt,
    Yt,
    $t,
    ei,
    ti,
    ii,
    ni,
    ri,
    oi,
    si,
    ai,
    li
  ];
}
class _n extends ve {
  constructor(e) {
    super(), be(
      this,
      e,
      Ln,
      vn,
      he,
      {
        ZOOM_DEFAULTS: 25,
        class: 2,
        apiKey: 26,
        bbox: 27,
        clearButtonTitle: 3,
        clearOnBlur: 28,
        collapsed: 4,
        country: 29,
        debounceSearch: 30,
        enableReverse: 5,
        errorMessage: 6,
        filter: 31,
        flyTo: 32,
        fuzzyMatch: 33,
        language: 34,
        limit: 35,
        mapController: 36,
        minLength: 37,
        noResultsMessage: 7,
        placeholder: 8,
        proximity: 38,
        reverseActive: 0,
        reverseButtonTitle: 9,
        searchValue: 1,
        pickedResultStyle: 39,
        showPlaceType: 10,
        showResultsWhileTyping: 40,
        autocompleteTimeout: 41,
        selectFirst: 11,
        flyToSelected: 42,
        markerOnSelected: 43,
        types: 44,
        exhaustiveReverseGeocoding: 45,
        excludeTypes: 46,
        zoom: 47,
        apiUrl: 48,
        fetchParameters: 49,
        iconsBaseUrl: 12,
        adjustUrlQuery: 50,
        focus: 51,
        blur: 52,
        setQuery: 53,
        clearList: 54,
        clearMap: 55
      },
      null,
      [-1, -1, -1]
    );
  }
  get ZOOM_DEFAULTS() {
    return this.$$.ctx[25];
  }
  get focus() {
    return this.$$.ctx[51];
  }
  get blur() {
    return this.$$.ctx[52];
  }
  get setQuery() {
    return this.$$.ctx[53];
  }
  get clearList() {
    return this.$$.ctx[54];
  }
  get clearMap() {
    return this.$$.ctx[55];
  }
}
const zt = [
  "featuresListed",
  "featuresMarked",
  "optionsVisibilityChange",
  "pick",
  "queryChange",
  "response",
  "reverseToggle",
  "select"
], yn = [
  "adjustUrlQuery",
  "apiKey",
  "bbox",
  "clearButtonTitle",
  "clearOnBlur",
  "collapsed",
  "country",
  "debounceSearch",
  "enableReverse",
  "errorMessage",
  "excludeTypes",
  "filter",
  "fuzzyMatch",
  "language",
  "limit",
  "mapController",
  "minLength",
  "noResultsMessage",
  "pickedResultStyle",
  "placeholder",
  "proximity",
  "reverseActive",
  "reverseButtonTitle",
  "showPlaceType",
  "showResultsWhileTyping",
  "types",
  "zoom"
];
function Dt(i) {
  return "on" + i[0].toUpperCase() + i.slice(1);
}
const Sn = di(function(e, t) {
  const n = ft(), r = ft(), u = { ...e };
  for (const a of zt)
    delete u[Dt(a)];
  it(() => {
    if (!n.current)
      throw new Error();
    const a = new _n({
      target: n.current,
      props: u
    });
    return r.current = a, () => a.$destroy();
  }, []);
  for (const a of yn)
    it(() => {
      r.current && e[a] !== void 0 && r.current.$set({ [a]: e[a] });
    }, [e[a]]);
  for (const a of zt) {
    const o = e[Dt(a)];
    it(
      () => {
        var f;
        return o && ((f = r.current) == null ? void 0 : f.$on(a, (c) => {
          o(c.detail);
        }));
      },
      [o]
    );
  }
  return fi(t, () => ({
    setQuery: (a, o = !0) => {
      var f;
      return (f = r.current) == null ? void 0 : f.setQuery(a, o);
    },
    clearMap: () => {
      var a;
      return (a = r.current) == null ? void 0 : a.clearMap();
    },
    clearList: () => {
      var a;
      return (a = r.current) == null ? void 0 : a.clearList();
    },
    focus: () => {
      var a;
      return (a = r.current) == null ? void 0 : a.focus();
    },
    blur: () => {
      var a;
      return (a = r.current) == null ? void 0 : a.blur();
    }
  })), mi("div", { ref: n });
});
export {
  Sn as GeocodingControl
};
//# sourceMappingURL=react.js.map
