var ri = Object.defineProperty;
var ni = (i, e, t) => e in i ? ri(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
var Ve = (i, e, t) => (ni(i, typeof e != "symbol" ? e + "" : e, t), t);
import { forwardRef as oi, useRef as lt, useEffect as Je, useImperativeHandle as si, createElement as ai } from "react";
function U() {
}
function li(i, e) {
  for (const t in e)
    i[t] = e[t];
  return (
    /** @type {T & S} */
    i
  );
}
function Mt(i) {
  return i();
}
function ct() {
  return /* @__PURE__ */ Object.create(null);
}
function re(i) {
  i.forEach(Mt);
}
function Wt(i) {
  return typeof i == "function";
}
function me(i, e) {
  return i != i ? e == e : i !== e || i && typeof i == "object" || typeof i == "function";
}
let Ue;
function q(i, e) {
  return i === e ? !0 : (Ue || (Ue = document.createElement("a")), Ue.href = e, i === Ue.href);
}
function ci(i) {
  return Object.keys(i).length === 0;
}
function ui(i, e, t, r) {
  if (i) {
    const o = Rt(i, e, t, r);
    return i[0](o);
  }
}
function Rt(i, e, t, r) {
  return i[1] && r ? li(t.ctx.slice(), i[1](r(e))) : t.ctx;
}
function di(i, e, t, r) {
  if (i[2] && r) {
    const o = i[2](r(t));
    if (e.dirty === void 0)
      return o;
    if (typeof o == "object") {
      const l = [], n = Math.max(e.dirty.length, o.length);
      for (let a = 0; a < n; a += 1)
        l[a] = e.dirty[a] | o[a];
      return l;
    }
    return e.dirty | o;
  }
  return e.dirty;
}
function fi(i, e, t, r, o, l) {
  if (o) {
    const n = Rt(e, t, r, l);
    i.p(n, o);
  }
}
function mi(i) {
  if (i.ctx.length > 32) {
    const e = [], t = i.ctx.length / 32;
    for (let r = 0; r < t; r++)
      e[r] = -1;
    return e;
  }
  return -1;
}
function ut(i) {
  return i ?? "";
}
function p(i, e) {
  i.appendChild(e);
}
function A(i, e, t) {
  i.insertBefore(e, t || null);
}
function B(i) {
  i.parentNode && i.parentNode.removeChild(i);
}
function R(i) {
  return document.createElement(i);
}
function se(i) {
  return document.createElementNS("http://www.w3.org/2000/svg", i);
}
function ae(i) {
  return document.createTextNode(i);
}
function V() {
  return ae(" ");
}
function gi() {
  return ae("");
}
function Q(i, e, t, r) {
  return i.addEventListener(e, t, r), () => i.removeEventListener(e, t, r);
}
function hi(i) {
  return function(e) {
    return e.preventDefault(), i.call(this, e);
  };
}
function u(i, e, t) {
  t == null ? i.removeAttribute(e) : i.getAttribute(e) !== t && i.setAttribute(e, t);
}
function bi(i) {
  return Array.from(i.childNodes);
}
function Ce(i, e) {
  e = "" + e, i.data !== e && (i.data = /** @type {string} */
  e);
}
function dt(i, e) {
  i.value = e ?? "";
}
function oe(i, e, t) {
  i.classList.toggle(e, !!t);
}
function vi(i, e, { bubbles: t = !1, cancelable: r = !1 } = {}) {
  return new CustomEvent(i, { detail: e, bubbles: t, cancelable: r });
}
let Te;
function pe(i) {
  Te = i;
}
function It() {
  if (!Te)
    throw new Error("Function called outside component initialization");
  return Te;
}
function _i(i) {
  It().$$.on_destroy.push(i);
}
function Li() {
  const i = It();
  return (e, t, { cancelable: r = !1 } = {}) => {
    const o = i.$$.callbacks[e];
    if (o) {
      const l = vi(
        /** @type {string} */
        e,
        t,
        { cancelable: r }
      );
      return o.slice().forEach((n) => {
        n.call(i, l);
      }), !l.defaultPrevented;
    }
    return !0;
  };
}
function ft(i, e) {
  const t = i.$$.callbacks[e.type];
  t && t.slice().forEach((r) => r.call(this, e));
}
const Ee = [], xe = [];
let Se = [];
const mt = [], yi = /* @__PURE__ */ Promise.resolve();
let $e = !1;
function wi() {
  $e || ($e = !0, yi.then(Ot));
}
function et(i) {
  Se.push(i);
}
const Xe = /* @__PURE__ */ new Set();
let we = 0;
function Ot() {
  if (we !== 0)
    return;
  const i = Te;
  do {
    try {
      for (; we < Ee.length; ) {
        const e = Ee[we];
        we++, pe(e), Ei(e.$$);
      }
    } catch (e) {
      throw Ee.length = 0, we = 0, e;
    }
    for (pe(null), Ee.length = 0, we = 0; xe.length; )
      xe.pop()();
    for (let e = 0; e < Se.length; e += 1) {
      const t = Se[e];
      Xe.has(t) || (Xe.add(t), t());
    }
    Se.length = 0;
  } while (Ee.length);
  for (; mt.length; )
    mt.pop()();
  $e = !1, Xe.clear(), pe(i);
}
function Ei(i) {
  if (i.fragment !== null) {
    i.update(), re(i.before_update);
    const e = i.dirty;
    i.dirty = [-1], i.fragment && i.fragment.p(i.ctx, e), i.after_update.forEach(et);
  }
}
function Si(i) {
  const e = [], t = [];
  Se.forEach((r) => i.indexOf(r) === -1 ? e.push(r) : t.push(r)), t.forEach((r) => r()), Se = e;
}
const De = /* @__PURE__ */ new Set();
let fe;
function Ae() {
  fe = {
    r: 0,
    c: [],
    p: fe
    // parent group
  };
}
function ze() {
  fe.r || re(fe.c), fe = fe.p;
}
function F(i, e) {
  i && i.i && (De.delete(i), i.i(e));
}
function Z(i, e, t, r) {
  if (i && i.o) {
    if (De.has(i))
      return;
    De.add(i), fe.c.push(() => {
      De.delete(i), r && (t && i.d(1), r());
    }), i.o(e);
  } else
    r && r();
}
function gt(i) {
  return (i == null ? void 0 : i.length) !== void 0 ? i : Array.from(i);
}
function Ni(i, e) {
  Z(i, 1, 1, () => {
    e.delete(i.key);
  });
}
function ki(i, e, t, r, o, l, n, a, d, c, f, v) {
  let b = i.length, S = l.length, C = b;
  const P = {};
  for (; C--; )
    P[i[C].key] = C;
  const w = [], E = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), g = [];
  for (C = S; C--; ) {
    const L = v(o, l, C), N = t(L);
    let h = n.get(N);
    h ? r && g.push(() => h.p(L, e)) : (h = c(N, L), h.c()), E.set(N, w[C] = h), N in P && D.set(N, Math.abs(C - P[N]));
  }
  const j = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
  function W(L) {
    F(L, 1), L.m(a, f), n.set(L.key, L), f = L.first, S--;
  }
  for (; b && S; ) {
    const L = w[S - 1], N = i[b - 1], h = L.key, y = N.key;
    L === N ? (f = L.first, b--, S--) : E.has(y) ? !n.has(h) || j.has(h) ? W(L) : m.has(y) ? b-- : D.get(h) > D.get(y) ? (m.add(h), W(L)) : (j.add(y), b--) : (d(N, n), b--);
  }
  for (; b--; ) {
    const L = i[b];
    E.has(L.key) || d(L, n);
  }
  for (; S; )
    W(w[S - 1]);
  return re(g), w;
}
function le(i) {
  i && i.c();
}
function te(i, e, t) {
  const { fragment: r, after_update: o } = i.$$;
  r && r.m(e, t), et(() => {
    const l = i.$$.on_mount.map(Mt).filter(Wt);
    i.$$.on_destroy ? i.$$.on_destroy.push(...l) : re(l), i.$$.on_mount = [];
  }), o.forEach(et);
}
function ie(i, e) {
  const t = i.$$;
  t.fragment !== null && (Si(t.after_update), re(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
}
function pi(i, e) {
  i.$$.dirty[0] === -1 && (Ee.push(i), wi(), i.$$.dirty.fill(0)), i.$$.dirty[e / 31 | 0] |= 1 << e % 31;
}
function ge(i, e, t, r, o, l, n = null, a = [-1]) {
  const d = Te;
  pe(i);
  const c = i.$$ = {
    fragment: null,
    ctx: [],
    // state
    props: l,
    update: U,
    not_equal: o,
    bound: ct(),
    // lifecycle
    on_mount: [],
    on_destroy: [],
    on_disconnect: [],
    before_update: [],
    after_update: [],
    context: new Map(e.context || (d ? d.$$.context : [])),
    // everything else
    callbacks: ct(),
    dirty: a,
    skip_bound: !1,
    root: e.target || d.$$.root
  };
  n && n(c.root);
  let f = !1;
  if (c.ctx = t ? t(i, e.props || {}, (v, b, ...S) => {
    const C = S.length ? S[0] : b;
    return c.ctx && o(c.ctx[v], c.ctx[v] = C) && (!c.skip_bound && c.bound[v] && c.bound[v](C), f && pi(i, v)), b;
  }) : [], c.update(), f = !0, re(c.before_update), c.fragment = r ? r(c.ctx) : !1, e.target) {
    if (e.hydrate) {
      const v = bi(e.target);
      c.fragment && c.fragment.l(v), v.forEach(B);
    } else
      c.fragment && c.fragment.c();
    e.intro && F(i.$$.fragment), te(i, e.target, e.anchor), Ot();
  }
  pe(d);
}
class he {
  constructor() {
    /**
     * ### PRIVATE API
     *
     * Do not use, may change at any time
     *
     * @type {any}
     */
    Ve(this, "$$");
    /**
     * ### PRIVATE API
     *
     * Do not use, may change at any time
     *
     * @type {any}
     */
    Ve(this, "$$set");
  }
  /** @returns {void} */
  $destroy() {
    ie(this, 1), this.$destroy = U;
  }
  /**
   * @template {Extract<keyof Events, string>} K
   * @param {K} type
   * @param {((e: Events[K]) => void) | null | undefined} callback
   * @returns {() => void}
   */
  $on(e, t) {
    if (!Wt(t))
      return U;
    const r = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
    return r.push(t), () => {
      const o = r.indexOf(t);
      o !== -1 && r.splice(o, 1);
    };
  }
  /**
   * @param {Partial<Props>} props
   * @returns {void}
   */
  $set(e) {
    this.$$set && !ci(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
  }
}
const Ci = "4";
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Ci);
function Ti(i) {
  let e, t;
  return {
    c() {
      e = se("svg"), t = se("path"), u(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"), u(e, "viewBox", "0 0 14 14"), u(e, "width", "13"), u(e, "height", "13"), u(e, "class", "svelte-en2qvf");
    },
    m(r, o) {
      A(r, e, o), p(e, t);
    },
    p: U,
    i: U,
    o: U,
    d(r) {
      r && B(e);
    }
  };
}
class Ut extends he {
  constructor(e) {
    super(), ge(this, e, null, Ti, me, {});
  }
}
function Mi(i) {
  let e, t;
  return {
    c() {
      e = se("svg"), t = se("path"), u(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"), u(e, "viewBox", "0 0 30 30"), u(e, "fill", "none"), u(e, "xmlns", "http://www.w3.org/2000/svg"), u(e, "class", "svelte-d2loi5");
    },
    m(r, o) {
      A(r, e, o), p(e, t);
    },
    p: U,
    i: U,
    o: U,
    d(r) {
      r && B(e);
    }
  };
}
class Bt extends he {
  constructor(e) {
    super(), ge(this, e, null, Mi, me, {});
  }
}
function Wi(i) {
  let e, t;
  return {
    c() {
      e = R("img"), q(e.src, t = /*iconsBaseUrl*/
      i[3] + "area.svg") || u(e, "src", t), u(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), u(e, "class", "svelte-ltkwvy");
    },
    m(r, o) {
      A(r, e, o);
    },
    p(r, o) {
      o & /*iconsBaseUrl*/
      8 && !q(e.src, t = /*iconsBaseUrl*/
      r[3] + "area.svg") && u(e, "src", t), o & /*placeType*/
      64 && u(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && B(e);
    }
  };
}
function Ri(i) {
  let e, t;
  return {
    c() {
      e = R("img"), q(e.src, t = /*iconsBaseUrl*/
      i[3] + "poi.svg") || u(e, "src", t), u(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), u(e, "class", "svelte-ltkwvy");
    },
    m(r, o) {
      A(r, e, o);
    },
    p(r, o) {
      o & /*iconsBaseUrl*/
      8 && !q(e.src, t = /*iconsBaseUrl*/
      r[3] + "poi.svg") && u(e, "src", t), o & /*placeType*/
      64 && u(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && B(e);
    }
  };
}
function Ii(i) {
  let e, t;
  return {
    c() {
      e = R("img"), q(e.src, t = /*iconsBaseUrl*/
      i[3] + "postal_code.svg") || u(e, "src", t), u(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), u(e, "class", "svelte-ltkwvy");
    },
    m(r, o) {
      A(r, e, o);
    },
    p(r, o) {
      o & /*iconsBaseUrl*/
      8 && !q(e.src, t = /*iconsBaseUrl*/
      r[3] + "postal_code.svg") && u(e, "src", t), o & /*placeType*/
      64 && u(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && B(e);
    }
  };
}
function Oi(i) {
  let e, t;
  return {
    c() {
      e = R("img"), q(e.src, t = /*iconsBaseUrl*/
      i[3] + "street.svg") || u(e, "src", t), u(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), u(e, "class", "svelte-ltkwvy");
    },
    m(r, o) {
      A(r, e, o);
    },
    p(r, o) {
      o & /*iconsBaseUrl*/
      8 && !q(e.src, t = /*iconsBaseUrl*/
      r[3] + "street.svg") && u(e, "src", t), o & /*placeType*/
      64 && u(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && B(e);
    }
  };
}
function Ui(i) {
  let e, t;
  return {
    c() {
      e = R("img"), q(e.src, t = /*iconsBaseUrl*/
      i[3] + "road.svg") || u(e, "src", t), u(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), u(e, "class", "svelte-ltkwvy");
    },
    m(r, o) {
      A(r, e, o);
    },
    p(r, o) {
      o & /*iconsBaseUrl*/
      8 && !q(e.src, t = /*iconsBaseUrl*/
      r[3] + "road.svg") && u(e, "src", t), o & /*placeType*/
      64 && u(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && B(e);
    }
  };
}
function Bi(i) {
  let e, t;
  return {
    c() {
      e = R("img"), q(e.src, t = /*iconsBaseUrl*/
      i[3] + "housenumber.svg") || u(e, "src", t), u(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), u(e, "class", "svelte-ltkwvy");
    },
    m(r, o) {
      A(r, e, o);
    },
    p(r, o) {
      o & /*iconsBaseUrl*/
      8 && !q(e.src, t = /*iconsBaseUrl*/
      r[3] + "housenumber.svg") && u(e, "src", t), o & /*placeType*/
      64 && u(
        e,
        "alt",
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && B(e);
    }
  };
}
function Di(i) {
  let e, t, r, o;
  return {
    c() {
      e = R("img"), q(e.src, t = /*imageUrl*/
      i[5]) || u(e, "src", t), u(
        e,
        "alt",
        /*category*/
        i[4]
      ), u(e, "class", "svelte-ltkwvy");
    },
    m(l, n) {
      A(l, e, n), r || (o = Q(
        e,
        "error",
        /*error_handler*/
        i[13]
      ), r = !0);
    },
    p(l, n) {
      n & /*imageUrl*/
      32 && !q(e.src, t = /*imageUrl*/
      l[5]) && u(e, "src", t), n & /*category*/
      16 && u(
        e,
        "alt",
        /*category*/
        l[4]
      );
    },
    d(l) {
      l && B(e), r = !1, o();
    }
  };
}
function ht(i) {
  let e, t;
  return {
    c() {
      e = R("span"), t = ae(
        /*placeType*/
        i[6]
      ), u(e, "class", "secondary svelte-ltkwvy");
    },
    m(r, o) {
      A(r, e, o), p(e, t);
    },
    p(r, o) {
      o & /*placeType*/
      64 && Ce(
        t,
        /*placeType*/
        r[6]
      );
    },
    d(r) {
      r && B(e);
    }
  };
}
function Ai(i) {
  var L, N;
  let e, t, r, o, l, n, a, d, c = (
    /*feature*/
    i[0].place_name.replace(/,.*/, "") + ""
  ), f, v, b = (
    /*showPlaceType*/
    i[2] === "always" || /*showPlaceType*/
    i[2] && !/*feature*/
    i[0].address && /*feature*/
    ((L = i[0].properties) == null ? void 0 : L.kind) !== "road" && /*feature*/
    ((N = i[0].properties) == null ? void 0 : N.kind) !== "road_relation" && !/*feature*/
    i[0].id.startsWith("address.") && !/*feature*/
    i[0].id.startsWith("postal_code.") && (!/*feature*/
    i[0].id.startsWith("poi.") || !/*imageUrl*/
    i[5])
  ), S, C, P = (
    /*feature*/
    i[0].place_name.replace(/[^,]*,?\s*/, "") + ""
  ), w, E, D;
  function g(h, y) {
    var X, T;
    return y & /*feature*/
    1 && (t = null), y & /*feature*/
    1 && (r = null), y & /*feature*/
    1 && (o = null), /*imageUrl*/
    h[5] ? Di : (
      /*feature*/
      h[0].address ? Bi : (
        /*feature*/
        ((X = h[0].properties) == null ? void 0 : X.kind) === "road" || /*feature*/
        ((T = h[0].properties) == null ? void 0 : T.kind) === "road_relation" ? Ui : (t == null && (t = !!/*feature*/
        h[0].id.startsWith("address.")), t ? Oi : (r == null && (r = !!/*feature*/
        h[0].id.startsWith("postal_code.")), r ? Ii : (o == null && (o = !!/*feature*/
        h[0].id.startsWith("poi.")), o ? Ri : Wi)))
      )
    );
  }
  let j = g(i, -1), m = j(i), W = b && ht(i);
  return {
    c() {
      e = R("li"), m.c(), l = V(), n = R("span"), a = R("span"), d = R("span"), f = ae(c), v = V(), W && W.c(), S = V(), C = R("span"), w = ae(P), u(d, "class", "primary svelte-ltkwvy"), u(a, "class", "svelte-ltkwvy"), u(C, "class", "line2 svelte-ltkwvy"), u(n, "class", "texts svelte-ltkwvy"), u(e, "tabindex", "0"), u(
        e,
        "data-selected",
        /*selected*/
        i[1]
      ), u(e, "class", "svelte-ltkwvy"), oe(
        e,
        "selected",
        /*selected*/
        i[1]
      );
    },
    m(h, y) {
      A(h, e, y), m.m(e, null), p(e, l), p(e, n), p(n, a), p(a, d), p(d, f), p(a, v), W && W.m(a, null), p(n, S), p(n, C), p(C, w), E || (D = [
        Q(
          e,
          "mouseenter",
          /*mouseenter_handler*/
          i[11]
        ),
        Q(
          e,
          "focus",
          /*focus_handler*/
          i[12]
        )
      ], E = !0);
    },
    p(h, [y]) {
      var X, T;
      j === (j = g(h, y)) && m ? m.p(h, y) : (m.d(1), m = j(h), m && (m.c(), m.m(e, l))), y & /*feature*/
      1 && c !== (c = /*feature*/
      h[0].place_name.replace(/,.*/, "") + "") && Ce(f, c), y & /*showPlaceType, feature, imageUrl*/
      37 && (b = /*showPlaceType*/
      h[2] === "always" || /*showPlaceType*/
      h[2] && !/*feature*/
      h[0].address && /*feature*/
      ((X = h[0].properties) == null ? void 0 : X.kind) !== "road" && /*feature*/
      ((T = h[0].properties) == null ? void 0 : T.kind) !== "road_relation" && !/*feature*/
      h[0].id.startsWith("address.") && !/*feature*/
      h[0].id.startsWith("postal_code.") && (!/*feature*/
      h[0].id.startsWith("poi.") || !/*imageUrl*/
      h[5])), b ? W ? W.p(h, y) : (W = ht(h), W.c(), W.m(a, null)) : W && (W.d(1), W = null), y & /*feature*/
      1 && P !== (P = /*feature*/
      h[0].place_name.replace(/[^,]*,?\s*/, "") + "") && Ce(w, P), y & /*selected*/
      2 && u(
        e,
        "data-selected",
        /*selected*/
        h[1]
      ), y & /*selected*/
      2 && oe(
        e,
        "selected",
        /*selected*/
        h[1]
      );
    },
    i: U,
    o: U,
    d(h) {
      h && B(e), m.d(), W && W.d(), E = !1, re(D);
    }
  };
}
function zi(i, e, t) {
  var D;
  let r, o, { feature: l } = e, { selected: n = !1 } = e, { showPlaceType: a } = e, { missingIconsCache: d } = e, { iconsBaseUrl: c } = e;
  const f = (D = l.properties) == null ? void 0 : D.categories;
  let v, b, S = 0;
  function C(g) {
    b && d.add(b), t(9, S++, S);
  }
  function P(g) {
    ft.call(this, i, g);
  }
  function w(g) {
    ft.call(this, i, g);
  }
  const E = (g) => C(g.currentTarget);
  return i.$$set = (g) => {
    "feature" in g && t(0, l = g.feature), "selected" in g && t(1, n = g.selected), "showPlaceType" in g && t(2, a = g.showPlaceType), "missingIconsCache" in g && t(8, d = g.missingIconsCache), "iconsBaseUrl" in g && t(3, c = g.iconsBaseUrl);
  }, i.$$.update = () => {
    var g, j, m, W;
    if (i.$$.dirty & /*loadIconAttempt, index, category, iconsBaseUrl, imageUrl, missingIconsCache*/
    1848)
      do
        t(10, r--, r), t(4, v = f == null ? void 0 : f[r]), t(5, b = v ? c + v.replace(/ /g, "_") + ".svg" : void 0);
      while (r > -1 && (!b || d.has(b)));
    i.$$.dirty & /*feature*/
    1 && t(6, o = l.id.startsWith("poi.") ? (j = (g = l.properties) == null ? void 0 : g.categories) == null ? void 0 : j.join(", ") : ((W = (m = l.properties) == null ? void 0 : m.place_type_name) == null ? void 0 : W[0]) ?? l.place_type[0]);
  }, t(10, r = (f == null ? void 0 : f.length) ?? 0), [
    l,
    n,
    a,
    c,
    v,
    b,
    o,
    C,
    d,
    S,
    r,
    P,
    w,
    E
  ];
}
class Fi extends he {
  constructor(e) {
    super(), ge(this, e, zi, Ai, me, {
      feature: 0,
      selected: 1,
      showPlaceType: 2,
      missingIconsCache: 8,
      iconsBaseUrl: 3
    });
  }
}
function Pi(i) {
  let e;
  return {
    c() {
      e = R("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>', u(e, "class", "svelte-7cmwmc");
    },
    m(t, r) {
      A(t, e, r);
    },
    p: U,
    i: U,
    o: U,
    d(t) {
      t && B(e);
    }
  };
}
class Hi extends he {
  constructor(e) {
    super(), ge(this, e, null, Pi, me, {});
  }
}
function ji(i) {
  let e, t;
  return {
    c() {
      e = se("svg"), t = se("path"), u(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"), u(e, "viewBox", "0 0 60.006 21.412"), u(e, "width", "14"), u(e, "height", "20"), u(e, "class", "svelte-en2qvf");
    },
    m(r, o) {
      A(r, e, o), p(e, t);
    },
    p: U,
    i: U,
    o: U,
    d(r) {
      r && B(e);
    }
  };
}
class Zi extends he {
  constructor(e) {
    super(), ge(this, e, null, ji, me, {});
  }
}
function Gi(i) {
  let e, t;
  return {
    c() {
      e = se("svg"), t = se("path"), u(t, "d", "M13.101 14.261 8.74 9.899a4.797 4.797 0 0 1-1.425.748 5.165 5.165 0 0 1-1.603.248c-1.446 0-2.677-.5-3.693-1.503S.495 7.164.495 5.717c0-1.446.508-2.678 1.524-3.693C3.035 1.008 4.266.5 5.712.5c1.448 0 2.672.508 3.675 1.524 1.002 1.015 1.503 2.247 1.503 3.693 0 .558-.08 1.092-.239 1.603-.159.512-.411.98-.757 1.405l4.382 4.4a.74.74 0 0 1 .229.568.81.81 0 0 1-.249.568.787.787 0 0 1-.577.239.787.787 0 0 1-.578-.239ZM5.712 9.223c.97 0 1.796-.342 2.48-1.026a3.378 3.378 0 0 0 1.026-2.48c0-.982-.34-1.818-1.016-2.509-.677-.69-1.507-1.035-2.49-1.035a3.42 3.42 0 0 0-2.509 1.035 3.42 3.42 0 0 0-1.035 2.51c0 .982.345 1.812 1.035 2.488.691.678 1.527 1.017 2.51 1.017Z"), u(e, "width", "14"), u(e, "height", "14"), u(e, "viewBox", "0 0 15 15"), u(e, "class", "svelte-en2qvf");
    },
    m(r, o) {
      A(r, e, o), p(e, t);
    },
    p: U,
    i: U,
    o: U,
    d(r) {
      r && B(e);
    }
  };
}
class Qi extends he {
  constructor(e) {
    super(), ge(this, e, null, Gi, me, {});
  }
}
function qi(i, e, t) {
  const r = e[1], o = e[0], l = r - o;
  return i === r && t ? i : ((i - o) % l + l) % l + o;
}
function bt(i) {
  const e = [...i];
  return e[2] < e[0] && (e[2] += 360), e;
}
let ke;
async function Ki(i, e, t) {
  const r = i == null ? void 0 : i.getCenterAndZoom();
  for (const o of e ?? [])
    if (!(r && (o.minZoom != null && o.minZoom > r[0] || o.maxZoom != null && o.maxZoom < r[0]))) {
      if (o.type === "fixed")
        return o.coordinates.join(",");
      e:
        if (o.type === "client-geolocation") {
          if (ke && o.cachedLocationExpiry && ke.time + o.cachedLocationExpiry > Date.now()) {
            if (!ke.coords)
              break e;
            return ke.coords;
          }
          let l;
          try {
            return l = await new Promise((n, a) => {
              t.signal.addEventListener("abort", () => {
                a(Error("aborted"));
              }), navigator.geolocation.getCurrentPosition(
                (d) => {
                  n(
                    [d.coords.longitude, d.coords.latitude].map((c) => c.toFixed(6)).join(",")
                  );
                },
                (d) => {
                  a(d);
                },
                o
              );
            }), l;
          } catch {
          } finally {
            o.cachedLocationExpiry && (ke = {
              time: Date.now(),
              coords: l
            });
          }
          if (t.signal.aborted)
            return;
        }
      if (o.type === "server-geolocation")
        return "ip";
      if (r && o.type === "map-center")
        return r[1].toFixed(6) + "," + r[2].toFixed(6);
    }
}
const vt = /(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, _t = /(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, Lt = /(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, yt = /(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 Vi(i) {
  if (!["DMS", "DM", "DD"].includes(i))
    throw new Error("invalid format specified");
  if (this.decimalCoordinates && this.decimalCoordinates.trim()) {
    if (i == "DD")
      return this.decimalCoordinates;
    const e = this.decimalCoordinates.split(",").map((n) => Number(n.trim()));
    let t = wt(e[0], i), r = wt(e[1], i);
    t.endsWith('.0"') && r.endsWith('.0"') && (t = t.replace(/\.0"$/, '"'), r = r.replace(/\.0"$/, '"'));
    const o = e[0] >= 0 ? " N" : " S", l = e[1] >= 0 ? " E" : " W";
    return `${t + o}, ${r + l}`;
  } else
    throw new Error("no decimal coordinates to convert");
}
function wt(i, e) {
  const t = Math.abs(i), r = Math.floor(t), o = (t - r) * 60;
  if (e == "DM") {
    let a = Ji(o, 3).toFixed(3).padStart(6, "0");
    return `${r}° ${a}'`;
  }
  let l = Math.floor(o), n = ((o - l) * 60).toFixed(1).padStart(4, "0");
  return l = l.toString().padStart(2, "0"), `${r}° ${l}' ${n}"`;
}
function Ji(i, e) {
  const t = Math.pow(10, e);
  return Math.round((i + Number.EPSILON) * t) / t;
}
function tt(i, e) {
  e || (e = 5), i = i.replace(/\s+/g, " ").trim();
  let t = null, r = null, o = "", l = "", n = [], a = !1;
  if (vt.test(i))
    if (n = vt.exec(i), a = Be(n), a) {
      if (t = n[2], r = n[6], t.includes(",") && (t = t.replace(",", ".")), r.includes(",") && (r = r.replace(",", ".")), Number(Math.round(t)) == Number(t))
        throw new Error("integer only coordinate provided");
      if (Number(Math.round(r)) == Number(r))
        throw new Error("integer only coordinate provided");
      n[1] ? (o = n[1], l = n[5]) : n[4] && (o = n[4], l = n[8]);
    } else
      throw new Error("invalid decimal coordinate format");
  else if (_t.test(i))
    if (n = _t.exec(i), a = Be(n), a)
      t = Math.abs(parseInt(n[2])), n[4] && (t += n[4] / 60), n[6] && (t += n[6].replace(",", ".") / 3600), parseInt(n[2]) < 0 && (t = -1 * t), r = Math.abs(parseInt(n[9])), n[11] && (r += n[11] / 60), n[13] && (r += n[13].replace(",", ".") / 3600), parseInt(n[9]) < 0 && (r = -1 * r), n[1] ? (o = n[1], l = n[8]) : n[7] && (o = n[7], l = n[14]);
    else
      throw new Error("invalid DMS coordinates format");
  else if (Lt.test(i))
    if (n = Lt.exec(i), a = Be(n), a)
      t = Math.abs(parseInt(n[2])), n[4] && (t += n[4] / 60), n[6] && (t += n[6] / 3600), parseInt(n[2]) < 0 && (t = -1 * t), r = Math.abs(parseInt(n[10])), n[12] && (r += n[12] / 60), n[14] && (r += n[14] / 3600), parseInt(n[10]) < 0 && (r = -1 * r), n[1] ? (o = n[1], l = n[9]) : n[8] && (o = n[8], l = n[16]);
    else
      throw new Error("invalid DMS coordinates format");
  else if (yt.test(i))
    if (n = yt.exec(i), a = Be(n), a)
      t = Math.abs(parseInt(n[2])), n[4] && (t += n[4] / 60), n[6] && (t += n[6] / 3600), parseInt(n[2]) < 0 && (t = -1 * t), r = Math.abs(parseInt(n[10])), n[12] && (r += n[12] / 60), n[14] && (r += n[14] / 3600), parseInt(n[10]) < 0 && (r = -1 * r), n[1] ? (o = n[1], l = n[9]) : n[8] && (o = n[8], l = n[16]);
    else
      throw new Error("invalid coordinates format");
  if (a) {
    if (Math.abs(r) >= 180)
      throw new Error("invalid longitude value");
    if (Math.abs(t) >= 90)
      throw new Error("invalid latitude value");
    if ((o || l) && (!o || !l))
      throw new Error("invalid coordinates format");
    if (o && o == l)
      throw new Error("invalid coordinates format");
    let d = /S|SOUTH/i;
    d.test(o) && t > 0 && (t = -1 * t), d = /W|WEST/i, d.test(l) && r > 0 && (r = -1 * r);
    const c = n[0].trim();
    let f, v;
    const b = /[,/;\u0020]/g, S = c.match(b);
    if (S == null) {
      const w = Math.floor(i.length / 2);
      f = c.substring(0, w).trim(), v = c.substring(w).trim();
    } else {
      let w;
      S.length % 2 == 1 ? w = Math.floor(S.length / 2) : w = S.length / 2 - 1;
      let E = 0;
      if (w == 0)
        E = c.indexOf(S[0]), f = c.substring(0, E).trim(), v = c.substring(E + 1).trim();
      else {
        let D = 0, g = 0;
        for (; D <= w; )
          E = c.indexOf(S[D], g), g = E + 1, D++;
        f = c.substring(0, E).trim(), v = c.substring(E + 1).trim();
      }
    }
    const C = f.split(".");
    if (C.length == 2 && C[1] == 0 && C[1].length != 2)
      throw new Error("invalid coordinates format");
    const P = v.split(".");
    if (P.length == 2 && P[1] == 0 && P[1].length != 2)
      throw new Error("invalid coordinates format");
    if (/^\d+$/.test(f) || /^\d+$/.test(v))
      throw new Error("degree only coordinate/s provided");
    return isNaN(t) && t.includes(",") && (t = t.replace(",", ".")), t = Number(Number(t).toFixed(e)), isNaN(r) && r.includes(",") && (r = r.replace(",", ".")), r = Number(Number(r).toFixed(e)), Object.freeze({
      verbatimCoordinates: c,
      verbatimLatitude: f,
      verbatimLongitude: v,
      decimalLatitude: t,
      decimalLongitude: r,
      decimalCoordinates: `${t},${r}`,
      closeEnough: Xi,
      toCoordinateFormat: Vi
    });
  } else
    throw new Error("coordinates pattern match failed");
}
function Be(i) {
  if (!isNaN(i[0]))
    return !1;
  const e = [...i];
  if (e.shift(), e.length % 2 > 0)
    return !1;
  const t = /^[-+]?\d+([\.,]\d+)?$/, r = /[eastsouthnorthwest]+/i, o = e.length / 2;
  for (let l = 0; l < o; l++) {
    const n = e[l], a = e[l + o], d = t.test(n) && t.test(a), c = r.test(n) && r.test(a), f = n == a;
    if (!(n == null && a == null)) {
      if (n == null || a == null)
        return !1;
      if (d || c || f)
        continue;
      return !1;
    }
  }
  return !0;
}
function Et(i, e) {
  const t = Math.abs(i - e);
  return Number(t.toFixed(6)) <= 1e-5;
}
function Xi(i) {
  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 Et(this.decimalLatitude, Number(e[0])) && Et(this.decimalLongitude, e[1]);
  } else
    throw new Error("coords being tested must be separated by a comma");
}
const Yi = Object.freeze({
  DMS: "DMS",
  DM: "DM",
  DD: "DD"
});
tt.to = Yi;
const xi = [
  {
    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"
  }
], $i = {
  decimalLatitude: 40.123,
  decimalLongitude: -74.123
}, er = [
  {
    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
  }
], tr = [
  // additional formats we've encountered
  {
    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
  }
];
function ir() {
  const i = [];
  return xi.forEach((e) => {
    e.decimalLatitude ? i.push(e) : i.push({ ...e, ...$i });
  }), [...i, ...er, ...tr];
}
const rr = ir();
tt.formats = rr.map((i) => i.verbatimCoordinates);
const Ye = tt;
function St(i, e, t) {
  const r = i.slice();
  return r[81] = e[t], r[83] = t, r;
}
function Nt(i) {
  let e, t;
  return e = new Hi({}), {
    c() {
      le(e.$$.fragment);
    },
    m(r, o) {
      te(e, r, o), t = !0;
    },
    i(r) {
      t || (F(e.$$.fragment, r), t = !0);
    },
    o(r) {
      Z(e.$$.fragment, r), t = !1;
    },
    d(r) {
      ie(e, r);
    }
  };
}
function kt(i) {
  let e, t, r, o, l;
  return t = new Zi({}), {
    c() {
      e = R("button"), le(t.$$.fragment), u(e, "type", "button"), u(
        e,
        "title",
        /*reverseButtonTitle*/
        i[9]
      ), u(e, "class", "svelte-1r7dvt7"), oe(
        e,
        "active",
        /*reverseActive*/
        i[0]
      );
    },
    m(n, a) {
      A(n, e, a), te(t, e, null), r = !0, o || (l = Q(
        e,
        "click",
        /*click_handler_2*/
        i[67]
      ), o = !0);
    },
    p(n, a) {
      (!r || a[0] & /*reverseButtonTitle*/
      512) && u(
        e,
        "title",
        /*reverseButtonTitle*/
        n[9]
      ), (!r || a[0] & /*reverseActive*/
      1) && oe(
        e,
        "active",
        /*reverseActive*/
        n[0]
      );
    },
    i(n) {
      r || (F(t.$$.fragment, n), r = !0);
    },
    o(n) {
      Z(t.$$.fragment, n), r = !1;
    },
    d(n) {
      n && B(e), ie(t), o = !1, l();
    }
  };
}
function nr(i) {
  let e, t = [], r = /* @__PURE__ */ new Map(), o, l, n, a = gt(
    /*listFeatures*/
    i[13]
  );
  const d = (c) => (
    /*feature*/
    c[81].id + /*feature*/
    (c[81].address ? "," + /*feature*/
    c[81].address : "")
  );
  for (let c = 0; c < a.length; c += 1) {
    let f = St(i, a, c), v = d(f);
    r.set(v, t[c] = pt(v, f));
  }
  return {
    c() {
      e = R("ul");
      for (let c = 0; c < t.length; c += 1)
        t[c].c();
      u(e, "class", "svelte-1r7dvt7");
    },
    m(c, f) {
      A(c, e, f);
      for (let v = 0; v < t.length; v += 1)
        t[v] && t[v].m(e, null);
      o = !0, l || (n = [
        Q(
          e,
          "mouseleave",
          /*mouseleave_handler*/
          i[71]
        ),
        Q(
          e,
          "blur",
          /*blur_handler_1*/
          i[72]
        )
      ], l = !0);
    },
    p(c, f) {
      f[0] & /*listFeatures, showPlaceType, selectedItemIndex, missingIconsCache, iconsBaseUrl, pick*/
      17869824 && (a = gt(
        /*listFeatures*/
        c[13]
      ), Ae(), t = ki(t, f, d, 1, c, a, r, e, Ni, pt, null, St), ze());
    },
    i(c) {
      if (!o) {
        for (let f = 0; f < a.length; f += 1)
          F(t[f]);
        o = !0;
      }
    },
    o(c) {
      for (let f = 0; f < t.length; f += 1)
        Z(t[f]);
      o = !1;
    },
    d(c) {
      c && B(e);
      for (let f = 0; f < t.length; f += 1)
        t[f].d();
      l = !1, re(n);
    }
  };
}
function or(i) {
  let e, t, r, o, l, n;
  return t = new Bt({}), {
    c() {
      e = R("div"), le(t.$$.fragment), r = V(), o = R("div"), l = ae(
        /*noResultsMessage*/
        i[7]
      ), u(o, "class", "svelte-1r7dvt7"), u(e, "class", "no-results svelte-1r7dvt7");
    },
    m(a, d) {
      A(a, e, d), te(t, e, null), p(e, r), p(e, o), p(o, l), n = !0;
    },
    p(a, d) {
      (!n || d[0] & /*noResultsMessage*/
      128) && Ce(
        l,
        /*noResultsMessage*/
        a[7]
      );
    },
    i(a) {
      n || (F(t.$$.fragment, a), n = !0);
    },
    o(a) {
      Z(t.$$.fragment, a), n = !1;
    },
    d(a) {
      a && B(e), ie(t);
    }
  };
}
function sr(i) {
  let e = "", t;
  return {
    c() {
      t = ae(e);
    },
    m(r, o) {
      A(r, t, o);
    },
    p: U,
    i: U,
    o: U,
    d(r) {
      r && B(t);
    }
  };
}
function ar(i) {
  let e, t, r, o, l, n, a, d, c, f, v;
  return t = new Bt({}), d = new Ut({}), {
    c() {
      e = R("div"), le(t.$$.fragment), r = V(), o = R("div"), l = ae(
        /*errorMessage*/
        i[6]
      ), n = V(), a = R("button"), le(d.$$.fragment), u(o, "class", "svelte-1r7dvt7"), u(a, "class", "svelte-1r7dvt7"), u(e, "class", "error svelte-1r7dvt7");
    },
    m(b, S) {
      A(b, e, S), te(t, e, null), p(e, r), p(e, o), p(o, l), p(e, n), p(e, a), te(d, a, null), c = !0, f || (v = Q(
        a,
        "click",
        /*click_handler_3*/
        i[68]
      ), f = !0);
    },
    p(b, S) {
      (!c || S[0] & /*errorMessage*/
      64) && Ce(
        l,
        /*errorMessage*/
        b[6]
      );
    },
    i(b) {
      c || (F(t.$$.fragment, b), F(d.$$.fragment, b), c = !0);
    },
    o(b) {
      Z(t.$$.fragment, b), Z(d.$$.fragment, b), c = !1;
    },
    d(b) {
      b && B(e), ie(t), ie(d), f = !1, v();
    }
  };
}
function pt(i, e) {
  let t, r, o;
  function l() {
    return (
      /*mouseenter_handler*/
      e[69](
        /*i*/
        e[83]
      )
    );
  }
  function n() {
    return (
      /*focus_handler_1*/
      e[70](
        /*feature*/
        e[81]
      )
    );
  }
  return r = new Fi({
    props: {
      feature: (
        /*feature*/
        e[81]
      ),
      showPlaceType: (
        /*showPlaceType*/
        e[10]
      ),
      selected: (
        /*selectedItemIndex*/
        e[15] === /*i*/
        e[83]
      ),
      missingIconsCache: (
        /*missingIconsCache*/
        e[20]
      ),
      iconsBaseUrl: (
        /*iconsBaseUrl*/
        e[11]
      )
    }
  }), r.$on("mouseenter", l), r.$on("focus", n), {
    key: i,
    first: null,
    c() {
      t = gi(), le(r.$$.fragment), this.first = t;
    },
    m(a, d) {
      A(a, t, d), te(r, a, d), o = !0;
    },
    p(a, d) {
      e = a;
      const c = {};
      d[0] & /*listFeatures*/
      8192 && (c.feature = /*feature*/
      e[81]), d[0] & /*showPlaceType*/
      1024 && (c.showPlaceType = /*showPlaceType*/
      e[10]), d[0] & /*selectedItemIndex, listFeatures*/
      40960 && (c.selected = /*selectedItemIndex*/
      e[15] === /*i*/
      e[83]), d[0] & /*iconsBaseUrl*/
      2048 && (c.iconsBaseUrl = /*iconsBaseUrl*/
      e[11]), r.$set(c);
    },
    i(a) {
      o || (F(r.$$.fragment, a), o = !0);
    },
    o(a) {
      Z(r.$$.fragment, a), o = !1;
    },
    d(a) {
      a && B(t), ie(r, a);
    }
  };
}
function lr(i) {
  let e, t, r, o, l, n, a, d, c, f, v, b, S, C, P, w, E, D, g, j, m, W = !1;
  l = new Qi({}), v = new Ut({});
  let L = (
    /*abortController*/
    i[19] && Nt()
  ), N = (
    /*enableReverse*/
    i[5] === !0 && kt(i)
  );
  const h = (
    /*#slots*/
    i[59].default
  ), y = ui(
    h,
    i,
    /*$$scope*/
    i[58],
    null
  ), X = [ar, sr, or, nr], T = [];
  function be(_, I) {
    var K, ve;
    return (
      /*error*/
      _[18] ? 0 : (
        /*focusedDelayed*/
        _[16] ? (
          /*listFeatures*/
          ((K = _[13]) == null ? void 0 : K.length) === 0 ? 2 : (
            /*focusedDelayed*/
            _[16] && /*listFeatures*/
            ((ve = _[13]) != null && ve.length) ? 3 : -1
          )
        ) : 1
      )
    );
  }
  return ~(w = be(i)) && (E = T[w] = X[w](i)), {
    c() {
      e = V(), t = R("form"), r = R("div"), o = R("button"), le(l.$$.fragment), n = V(), a = R("input"), d = V(), c = R("div"), f = R("button"), le(v.$$.fragment), b = V(), L && L.c(), S = V(), N && N.c(), C = V(), y && y.c(), P = V(), E && E.c(), u(o, "class", "search-button svelte-1r7dvt7"), u(o, "type", "button"), u(
        a,
        "placeholder",
        /*placeholder*/
        i[8]
      ), u(
        a,
        "aria-label",
        /*placeholder*/
        i[8]
      ), u(a, "class", "svelte-1r7dvt7"), u(f, "type", "button"), u(
        f,
        "title",
        /*clearButtonTitle*/
        i[3]
      ), u(f, "class", "svelte-1r7dvt7"), u(c, "class", "clear-button-container svelte-1r7dvt7"), oe(
        c,
        "displayable",
        /*searchValue*/
        i[1] !== ""
      ), u(r, "class", "input-group svelte-1r7dvt7"), u(t, "tabindex", "0"), u(t, "class", D = ut(
        /*className*/
        i[2]
      ) + " svelte-1r7dvt7"), oe(
        t,
        "can-collapse",
        /*collapsed*/
        i[4] && /*searchValue*/
        i[1] === ""
      );
    },
    m(_, I) {
      A(_, e, I), A(_, t, I), p(t, r), p(r, o), te(l, o, null), p(r, n), p(r, a), i[61](a), dt(
        a,
        /*searchValue*/
        i[1]
      ), p(r, d), p(r, c), p(c, f), te(v, f, null), p(c, b), L && L.m(c, null), p(r, S), N && N.m(r, null), p(r, C), y && y.m(r, null), p(t, P), ~w && T[w].m(t, null), g = !0, j || (m = [
        Q(
          o,
          "click",
          /*click_handler*/
          i[60]
        ),
        Q(
          a,
          "input",
          /*input_1_input_handler*/
          i[62]
        ),
        Q(
          a,
          "focus",
          /*focus_handler*/
          i[63]
        ),
        Q(
          a,
          "blur",
          /*blur_handler*/
          i[64]
        ),
        Q(
          a,
          "keydown",
          /*handleKeyDown*/
          i[22]
        ),
        Q(
          a,
          "input",
          /*input_handler*/
          i[65]
        ),
        Q(
          f,
          "click",
          /*click_handler_1*/
          i[66]
        ),
        Q(t, "submit", hi(
          /*handleOnSubmit*/
          i[21]
        ))
      ], j = !0);
    },
    p(_, I) {
      (!g || I[0] & /*placeholder*/
      256) && u(
        a,
        "placeholder",
        /*placeholder*/
        _[8]
      ), (!g || I[0] & /*placeholder*/
      256) && u(
        a,
        "aria-label",
        /*placeholder*/
        _[8]
      ), I[0] & /*searchValue*/
      2 && a.value !== /*searchValue*/
      _[1] && dt(
        a,
        /*searchValue*/
        _[1]
      ), (!g || I[0] & /*clearButtonTitle*/
      8) && u(
        f,
        "title",
        /*clearButtonTitle*/
        _[3]
      ), /*abortController*/
      _[19] ? L ? I[0] & /*abortController*/
      524288 && F(L, 1) : (L = Nt(), L.c(), F(L, 1), L.m(c, null)) : L && (Ae(), Z(L, 1, 1, () => {
        L = null;
      }), ze()), (!g || I[0] & /*searchValue*/
      2) && oe(
        c,
        "displayable",
        /*searchValue*/
        _[1] !== ""
      ), /*enableReverse*/
      _[5] === !0 ? N ? (N.p(_, I), I[0] & /*enableReverse*/
      32 && F(N, 1)) : (N = kt(_), N.c(), F(N, 1), N.m(r, C)) : N && (Ae(), Z(N, 1, 1, () => {
        N = null;
      }), ze()), y && y.p && (!g || I[1] & /*$$scope*/
      134217728) && fi(
        y,
        h,
        _,
        /*$$scope*/
        _[58],
        g ? di(
          h,
          /*$$scope*/
          _[58],
          I,
          null
        ) : mi(
          /*$$scope*/
          _[58]
        ),
        null
      );
      let K = w;
      w = be(_), w === K ? ~w && T[w].p(_, I) : (E && (Ae(), Z(T[K], 1, 1, () => {
        T[K] = null;
      }), ze()), ~w ? (E = T[w], E ? E.p(_, I) : (E = T[w] = X[w](_), E.c()), F(E, 1), E.m(t, null)) : E = null), (!g || I[0] & /*className*/
      4 && D !== (D = ut(
        /*className*/
        _[2]
      ) + " svelte-1r7dvt7")) && u(t, "class", D), (!g || I[0] & /*className, collapsed, searchValue*/
      22) && oe(
        t,
        "can-collapse",
        /*collapsed*/
        _[4] && /*searchValue*/
        _[1] === ""
      );
    },
    i(_) {
      g || (F(W), F(l.$$.fragment, _), F(v.$$.fragment, _), F(L), F(N), F(y, _), F(E), g = !0);
    },
    o(_) {
      Z(W), Z(l.$$.fragment, _), Z(v.$$.fragment, _), Z(L), Z(N), Z(y, _), Z(E), g = !1;
    },
    d(_) {
      _ && (B(e), B(t)), ie(l), i[61](null), ie(v), L && L.d(), N && N.d(), y && y.d(_), ~w && T[w].d(), j = !1, re(m);
    }
  };
}
function cr(i, e, t) {
  let r, { $$slots: o = {}, $$scope: l } = e, { class: n = void 0 } = e, { apiKey: a } = e, { bbox: d = void 0 } = e, { clearButtonTitle: c = "clear" } = e, { clearOnBlur: f = !1 } = e, { collapsed: v = !1 } = e, { country: b = void 0 } = e, { debounceSearch: S = 200 } = e, { enableReverse: C = !1 } = e, { errorMessage: P = "Something went wrong…" } = e, { filter: w = () => !0 } = e, { flyTo: E = !0 } = e, { fuzzyMatch: D = !0 } = e, { language: g = void 0 } = e, { limit: j = void 0 } = e, { mapController: m = void 0 } = e, { minLength: W = 2 } = e, { noResultsMessage: L = "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: N = "Search" } = e, { proximity: h = [{ type: "server-geolocation" }] } = e, { reverseActive: y = C === "always" } = e, { reverseButtonTitle: X = "toggle reverse geocoding" } = e, { searchValue: T = "" } = e, { showFullGeometry: be = !0 } = e, { showPlaceType: _ = "ifNeeded" } = e, { showResultsWhileTyping: I = !0 } = e, { selectFirst: K = !0 } = e, { flyToSelected: ve = !1 } = e, { markerOnSelected: Me = !0 } = e, { types: ce = void 0 } = e, { excludeTypes: We = !1 } = e, { zoom: Ne = 16 } = e, { maxZoom: _e = 18 } = e, { apiUrl: Fe = "https://api.maptiler.com/geocoding" } = e, { fetchParameters: Pe = {} } = e, { iconsBaseUrl: it = "https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.0-rc5/icons/" } = e, { adjustUrlQuery: He = (s) => {
  } } = e;
  function Dt() {
    Y.focus();
  }
  function At() {
    Y.blur();
  }
  function rt(s, H = !0) {
    t(1, T = s), H ? (t(15, O = -1), ot()) : (Ge(), setTimeout(() => {
      Y.focus(), Y.select();
    }));
  }
  function zt() {
    t(13, M = void 0), t(55, k = void 0), t(15, O = -1);
  }
  function Ft() {
    t(14, z = []), t(55, k = void 0);
  }
  let Le = !1, M, z, k, nt = "", Y, O = -1, x, Re = [], ue, ye, Ie, je;
  const Pt = /* @__PURE__ */ new Set(), ne = Li();
  _i(() => {
    m && (m.setEventHandler(void 0), m.indicateReverse(!1), m.setSelectedMarker(-1), m.setMarkers(void 0, void 0));
  });
  function ot(s) {
    if (ye && (clearTimeout(ye), ye = void 0), O > -1 && M)
      t(55, k = M[O]), t(1, T = k.place_name.replace(/,.*/, "")), t(18, x = void 0), t(14, z = void 0), t(15, O = -1);
    else if (T) {
      const H = s || !st();
      Ze(T, { exact: !0 }).then(() => {
        t(14, z = M), t(55, k = void 0), H && Ht();
      }).catch(($) => t(18, x = $));
    }
  }
  function st() {
    try {
      return Ye(T, 6), !0;
    } catch {
      return !1;
    }
  }
  async function Ze(s, { byId: H = !1, exact: $ = !1 } = {}) {
    t(18, x = void 0), ue == null || ue.abort();
    const ee = new AbortController();
    t(19, ue = ee);
    try {
      const G = st(), J = new URLSearchParams();
      if (g !== void 0 && J.set("language", Array.isArray(g) ? g.join(",") : g ?? ""), ce && J.set("types", ce.join(",")), We && J.set("excludeTypes", String(We)), d && J.set("bbox", d.map((de) => de.toFixed(6)).join(",")), b && J.set("country", Array.isArray(b) ? b.join(",") : b), !H && !G) {
        const de = await Ki(m, h, ee);
        de && J.set("proximity", de), ($ || !I) && J.set("autocomplete", "false"), J.set("fuzzyMatch", String(D));
      }
      j !== void 0 && (!G || (ce == null ? void 0 : ce.length) === 1) && J.set("limit", String(j)), J.set("key", a), He(J);
      let qe;
      try {
        const de = Ye(s, 6);
        qe = de.decimalLongitude + "," + de.decimalLatitude;
      } catch {
        qe = s;
      }
      const Oe = Fe + "/" + encodeURIComponent(qe) + ".json?" + J.toString();
      if (Oe === nt) {
        H ? (t(13, M = void 0), t(55, k = Re[0])) : t(13, M = Re);
        return;
      }
      nt = Oe;
      const at = await fetch(Oe, { signal: ee.signal, ...Pe });
      if (!at.ok)
        throw new Error();
      const Ke = await at.json();
      ne("response", { url: Oe, featureCollection: Ke }), H ? (t(13, M = void 0), t(55, k = Ke.features[0]), Re = [k]) : (t(13, M = Ke.features.filter(w)), Re = M, G && Y.focus());
    } catch (G) {
      if (G && typeof G == "object" && "name" in G && G.name === "AbortError")
        return;
      throw G;
    } finally {
      ee === ue && t(19, ue = void 0);
    }
  }
  function Ht() {
    var $;
    if (!(z != null && z.length) || !E)
      return;
    const s = [180, 90, -180, -90], H = !z.some((ee) => !ee.matching_text);
    for (const ee of z)
      if (H || !ee.matching_text)
        for (const G of [0, 1, 2, 3])
          s[G] = Math[G < 2 ? "min" : "max"](s[G], (($ = ee.bbox) == null ? void 0 : $[G]) ?? ee.center[G % 2]);
    m && z.length > 0 && (k && s[0] === s[2] && s[1] === s[3] ? m.flyTo(k.center, Ne) : m.fitBounds(bt(s), 50, _e));
  }
  function jt(s) {
    t(0, y = C === "always"), rt(s[1].toFixed(6) + ", " + qi(s[0], [-180, 180], !0).toFixed(6));
  }
  function Zt(s) {
    if (!M)
      return;
    let H = s.key === "ArrowDown" ? 1 : s.key === "ArrowUp" ? -1 : 0;
    H && (O === (K ? 0 : -1) && H === -1 && t(15, O = M.length), t(15, O += H), O >= M.length && t(15, O = -1), O < 0 && K && t(15, O = 0), s.preventDefault());
  }
  function Ge(s = !0) {
    if (t(18, x = void 0), I) {
      if (ye && clearTimeout(ye), T.length < W)
        return;
      const H = T;
      ye = window.setTimeout(
        () => {
          Ze(H).catch(($) => t(18, x = $));
        },
        s ? S : 0
      );
    } else
      t(13, M = void 0), t(18, x = void 0);
  }
  function Qe(s) {
    t(55, k = s), t(1, T = s.place_name), t(15, O = -1);
  }
  const Gt = () => Y.focus();
  function Qt(s) {
    xe[s ? "unshift" : "push"](() => {
      Y = s, t(17, Y);
    });
  }
  function qt() {
    T = this.value, t(1, T), t(12, Le), t(27, f);
  }
  const Kt = () => t(12, Le = !0), Vt = () => t(12, Le = !1), Jt = () => Ge(), Xt = () => {
    t(1, T = ""), Y.focus();
  }, Yt = () => t(0, y = !y), xt = () => t(18, x = void 0), $t = (s) => t(15, O = s), ei = (s) => Qe(s), ti = () => {
    z && t(15, O = -1);
  }, ii = () => {
  };
  return i.$$set = (s) => {
    "class" in s && t(2, n = s.class), "apiKey" in s && t(25, a = s.apiKey), "bbox" in s && t(26, d = s.bbox), "clearButtonTitle" in s && t(3, c = s.clearButtonTitle), "clearOnBlur" in s && t(27, f = s.clearOnBlur), "collapsed" in s && t(4, v = s.collapsed), "country" in s && t(28, b = s.country), "debounceSearch" in s && t(29, S = s.debounceSearch), "enableReverse" in s && t(5, C = s.enableReverse), "errorMessage" in s && t(6, P = s.errorMessage), "filter" in s && t(30, w = s.filter), "flyTo" in s && t(31, E = s.flyTo), "fuzzyMatch" in s && t(32, D = s.fuzzyMatch), "language" in s && t(33, g = s.language), "limit" in s && t(34, j = s.limit), "mapController" in s && t(35, m = s.mapController), "minLength" in s && t(36, W = s.minLength), "noResultsMessage" in s && t(7, L = s.noResultsMessage), "placeholder" in s && t(8, N = s.placeholder), "proximity" in s && t(37, h = s.proximity), "reverseActive" in s && t(0, y = s.reverseActive), "reverseButtonTitle" in s && t(9, X = s.reverseButtonTitle), "searchValue" in s && t(1, T = s.searchValue), "showFullGeometry" in s && t(38, be = s.showFullGeometry), "showPlaceType" in s && t(10, _ = s.showPlaceType), "showResultsWhileTyping" in s && t(39, I = s.showResultsWhileTyping), "selectFirst" in s && t(40, K = s.selectFirst), "flyToSelected" in s && t(41, ve = s.flyToSelected), "markerOnSelected" in s && t(42, Me = s.markerOnSelected), "types" in s && t(43, ce = s.types), "excludeTypes" in s && t(44, We = s.excludeTypes), "zoom" in s && t(45, Ne = s.zoom), "maxZoom" in s && t(46, _e = s.maxZoom), "apiUrl" in s && t(47, Fe = s.apiUrl), "fetchParameters" in s && t(48, Pe = s.fetchParameters), "iconsBaseUrl" in s && t(11, it = s.iconsBaseUrl), "adjustUrlQuery" in s && t(49, He = s.adjustUrlQuery), "$$scope" in s && t(58, l = s.$$scope);
  }, i.$$.update = () => {
    if (i.$$.dirty[0] & /*focused, clearOnBlur*/
    134221824 && setTimeout(() => {
      t(16, Ie = Le), f && !Le && t(1, T = "");
    }), i.$$.dirty[0] & /*searchValue, listFeatures*/
    8194 | i.$$.dirty[1] & /*minLength*/
    32 && T.length < W && (t(55, k = void 0), t(13, M = void 0), t(18, x = void 0), t(14, z = M)), i.$$.dirty[1] & /*showFullGeometry, picked*/
    16777344 && be && k && !k.address && k.geometry.type === "Point" && Ze(k.id, { byId: !0 }).catch((s) => t(18, x = s)), i.$$.dirty[1] & /*mapController, picked, prevIdToFly, flyTo, maxZoom, zoom*/
    50380817 && (m && k && k.id !== je && E && (!k.bbox || k.bbox[0] === k.bbox[2] && k.bbox[1] === k.bbox[3] ? m.flyTo(k.center, k.id.startsWith("poi.") || k.id.startsWith("address.") ? _e : Ne) : m.fitBounds(bt(k.bbox), 50, _e), t(13, M = void 0), t(14, z = void 0), t(15, O = -1)), t(56, je = k == null ? void 0 : k.id)), i.$$.dirty[0] & /*listFeatures*/
    8192 | i.$$.dirty[1] & /*selectFirst*/
    512 && K && M != null && M.length && t(15, O = 0), i.$$.dirty[0] & /*searchValue*/
    2 | i.$$.dirty[1] & /*selectFirst*/
    512 && (K || t(15, O = -1)), i.$$.dirty[0] & /*markedFeatures, listFeatures*/
    24576 && z !== M && t(14, z = void 0), i.$$.dirty[0] & /*reverseActive, listFeatures, markedFeatures, focusedDelayed*/
    90113 | i.$$.dirty[1] & /*mapController*/
    16 && m && m.setEventHandler((s) => {
      switch (s.type) {
        case "mapClick":
          y && jt(s.coordinates);
          break;
        case "markerClick":
          {
            const H = M == null ? void 0 : M.find(($) => $.id === s.id);
            H && Qe(H);
          }
          break;
        case "markerMouseEnter":
          z && t(15, O = Ie ? (M == null ? void 0 : M.findIndex((H) => H.id === s.id)) ?? -1 : -1);
          break;
        case "markerMouseLeave":
          z && t(15, O = -1);
          break;
      }
    }), i.$$.dirty[0] & /*listFeatures, selectedItemIndex*/
    40960 && t(57, r = M == null ? void 0 : M[O]), i.$$.dirty[1] & /*mapController, selected, flyTo, flyToSelected, maxZoom, zoom*/
    67159057 && m && r && E && ve && m.flyTo(r.center, r.id.startsWith("poi.") || r.id.startsWith("address.") ? _e : Ne), i.$$.dirty[1] & /*markerOnSelected, mapController*/
    2064 && (Me || m == null || m.setMarkers(void 0, void 0)), i.$$.dirty[0] & /*markedFeatures*/
    16384 | i.$$.dirty[1] & /*mapController, markerOnSelected, selected*/
    67110928 && m && Me && !z && (m.setMarkers(r ? [r] : void 0, void 0), m.setSelectedMarker(r ? 0 : -1)), i.$$.dirty[0] & /*markedFeatures*/
    16384 | i.$$.dirty[1] & /*mapController, picked*/
    16777232 && m && m.setMarkers(z, k), i.$$.dirty[0] & /*markedFeatures, selectedItemIndex*/
    49152 | i.$$.dirty[1] & /*mapController*/
    16 && z && m && m.setSelectedMarker(O), i.$$.dirty[0] & /*searchValue*/
    2 | i.$$.dirty[1] & /*mapController*/
    16 && m) {
      let s;
      try {
        s = Ye(T, 6);
      } catch {
      }
      m.setReverseMarker(s ? [s.decimalLongitude, s.decimalLatitude] : void 0);
    }
    i.$$.dirty[1] & /*selected*/
    67108864 && ne("select", r), i.$$.dirty[1] & /*picked*/
    16777216 && ne("pick", k), i.$$.dirty[0] & /*focusedDelayed, listFeatures*/
    73728 && ne("optionsVisibilityChange", Ie && !!M), i.$$.dirty[0] & /*listFeatures*/
    8192 && ne("featuresListed", M), i.$$.dirty[0] & /*markedFeatures*/
    16384 && ne("featuresMarked", z), i.$$.dirty[0] & /*reverseActive*/
    1 && ne("reverseToggle", y), i.$$.dirty[0] & /*searchValue*/
    2 && ne("queryChange", T), i.$$.dirty[0] & /*reverseActive*/
    1 | i.$$.dirty[1] & /*mapController*/
    16 && m && m.indicateReverse(y);
  }, [
    y,
    T,
    n,
    c,
    v,
    C,
    P,
    L,
    N,
    X,
    _,
    it,
    Le,
    M,
    z,
    O,
    Ie,
    Y,
    x,
    ue,
    Pt,
    ot,
    Zt,
    Ge,
    Qe,
    a,
    d,
    f,
    b,
    S,
    w,
    E,
    D,
    g,
    j,
    m,
    W,
    h,
    be,
    I,
    K,
    ve,
    Me,
    ce,
    We,
    Ne,
    _e,
    Fe,
    Pe,
    He,
    Dt,
    At,
    rt,
    zt,
    Ft,
    k,
    je,
    r,
    l,
    o,
    Gt,
    Qt,
    qt,
    Kt,
    Vt,
    Jt,
    Xt,
    Yt,
    xt,
    $t,
    ei,
    ti,
    ii
  ];
}
class ur extends he {
  constructor(e) {
    super(), ge(
      this,
      e,
      cr,
      lr,
      me,
      {
        class: 2,
        apiKey: 25,
        bbox: 26,
        clearButtonTitle: 3,
        clearOnBlur: 27,
        collapsed: 4,
        country: 28,
        debounceSearch: 29,
        enableReverse: 5,
        errorMessage: 6,
        filter: 30,
        flyTo: 31,
        fuzzyMatch: 32,
        language: 33,
        limit: 34,
        mapController: 35,
        minLength: 36,
        noResultsMessage: 7,
        placeholder: 8,
        proximity: 37,
        reverseActive: 0,
        reverseButtonTitle: 9,
        searchValue: 1,
        showFullGeometry: 38,
        showPlaceType: 10,
        showResultsWhileTyping: 39,
        selectFirst: 40,
        flyToSelected: 41,
        markerOnSelected: 42,
        types: 43,
        excludeTypes: 44,
        zoom: 45,
        maxZoom: 46,
        apiUrl: 47,
        fetchParameters: 48,
        iconsBaseUrl: 11,
        adjustUrlQuery: 49,
        focus: 50,
        blur: 51,
        setQuery: 52,
        clearList: 53,
        clearMap: 54
      },
      null,
      [-1, -1, -1]
    );
  }
  get focus() {
    return this.$$.ctx[50];
  }
  get blur() {
    return this.$$.ctx[51];
  }
  get setQuery() {
    return this.$$.ctx[52];
  }
  get clearList() {
    return this.$$.ctx[53];
  }
  get clearMap() {
    return this.$$.ctx[54];
  }
}
const Ct = [
  "featuresListed",
  "featuresMarked",
  "optionsVisibilityChange",
  "pick",
  "queryChange",
  "response",
  "reverseToggle",
  "select"
], dr = [
  "apiKey",
  "bbox",
  "clearButtonTitle",
  "clearOnBlur",
  "collapsed",
  "country",
  "debounceSearch",
  "enableReverse",
  "reverseActive",
  "errorMessage",
  "filter",
  "fuzzyMatch",
  "language",
  "limit",
  "minLength",
  "noResultsMessage",
  "placeholder",
  "proximity",
  "reverseButtonTitle",
  "showFullGeometry",
  "showPlaceType",
  "showResultsWhileTyping",
  "adjustUrlQuery",
  "types",
  "excludeTypes",
  "zoom",
  "mapController"
];
function Tt(i) {
  return "on" + i[0].toUpperCase() + i.slice(1);
}
const gr = oi(function(e, t) {
  const r = lt(), o = lt(), l = { ...e };
  for (const n of Ct)
    delete l[Tt(n)];
  Je(() => {
    if (!r.current)
      throw new Error();
    const n = new ur({
      target: r.current,
      props: l
    });
    return o.current = n, () => n.$destroy();
  }, []);
  for (const n of dr)
    Je(() => {
      o.current && e[n] !== void 0 && o.current.$set({ [n]: e[n] });
    }, [e[n]]);
  for (const n of Ct) {
    const a = e[Tt(n)];
    Je(
      () => {
        var d;
        return a && ((d = o.current) == null ? void 0 : d.$on(n, (c) => {
          a(c.detail);
        }));
      },
      [a]
    );
  }
  return si(t, () => ({
    setQuery: (n, a = !0) => {
      var d;
      return (d = o.current) == null ? void 0 : d.setQuery(n, a);
    },
    clearMap: () => {
      var n;
      return (n = o.current) == null ? void 0 : n.clearMap();
    },
    clearList: () => {
      var n;
      return (n = o.current) == null ? void 0 : n.clearList();
    },
    focus: () => {
      var n;
      return (n = o.current) == null ? void 0 : n.focus();
    },
    blur: () => {
      var n;
      return (n = o.current) == null ? void 0 : n.blur();
    }
  })), ai("div", { ref: r });
});
export {
  gr as GeocodingControl
};
//# sourceMappingURL=react.js.map
