import { mapValues as h } from "es-toolkit/compat";
import { storage as n } from "./storageUtils.js";
const i = "featureToggle.", f = (t, o) => {
  try {
    t.forEach((e) => {
      n.removeItem(e, o);
    });
  } catch (e) {
    console.error(e);
  }
}, r = (t, o, e, s) => {
  const [d, m = ""] = window.location.hash.split("?"), a = new URLSearchParams(m).get(t) ?? "", c = a ? n.save(t, a, o) : n.load(t, o);
  return c ? e(c) : s;
}, l = (t) => t === "true" || t === "1", u = (t) => t, g = (t) => Number.parseFloat(t), D = (t) => (o) => r(t, o, l, null), F = (t, o) => (e) => r(t, e, l, o), N = (t) => (o) => r(t, o, u, null), S = (t, o) => (e) => r(t, e, u, o), p = (t) => (o) => r(t, o, g, null), w = (t, o) => (e) => r(t, e, g, o), B = (t, o = [], e = i) => (f(o, e), h(t, (s) => s(e)));
export {
  i as DEFAULT_PREFIX,
  D as asBoolean,
  F as asBooleanWithDefault,
  p as asNumber,
  w as asNumberWithDefault,
  N as asString,
  S as asStringWithDefault,
  f as cleanupOldToggles,
  B as detectFeatureToggles
};
//# sourceMappingURL=urlFeatureToggles.js.map
